Medical Imaging Interaction Toolkit  2016.11.0
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...
 
virtual 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...
 
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...
 
virtual itk::DataObject::Pointer MakeOutput (DataObjectPointerArraySizeType idx) override
 
virtual 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 ()
 
virtual ~TrackingDeviceSource ()
 
virtual 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 ()
 
virtual ~NavigationDataSource ()
 

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
 

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 42 of file mitkTrackingDeviceSource.h.

Constructor & Destructor Documentation

mitk::TrackingDeviceSource::TrackingDeviceSource ( )
protected

Definition at line 25 of file mitkTrackingDeviceSource.cpp.

mitk::TrackingDeviceSource::~TrackingDeviceSource ( )
protectedvirtual

Member Function Documentation

Pointer mitk::TrackingDeviceSource::Clone ( ) const
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 139 of file mitkTrackingDeviceSource.cpp.

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 110 of file mitkTrackingDeviceSource.cpp.

References MITK_DEBUG.

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 167 of file mitkTrackingDeviceSource.cpp.

void mitk::TrackingDeviceSource::GenerateData ( )
overrideprotectedvirtual
virtual const mitk::TrackingDevice* mitk::TrackingDeviceSource::GetTrackingDevice ( )
virtual

returns the tracking device that is used by this filter

bool mitk::TrackingDeviceSource::IsConnected ( )
virtual

returns true if a connection to the tracking device is established

Definition at line 199 of file mitkTrackingDeviceSource.cpp.

References mitk::TrackingDevice::Ready, and mitk::TrackingDevice::Tracking.

bool mitk::TrackingDeviceSource::IsTracking ( )
virtual

returns true if tracking is in progress

Definition at line 207 of file mitkTrackingDeviceSource.cpp.

References mitk::TrackingDevice::Tracking.

mitk::TrackingDeviceSource::mitkClassMacro ( TrackingDeviceSource  ,
NavigationDataSource   
)
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 97 of file mitkTrackingDeviceSource.cpp.

References MITK_DEBUG.

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 157 of file mitkTrackingDeviceSource.cpp.

References mitk::TrackingDevice::Tracking.

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 175 of file mitkTrackingDeviceSource.cpp.

void mitk::TrackingDeviceSource::UpdateOutputInformation ( )
overridevirtual

Used for pipeline update.

Definition at line 183 of file mitkTrackingDeviceSource.cpp.

Member Data Documentation

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

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

Definition at line 132 of file mitkTrackingDeviceSource.h.


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