14 #include <vtkImageChangeInformation.h> 15 #include <vtkImageData.h> 27 mUid(uid), mBase(source), mProbe(probe)
36 mRedirecter = vtkImageChangeInformationPtr::New();
37 mRedirecter->SetInputData(mBase->getVtkImageData());
38 this->probeChangedSlot();
56 return mBase->getName();
61 return mRedirecter->GetOutput();
66 QString uid = mBase->getUid();
69 return mBase->getTimestamp() - probe->getProbeDefinition(uid).getTemporalCalibration();
71 return mBase->getTimestamp();
83 return mBase->getInfoString();
88 return mBase->getStatusString();
103 return mBase->validData();
108 return mBase->isConnected();
113 return mBase->isStreaming();
121 void ProbeAdapterRTSource::newFrameSlot()
129 mRedirecter->Update();
131 QString uid = mBase->getUid();
133 QSize dimProbe = data.
getSize();
134 QSize dimImage(mRedirecter->GetOutput()->GetDimensions()[0], mRedirecter->GetOutput()->GetDimensions()[1]);
136 if (dimProbe!=dimImage)
139 QString(
"Resampling probe calibration. Calibration:[%1,%2], Image:[%3,%4], uid=%5")
140 .arg(dimProbe.width())
141 .arg(dimProbe.height())
142 .arg(dimImage.width())
143 .arg(dimImage.height())
147 probe->setProbeDefinition(data);
152 void ProbeAdapterRTSource::probeChangedSlot()
158 mRedirecter->Update();
160 QString uid = mBase->getUid();
161 mRedirecter->SetOutputSpacing(probe->getProbeDefinition(uid).getSpacing().begin());
163 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.
Namespace for all CustusX production code.