Medical Imaging Interaction Toolkit
2018.4.99-389bf124
Medical Imaging Interaction Toolkit
|
An object of this class represents the interface to Polhemus trackers. All variables with the name "tool" start with index 1, which is the station number of Polhemus. Make sure to call functions in this class with parameter "1" if you want to loop over all tools. If you need to access an array (e.g. m_Hemisphere), you need to use "_tool -1" and adapt your index for loops... More...
#include <mitkPolhemusInterface.h>
Classes | |
struct | trackingData |
Public Member Functions | |
mitkClassMacroItkParent (PolhemusInterface, itk::Object) | |
Pointer | Clone () const |
bool | StartTracking () |
Opens the connection to the device and makes it ready to track tools. More... | |
bool | StopTracking () |
Clears all resources. After this method have been called the system isn't ready to track any longer. More... | |
bool | Connect () |
bool | Disconnect () |
unsigned int | GetNumberOfTools () |
void | SetHemisphereTrackingEnabled (bool _HemisphereTrackingEnabled, int _tool=-1) |
void | ToggleHemisphere (int _tool=-1) |
void | PrintStatus () |
void | SetHemisphere (int _tool, mitk::Vector3D _hemisphere) |
mitk::Vector3D | GetHemisphere (int _tool) |
std::vector< int > | GetToolPorts () |
bool | GetHemisphereTrackingEnabled (int _tool) |
void | AdjustHemisphere (int _tool) |
std::vector< trackingData > | GetSingleFrame () |
std::vector< trackingData > | AutoDetectTools () |
std::vector< trackingData > | GetLastFrame () |
Static Public Member Functions | |
static Pointer | New () |
Protected Member Functions | |
PolhemusInterface () | |
standard constructor More... | |
~PolhemusInterface () | |
standard destructor More... | |
std::vector< mitk::PolhemusInterface::trackingData > | ParsePolhemusRawData (PBYTE pBuf, DWORD dwSize) |
bool | InitializeDevice () |
bool | SetupDevice () |
int | GetToolIndex (int _tool) |
std::vector< trackingData > | GetFrame () |
Convenient method to get a frame from the tracking device. More... | |
Protected Attributes | |
CPDIdev * | m_pdiDev |
An object of this class represents the interface to Polhemus trackers. All variables with the name "tool" start with index 1, which is the station number of Polhemus. Make sure to call functions in this class with parameter "1" if you want to loop over all tools. If you need to access an array (e.g. m_Hemisphere), you need to use "_tool -1" and adapt your index for loops...
Documentation:
Definition at line 42 of file mitkPolhemusInterface.h.
|
protected |
|
protected |
void mitk::PolhemusInterface::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 363 of file mitkPolhemusInterface.cpp.
References mitk::FillVector3D(), m_pdiDev, SetHemisphere(), and SetHemisphereTrackingEnabled().
std::vector< mitk::PolhemusInterface::trackingData > mitk::PolhemusInterface::AutoDetectTools | ( | ) |
Definition at line 192 of file mitkPolhemusInterface.cpp.
References GetSingleFrame(), and m_pdiDev.
Pointer mitk::PolhemusInterface::Clone | ( | ) | const |
bool mitk::PolhemusInterface::Connect | ( | ) |
Definition at line 120 of file mitkPolhemusInterface.cpp.
References mitk::FillVector3D(), GetFrame(), and GetNumberOfTools().
bool mitk::PolhemusInterface::Disconnect | ( | ) |
Definition at line 178 of file mitkPolhemusInterface.cpp.
References m_pdiDev, MITK_INFO, and StopTracking().
|
protected |
Convenient method to get a frame from the tracking device.
Definition at line 206 of file mitkPolhemusInterface.cpp.
References GetLastFrame(), and GetSingleFrame().
Referenced by Connect(), GetNumberOfTools(), and SetHemisphereTrackingEnabled().
mitk::Vector3D mitk::PolhemusInterface::GetHemisphere | ( | int | _tool | ) |
Get the Hemisphere for _tool as mitk vector. -1 ("all tools") returns hemisphere of first tool. Index starts at "1" for the first tool (i.e. station number of Polhemus). Not 0!
Definition at line 410 of file mitkPolhemusInterface.cpp.
References GetToolIndex(), and MITK_WARN.
bool mitk::PolhemusInterface::GetHemisphereTrackingEnabled | ( | int | _tool | ) |
Is Hemisphere Tracking Enabled for this tool? if tool is -1, this means "All Tools". We return true if HemiTracking is enabled for all tools, and false if it is off for at least one tool.
Definition at line 420 of file mitkPolhemusInterface.cpp.
References GetToolIndex().
std::vector< mitk::PolhemusInterface::trackingData > mitk::PolhemusInterface::GetLastFrame | ( | ) |
Definition at line 214 of file mitkPolhemusInterface.cpp.
References m_pdiDev, MITK_WARN, and ParsePolhemusRawData().
Referenced by GetFrame(), and mitk::PolhemusTrackingDevice::TrackTools().
unsigned int mitk::PolhemusInterface::GetNumberOfTools | ( | ) |
Definition at line 200 of file mitkPolhemusInterface.cpp.
References GetFrame().
Referenced by Connect().
std::vector< mitk::PolhemusInterface::trackingData > mitk::PolhemusInterface::GetSingleFrame | ( | ) |
Definition at line 232 of file mitkPolhemusInterface.cpp.
References m_pdiDev, MITK_WARN, and ParsePolhemusRawData().
Referenced by AutoDetectTools(), and GetFrame().
|
protected |
Definition at line 439 of file mitkPolhemusInterface.cpp.
Referenced by GetHemisphere(), GetHemisphereTrackingEnabled(), and SetHemisphereTrackingEnabled().
std::vector< int > mitk::PolhemusInterface::GetToolPorts | ( | ) |
Get the ports on which tools are connected. Returns empty vector if device is not connected!
Definition at line 434 of file mitkPolhemusInterface.cpp.
|
protected |
Definition at line 29 of file mitkPolhemusInterface.cpp.
References m_pdiDev.
Referenced by StopTracking().
mitk::PolhemusInterface::mitkClassMacroItkParent | ( | PolhemusInterface | , |
itk::Object | |||
) |
|
static |
|
protected |
Parses polhemus raw data to a collection of tracking data of single tools.
Definition at line 251 of file mitkPolhemusInterface.cpp.
References mitk::PolhemusInterface::trackingData::distortionLevel, mitk::PolhemusInterface::trackingData::id, mitk::PolhemusInterface::trackingData::pos, and mitk::PolhemusInterface::trackingData::rot.
Referenced by GetLastFrame(), and GetSingleFrame().
void mitk::PolhemusInterface::PrintStatus | ( | ) |
Convenient method to print the status of the tracking device (true/false) if connection is established. For debugging...
Definition at line 462 of file mitkPolhemusInterface.cpp.
void mitk::PolhemusInterface::SetHemisphere | ( | int | _tool, |
mitk::Vector3D | _hemisphere | ||
) |
Sets the Hemisphere of tool _tool to the vector _hemisphere. "-1" sets all tools. Index starts at "1" for the first tool (i.e. station number of Polhemus). Not 0!
Definition at line 387 of file mitkPolhemusInterface.cpp.
References m_pdiDev.
Referenced by AdjustHemisphere(), SetHemisphereTrackingEnabled(), and ToggleHemisphere().
void mitk::PolhemusInterface::SetHemisphereTrackingEnabled | ( | bool | _HemisphereTrackingEnabled, |
int | _tool = -1 |
||
) |
Enables/disables hemisphere tracking for all stations/tools.
Definition at line 290 of file mitkPolhemusInterface.cpp.
References GetFrame(), GetToolIndex(), m_pdiDev, MITK_ERROR, and SetHemisphere().
Referenced by AdjustHemisphere(), and ToggleHemisphere().
|
protected |
Definition at line 38 of file mitkPolhemusInterface.cpp.
References m_pdiDev, and MotionBuf.
Referenced by StopTracking().
bool mitk::PolhemusInterface::StartTracking | ( | ) |
Opens the connection to the device and makes it ready to track tools.
Definition at line 61 of file mitkPolhemusInterface.cpp.
References m_pdiDev.
bool mitk::PolhemusInterface::StopTracking | ( | ) |
Clears all resources. After this method have been called the system isn't ready to track any longer.
Definition at line 67 of file mitkPolhemusInterface.cpp.
References InitializeDevice(), m_pdiDev, MITK_INFO, and SetupDevice().
Referenced by Disconnect().
void mitk::PolhemusInterface::ToggleHemisphere | ( | int | _tool = -1 | ) |
Toggles the current hemisphere. Parameter _tool describes, for which tool the hemisphere should change. Default -1 toggles all tools. Index starts at "1" for the first tool (i.e. station number of Polhemus). Not 0!
Definition at line 341 of file mitkPolhemusInterface.cpp.
References m_pdiDev, SetHemisphere(), and SetHemisphereTrackingEnabled().
|
protected |
Polhemus liberty/patriot tracker object
Definition at line 130 of file mitkPolhemusInterface.h.
Referenced by AdjustHemisphere(), AutoDetectTools(), Disconnect(), GetLastFrame(), GetSingleFrame(), InitializeDevice(), PolhemusInterface(), PrintStatus(), SetHemisphere(), SetHemisphereTrackingEnabled(), SetupDevice(), StartTracking(), StopTracking(), ToggleHemisphere(), and ~PolhemusInterface().