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

Interface for an IGI Data Source (e.g. video feed, ultrasound feed, tracker feed). More...

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

Public Member Functions

 mitkClassMacroItkParent (IGIDataSourceI, itk::Object) virtual QString GetName() const =0
 Returns the unique name of the data source, e.g. OpenCV-0. More...
 
virtual QString GetFactoryName () const =0
 Returns the name of the factory that created it. The name should be the string that appears in the GUI combo-box. So, implementing classes should have this value set at construction, and it should be immutable throughout the lifetime of the object. More...
 
virtual QString GetStatus () const =0
 Returns a status string. More...
 
virtual QString GetDescription () const =0
 Returns a free-text string describing the source. More...
 
virtual void StartPlayback (niftk::IGIDataType::IGITimeType firstTimeStamp, niftk::IGIDataType::IGITimeType lastTimeStamp)=0
 Starts the playback process, implementors are meant to do all initialisation in this method, so that after the successful return of this method, the data source is fully ready to play back. More...
 
virtual void StopPlayback ()=0
 Stops the playback process, so after this call, implementing data sources should be grabbing live data again. More...
 
virtual void PlaybackData (niftk::IGIDataType::IGITimeType requestedTimeStamp)=0
 Request that the data source loads data corresponding to the given timestamp. More...
 
virtual void SetRecordingLocation (const QString &pathName)=0
 Set the root directory of the recording session. More...
 
virtual QString GetRecordingLocation () const =0
 Get the root directory of the recording session. More...
 
virtual void SetPlaybackSourceName (const QString &sourceName)=0
 The source name is the first level directory name within the root recording location. This normally corresponds to a device name, like OpenCV-0 for the OpenCV Video Source. More...
 
virtual QString GetPlaybackSourceName () const =0
 
virtual void StartRecording ()=0
 Start recording. More...
 
virtual void StopRecording ()=0
 Stops the recording process, switching the data source back to the live grabbing mode. More...
 
virtual void SetShouldUpdate (bool shouldUpdate)=0
 Sets a flag to say that this data source should/should not update the data storage. This enables us to freeze the views while the data source itself can continue grabbing and hence continue recording. More...
 
virtual bool GetShouldUpdate () const =0
 Returns the value of the update flag,. 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

 IGIDataSourceI ()
 
virtual ~IGIDataSourceI ()
 

Detailed Description

Interface for an IGI Data Source (e.g. video feed, ultrasound feed, tracker feed).

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

Constructor & Destructor Documentation

niftk::IGIDataSourceI::IGIDataSourceI ( )
protected
niftk::IGIDataSourceI::~IGIDataSourceI ( )
protectedvirtual

Member Function Documentation

virtual QString niftk::IGIDataSourceI::GetDescription ( ) const
pure virtual

Returns a free-text string describing the source.

Implemented in niftk::IGIDataSource.

virtual QString niftk::IGIDataSourceI::GetFactoryName ( ) const
pure virtual

Returns the name of the factory that created it. The name should be the string that appears in the GUI combo-box. So, implementing classes should have this value set at construction, and it should be immutable throughout the lifetime of the object.

Implemented in niftk::IGIDataSource.

virtual QString niftk::IGIDataSourceI::GetPlaybackSourceName ( ) const
pure virtual

Implemented in niftk::IGIDataSource.

virtual IGIDataSourceProperties niftk::IGIDataSourceI::GetProperties ( ) const
pure virtual
virtual QString niftk::IGIDataSourceI::GetRecordingLocation ( ) const
pure virtual

Get the root directory of the recording session.

Implemented in niftk::IGIDataSource.

virtual bool niftk::IGIDataSourceI::GetShouldUpdate ( ) const
pure virtual

Returns the value of the update flag,.

See also
SetShouldUpdate().

Implemented in niftk::IGIDataSource.

virtual QString niftk::IGIDataSourceI::GetStatus ( ) const
pure virtual

Returns a status string.

At this stage, each data-source can return whatever it likes that best describes its current status. This is currently not something specific like an enum, but may have to change in future.

Implemented in niftk::IGIDataSource.

niftk::IGIDataSourceI::mitkClassMacroItkParent ( IGIDataSourceI  ,
itk::Object   
) const
pure virtual

Returns the unique name of the data source, e.g. OpenCV-0.

Implementing classes should have this value set at construction, and it should be immutable throughout the lifetime of the object.

virtual void niftk::IGIDataSourceI::PlaybackData ( niftk::IGIDataType::IGITimeType  requestedTimeStamp)
pure virtual

Request that the data source loads data corresponding to the given timestamp.

This is expected to just load data into internal buffers. It should then be up to the Update() method to update data storage.

Implemented in niftk::NVidiaSDIDataSourceService, niftk::MITKTrackerDataSourceService, niftk::OpenCVVideoDataSourceService, niftk::QtAudioDataSourceService, and niftk::UltrasonixDataSourceService.

virtual bool niftk::IGIDataSourceI::ProbeRecordedData ( niftk::IGIDataType::IGITimeType firstTimeStampInStore,
niftk::IGIDataType::IGITimeType lastTimeStampInStore 
)
pure virtual

Checks whether the previously recorded data is readable, and returns the time-range for it.

Parameters
firstTimeStampInStoreearliest suitable data item. Not optional!
lastTimeStampInStorelast suitable data item. Not optional!
Returns
true if there is suitable data to playback
Exceptions
shouldnot throw! Return false instead.
See also
SetRecordingLocation
SetPlaybackSourceName

Implemented in niftk::NiftyLinkDataSourceService, niftk::NVidiaSDIDataSourceService, niftk::MITKTrackerDataSourceService, niftk::OpenCVVideoDataSourceService, niftk::UltrasonixDataSourceService, and niftk::QtAudioDataSourceService.

virtual void niftk::IGIDataSourceI::SetPlaybackSourceName ( const QString &  sourceName)
pure virtual

The source name is the first level directory name within the root recording location. This normally corresponds to a device name, like OpenCV-0 for the OpenCV Video Source.

When we playback, we call this setter with whatever is currently in the folder, thereby allowing us to use legacy sources.

Implemented in niftk::IGIDataSource.

virtual void niftk::IGIDataSourceI::SetProperties ( const IGIDataSourceProperties properties)
pure virtual
virtual void niftk::IGIDataSourceI::SetRecordingLocation ( const QString &  pathName)
pure virtual

Set the root directory of the recording session.

Implemented in niftk::IGIDataSource.

virtual void niftk::IGIDataSourceI::SetShouldUpdate ( bool  shouldUpdate)
pure virtual

Sets a flag to say that this data source should/should not update the data storage. This enables us to freeze the views while the data source itself can continue grabbing and hence continue recording.

Implemented in niftk::IGIDataSource.

virtual void niftk::IGIDataSourceI::StartPlayback ( niftk::IGIDataType::IGITimeType  firstTimeStamp,
niftk::IGIDataType::IGITimeType  lastTimeStamp 
)
pure virtual

Starts the playback process, implementors are meant to do all initialisation in this method, so that after the successful return of this method, the data source is fully ready to play back.

Parameters
firstTimeStampspecifies the minimum time of the recording session.
lastTimeStampspecifies the maximum time of the recording session.

Implemented in niftk::IGIDataSource, niftk::NVidiaSDIDataSourceService, niftk::MITKTrackerDataSourceService, niftk::OpenCVVideoDataSourceService, niftk::QtAudioDataSourceService, and niftk::UltrasonixDataSourceService.

virtual void niftk::IGIDataSourceI::StartRecording ( )
pure virtual

Start recording.

Given a pathName (root directory) for a recording session, specified by calling SetRecordingLocation(), a data source can decide to record to a sub-folder. This method should initialise the sub-folder and make sure the data-source is ready to record all data. The data source is assumed to be grabbing live while switching into recording mode, so make sure all your code is thread safe.

Implemented in niftk::IGIDataSource, and niftk::QtAudioDataSourceService.

virtual void niftk::IGIDataSourceI::StopPlayback ( )
pure virtual
virtual void niftk::IGIDataSourceI::StopRecording ( )
pure virtual

Stops the recording process, switching the data source back to the live grabbing mode.

Implemented in niftk::IGIDataSource, and niftk::QtAudioDataSourceService.

virtual std::vector<IGIDataItemInfo> niftk::IGIDataSourceI::Update ( const niftk::IGIDataType::IGITimeType time)
pure virtual

Requests that this data source updates data storage to reflect the given point in time.

Returns
When successful, we return a vector of information about each item that we report on.

e.g. a tracker may have many tools, so each item in the return vector describes the status of a specific tool. This means that as the number of visible items changes, this array may change size.

Implemented in niftk::NiftyLinkDataSourceService, niftk::NVidiaSDIDataSourceService, niftk::MITKTrackerDataSourceService, niftk::OpenCVVideoDataSourceService, niftk::QtAudioDataSourceService, and niftk::UltrasonixDataSourceService.


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