MITK-IGT
IGT Extension of MITK
|
Interface for all Tracking Devices. More...
#include <mitkTrackingDevice.h>
Public Types | |
enum | RotationMode { RotationStandard , RotationTransposed } |
enum | TrackingDeviceState { Setup , Ready , Tracking } |
Public Member Functions | |
mitkClassMacroItkParent (TrackingDevice, itk::Object) | |
virtual bool | OpenConnection ()=0 |
Opens a connection to the device. | |
virtual bool | CloseConnection ()=0 |
Closes the connection to the device. | |
virtual bool | StartTracking ()=0 |
start retrieving tracking data from the device. | |
virtual bool | StopTracking () |
stop retrieving tracking data from the device. stop retrieving tracking data from the device. This may only be called after StartTracking was called (e.g. the object is in Tracking mode). This will change the object state from Tracking to Ready. | |
virtual TrackingTool * | GetTool (unsigned int toolNumber) const =0 |
Return tool with index toolNumber. | |
virtual mitk::TrackingTool * | GetToolByName (std::string name) const |
Returns the tool with the given tool name. | |
virtual unsigned int | GetToolCount () const =0 |
Returns number of tracking tools. | |
virtual void | SetRotationMode (RotationMode r) |
itkGetConstMacro (RotationMode, RotationMode) | |
TrackingDeviceState | GetState () const |
return current object state (Setup, Ready or Tracking) | |
TrackingDeviceType | GetType () const |
Deprecated! Use the more specific getData or GetTrackingDeviceName instead. return device type identifier. | |
void | SetType (TrackingDeviceType type) |
Deprecated! Use the more specific setDeviceData instead. set device type. | |
std::string | GetTrackingDeviceName () |
Convenient Method to get the Name of the Tracking Device. This is identical with GetData().Line and can be used to compare with TrackingDeviceTypeInformation::GetTrackingDeviceName() to check if you have a specific device. | |
TrackingDeviceData | GetData () const |
return device data | |
void | SetData (TrackingDeviceData data) |
set device type | |
virtual bool | IsDeviceInstalled () |
virtual bool | AutoDetectToolsAvailable () |
virtual bool | AddSingleToolIsAvailable () |
virtual mitk::NavigationToolStorage::Pointer | AutoDetectTools () |
Protected Member Functions | |
void | SetState (TrackingDeviceState state) |
change object state | |
TrackingDevice () | |
~TrackingDevice () override | |
Protected Attributes | |
TrackingDeviceData | m_Data |
current device Data | |
bool | m_StopTracking |
signal stop to tracking thread | |
std::mutex | m_StopTrackingMutex |
mutex to control access to m_StopTracking | |
std::mutex | m_TrackingFinishedMutex |
mutex to manage control flow of StopTracking() | |
std::mutex | m_StateMutex |
mutex to control access to m_State | |
RotationMode | m_RotationMode |
defines the rotation mode Standard or Transposed, Standard is default | |
Interface for all Tracking Devices.
Documentation
Defines the methods that are common for all tracking devices.
Definition at line 34 of file mitkTrackingDevice.h.
Defines the rotation modes of this tracking device which results in different representations of quaternions.
CAUTION: The rotation mode can only be changed for backward compatibility of old WRONG code. PLEASE DO NOT CHANGE THE ROTATION MODE UNLESS YOU ARE KNOWING EXACTLY WHAT YOU ARE DOING!
use SetRotationMode to change the mode.
Enumerator | |
---|---|
RotationStandard | |
RotationTransposed |
Definition at line 52 of file mitkTrackingDevice.h.
Enumerator | |
---|---|
Setup | |
Ready | |
Tracking |
Definition at line 54 of file mitkTrackingDevice.h.
|
protected |
Definition at line 24 of file mitkTrackingDevice.cpp.
|
overrideprotected |
Definition at line 34 of file mitkTrackingDevice.cpp.
|
virtual |
Reimplemented in mitk::NDITrackingDevice.
Definition at line 51 of file mitkTrackingDevice.cpp.
|
virtual |
Autodetects tools from this device and returns them as a navigation tool storage.
Reimplemented in mitk::NDITrackingDevice, mitk::OpenIGTLinkTrackingDevice, and mitk::PolhemusTrackingDevice.
Definition at line 56 of file mitkTrackingDevice.cpp.
|
virtual |
Reimplemented in mitk::NDITrackingDevice, mitk::OpenIGTLinkTrackingDevice, and mitk::PolhemusTrackingDevice.
Definition at line 46 of file mitkTrackingDevice.cpp.
|
pure virtual |
Closes the connection to the device.
This may only be called if there is currently a connection to the device, but tracking is not running (e.g. object is in Ready state) Closes the connection with the device
Implemented in mitk::ClaronTrackingDevice, mitk::MicroBirdTrackingDevice, mitk::NDITrackingDevice, mitk::OpenIGTLinkTrackingDevice, mitk::OptitrackTrackingDevice, mitk::PolhemusTrackingDevice, mitk::VirtualTrackingDevice, and TrackingDeviceTestClass.
mitk::TrackingDeviceData mitk::TrackingDevice::GetData | ( | ) | const |
return device data
Definition at line 105 of file mitkTrackingDevice.cpp.
mitk::TrackingDevice::TrackingDeviceState mitk::TrackingDevice::GetState | ( | ) | const |
return current object state (Setup, Ready or Tracking)
Definition at line 62 of file mitkTrackingDevice.cpp.
|
pure virtual |
Return tool with index toolNumber.
tools are numbered from 0 to GetToolCount() - 1.
Implemented in mitk::ClaronTrackingDevice, mitk::NDITrackingDevice, mitk::OpenIGTLinkTrackingDevice, mitk::OptitrackTrackingDevice, mitk::PolhemusTrackingDevice, mitk::VirtualTrackingDevice, and TrackingDeviceTestClass.
|
virtual |
Returns the tool with the given tool name.
Note: subclasses can and should implement optimized versions of this method
Reimplemented in mitk::NDITrackingDevice.
Definition at line 134 of file mitkTrackingDevice.cpp.
|
pure virtual |
Returns number of tracking tools.
Implemented in mitk::ClaronTrackingDevice, mitk::MicroBirdTrackingDevice, mitk::NDITrackingDevice, mitk::OpenIGTLinkTrackingDevice, mitk::OptitrackTrackingDevice, mitk::PolhemusTrackingDevice, mitk::VirtualTrackingDevice, and TrackingDeviceTestClass.
std::string mitk::TrackingDevice::GetTrackingDeviceName | ( | ) |
Convenient Method to get the Name of the Tracking Device. This is identical with GetData().Line and can be used to compare with TrackingDeviceTypeInformation::GetTrackingDeviceName() to check if you have a specific device.
Definition at line 143 of file mitkTrackingDevice.cpp.
mitk::TrackingDeviceType mitk::TrackingDevice::GetType | ( | ) | const |
Deprecated! Use the more specific getData or GetTrackingDeviceName instead. return device type identifier.
Definition at line 87 of file mitkTrackingDevice.cpp.
|
virtual |
Note that some tracking systems communicate via a standard interface (e.g., serial port) and don't need any library or installation. These devices are always "installed".
Reimplemented in mitk::ClaronTrackingDevice, mitk::OpenIGTLinkTrackingDevice, mitk::OptitrackTrackingDevice, and mitk::PolhemusTrackingDevice.
Definition at line 38 of file mitkTrackingDevice.cpp.
mitk::TrackingDevice::itkGetConstMacro | ( | RotationMode | , |
RotationMode | ) |
mitk::TrackingDevice::mitkClassMacroItkParent | ( | TrackingDevice | , |
itk::Object | ) |
|
pure virtual |
Opens a connection to the device.
This may only be called if there is currently no connection to the device. If OpenConnection() is successful, the object will change from Setup state to Ready state
Implemented in mitk::ClaronTrackingDevice, mitk::MicroBirdTrackingDevice, mitk::NDITrackingDevice, mitk::OpenIGTLinkTrackingDevice, mitk::OptitrackTrackingDevice, mitk::PolhemusTrackingDevice, and mitk::VirtualTrackingDevice.
void mitk::TrackingDevice::SetData | ( | mitk::TrackingDeviceData | data | ) |
set device type
Definition at line 110 of file mitkTrackingDevice.cpp.
|
virtual |
Sets the rotation mode of this class. See documentation of enum RotationMode for details on the different modes. This method has to be implemented in a deriving class to become functional / if different rotation modes should be supported. CAUTION: The rotation mode can only be changed for backward compatibility of old WRONG code. PLEASE DO NOT CHANGE THE ROTATION MODE UNLESS YOU ARE KNOWING EXACTLY WHAT YOU ARE DOING!
Reimplemented in mitk::NDITrackingDevice.
Definition at line 82 of file mitkTrackingDevice.cpp.
|
protected |
change object state
Definition at line 69 of file mitkTrackingDevice.cpp.
void mitk::TrackingDevice::SetType | ( | mitk::TrackingDeviceType | deviceType | ) |
Deprecated! Use the more specific setDeviceData instead. set device type.
Definition at line 91 of file mitkTrackingDevice.cpp.
|
pure virtual |
start retrieving tracking data from the device.
This may only be called after the connection to the device has been established with a call to OpenConnection() (E.g. object is in Ready mode). This will change the object state from Ready to Tracking
Implemented in mitk::ClaronTrackingDevice, mitk::MicroBirdTrackingDevice, mitk::NDITrackingDevice, mitk::OpenIGTLinkTrackingDevice, mitk::OptitrackTrackingDevice, mitk::PolhemusTrackingDevice, mitk::VirtualTrackingDevice, and TrackingDeviceTestClass.
|
virtual |
stop retrieving tracking data from the device. stop retrieving tracking data from the device. This may only be called after StartTracking was called (e.g. the object is in Tracking mode). This will change the object state from Tracking to Ready.
Reimplemented in mitk::ClaronTrackingDevice, mitk::MicroBirdTrackingDevice, mitk::OpenIGTLinkTrackingDevice, mitk::OptitrackTrackingDevice, mitk::PolhemusTrackingDevice, and mitk::VirtualTrackingDevice.
Definition at line 115 of file mitkTrackingDevice.cpp.
|
protected |
current device Data
Definition at line 194 of file mitkTrackingDevice.h.
|
protected |
defines the rotation mode Standard or Transposed, Standard is default
Definition at line 200 of file mitkTrackingDevice.h.
|
mutableprotected |
mutex to control access to m_State
Definition at line 199 of file mitkTrackingDevice.h.
|
protected |
signal stop to tracking thread
Definition at line 196 of file mitkTrackingDevice.h.
|
protected |
mutex to control access to m_StopTracking
Definition at line 197 of file mitkTrackingDevice.h.
|
protected |
mutex to manage control flow of StopTracking()
Definition at line 198 of file mitkTrackingDevice.h.