Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
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 http://www.naturalpoint.com/ for details. More...

#include <mitkOptitrackTrackingTool.h>

Inheritance diagram for mitk::OptitrackTrackingTool:
Collaboration diagram for mitk::OptitrackTrackingTool:

Public Member Functions

 mitkClassMacro (mitk::OptitrackTrackingTool, mitk::InternalTrackingTool)
 
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. More...
 
int get_IDnext ()
 Ask API the next number of defined tool. More...
 
bool DeleteTrackable ()
 Delete the tool from the list of tools inside API Optitrack. More...
 
void SetPosition (mitk::Point3D position, ScalarType eps=0.0)
 Set the position to a given one. More...
 
void SetOrientation (mitk::Quaternion orientation, ScalarType eps=0.0)
 Set the orientation to a given one using a quaternion nomenclature. More...
 
void GetPosition (mitk::Point3D &position) const override
 Get the position of the tool. More...
 
void GetOrientation (mitk::Quaternion &orientation) const override
 Get the orientation of the tool using quaternion nomenclature. More...
 
bool Enable () override
 Set the tool enabled for tracking. More...
 
bool Disable () override
 Set the tool disabled for tracking. More...
 
bool IsEnabled () const override
 Check if the tool is enabled (true) or not. More...
 
bool IsDataValid () const override
 Check if the data of the tool is valid. More...
 
float GetTrackingError () const override
 Get the expectated error in the tracked tool. More...
 
void SetTrackingError (float FLEerror) override
 Set the FLE (Fiducial Localization Error) for the tool. More...
 
void SetDataValid (bool _arg) override
 Set the valid flag for tracking data to true. More...
 
void updateTool ()
 Update location and orientation of the tool. More...
 
 OptitrackTrackingTool ()
 Constructor of the class. More...
 
 ~OptitrackTrackingTool ()
 Destructor of the class. More...
 
- Public Member Functions inherited from mitk::InternalTrackingTool
 mitkClassMacro (InternalTrackingTool, TrackingTool)
 
virtual void PrintSelf (std::ostream &os, itk::Indent indent) const override
 
virtual bool IsTooltipSet () const
 returns true if a tooltip is set, false if not 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...
 
virtual void SetPosition (Point3D position)
 sets the position More...
 
virtual void SetOrientation (Quaternion orientation)
 sets the orientation as a quaternion More...
 
virtual void SetErrorMessage (const char *_arg)
 sets the error message More...
 
virtual void SetToolTip (Point3D toolTipPosition, Quaternion orientation=Quaternion(0, 0, 0, 1), ScalarType eps=0.0) override
 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...
 
- Public Member Functions inherited from mitk::TrackingTool
 mitkClassMacroItkParent (TrackingTool, itk::Object)
 
virtual const char * GetToolName () const
 every tool has a name that can be used to identify it. 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 SetIGTTimeStamp (double _arg)
 
virtual double GetIGTTimeStamp () const
 Sets the IGT timestamp of the tracking tool object (time in milliseconds) More...
 

Static Public Member Functions

static Pointer New ()
 

Public Attributes

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

Additional Inherited Members

- Protected Member Functions inherited from mitk::InternalTrackingTool
Pointer Clone () const
 
 InternalTrackingTool ()
 
virtual ~InternalTrackingTool ()
 
- 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. More...
 
virtual ~TrackingTool ()
 
- Static Protected Member Functions inherited from mitk::InternalTrackingTool
static Pointer New ()
 
- Protected Attributes inherited from mitk::InternalTrackingTool
Point3D m_Position
 holds the position of the tool More...
 
Quaternion m_Orientation
 holds the orientation of the tool 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_ToolTip
 
Quaternion m_ToolTipRotation
 
bool m_ToolTipSet
 
- Protected Attributes inherited from mitk::TrackingTool
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...
 

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 http://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 58 of file mitkOptitrackTrackingTool.h.

Constructor & Destructor Documentation

mitk::OptitrackTrackingTool::OptitrackTrackingTool ( )

Constructor of the class.

Definition at line 498 of file mitkOptitrackTrackingTool.cpp.

References mitk::OptitrackErrorMessages::GetOptitrackErrorMessage(), and MITK_WARN.

mitk::OptitrackTrackingTool::~OptitrackTrackingTool ( )

Destructor of the class.

Definition at line 508 of file mitkOptitrackTrackingTool.cpp.

References mitk::OptitrackErrorMessages::GetOptitrackErrorMessage(), and MITK_WARN.

Member Function Documentation

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 534 of file mitkOptitrackTrackingTool.cpp.

References mitk::OptitrackErrorMessages::GetOptitrackErrorMessage(), and MITK_WARN.

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::InternalTrackingTool.

Definition at line 584 of file mitkOptitrackTrackingTool.cpp.

References mitk::OptitrackErrorMessages::GetOptitrackErrorMessage(), and MITK_WARN.

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::InternalTrackingTool.

Definition at line 575 of file mitkOptitrackTrackingTool.cpp.

References mitk::OptitrackErrorMessages::GetOptitrackErrorMessage(), and MITK_WARN.

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 525 of file mitkOptitrackTrackingTool.cpp.

References mitk::OptitrackErrorMessages::GetOptitrackErrorMessage(), and MITK_WARN.

void mitk::OptitrackTrackingTool::GetOrientation ( mitk::Quaternion orientation) const
overridevirtual

Get the orientation of the tool using quaternion nomenclature.

Exceptions
mitk::IGTExceptionThrows an exception if

Reimplemented from mitk::InternalTrackingTool.

Definition at line 567 of file mitkOptitrackTrackingTool.cpp.

References mitk::OptitrackErrorMessages::GetOptitrackErrorMessage(), and MITK_WARN.

void mitk::OptitrackTrackingTool::GetPosition ( mitk::Point3D position) const
overridevirtual

Get the position of the tool.

Exceptions
mitk::IGTExceptionThrows an exception if

Reimplemented from mitk::InternalTrackingTool.

Definition at line 559 of file mitkOptitrackTrackingTool.cpp.

References mitk::OptitrackErrorMessages::GetOptitrackErrorMessage(), and MITK_WARN.

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::InternalTrackingTool.

Definition at line 611 of file mitkOptitrackTrackingTool.cpp.

References mitk::OptitrackErrorMessages::GetOptitrackErrorMessage(), and MITK_WARN.

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::InternalTrackingTool.

Definition at line 602 of file mitkOptitrackTrackingTool.cpp.

References mitk::OptitrackErrorMessages::GetOptitrackErrorMessage(), and MITK_WARN.

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::InternalTrackingTool.

Definition at line 593 of file mitkOptitrackTrackingTool.cpp.

References mitk::OptitrackErrorMessages::GetOptitrackErrorMessage(), and MITK_WARN.

mitk::OptitrackTrackingTool::mitkClassMacro ( mitk::OptitrackTrackingTool  ,
mitk::InternalTrackingTool   
)
static Pointer mitk::OptitrackTrackingTool::New ( )
static
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::InternalTrackingTool.

Definition at line 628 of file mitkOptitrackTrackingTool.cpp.

References mitk::OptitrackErrorMessages::GetOptitrackErrorMessage(), and MITK_WARN.

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

Set the orientation to a given one using a quaternion nomenclature.

Exceptions
mitk::IGTExceptionThrows an exception if

Definition at line 551 of file mitkOptitrackTrackingTool.cpp.

References mitk::OptitrackErrorMessages::GetOptitrackErrorMessage(), and MITK_WARN.

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

Set the position to a given one.

Exceptions
mitk::IGTExceptionThrows an exception if

Definition at line 543 of file mitkOptitrackTrackingTool.cpp.

References mitk::OptitrackErrorMessages::GetOptitrackErrorMessage(), and MITK_WARN.

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 516 of file mitkOptitrackTrackingTool.cpp.

References mitk::OptitrackErrorMessages::GetOptitrackErrorMessage(), and MITK_WARN.

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::InternalTrackingTool.

Definition at line 620 of file mitkOptitrackTrackingTool.cpp.

References mitk::OptitrackErrorMessages::GetOptitrackErrorMessage(), and MITK_WARN.

void mitk::OptitrackTrackingTool::updateTool ( )

Update location and orientation of the tool.

Exceptions
mitk::IGTExceptionThrows an exception if

Definition at line 636 of file mitkOptitrackTrackingTool.cpp.

References mitk::OptitrackErrorMessages::GetOptitrackErrorMessage(), and MITK_WARN.

Member Data Documentation

float* mitk::OptitrackTrackingTool::m_calibrationPoints

List of Markers locations in calibration position and orientation.

Definition at line 196 of file mitkOptitrackTrackingTool.h.

std::string mitk::OptitrackTrackingTool::m_fileConfiguration

File of the configuration for the tool.

Definition at line 186 of file mitkOptitrackTrackingTool.h.

float mitk::OptitrackTrackingTool::m_FLE

Expected value of the fiducial localization error (rms)

Definition at line 211 of file mitkOptitrackTrackingTool.h.

int mitk::OptitrackTrackingTool::m_ID

ID number from Optitrack API.

Definition at line 191 of file mitkOptitrackTrackingTool.h.

int mitk::OptitrackTrackingTool::m_numMarkers

Number of Markers that blong to the tool.

Definition at line 206 of file mitkOptitrackTrackingTool.h.

float* mitk::OptitrackTrackingTool::m_pivotPoint

location of the pivot point during calibration

Definition at line 201 of file mitkOptitrackTrackingTool.h.


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