MITK-IGT
IGT Extension of MITK
Loading...
Searching...
No Matches
mitk::TrackingDeviceSource Class Reference

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

#include <mitkTrackingDeviceSource.h>

Inheritance diagram for mitk::TrackingDeviceSource:
mitk::NavigationDataSource

Public Member Functions

 mitkClassMacro (TrackingDeviceSource, NavigationDataSource)
 
 itkFactorylessNewMacro (Self)
 
 itkCloneMacro (Self)
 
virtual void SetTrackingDevice (mitk::TrackingDevice *td)
 sets the tracking device that will be used as a source for tracking data
 
 itkGetConstObjectMacro (TrackingDevice, mitk::TrackingDevice)
 returns the tracking device that is used by this filter
 
void Connect ()
 Establishes a connection to the tracking device. If there is already a connection the method does nothing.
 
void Disconnect ()
 Closes the connection to the tracking device.
 
void StartTracking ()
 starts tracking. This needs to be called before Update() or GetOutput()->Update(). If the device is already tracking the method does nothing.
 
void StopTracking ()
 stops tracking.
 
virtual bool IsConnected ()
 returns true if a connection to the tracking device is established
 
virtual bool IsTracking ()
 returns true if tracking is in progress
 
void UpdateOutputInformation () override
 Used for pipeline update.
 
- Public Member Functions inherited from mitk::NavigationDataSource
 mitkClassMacroItkParent (NavigationDataSource, itk::ProcessObject)
 
 itkGetMacro (Name, std::string)
 
 itkSetMacro (Name, std::string)
 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.
 
NavigationDataGetOutput (void)
 return the output (output with id 0) of the filter
 
NavigationDataGetOutput (DataObjectPointerArraySizeType idx)
 return the output with id idx of the filter
 
NavigationDataGetOutput (const std::string &navDataName)
 return the output with name navDataName of the filter
 
NavigationTool::Pointer GetToolMetaData (DataObjectPointerArraySizeType idx)
 
NavigationTool::Pointer GetToolMetaData (const std::string &navDataName)
 
 itkGetMacro (ToolMetaDataCollection, mitk::NavigationToolStorage::Pointer)
 
 itkSetMacro (ToolMetaDataCollection, mitk::NavigationToolStorage::Pointer)
 
DataObjectPointerArraySizeType GetOutputIndex (std::string navDataName)
 return the index of the output with name navDataName, -1 if no output with that name was found
 
virtual void RegisterAsMicroservice ()
 Registers this object as a Microservice, making it available to every module and/or plugin. To unregister, call UnregisterMicroservice().
 
virtual void UnRegisterMicroservice ()
 Registers this object as a Microservice, making it available to every module and/or plugin.
 
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().
 
virtual void GraftNthOutput (unsigned int idx, itk::DataObject *graft)
 Graft the specified DataObject onto this ProcessObject's output.
 
virtual void GraftOutput (itk::DataObject *graft)
 Graft the specified DataObject onto this ProcessObject's output.
 
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.
 
virtual mitk::PropertyList::ConstPointer GetParameters () const
 Get all filter parameters as a PropertyList.
 
virtual void Freeze ()
 
virtual void UnFreeze ()
 
 itkGetMacro (IsFrozen, bool)
 

Protected Member Functions

 TrackingDeviceSource ()
 
 ~TrackingDeviceSource () override
 
void GenerateData () override
 filter execute method
 
void CreateOutputs ()
 Create the necessary outputs for the TrackingTool objects in m_TrackingDevice.
 
- 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
 
- 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 = "org.mitk.services.NavigationDataSource"
 These Constants are used in conjunction with Microservices.
 
static const std::string US_PROPKEY_DEVICENAME = US_INTERFACE_NAME + ".devicename"
 
static const std::string US_PROPKEY_ID = US_INTERFACE_NAME + ".id"
 
static const std::string US_PROPKEY_ISACTIVE = US_INTERFACE_NAME + ".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

Definition at line 22 of file mitkTrackingDeviceSource.cpp.

◆ ~TrackingDeviceSource()

mitk::TrackingDeviceSource::~TrackingDeviceSource ( )
overrideprotected

Definition at line 27 of file mitkTrackingDeviceSource.cpp.

Member Function Documentation

◆ 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.

Definition at line 136 of file mitkTrackingDeviceSource.cpp.

◆ 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.

Definition at line 107 of file mitkTrackingDeviceSource.cpp.

◆ 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.

Definition at line 166 of file mitkTrackingDeviceSource.cpp.

◆ 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

Definition at line 43 of file mitkTrackingDeviceSource.cpp.

◆ IsConnected()

bool mitk::TrackingDeviceSource::IsConnected ( )
virtual

returns true if a connection to the tracking device is established

Definition at line 198 of file mitkTrackingDeviceSource.cpp.

◆ IsTracking()

bool mitk::TrackingDeviceSource::IsTracking ( )
virtual

returns true if tracking is in progress

Definition at line 206 of file mitkTrackingDeviceSource.cpp.

◆ itkCloneMacro()

mitk::TrackingDeviceSource::itkCloneMacro ( Self )

◆ itkFactorylessNewMacro()

mitk::TrackingDeviceSource::itkFactorylessNewMacro ( Self )

◆ itkGetConstObjectMacro()

mitk::TrackingDeviceSource::itkGetConstObjectMacro ( TrackingDevice ,
mitk::TrackingDevice  )

returns the tracking device that is used by this filter

◆ mitkClassMacro()

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

◆ SetTrackingDevice()

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

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

Definition at line 94 of file mitkTrackingDeviceSource.cpp.

◆ 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.

Definition at line 156 of file mitkTrackingDeviceSource.cpp.

◆ 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.

Definition at line 174 of file mitkTrackingDeviceSource.cpp.

◆ UpdateOutputInformation()

void mitk::TrackingDeviceSource::UpdateOutputInformation ( )
override

Used for pipeline update.

Definition at line 182 of file mitkTrackingDeviceSource.cpp.

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 files: