MITK-IGT
IGT Extension of MITK
Loading...
Searching...
No Matches
mitk::OptitrackTrackingTool Class Reference

An object of this class represents the a Tool tracked by Optitrack System. You can define the tool by the a definition file like in the example in ****. Remember that it will be necessary to to have a license for using the Optitrack System. See https://www.naturalpoint.com/ for details. More...

#include <mitkOptitrackTrackingTool.h>

Inheritance diagram for mitk::OptitrackTrackingTool:
mitk::TrackingTool

Public Member Functions

 mitkClassMacro (mitk::OptitrackTrackingTool, mitk::TrackingTool)
 
 itkNewMacro (Self)
 
bool SetToolByFileName (std::string nameFile)
 Define the tool by a calibration File. The file must to have the next structure. Makers locations must to have "%fe %fe %fe\n" format and in (mm). See http://www.cplusplus.com/reference/cstdio/fscanf/ ToolName #NumberOfMarkers X Y Z - for the first marker X Y Z - for the second marker ... X Y Z - for the last marker, the number #NumberOfMarkers X Y Z - for the PIVOT point.
 
int get_IDnext ()
 Ask API the next number of defined tool.
 
bool DeleteTrackable ()
 Delete the tool from the list of tools inside API Optitrack.
 
void SetPosition (mitk::Point3D position, ScalarType eps=0.0)
 
void SetOrientation (mitk::Quaternion orientation, ScalarType eps=0.0)
 
void GetPosition (mitk::Point3D &position) const override
 Get the position of the tool.
 
void GetOrientation (mitk::Quaternion &orientation) const override
 Get the orientation of the tool using quaternion nomenclature.
 
bool Enable () override
 Set the tool enabled for tracking.
 
bool Disable () override
 Set the tool disabled for tracking.
 
bool IsEnabled () const override
 Check if the tool is enabled (true) or not.
 
bool IsDataValid () const override
 Check if the data of the tool is valid.
 
float GetTrackingError () const override
 Get the expectated error in the tracked tool.
 
void SetTrackingError (float FLEerror) override
 Set the FLE (Fiducial Localization Error) for the tool.
 
void SetDataValid (bool _arg) override
 Set the valid flag for tracking data to true.
 
void updateTool ()
 Update location and orientation of the tool.
 
 OptitrackTrackingTool ()
 Constructor of the class.
 
 ~OptitrackTrackingTool () override
 Destructor of the class.
 
- Public Member Functions inherited from mitk::TrackingTool
 mitkClassMacroItkParent (TrackingTool, itk::Object)
 
 itkFactorylessNewMacro (Self)
 
 itkCloneMacro (Self)
 
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.
 
virtual void SetToolName (const std::string _arg)
 Sets the name of the tool.
 
virtual void SetToolName (const char *_arg)
 Sets the name of the tool.
 
Point3D GetToolTipPosition () const
 returns the tool tip in tool coordinates, which where set by SetToolTip
 
Quaternion GetToolAxisOrientation () const
 returns the transformation of the tool axis with respect to the MITK-IGT main tool axis (0,0,-1)
 
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.
 
virtual bool IsToolTipSet () const
 returns true if a tool tip is set, false if not
 
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)
 
virtual void SetPosition (Point3D position)
 sets the position
 
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)
 
virtual void SetOrientation (Quaternion orientation)
 sets the orientation as a quaternion
 
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)
 
virtual void SetErrorMessage (const char *_arg)
 sets the error message
 
 itkSetMacro (IGTTimeStamp, double) itkGetConstMacro(IGTTimeStamp
 

Public Attributes

std::string m_fileConfiguration
 File of the configuration for the tool.
 
int m_ID
 ID number from Optitrack API.
 
float * m_calibrationPoints
 List of Markers locations in calibration position and orientation.
 
float * m_pivotPoint
 location of the pivot point during calibration
 
int m_numMarkers
 Number of Markers that blong to the tool.
 
float m_FLE
 Expected value of the fiducial localization error (rms)
 

Friends

class OptitrackTrackingDevice
 

Additional Inherited Members

- Protected Member Functions inherited from mitk::TrackingTool
 TrackingTool ()
 < Gets the IGT timestamp of the tracking tool object (time in milliseconds). Returns 0 if the timestamp was not set.
 
 ~TrackingTool () override
 
- Protected Attributes inherited from mitk::TrackingTool
std::string m_ToolName
 every tool has a name that can be used to identify it.
 
std::string m_ErrorMessage
 if a tool is invalid, this member should contain a human readable explanation of why it is invalid
 
double m_IGTTimeStamp
 contains the time at which the tracking data was recorded
 
std::mutex m_MyMutex
 mutex to control concurrent access to the tool
 
Point3D m_Position
 holds the position of the tool in global tracking coordinates
 
Quaternion m_Orientation
 holds the orientation of the tool´in global tracking coordinates
 
float m_TrackingError
 holds the tracking error of the tool
 
bool m_Enabled
 if true, tool is enabled and should receive tracking updates from the tracking device
 
bool m_DataValid
 if true, data in m_Position and m_Orientation is valid, e.g. true tracking data
 
Point3D m_ToolTipPosition
 holds the position of the tool tip in the coordinate system of the tracking sensor
 
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
 
bool m_ToolTipSet
 

Detailed Description

An object of this class represents the a Tool tracked by Optitrack System. You can define the tool by the a definition file like in the example in ****. Remember that it will be necessary to to have a license for using the Optitrack System. See https://www.naturalpoint.com/ for details.

Documentation:

Author
E. Marinetto (emari.nosp@m.nett.nosp@m.o@hgg.nosp@m.m.es) Instituto de Investigación Sanitaria Gregorio Marañón, Madrid, Spain. & M. Noll (matth.nosp@m.ias..nosp@m.noll@.nosp@m.igd..nosp@m.fraun.nosp@m.hofe.nosp@m.r.de) Cognitive Computing & Medical Imaging | Fraunhofer IGD

Definition at line 50 of file mitkOptitrackTrackingTool.h.

Constructor & Destructor Documentation

◆ OptitrackTrackingTool()

mitk::OptitrackTrackingTool::OptitrackTrackingTool ( )

Constructor of the class.

Definition at line 494 of file mitkOptitrackTrackingTool.cpp.

◆ ~OptitrackTrackingTool()

mitk::OptitrackTrackingTool::~OptitrackTrackingTool ( )
override

Destructor of the class.

Definition at line 504 of file mitkOptitrackTrackingTool.cpp.

Member Function Documentation

◆ DeleteTrackable()

bool mitk::OptitrackTrackingTool::DeleteTrackable ( )

Delete the tool from the list of tools inside API Optitrack.

Returns
Returns true if the deletion was correct
Exceptions
mitk::IGTExceptionThrows an exception if

Definition at line 530 of file mitkOptitrackTrackingTool.cpp.

◆ Disable()

bool mitk::OptitrackTrackingTool::Disable ( )
overridevirtual

Set the tool disabled for tracking.

Returns
Return true if the disabling was successfull
Exceptions
mitk::IGTExceptionThrows an exception if

Reimplemented from mitk::TrackingTool.

Definition at line 580 of file mitkOptitrackTrackingTool.cpp.

◆ Enable()

bool mitk::OptitrackTrackingTool::Enable ( )
overridevirtual

Set the tool enabled for tracking.

Returns
Return true if the enabling was successfull
Exceptions
mitk::IGTExceptionThrows an exception if

Reimplemented from mitk::TrackingTool.

Definition at line 571 of file mitkOptitrackTrackingTool.cpp.

◆ get_IDnext()

int mitk::OptitrackTrackingTool::get_IDnext ( )

Ask API the next number of defined tool.

Returns
Returns the next ID (int) for a new tool in the device list for API
Exceptions
mitk::IGTExceptionThrows an exception if get_IDnext failed

Definition at line 521 of file mitkOptitrackTrackingTool.cpp.

◆ GetOrientation()

void mitk::OptitrackTrackingTool::GetOrientation ( mitk::Quaternion & orientation) const
override

Get the orientation of the tool using quaternion nomenclature.

Exceptions
mitk::IGTExceptionThrows an exception if

Definition at line 563 of file mitkOptitrackTrackingTool.cpp.

◆ GetPosition()

void mitk::OptitrackTrackingTool::GetPosition ( mitk::Point3D & position) const
override

Get the position of the tool.

Exceptions
mitk::IGTExceptionThrows an exception if

Definition at line 555 of file mitkOptitrackTrackingTool.cpp.

◆ GetTrackingError()

float mitk::OptitrackTrackingTool::GetTrackingError ( ) const
overridevirtual

Get the expectated error in the tracked tool.

Returns
Return the error location
Exceptions
mitk::IGTExceptionThrows an exception if

Reimplemented from mitk::TrackingTool.

Definition at line 607 of file mitkOptitrackTrackingTool.cpp.

◆ IsDataValid()

bool mitk::OptitrackTrackingTool::IsDataValid ( ) const
overridevirtual

Check if the data of the tool is valid.

Returns
Return true if location data is valid
Exceptions
mitk::IGTExceptionThrows an exception if

Reimplemented from mitk::TrackingTool.

Definition at line 598 of file mitkOptitrackTrackingTool.cpp.

◆ IsEnabled()

bool mitk::OptitrackTrackingTool::IsEnabled ( ) const
overridevirtual

Check if the tool is enabled (true) or not.

Returns
Return true if the tool is enabled for tracking
Exceptions
mitk::IGTExceptionThrows an exception if

Reimplemented from mitk::TrackingTool.

Definition at line 589 of file mitkOptitrackTrackingTool.cpp.

◆ itkNewMacro()

mitk::OptitrackTrackingTool::itkNewMacro ( Self )

◆ mitkClassMacro()

mitk::OptitrackTrackingTool::mitkClassMacro ( mitk::OptitrackTrackingTool ,
mitk::TrackingTool  )

◆ SetDataValid()

void mitk::OptitrackTrackingTool::SetDataValid ( bool _arg)
overridevirtual

Set the valid flag for tracking data to true.

Exceptions
mitk::IGTExceptionThrows an exception if

Reimplemented from mitk::TrackingTool.

Definition at line 624 of file mitkOptitrackTrackingTool.cpp.

◆ SetOrientation()

void mitk::OptitrackTrackingTool::SetOrientation ( mitk::Quaternion orientation,
ScalarType eps = 0.0 )

Definition at line 547 of file mitkOptitrackTrackingTool.cpp.

◆ SetPosition()

void mitk::OptitrackTrackingTool::SetPosition ( mitk::Point3D position,
ScalarType eps = 0.0 )

Definition at line 539 of file mitkOptitrackTrackingTool.cpp.

◆ SetToolByFileName()

bool mitk::OptitrackTrackingTool::SetToolByFileName ( std::string nameFile)

Define the tool by a calibration File. The file must to have the next structure. Makers locations must to have "%fe %fe %fe\n" format and in (mm). See http://www.cplusplus.com/reference/cstdio/fscanf/ ToolName #NumberOfMarkers X Y Z - for the first marker X Y Z - for the second marker ... X Y Z - for the last marker, the number #NumberOfMarkers X Y Z - for the PIVOT point.

Returns
Returns true if the tool was set correctly
Exceptions
mitk::IGTExceptionThrows an exception if there exist any problem during the configuration file reading.

Definition at line 512 of file mitkOptitrackTrackingTool.cpp.

◆ SetTrackingError()

void mitk::OptitrackTrackingTool::SetTrackingError ( float FLEerror)
overridevirtual

Set the FLE (Fiducial Localization Error) for the tool.

Exceptions
mitk::IGTExceptionThrows an exception if

Reimplemented from mitk::TrackingTool.

Definition at line 616 of file mitkOptitrackTrackingTool.cpp.

◆ updateTool()

void mitk::OptitrackTrackingTool::updateTool ( )

Update location and orientation of the tool.

Exceptions
mitk::IGTExceptionThrows an exception if

Definition at line 632 of file mitkOptitrackTrackingTool.cpp.

Friends And Related Symbol Documentation

◆ OptitrackTrackingDevice

friend class OptitrackTrackingDevice
friend

Definition at line 53 of file mitkOptitrackTrackingTool.h.

Member Data Documentation

◆ m_calibrationPoints

float* mitk::OptitrackTrackingTool::m_calibrationPoints

List of Markers locations in calibration position and orientation.

Definition at line 190 of file mitkOptitrackTrackingTool.h.

◆ m_fileConfiguration

std::string mitk::OptitrackTrackingTool::m_fileConfiguration

File of the configuration for the tool.

Definition at line 180 of file mitkOptitrackTrackingTool.h.

◆ m_FLE

float mitk::OptitrackTrackingTool::m_FLE

Expected value of the fiducial localization error (rms)

Definition at line 205 of file mitkOptitrackTrackingTool.h.

◆ m_ID

int mitk::OptitrackTrackingTool::m_ID

ID number from Optitrack API.

Definition at line 185 of file mitkOptitrackTrackingTool.h.

◆ m_numMarkers

int mitk::OptitrackTrackingTool::m_numMarkers

Number of Markers that blong to the tool.

Definition at line 200 of file mitkOptitrackTrackingTool.h.

◆ m_pivotPoint

float* mitk::OptitrackTrackingTool::m_pivotPoint

location of the pivot point during calibration

Definition at line 195 of file mitkOptitrackTrackingTool.h.


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