35 #include <vtkImageChangeInformation.h>
36 #include <vtkImageData.h>
47 mUid(uid), mBase(source), mProbe(probe)
56 mRedirecter = vtkImageChangeInformationPtr::New();
57 mRedirecter->SetInputData(mBase->getVtkImageData());
58 this->probeChangedSlot();
71 return mBase->getName();
76 return mRedirecter->GetOutput();
81 QString uid = mBase->getUid();
84 return mBase->getTimestamp() - probe->getProbeData(uid).getTemporalCalibration();
86 return mBase->getTimestamp();
91 return mBase->getInfoString();
96 return mBase->getStatusString();
111 return mBase->validData();
116 return mBase->isConnected();
121 return mBase->isStreaming();
129 void ProbeAdapterRTSource::newFrameSlot()
137 mRedirecter->Update();
139 QString uid = mBase->getUid();
141 QSize dimProbe = data.
getSize();
142 QSize dimImage(mRedirecter->GetOutput()->GetDimensions()[0], mRedirecter->GetOutput()->GetDimensions()[1]);
144 if (dimProbe!=dimImage)
147 QString(
"Resampling probe calibration. Calibration:[%1,%2], Image:[%3,%4], uid=%5")
148 .arg(dimProbe.width())
149 .arg(dimProbe.height())
150 .arg(dimImage.width())
151 .arg(dimImage.height())
155 probe->setProbeSector(data);
160 void ProbeAdapterRTSource::probeChangedSlot()
166 mRedirecter->Update();
168 QString uid = mBase->getUid();
169 mRedirecter->SetOutputSpacing(probe->getProbeData(uid).getSpacing().begin());
171 mRedirecter->Update();
void connected(bool on)
emitted when source is connected/disconnected
virtual QString getInfoString() const
an information text intended to be visible along with the data stream at all times ...
void streaming(bool on)
emitted when streaming started/stopped
virtual bool validData() const
return true is data stream is ok to display. This is a heuristic based on the data rate...
virtual QString getName()
virtual void stop()
stop streaming
void resample(QSize mSize)
Set a new image size. Resample all other parameters to match this new image size, keeping sizes in mi...
virtual double getTimestamp()
boost::shared_ptr< Probe > ProbePtr
virtual void start()
start streaming
virtual bool isConnected() const
return true when a connection to the data source is established.
virtual QString getStatusString() const
status text describing the stream state, display instead of stream when the stream is invalid...
VideoSourcePtr getBaseSource()
ProbeAdapterRTSource(QString uid, ProbePtr probe, VideoSourcePtr source)
virtual ~ProbeAdapterRTSource()
boost::shared_ptr< class VideoSource > VideoSourcePtr
void sectorChanged()
< Return a ProbeSectorPtr for the given uid. Use 'active' to get the default.
Definition of characteristics for an Ultrasound Probe Sector.
virtual vtkImageDataPtr getVtkImageData()
void newFrame()
emitted when a new frame has arrived (getVtkImageData() returns something new). info/status/name/vali...
virtual bool isStreaming() const
return true when the source is streaming data.