Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
Medical Imaging Interaction Toolkit
mitk::TrackingTool Class Reference

Interface for all Tracking Tools. More...

#include <mitkTrackingTool.h>

Inheritance diagram for mitk::TrackingTool:
Collaboration diagram for mitk::TrackingTool:

Public Member Functions

 mitkClassMacroItkParent (TrackingTool, itk::Object) static Pointer New()
 
Pointer Clone () const
 
void PrintSelf (std::ostream &os, itk::Indent indent) const override
 
virtual const char * GetToolName () const
 every tool has a name thatgit can be used to identify it. More...
 
virtual void SetToolName (const std::string _arg)
 Sets the name of the tool. More...
 
virtual void SetToolName (const char *_arg)
 Sets the name of the tool. More...
 
Point3D GetToolTipPosition () const
 returns the tool tip in tool coordinates, which where set by SetToolTip More...
 
Quaternion GetToolAxisOrientation () const
 returns the transformation of the tool axis with respect to the MITK-IGT main tool axis (0,0,-1) More...
 
virtual void SetToolTipPosition (Point3D toolTipPosition, Quaternion orientation, ScalarType eps=0.0)
 defines a tool tip for this tool in tool coordinates. GetPosition() and GetOrientation() return the data of the tool tip if it is defined. By default no tooltip is defined. More...
 
virtual bool IsToolTipSet () const
 returns true if a tool tip is set, false if not More...
 
virtual void GetPosition (Point3D &position) const
 returns the current position of the tool as an array of three floats (in the tracking device coordinate system) More...
 
virtual void SetPosition (Point3D position)
 sets the position More...
 
virtual void GetOrientation (Quaternion &orientation) const
 returns the current orientation of the tool as a quaternion in a mitk::Point4D (in the tracking device coordinate system) More...
 
virtual void SetOrientation (Quaternion orientation)
 sets the orientation as a quaternion More...
 
virtual bool Enable ()
 enables the tool, so that it will be tracked More...
 
virtual bool Disable ()
 disables the tool, so that it will not be tracked anymore More...
 
virtual bool IsEnabled () const
 returns whether the tool is enabled or disabled More...
 
virtual void SetDataValid (bool isDataValid)
 sets if the tracking data (position & orientation) is valid More...
 
virtual bool IsDataValid () const
 returns true if the current position data is valid (no error during tracking, tracking error below threshold, ...) More...
 
virtual float GetTrackingError () const
 returns one value that corresponds to the overall tracking error. More...
 
virtual void SetTrackingError (float error)
 sets the tracking error More...
 
virtual const char * GetErrorMessage () const
 if the data is not valid, ErrorMessage should contain a string explaining why it is invalid (the Set-method should be implemented in subclasses, it should not be accessible by the user) More...
 
virtual void SetErrorMessage (const char *_arg)
 sets the error message More...
 
virtual void SetIGTTimeStamp (double _arg)
 Sets the IGT timestamp of the tracking tool object (time in milliseconds) More...
 
virtual double GetIGTTimeStamp () const
 Gets the IGT timestamp of the tracking tool object (time in milliseconds). Returns 0 if the timestamp was not set. More...
 

Protected Member Functions

 TrackingTool ()
 
 ~TrackingTool () override
 

Protected Attributes

std::string m_ToolName
 every tool has a name that can be used to identify it. More...
 
std::string m_ErrorMessage
 if a tool is invalid, this member should contain a human readable explanation of why it is invalid More...
 
double m_IGTTimeStamp
 contains the time at which the tracking data was recorded More...
 
itk::FastMutexLock::Pointer m_MyMutex
 mutex to control concurrent access to the tool More...
 
Point3D m_Position
 holds the position of the tool in global tracking coordinates More...
 
Quaternion m_Orientation
 holds the orientation of the tool´in global tracking coordinates More...
 
float m_TrackingError
 holds the tracking error of the tool More...
 
bool m_Enabled
 if true, tool is enabled and should receive tracking updates from the tracking device More...
 
bool m_DataValid
 if true, data in m_Position and m_Orientation is valid, e.g. true tracking data More...
 
Point3D m_ToolTipPosition
 holds the position of the tool tip in the coordinate system of the tracking sensor More...
 
Quaternion m_ToolAxisOrientation
 holds the rotation of the sensor coordinate system such that the z-axis coincides with the main tool axis e.g. obtained by a tool calibration More...
 
bool m_ToolTipSet
 

Detailed Description

Interface for all Tracking Tools.

Documentation This class is a complete TrackingTool implementation. It can either be used directly by TrackingDevices, or be subclassed for more specific implementations. mitk::MicroBirdTrackingDevice uses this class to manage its tools. Other tracking devices uses specialized versions of this class (e.g. mitk::NDITrackingTool)

The TrackingTool class holds all coordinate transforms associated with tracking of a tool. The sensor attached to the tool is localized in the global tracking coordinate system (m_Position, m_Orientation). A tool tip (m_ToolTipPosition) can be defined in sensor coordinates. The tool axis defines the main axis of the tool and is defined as the negative z-axis of the tool tip coordinate system The main axis of the representation object of the tool (e.g. a surface) has to be defined along the negative z-axis

TrackingTool.png
Coordinate transforms associated to the tracking tool.

Definition at line 42 of file mitkTrackingTool.h.

Constructor & Destructor Documentation

◆ TrackingTool()

mitk::TrackingTool::TrackingTool ( )
protected

◆ ~TrackingTool()

mitk::TrackingTool::~TrackingTool ( )
overrideprotected

Definition at line 46 of file mitkTrackingTool.cpp.

References m_MyMutex.

Member Function Documentation

◆ Clone()

Pointer mitk::TrackingTool::Clone ( ) const

◆ Disable()

bool mitk::TrackingTool::Disable ( )
virtual

disables the tool, so that it will not be tracked anymore

Reimplemented in mitk::OptitrackTrackingTool.

Definition at line 220 of file mitkTrackingTool.cpp.

References m_Enabled, and m_MyMutex.

◆ Enable()

bool mitk::TrackingTool::Enable ( )
virtual

enables the tool, so that it will be tracked

Reimplemented in mitk::OptitrackTrackingTool.

Definition at line 209 of file mitkTrackingTool.cpp.

References m_Enabled, and m_MyMutex.

◆ GetErrorMessage()

const char * mitk::TrackingTool::GetErrorMessage ( ) const
virtual

if the data is not valid, ErrorMessage should contain a string explaining why it is invalid (the Set-method should be implemented in subclasses, it should not be accessible by the user)

Definition at line 271 of file mitkTrackingTool.cpp.

References m_ErrorMessage, and m_MyMutex.

◆ GetIGTTimeStamp()

virtual double mitk::TrackingTool::GetIGTTimeStamp ( ) const
virtual

Gets the IGT timestamp of the tracking tool object (time in milliseconds). Returns 0 if the timestamp was not set.

Referenced by mitk::TrackingDeviceSource::GenerateData().

◆ GetOrientation()

void mitk::TrackingTool::GetOrientation ( mitk::Quaternion orientation) const
virtual

returns the current orientation of the tool as a quaternion in a mitk::Point4D (in the tracking device coordinate system)

Reimplemented in mitk::OptitrackTrackingTool.

Definition at line 179 of file mitkTrackingTool.cpp.

References m_MyMutex, m_Orientation, m_ToolAxisOrientation, and m_ToolTipSet.

Referenced by mitk::TrackingDeviceSource::GenerateData().

◆ GetPosition()

void mitk::TrackingTool::GetPosition ( mitk::Point3D position) const
virtual

returns the current position of the tool as an array of three floats (in the tracking device coordinate system)

Reimplemented in mitk::OptitrackTrackingTool.

Definition at line 143 of file mitkTrackingTool.cpp.

References m_MyMutex, m_Orientation, m_Position, m_ToolTipPosition, and m_ToolTipSet.

Referenced by mitk::TrackingDeviceSource::GenerateData().

◆ GetToolAxisOrientation()

mitk::Quaternion mitk::TrackingTool::GetToolAxisOrientation ( ) const

returns the transformation of the tool axis with respect to the MITK-IGT main tool axis (0,0,-1)

Definition at line 104 of file mitkTrackingTool.cpp.

References m_MyMutex, and m_ToolAxisOrientation.

Referenced by QmitkPolhemusTrackerWidget::on_m_ToggleToolTipCalibration_clicked().

◆ GetToolName()

const char * mitk::TrackingTool::GetToolName ( ) const
virtual

◆ GetToolTipPosition()

mitk::Point3D mitk::TrackingTool::GetToolTipPosition ( ) const

returns the tool tip in tool coordinates, which where set by SetToolTip

Definition at line 98 of file mitkTrackingTool.cpp.

References m_MyMutex, and m_ToolTipPosition.

Referenced by QmitkPolhemusTrackerWidget::on_m_ToggleToolTipCalibration_clicked().

◆ GetTrackingError()

float mitk::TrackingTool::GetTrackingError ( ) const
virtual

returns one value that corresponds to the overall tracking error.

Reimplemented in mitk::OptitrackTrackingTool.

Definition at line 254 of file mitkTrackingTool.cpp.

References m_MyMutex, and m_TrackingError.

Referenced by mitk::TrackingDeviceSource::GenerateData().

◆ IsDataValid()

bool mitk::TrackingTool::IsDataValid ( ) const
virtual

returns true if the current position data is valid (no error during tracking, tracking error below threshold, ...)

Reimplemented in mitk::OptitrackTrackingTool.

Definition at line 248 of file mitkTrackingTool.cpp.

References m_DataValid, and m_MyMutex.

Referenced by mitk::TrackingDeviceSource::GenerateData().

◆ IsEnabled()

bool mitk::TrackingTool::IsEnabled ( ) const
virtual

returns whether the tool is enabled or disabled

Reimplemented in mitk::OptitrackTrackingTool.

Definition at line 231 of file mitkTrackingTool.cpp.

References m_Enabled, and m_MyMutex.

Referenced by mitk::TrackingDeviceSource::GenerateData(), mitk::NDITrackingDevice::InitializeWiredTools(), and QmitkNDIConfigurationWidget::UpdateToolTable().

◆ IsToolTipSet()

bool mitk::TrackingTool::IsToolTipSet ( ) const
virtual

returns true if a tool tip is set, false if not

Definition at line 137 of file mitkTrackingTool.cpp.

References m_MyMutex, and m_ToolTipSet.

◆ mitkClassMacroItkParent()

mitk::TrackingTool::mitkClassMacroItkParent ( TrackingTool  ,
itk::Object   
)

◆ PrintSelf()

void mitk::TrackingTool::PrintSelf ( std::ostream &  os,
itk::Indent  indent 
) const
override

◆ SetDataValid()

void mitk::TrackingTool::SetDataValid ( bool  isDataValid)
virtual

sets if the tracking data (position & orientation) is valid

Reimplemented in mitk::OptitrackTrackingTool.

Definition at line 237 of file mitkTrackingTool.cpp.

References m_DataValid, and m_MyMutex.

Referenced by mitk::MicroBirdTrackingDevice::TrackTools().

◆ SetErrorMessage()

void mitk::TrackingTool::SetErrorMessage ( const char *  _arg)
virtual

sets the error message

Definition at line 277 of file mitkTrackingTool.cpp.

References m_ErrorMessage, and m_MyMutex.

◆ SetIGTTimeStamp()

virtual void mitk::TrackingTool::SetIGTTimeStamp ( double  _arg)
virtual

Sets the IGT timestamp of the tracking tool object (time in milliseconds)

◆ SetOrientation()

void mitk::TrackingTool::SetOrientation ( mitk::Quaternion  orientation)
virtual

sets the orientation as a quaternion

Definition at line 197 of file mitkTrackingTool.cpp.

References m_MyMutex, and m_Orientation.

Referenced by mitk::MicroBirdTrackingDevice::TrackTools().

◆ SetPosition()

void mitk::TrackingTool::SetPosition ( mitk::Point3D  position)
virtual

sets the position

Definition at line 167 of file mitkTrackingTool.cpp.

References m_MyMutex, and m_Position.

Referenced by mitk::MicroBirdTrackingDevice::TrackTools().

◆ SetToolName() [1/2]

void mitk::TrackingTool::SetToolName ( const std::string  _arg)
virtual

Sets the name of the tool.

Definition at line 93 of file mitkTrackingTool.cpp.

Referenced by QmitkNDIConfigurationWidget::UpdateTrackerFromToolTable().

◆ SetToolName() [2/2]

void mitk::TrackingTool::SetToolName ( const char *  _arg)
virtual

Sets the name of the tool.

Definition at line 73 of file mitkTrackingTool.cpp.

References m_MyMutex, and m_ToolName.

◆ SetToolTipPosition()

void mitk::TrackingTool::SetToolTipPosition ( mitk::Point3D  toolTipPosition,
mitk::Quaternion  orientation,
mitk::ScalarType  eps = 0.0 
)
virtual

defines a tool tip for this tool in tool coordinates. GetPosition() and GetOrientation() return the data of the tool tip if it is defined. By default no tooltip is defined.

Definition at line 110 of file mitkTrackingTool.cpp.

References mitk::Equal(), m_ToolAxisOrientation, m_ToolTipPosition, and m_ToolTipSet.

Referenced by QmitkPolhemusTrackerWidget::on_m_ToggleToolTipCalibration_clicked().

◆ SetTrackingError()

void mitk::TrackingTool::SetTrackingError ( float  error)
virtual

sets the tracking error

Reimplemented in mitk::OptitrackTrackingTool.

Definition at line 260 of file mitkTrackingTool.cpp.

References m_MyMutex, and m_TrackingError.

Referenced by mitk::MicroBirdTrackingDevice::TrackTools().

Member Data Documentation

◆ m_DataValid

bool mitk::TrackingTool::m_DataValid
protected

if true, data in m_Position and m_Orientation is valid, e.g. true tracking data

Definition at line 95 of file mitkTrackingTool.h.

Referenced by IsDataValid(), PrintSelf(), and SetDataValid().

◆ m_Enabled

bool mitk::TrackingTool::m_Enabled
protected

if true, tool is enabled and should receive tracking updates from the tracking device

Definition at line 94 of file mitkTrackingTool.h.

Referenced by Disable(), Enable(), IsEnabled(), and PrintSelf().

◆ m_ErrorMessage

std::string mitk::TrackingTool::m_ErrorMessage
protected

if a tool is invalid, this member should contain a human readable explanation of why it is invalid

Definition at line 87 of file mitkTrackingTool.h.

Referenced by GetErrorMessage(), PrintSelf(), and SetErrorMessage().

◆ m_IGTTimeStamp

double mitk::TrackingTool::m_IGTTimeStamp
protected

contains the time at which the tracking data was recorded

Definition at line 88 of file mitkTrackingTool.h.

◆ m_MyMutex

itk::FastMutexLock::Pointer mitk::TrackingTool::m_MyMutex
protected

◆ m_Orientation

Quaternion mitk::TrackingTool::m_Orientation
protected

holds the orientation of the tool´in global tracking coordinates

Definition at line 92 of file mitkTrackingTool.h.

Referenced by GetOrientation(), GetPosition(), PrintSelf(), SetOrientation(), and TrackingTool().

◆ m_Position

Point3D mitk::TrackingTool::m_Position
protected

holds the position of the tool in global tracking coordinates

Definition at line 91 of file mitkTrackingTool.h.

Referenced by GetPosition(), PrintSelf(), SetPosition(), and TrackingTool().

◆ m_ToolAxisOrientation

Quaternion mitk::TrackingTool::m_ToolAxisOrientation
protected

holds the rotation of the sensor coordinate system such that the z-axis coincides with the main tool axis e.g. obtained by a tool calibration

Definition at line 97 of file mitkTrackingTool.h.

Referenced by GetOrientation(), GetToolAxisOrientation(), PrintSelf(), SetToolTipPosition(), and TrackingTool().

◆ m_ToolName

std::string mitk::TrackingTool::m_ToolName
protected

every tool has a name that can be used to identify it.

Definition at line 86 of file mitkTrackingTool.h.

Referenced by GetToolName(), PrintSelf(), and SetToolName().

◆ m_ToolTipPosition

Point3D mitk::TrackingTool::m_ToolTipPosition
protected

holds the position of the tool tip in the coordinate system of the tracking sensor

Definition at line 96 of file mitkTrackingTool.h.

Referenced by GetPosition(), GetToolTipPosition(), PrintSelf(), SetToolTipPosition(), and TrackingTool().

◆ m_ToolTipSet

bool mitk::TrackingTool::m_ToolTipSet
protected

◆ m_TrackingError

float mitk::TrackingTool::m_TrackingError
protected

holds the tracking error of the tool

Definition at line 93 of file mitkTrackingTool.h.

Referenced by GetTrackingError(), PrintSelf(), and SetTrackingError().


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