Medical Imaging Interaction Toolkit  2023.04.00
Medical Imaging Interaction Toolkit
mitk::TrackingDeviceSource Class Reference

Connects a mitk::TrackingDevice to a MITK-IGT NavigationData-Filterpipeline. More...

#include <mitkTrackingDeviceSource.h>

Inheritance diagram for mitk::TrackingDeviceSource:
Collaboration diagram for mitk::TrackingDeviceSource:

Public Member Functions

 mitkClassMacro (TrackingDeviceSource, NavigationDataSource)
 
Pointer Clone () const
 
virtual void SetTrackingDevice (mitk::TrackingDevice *td)
 sets the tracking device that will be used as a source for tracking data More...
 
virtual const mitk::TrackingDeviceGetTrackingDevice ()
 returns the tracking device that is used by this filter More...
 
void Connect ()
 Establishes a connection to the tracking device. If there is already a connection the method does nothing. More...
 
void Disconnect ()
 Closes the connection to the tracking device. More...
 
void StartTracking ()
 starts tracking. This needs to be called before Update() or GetOutput()->Update(). If the device is already tracking the method does nothing. More...
 
void StopTracking ()
 stops tracking. More...
 
virtual bool IsConnected ()
 returns true if a connection to the tracking device is established More...
 
virtual bool IsTracking ()
 returns true if tracking is in progress More...
 
void UpdateOutputInformation () override
 Used for pipeline update. More...
 
- Public Member Functions inherited from mitk::NavigationDataSource
 mitkClassMacroItkParent (NavigationDataSource, itk::ProcessObject)
 
virtual std::string GetName ()
 
virtual void SetName (std::string _arg)
 Sets the human readable name of this source. There is also a default name, but you can use this method if you need to define it on your own. More...
 
NavigationDataGetOutput (void)
 return the output (output with id 0) of the filter More...
 
NavigationDataGetOutput (DataObjectPointerArraySizeType idx)
 return the output with id idx of the filter More...
 
NavigationDataGetOutput (const std::string &navDataName)
 return the output with name navDataName of the filter More...
 
NavigationTool::Pointer GetToolMetaData (DataObjectPointerArraySizeType idx)
 
NavigationTool::Pointer GetToolMetaData (const std::string &navDataName)
 
virtual mitk::NavigationToolStorage::Pointer GetToolMetaDataCollection ()
 
virtual void SetToolMetaDataCollection (mitk::NavigationToolStorage::Pointer _arg)
 
DataObjectPointerArraySizeType GetOutputIndex (std::string navDataName)
 return the index of the output with name navDataName, -1 if no output with that name was found More...
 
virtual void RegisterAsMicroservice ()
 Registers this object as a Microservice, making it available to every module and/or plugin. To unregister, call UnregisterMicroservice(). More...
 
virtual void UnRegisterMicroservice ()
 Registers this object as a Microservice, making it available to every module and/or plugin. More...
 
std::string GetMicroserviceID ()
 Returns the id that this device is registered with. The id will only be valid, if the NavigationDataSource has been registered using RegisterAsMicroservice(). More...
 
virtual void GraftNthOutput (unsigned int idx, itk::DataObject *graft)
 Graft the specified DataObject onto this ProcessObject's output. More...
 
virtual void GraftOutput (itk::DataObject *graft)
 Graft the specified DataObject onto this ProcessObject's output. More...
 
itk::DataObject::Pointer MakeOutput (DataObjectPointerArraySizeType idx) override
 
itk::DataObject::Pointer MakeOutput (const DataObjectIdentifierType &name) override
 
virtual void SetParameters (const mitk::PropertyList *)
 Set all filter parameters as the PropertyList p. More...
 
virtual mitk::PropertyList::ConstPointer GetParameters () const
 Get all filter parameters as a PropertyList. More...
 
virtual void Freeze ()
 
virtual void UnFreeze ()
 
virtual bool GetIsFrozen ()
 

Static Public Member Functions

static Pointer New ()
 

Protected Member Functions

 TrackingDeviceSource ()
 
 ~TrackingDeviceSource () override
 
void GenerateData () override
 filter execute method More...
 
void CreateOutputs ()
 Create the necessary outputs for the TrackingTool objects in m_TrackingDevice. More...
 
- Protected Member Functions inherited from mitk::NavigationDataSource
 NavigationDataSource ()
 
 ~NavigationDataSource () override
 

Protected Attributes

mitk::TrackingDevice::Pointer m_TrackingDevice
 the tracking device that is used as a source for this filter object More...
 
- Protected Attributes inherited from mitk::NavigationDataSource
std::string m_Name
 
bool m_IsFrozen
 
NavigationToolStorage::Pointer m_ToolMetaDataCollection
 

Additional Inherited Members

- Static Public Attributes inherited from mitk::NavigationDataSource
static const std::string US_INTERFACE_NAME
 These Constants are used in conjunction with Microservices. More...
 
static const std::string US_PROPKEY_DEVICENAME
 
static const std::string US_PROPKEY_ID
 
static const std::string US_PROPKEY_ISACTIVE
 

Detailed Description

Connects a mitk::TrackingDevice to a MITK-IGT NavigationData-Filterpipeline.

Documentation This class is the source of most navigation pipelines. It encapsulates a mitk::TrackingDevice and provides the position and orientation of the connected mitk::TrackingTool objects as NavigationData objects. Note, that the number of outputs of TrackingDeviceSource is equal to the number of tools connected to the TrackingDevice at the time SetTrackingDevice() is called. If tools are added to the TrackingDevice later, there will not be additional outputs in TrackingDeviceSource. You have to call SetTrackingDevice() again to add the new tools as additional outputs of the filter. Otherwise TrackingDeviceSource will raise an std::out_of_range exception when the filter pipeline is executed. the tool number corresponds with the output number, e.g. trackingDevice-GetTool(0) is the tool that will produce trackingDeviceSourceFilter->GetOutput().

Warning
If a tool is removed from the tracking device, there will be a mismatch between the outputs and the tool number!

Definition at line 38 of file mitkTrackingDeviceSource.h.

Constructor & Destructor Documentation

◆ TrackingDeviceSource()

mitk::TrackingDeviceSource::TrackingDeviceSource ( )
protected

◆ ~TrackingDeviceSource()

mitk::TrackingDeviceSource::~TrackingDeviceSource ( )
overrideprotected

Member Function Documentation

◆ Clone()

Pointer mitk::TrackingDeviceSource::Clone ( ) const

◆ Connect()

void mitk::TrackingDeviceSource::Connect ( )

Establishes a connection to the tracking device. If there is already a connection the method does nothing.

Warning
. Will throw a std::invalid_argument exception if no tracking device was set with SetTrackingDevice(). Will throw a std::runtime_error if the tracking device returns an error.

◆ CreateOutputs()

void mitk::TrackingDeviceSource::CreateOutputs ( )
protected

Create the necessary outputs for the TrackingTool objects in m_TrackingDevice.

This Method is called internally whenever outputs need to be reset. Old Outputs are deleted when called.

◆ Disconnect()

void mitk::TrackingDeviceSource::Disconnect ( )

Closes the connection to the tracking device.

Warning
. Will throw a std::invalid_argument exception if no tracking device was set with SetTrackingDevice(). Will throw a std::runtime_error if the tracking device returns an error.

◆ GenerateData()

void mitk::TrackingDeviceSource::GenerateData ( )
overrideprotected

filter execute method

queries the tracking device for new position and orientation data for all tools and updates its output NavigationData objects with it.

Warning
Will raise a std::out_of_range exception, if tools were added to the tracking device after it was set as input for this filter

◆ GetTrackingDevice()

virtual const mitk::TrackingDevice* mitk::TrackingDeviceSource::GetTrackingDevice ( )
virtual

returns the tracking device that is used by this filter

◆ IsConnected()

virtual bool mitk::TrackingDeviceSource::IsConnected ( )
virtual

returns true if a connection to the tracking device is established

◆ IsTracking()

virtual bool mitk::TrackingDeviceSource::IsTracking ( )
virtual

returns true if tracking is in progress

◆ mitkClassMacro()

mitk::TrackingDeviceSource::mitkClassMacro ( TrackingDeviceSource  ,
NavigationDataSource   
)

◆ New()

static Pointer mitk::TrackingDeviceSource::New ( )
static

◆ SetTrackingDevice()

virtual void mitk::TrackingDeviceSource::SetTrackingDevice ( mitk::TrackingDevice td)
virtual

sets the tracking device that will be used as a source for tracking data

◆ StartTracking()

void mitk::TrackingDeviceSource::StartTracking ( )

starts tracking. This needs to be called before Update() or GetOutput()->Update(). If the device is already tracking the method does nothing.

Warning
. Will throw a std::invalid_argument exception if no tracking device was set with SetTrackingDevice(). Will throw a std::runtime_error if the tracking device returns an error.

◆ StopTracking()

void mitk::TrackingDeviceSource::StopTracking ( )

stops tracking.

Warning
. Will throw a std::invalid_argument exception if no tracking device was set with SetTrackingDevice(). Will throw a std::runtime_error if the tracking device returns an error.

◆ UpdateOutputInformation()

void mitk::TrackingDeviceSource::UpdateOutputInformation ( )
override

Used for pipeline update.

Member Data Documentation

◆ m_TrackingDevice

mitk::TrackingDevice::Pointer mitk::TrackingDeviceSource::m_TrackingDevice
protected

the tracking device that is used as a source for this filter object

Definition at line 128 of file mitkTrackingDeviceSource.h.


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