MITK-IGT
IGT Extension of MITK
|
An object of this class represents Polhemus tracking device. You can add tools to this device, then open the connection and start tracking. The tracking device will then continuously update the tool coordinates. The tools which are used by Polhemus need to be connected to the correct port. The port of the tool is stored as m_ToolPort in PolhemusTool AND as identifier in the NavigationTool (ToolStorage). More...
#include <mitkPolhemusTrackingDevice.h>
Public Member Functions | |
mitkClassMacro (PolhemusTrackingDevice, TrackingDevice) | |
itkFactorylessNewMacro (Self) | |
itkCloneMacro (Self) | |
virtual bool | StartTracking () override |
Starts the tracking. | |
virtual bool | StopTracking () override |
Stops the tracking. | |
virtual bool | OpenConnection () override |
Opens the connection to the device. This have to be done before the tracking is started. | |
virtual bool | CloseConnection () override |
Closes the connection and clears all resources. | |
virtual unsigned int | GetToolCount () const override |
TrackingTool * | GetTool (unsigned int toolNumber) const override |
mitk::TrackingTool * | AddTool (const char *toolName, int toolPort) |
Create a new Polhemus tool with toolName and add it to the list of tools. | |
bool | IsDeviceInstalled () |
virtual bool | AutoDetectToolsAvailable () |
virtual mitk::NavigationToolStorage::Pointer | AutoDetectTools () |
void | SetHemisphereTrackingEnabled (bool _HemisphereTrackingEnabled) |
bool | GetHemisphereTrackingEnabled (int _tool) |
void | ToggleHemisphere (int _tool=-1) |
void | SetHemisphere (int _tool, mitk::Vector3D _hemisphere) |
mitk::Vector3D | GetHemisphere (int _tool) |
void | AdjustHemisphere (int _tool) |
![]() | |
mitkClassMacroItkParent (TrackingDevice, itk::Object) | |
virtual mitk::TrackingTool * | GetToolByName (std::string name) const |
Returns the tool with the given tool name. | |
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 | AddSingleToolIsAvailable () |
Protected Member Functions | |
PolhemusTrackingDevice () | |
~PolhemusTrackingDevice () | |
bool | InternalAddTool (PolhemusTool::Pointer tool) |
Adds a tool to the tracking device. | |
void | TrackTools () |
This method tracks tools as long as the variable m_Mode is set to "Tracking". Tracking tools means grabbing frames from the camera an updating the tools. | |
std::vector< PolhemusTool::Pointer > | GetAllTools () |
PolhemusInterface * | GetDevice () |
void | ThreadStartTracking () |
![]() | |
void | SetState (TrackingDeviceState state) |
change object state | |
TrackingDevice () | |
~TrackingDevice () override | |
Protected Attributes | |
std::vector< PolhemusTool::Pointer > | m_AllTools |
vector holding all tools | |
PolhemusInterface::Pointer | m_Device |
represents the interface to the tracking hardware | |
std::thread | m_Thread |
bool | m_HemisphereTrackingEnabled |
![]() | |
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 | |
Additional Inherited Members | |
![]() | |
enum | RotationMode { RotationStandard , RotationTransposed } |
enum | TrackingDeviceState { Setup , Ready , Tracking } |
An object of this class represents Polhemus tracking device. You can add tools to this device, then open the connection and start tracking. The tracking device will then continuously update the tool coordinates. The tools which are used by Polhemus need to be connected to the correct port. The port of the tool is stored as m_ToolPort in PolhemusTool AND as identifier in the NavigationTool (ToolStorage).
Documentation:
Definition at line 33 of file mitkPolhemusTrackingDevice.h.
|
protected |
Definition at line 23 of file mitkPolhemusTrackingDevice.cpp.
|
protected |
Definition at line 30 of file mitkPolhemusTrackingDevice.cpp.
mitk::TrackingTool * mitk::PolhemusTrackingDevice::AddTool | ( | const char * | toolName, |
int | toolPort ) |
Create a new Polhemus tool with toolName and add it to the list of tools.
This method will create a new PolhemusTool object, set the tool name toolName and then add it to the list of tools. It returns a pointer of type mitk::TrackingTool to the tool that can be used to read tracking data from it. This is the only way to add tools to PolhemusTrackingDevice.
Definition at line 39 of file mitkPolhemusTrackingDevice.cpp.
void mitk::PolhemusTrackingDevice::AdjustHemisphere | ( | int | _tool | ) |
Adjust the Hemisphere for this tool. User needs to make sure, that the tool is located in hemisphere (1|0|0) when calling this function. In contrast to SetHemisphere(1,0,0), this method restores the original HemisphereTracking settings at the end.
Definition at line 301 of file mitkPolhemusTrackingDevice.cpp.
|
virtual |
Autodetects tools from this device and returns them as a navigation tool storage.
Reimplemented from mitk::TrackingDevice.
Definition at line 241 of file mitkPolhemusTrackingDevice.cpp.
|
virtual |
Reimplemented from mitk::TrackingDevice.
Definition at line 236 of file mitkPolhemusTrackingDevice.cpp.
|
overridevirtual |
Closes the connection and clears all resources.
Implements mitk::TrackingDevice.
Definition at line 151 of file mitkPolhemusTrackingDevice.cpp.
|
protected |
Definition at line 168 of file mitkPolhemusTrackingDevice.cpp.
|
protected |
Definition at line 163 of file mitkPolhemusTrackingDevice.cpp.
mitk::Vector3D mitk::PolhemusTrackingDevice::GetHemisphere | ( | int | _tool | ) |
Get the Hemisphere for _tool as mitk vector
Definition at line 291 of file mitkPolhemusTrackingDevice.cpp.
bool mitk::PolhemusTrackingDevice::GetHemisphereTrackingEnabled | ( | int | _tool | ) |
Is Hemisphere Tracking Enabled for this tool?
Definition at line 296 of file mitkPolhemusTrackingDevice.cpp.
|
overridevirtual |
toolNumber | The number of the tool which should be given back. |
Implements mitk::TrackingDevice.
Definition at line 97 of file mitkPolhemusTrackingDevice.cpp.
|
overridevirtual |
Implements mitk::TrackingDevice.
Definition at line 92 of file mitkPolhemusTrackingDevice.cpp.
|
protected |
Adds a tool to the tracking device.
tool | The tool which will be added. |
Definition at line 59 of file mitkPolhemusTrackingDevice.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 from mitk::TrackingDevice.
Definition at line 34 of file mitkPolhemusTrackingDevice.cpp.
mitk::PolhemusTrackingDevice::itkCloneMacro | ( | Self | ) |
mitk::PolhemusTrackingDevice::itkFactorylessNewMacro | ( | Self | ) |
mitk::PolhemusTrackingDevice::mitkClassMacro | ( | PolhemusTrackingDevice | , |
TrackingDevice | ) |
|
overridevirtual |
Opens the connection to the device. This have to be done before the tracking is started.
mitk::IGTHardwareException | Throws an exception if there is an error during open connection. |
Implements mitk::TrackingDevice.
Definition at line 105 of file mitkPolhemusTrackingDevice.cpp.
void mitk::PolhemusTrackingDevice::SetHemisphere | ( | int | _tool, |
mitk::Vector3D | _hemisphere ) |
Sets the Hemisphere of tool _tool to the vector _hemisphere
Definition at line 281 of file mitkPolhemusTrackingDevice.cpp.
void mitk::PolhemusTrackingDevice::SetHemisphereTrackingEnabled | ( | bool | _HemisphereTrackingEnabled | ) |
Enables/disables hemisphere tracking for all sensors.
Definition at line 265 of file mitkPolhemusTrackingDevice.cpp.
|
overridevirtual |
Starts the tracking.
mitk::IGTHardwareException | Throws an exception if there is an error during start tracking. |
Implements mitk::TrackingDevice.
Definition at line 65 of file mitkPolhemusTrackingDevice.cpp.
|
overridevirtual |
Stops the tracking.
Reimplemented from mitk::TrackingDevice.
Definition at line 86 of file mitkPolhemusTrackingDevice.cpp.
|
protected |
Definition at line 231 of file mitkPolhemusTrackingDevice.cpp.
void mitk::PolhemusTrackingDevice::ToggleHemisphere | ( | int | _tool = -1 | ) |
Toggles the current hemisphere. Parameter _tool describes, for which tool the hemisphere should change. Default -1 toggles all tools.
Definition at line 276 of file mitkPolhemusTrackingDevice.cpp.
|
protected |
This method tracks tools as long as the variable m_Mode is set to "Tracking". Tracking tools means grabbing frames from the camera an updating the tools.
mitk::IGTHardwareException | Throws an exception if there is an error during tracking of tools. |
Definition at line 173 of file mitkPolhemusTrackingDevice.cpp.
|
protected |
vector holding all tools
Definition at line 154 of file mitkPolhemusTrackingDevice.h.
|
protected |
represents the interface to the tracking hardware
Definition at line 155 of file mitkPolhemusTrackingDevice.h.
|
protected |
Definition at line 157 of file mitkPolhemusTrackingDevice.h.
|
protected |
Definition at line 156 of file mitkPolhemusTrackingDevice.h.