NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
Public Member Functions | Protected Member Functions | List of all members
niftk::IGIDataSource Class Reference

Abstract base class for IGI DataSources, such as objects that produce tracking data, video frames or ultrasound frames. More...

Inheritance diagram for niftk::IGIDataSource:
Inheritance graph
[legend]
Collaboration diagram for niftk::IGIDataSource:
Collaboration graph
[legend]

Public Member Functions

 mitkClassMacroItkParent (IGIDataSource, niftk::IGIDataSourceI) virtual QString GetName() const override
 
virtual QString GetFactoryName () const override
 
virtual QString GetStatus () const override
 
QString GetDescription () const override
 
virtual bool GetShouldUpdate () const override
 
virtual void SetShouldUpdate (bool shouldUpdate) override
 
virtual void StartPlayback (niftk::IGIDataType::IGITimeType firstTimeStamp, niftk::IGIDataType::IGITimeType lastTimeStamp) override
 
virtual void StopPlayback () override
 
virtual void StartRecording () override
 
virtual void StopRecording () override
 
virtual void SetRecordingLocation (const QString &pathName) override
 
virtual QString GetRecordingLocation () const override
 
virtual void SetPlaybackSourceName (const QString &sourceName) override
 
virtual QString GetPlaybackSourceName () const override
 
QString GetPlaybackDirectory () const
 Returns this->GetRecordingLocation() slash this->GetPlaybackSourceName(). More...
 
QString GetRecordingDirectory () const
 Returns this->GetRecordingLocation() slash this->GetName(). More...
 
virtual bool GetIsRecording () const
 
virtual bool GetIsPlayingBack () const
 
virtual void SetTimeStampTolerance (niftk::IGIDataType::IGITimeType _arg)
 
virtual
niftk::IGIDataType::IGITimeType 
GetTimeStampTolerance () const
 
- Public Member Functions inherited from niftk::IGIDataSourceI
 mitkClassMacroItkParent (IGIDataSourceI, itk::Object) virtual QString GetName() const =0
 Returns the unique name of the data source, e.g. OpenCV-0. More...
 
virtual void PlaybackData (niftk::IGIDataType::IGITimeType requestedTimeStamp)=0
 Request that the data source loads data corresponding to the given timestamp. More...
 
virtual std::vector
< IGIDataItemInfo
Update (const niftk::IGIDataType::IGITimeType &time)=0
 Requests that this data source updates data storage to reflect the given point in time. More...
 
virtual bool ProbeRecordedData (niftk::IGIDataType::IGITimeType *firstTimeStampInStore, niftk::IGIDataType::IGITimeType *lastTimeStampInStore)=0
 
virtual void SetProperties (const IGIDataSourceProperties &properties)=0
 Allows you to set properties, but the implementor is free to ignore them. More...
 
virtual IGIDataSourceProperties GetProperties () const =0
 Retrieve any properties from the data source. More...
 

Protected Member Functions

 IGIDataSource (const std::string &name, const std::string &factoryName, mitk::DataStorage::Pointer dataStorage)
 
virtual ~IGIDataSource ()
 
 IGIDataSource (const IGIDataSource &)
 
IGIDataSourceoperator= (const IGIDataSource &)
 
mitk::DataNode::Pointer GetDataNode (const QString &name=QString(), const bool &addToDataStorage=true)
 Derived classes request a node for a given name. If the node does not exist, it will be created with some default properties. More...
 
bool IsLate (const niftk::IGIDataType::IGITimeType &requested, const niftk::IGIDataType::IGITimeType &actual) const
 Returns true if the delay between requested and actual is greater than the TimeStampTolerance, and false otherwise. More...
 
unsigned int GetLagInMilliseconds (const niftk::IGIDataType::IGITimeType &requested, const niftk::IGIDataType::IGITimeType &actual) const
 Simply checks the difference in time, and converts to milliseconds. More...
 
mitk::DataStorage::Pointer GetDataStorage () const
 Returns the pointer to the internal data storage. More...
 
niftk::IGIDataType::IGITimeType GetTimeStampInNanoseconds ()
 Queries the internal igtl::TimeStamp to get an up-to-date timestamp. More...
 
virtual void SetIsRecording (bool _arg)
 
virtual void SetIsPlayingBack (bool _arg)
 
void SetStatus (const QString &status)
 
void SetDescription (const QString &description)
 
- Protected Member Functions inherited from niftk::IGIDataSourceI
 IGIDataSourceI ()
 
virtual ~IGIDataSourceI ()
 

Detailed Description

Abstract base class for IGI DataSources, such as objects that produce tracking data, video frames or ultrasound frames.

Each source registers as a service when it is instantiated. You MUST allow for multiple instances of each service. Each service should have a different name, and unique Id.

Uses RAII pattern to register/de-register as MITK Micro-Service.

Note: All errors should thrown as mitk::Exception or sub-classes thereof.

Constructor & Destructor Documentation

IGIDataSource::IGIDataSource ( const std::string name,
const std::string factoryName,
mitk::DataStorage::Pointer  dataStorage 
)
protected
IGIDataSource::~IGIDataSource ( )
protectedvirtual
niftk::IGIDataSource::IGIDataSource ( const IGIDataSource )
protected

Member Function Documentation

mitk::DataNode::Pointer IGIDataSource::GetDataNode ( const QString &  name = QString(),
const bool &  addToDataStorage = true 
)
protected

Derived classes request a node for a given name. If the node does not exist, it will be created with some default properties.

Parameters
nameif supplied the node will be assigned that name, and if empty, the node will be given the name this->GetMicroServiceDeviceName().
addToDataStorageif true, will be added to data storage, if false, the caller can determine when to do it.
mitk::DataStorage::Pointer IGIDataSource::GetDataStorage ( ) const
protected

Returns the pointer to the internal data storage.

QString IGIDataSource::GetDescription ( ) const
overridevirtual
QString IGIDataSource::GetFactoryName ( ) const
overridevirtual
virtual bool niftk::IGIDataSource::GetIsPlayingBack ( ) const
virtual
virtual bool niftk::IGIDataSource::GetIsRecording ( ) const
virtual
unsigned int IGIDataSource::GetLagInMilliseconds ( const niftk::IGIDataType::IGITimeType requested,
const niftk::IGIDataType::IGITimeType actual 
) const
protected

Simply checks the difference in time, and converts to milliseconds.

QString IGIDataSource::GetPlaybackDirectory ( ) const

Returns this->GetRecordingLocation() slash this->GetPlaybackSourceName().

QString IGIDataSource::GetPlaybackSourceName ( ) const
overridevirtual
QString IGIDataSource::GetRecordingDirectory ( ) const

Returns this->GetRecordingLocation() slash this->GetName().

QString IGIDataSource::GetRecordingLocation ( ) const
overridevirtual
bool IGIDataSource::GetShouldUpdate ( ) const
overridevirtual
QString IGIDataSource::GetStatus ( ) const
overridevirtual
niftk::IGIDataType::IGITimeType IGIDataSource::GetTimeStampInNanoseconds ( )
protected

Queries the internal igtl::TimeStamp to get an up-to-date timestamp.

virtual niftk::IGIDataType::IGITimeType niftk::IGIDataSource::GetTimeStampTolerance ( ) const
virtual
bool IGIDataSource::IsLate ( const niftk::IGIDataType::IGITimeType requested,
const niftk::IGIDataType::IGITimeType actual 
) const
protected

Returns true if the delay between requested and actual is greater than the TimeStampTolerance, and false otherwise.

niftk::IGIDataSource::mitkClassMacroItkParent ( IGIDataSource  ,
niftk::IGIDataSourceI   
) const
override
See also
IGIDataSourceI::GetName()
IGIDataSource& niftk::IGIDataSource::operator= ( const IGIDataSource )
protected
void IGIDataSource::SetDescription ( const QString &  description)
protected
virtual void niftk::IGIDataSource::SetIsPlayingBack ( bool  _arg)
protectedvirtual
virtual void niftk::IGIDataSource::SetIsRecording ( bool  _arg)
protectedvirtual
void IGIDataSource::SetPlaybackSourceName ( const QString &  sourceName)
overridevirtual
void IGIDataSource::SetRecordingLocation ( const QString &  pathName)
overridevirtual
void IGIDataSource::SetShouldUpdate ( bool  shouldUpdate)
overridevirtual
void IGIDataSource::SetStatus ( const QString &  status)
protected
virtual void niftk::IGIDataSource::SetTimeStampTolerance ( niftk::IGIDataType::IGITimeType  _arg)
virtual
void IGIDataSource::StartPlayback ( niftk::IGIDataType::IGITimeType  firstTimeStamp,
niftk::IGIDataType::IGITimeType  lastTimeStamp 
)
overridevirtual
void IGIDataSource::StartRecording ( )
overridevirtual
void IGIDataSource::StopPlayback ( )
overridevirtual
void IGIDataSource::StopRecording ( )
overridevirtual

The documentation for this class was generated from the following files: