|
NorMIT-nav
22.09
An IGT application
|
Go to the documentation of this file.
16 #include <vtkImageChangeInformation.h>
17 #include <vtkImageData.h>
31 mStatus =
"USE_DEFAULT";
32 mRedirecter = vtkSmartPointer<vtkImageChangeInformation>::New();
38 mEmptyImage.reset(
new Image(uid, emptyImage));
39 mReceivedImage = mEmptyImage;
40 mRedirecter->SetInputData(mEmptyImage->getBaseVtkImageData());
43 mTimeoutTimer =
new QTimer(
this);
44 mTimeoutTimer->setInterval(1000);
45 connect(mTimeoutTimer, SIGNAL(timeout()),
this, SLOT(timeout()));
57 mTimeoutTimer->setParent(NULL);
67 return mReceivedImage->getUid();
71 return mReceivedImage->getName();
74 void BasicVideoSource::timeout()
91 return mReceivedImage->getAcquisitionTime().toMSecsSinceEpoch();
96 return mReceivedImage->getAdvancedTimeInfo();
101 return (mReceivedImage!=mEmptyImage);
111 mRedirecter->SetOutputSpacing(resolution, resolution, resolution);
116 mRedirecter->Update();
117 return mRedirecter->GetOutput();
129 mTimeoutTimer->start();
147 mTimeoutTimer->stop();
156 if (mStatus!=
"USE_DEFAULT")
161 return "Not connected";
163 return "Not streaming";
177 mReceivedImage = input;
184 mEmptyImage.reset(
new Image(mReceivedImage->getUid(), mEmptyImage->getBaseVtkImageData()));
186 mReceivedImage = mEmptyImage;
188 mRedirecter->SetInputData(mReceivedImage->getBaseVtkImageData());
189 mRedirecter->Update();
194 mTimeoutTimer->start();
virtual TimeInfo getAdvancedTimeInfo()
void newFrame()
emitted when a new frame has arrived (getVtkImageData() returns something new). info/status/name/vali...
virtual void start()
start streaming
void overrideTimeout(bool timeout)
virtual bool isStreaming() const
return true when the source is streaming data.
Namespace for all CustusX production code.
void connected(bool on)
emitted when source is connected/disconnected
virtual ~BasicVideoSource()
virtual bool validData() const
return true is data stream is ok to display. This is a heuristic based on the data rate.
virtual vtkImageDataPtr getVtkImageData()
vtkImageDataPtr generateVtkImageData(Eigen::Array3i dim, Vector3D spacing, const unsigned char initValue, int components)
virtual void setResolution(double resolution)
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.
boost::shared_ptr< class Image > ImagePtr
virtual QString getName()
void setInput(ImagePtr input)
BasicVideoSource(QString uid="<none>")
void streaming(bool on)
emitted when streaming started/stopped
virtual double getTimestamp()
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
void reportWarning(QString msg)
virtual void stop()
stop streaming