Medical Imaging Interaction Toolkit
2018.4.99-389bf124
Medical Imaging Interaction Toolkit
|
Connects a mitk::TrackingDevice to a MITK-IGT NavigationData-Filterpipeline. More...
#include <mitkTrackingDeviceSource.h>
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::TrackingDevice * | GetTrackingDevice () |
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... | |
![]() | |
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... | |
NavigationData * | GetOutput (void) |
return the output (output with id 0) of the filter More... | |
NavigationData * | GetOutput (DataObjectPointerArraySizeType idx) |
return the output with id idx of the filter More... | |
NavigationData * | GetOutput (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... | |
![]() | |
NavigationDataSource () | |
~NavigationDataSource () override | |
Protected Attributes | |
mitk::TrackingDevice::Pointer | m_TrackingDevice |
the tracking device that is used as a source for this filter object More... | |
![]() | |
std::string | m_Name |
bool | m_IsFrozen |
NavigationToolStorage::Pointer | m_ToolMetaDataCollection |
Additional Inherited Members | |
![]() | |
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 |
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().
Definition at line 38 of file mitkTrackingDeviceSource.h.
|
protected |
Definition at line 22 of file mitkTrackingDeviceSource.cpp.
|
overrideprotected |
Definition at line 27 of file mitkTrackingDeviceSource.cpp.
References Disconnect(), m_TrackingDevice, mitk::TrackingDevice::Ready, StopTracking(), and mitk::TrackingDevice::Tracking.
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.
Definition at line 136 of file mitkTrackingDeviceSource.cpp.
References IsConnected(), m_TrackingDevice, and mitkThrowException.
|
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.
References mitk::NavigationDataSource::GetOutput(), m_TrackingDevice, mitk::NavigationDataSource::MakeOutput(), MITK_DEBUG, and mitk::NavigationDataSource::SetName().
Referenced by SetTrackingDevice(), and UpdateOutputInformation().
void mitk::TrackingDeviceSource::Disconnect | ( | ) |
Closes the connection to the tracking device.
Definition at line 166 of file mitkTrackingDeviceSource.cpp.
References m_TrackingDevice.
Referenced by ~TrackingDeviceSource().
|
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.
Definition at line 43 of file mitkTrackingDeviceSource.cpp.
References mitk::IGTTimeStamp::GetElapsed(), mitk::TrackingTool::GetIGTTimeStamp(), mitk::NavigationData::GetIGTTimeStamp(), mitk::IGTTimeStamp::GetInstance(), mitk::TrackingTool::GetOrientation(), mitk::NavigationDataSource::GetOutput(), mitk::TrackingTool::GetPosition(), mitk::TrackingTool::GetTrackingError(), mitk::TrackingTool::IsDataValid(), mitk::TrackingTool::IsEnabled(), mitk::NavigationDataSource::m_IsFrozen, m_TrackingDevice, mitk::NavigationData::SetDataValid(), mitk::NavigationData::SetIGTTimeStamp(), mitk::NavigationData::SetOrientation(), mitk::NavigationData::SetOrientationAccuracy(), mitk::NavigationData::SetPosition(), and mitk::NavigationData::SetPositionAccuracy().
|
virtual |
returns the tracking device that is used by this filter
Referenced by UpdateOutputInformation().
|
virtual |
returns true if a connection to the tracking device is established
Definition at line 198 of file mitkTrackingDeviceSource.cpp.
References m_TrackingDevice, mitk::TrackingDevice::Ready, and mitk::TrackingDevice::Tracking.
Referenced by Connect().
|
virtual |
returns true if tracking is in progress
Definition at line 206 of file mitkTrackingDeviceSource.cpp.
References m_TrackingDevice, and mitk::TrackingDevice::Tracking.
mitk::TrackingDeviceSource::mitkClassMacro | ( | TrackingDeviceSource | , |
NavigationDataSource | |||
) |
|
static |
Referenced by mitk::MicronTrackerTypeInformation::CreateTrackingDeviceSource(), mitk::VirtualTrackerTypeInformation::CreateTrackingDeviceSource(), mitk::NDIAuroraTypeInformation::CreateTrackingDeviceSource(), mitk::PolhemusTrackerTypeInformation::CreateTrackingDeviceSource(), mitk::NDIPolarisTypeInformation::CreateTrackingDeviceSource(), mitk::OpenIGTLinkTypeInformation::CreateTrackingDeviceSource(), mitk::NPOptitrackTrackingTypeInformation::CreateTrackingDeviceSource(), main(), and mitkTrackingDeviceSourceTest().
|
virtual |
sets the tracking device that will be used as a source for tracking data
Definition at line 94 of file mitkTrackingDeviceSource.cpp.
References CreateOutputs(), m_TrackingDevice, MITK_DEBUG, and mitk::NavigationDataSource::SetName().
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.
Definition at line 156 of file mitkTrackingDeviceSource.cpp.
References m_TrackingDevice, and mitk::TrackingDevice::Tracking.
void mitk::TrackingDeviceSource::StopTracking | ( | ) |
stops tracking.
Definition at line 174 of file mitkTrackingDeviceSource.cpp.
References m_TrackingDevice.
Referenced by ~TrackingDeviceSource().
|
override |
Used for pipeline update.
Definition at line 182 of file mitkTrackingDeviceSource.cpp.
References CreateOutputs(), and GetTrackingDevice().
|
protected |
the tracking device that is used as a source for this filter object
Definition at line 128 of file mitkTrackingDeviceSource.h.
Referenced by Connect(), CreateOutputs(), Disconnect(), GenerateData(), IsConnected(), IsTracking(), SetTrackingDevice(), StartTracking(), StopTracking(), and ~TrackingDeviceSource().