35 #include <vtkImageChangeInformation.h>
36 #include <vtkImageData.h>
48 mUid(uid), mBase(source), mProbe(probe)
57 mRedirecter = vtkImageChangeInformationPtr::New();
58 mRedirecter->SetInputData(mBase->getVtkImageData());
59 this->probeChangedSlot();
77 return mBase->getName();
82 return mRedirecter->GetOutput();
87 QString uid = mBase->getUid();
90 return mBase->getTimestamp() - probe->getProbeDefinition(uid).getTemporalCalibration();
92 return mBase->getTimestamp();
104 return mBase->getInfoString();
109 return mBase->getStatusString();
124 return mBase->validData();
129 return mBase->isConnected();
134 return mBase->isStreaming();
142 void ProbeAdapterRTSource::newFrameSlot()
150 mRedirecter->Update();
152 QString uid = mBase->getUid();
154 QSize dimProbe = data.
getSize();
155 QSize dimImage(mRedirecter->GetOutput()->GetDimensions()[0], mRedirecter->GetOutput()->GetDimensions()[1]);
157 if (dimProbe!=dimImage)
160 QString(
"Resampling probe calibration. Calibration:[%1,%2], Image:[%3,%4], uid=%5")
161 .arg(dimProbe.width())
162 .arg(dimProbe.height())
163 .arg(dimImage.width())
164 .arg(dimImage.height())
168 probe->setProbeDefinition(data);
173 void ProbeAdapterRTSource::probeChangedSlot()
179 mRedirecter->Update();
181 QString uid = mBase->getUid();
182 mRedirecter->SetOutputSpacing(probe->getProbeDefinition(uid).getSpacing().begin());
184 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 TimeInfo getAdvancedTimeInfo()
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.
QDateTime mAcquisitionTime
Possibly modified time stamp.
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.