Medical Imaging Interaction Toolkit  2023.04.00
Medical Imaging Interaction Toolkit
mitk::ClaronTrackingDevice Class Reference

An object of this class represents the MicronTracker 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. More...

#include <mitkClaronTrackingDevice.h>

Inheritance diagram for mitk::ClaronTrackingDevice:
Collaboration diagram for mitk::ClaronTrackingDevice:

Public Member Functions

 mitkClassMacro (ClaronTrackingDevice, TrackingDevice)
 
Pointer Clone () const
 
bool IsDeviceInstalled () override
 
bool StartTracking () override
 Starts the tracking. More...
 
bool StopTracking () override
 Stops the tracking. More...
 
bool OpenConnection () override
 Opens the connection to the device. This have to be done before the tracking is started. More...
 
bool CloseConnection () override
 Closes the connection and clears all resources. More...
 
unsigned int GetToolCount () const override
 
TrackingToolGetTool (unsigned int toolNumber) const override
 
mitk::TrackingToolAddTool (const char *toolName, const char *fileName)
 Create a new Claron tool with toolName and fileName and add it to the list of tools. More...
 
bool IsMicronTrackerInstalled ()
 
virtual void SetCalibrationDir (std::string _arg)
 Sets the directory where the calibration file of the MicronTracker can be found. More...
 
virtual std::string GetCalibrationDir ()
 Gets the current calibration directory. More...
 
- Public Member Functions inherited from mitk::TrackingDevice
 mitkClassMacroItkParent (TrackingDevice, itk::Object)
 
virtual mitk::TrackingToolGetToolByName (std::string name) const
 Returns the tool with the given tool name. More...
 
virtual void SetRotationMode (RotationMode r)
 
virtual RotationMode GetRotationMode () const
 
TrackingDeviceState GetState () const
 return current object state (Setup, Ready or Tracking) More...
 
TrackingDeviceType GetType () const
 Deprecated! Use the more specific getData or GetTrackingDeviceName instead. return device type identifier. More...
 
void SetType (TrackingDeviceType type)
 Deprecated! Use the more specific setDeviceData instead. set device type. More...
 
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. More...
 
TrackingDeviceData GetData () const
 return device data More...
 
void SetData (TrackingDeviceData data)
 set device type More...
 
virtual bool AutoDetectToolsAvailable ()
 
virtual bool AddSingleToolIsAvailable ()
 
virtual mitk::NavigationToolStorage::Pointer AutoDetectTools ()
 

Static Public Member Functions

static Pointer New ()
 

Protected Member Functions

 ClaronTrackingDevice ()
 
 ~ClaronTrackingDevice () override
 
bool InternalAddTool (ClaronTool::Pointer tool)
 Adds a tool to the tracking device. More...
 
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. More...
 
std::vector< ClaronTool::Pointer > DetectTools ()
 Automatically detects tools in field of measurement of the tracking device. Tools can only be detected if their calibration file is availiable in the directory for calibration files. More...
 
std::vector< ClaronTool::Pointer > GetAllTools ()
 
ClaronInterfaceGetDevice ()
 
void ThreadStartTracking ()
 
- Protected Member Functions inherited from mitk::TrackingDevice
void SetState (TrackingDeviceState state)
 change object state More...
 
 TrackingDevice ()
 
 ~TrackingDevice () override
 

Protected Attributes

std::vector< ClaronTool::Pointer > m_AllTools
 vector holding all tools More...
 
ClaronInterface::Pointer m_Device
 represents the interface to the tracking hardware More...
 
std::thread m_Thread
 
std::string m_CalibrationDir
 The directory where the camera calibration files can be found. More...
 
std::string m_ToolfilesDir
 The directory where the tool calibration files can be found. More...
 
- Protected Attributes inherited from mitk::TrackingDevice
TrackingDeviceData m_Data
 current device Data More...
 
bool m_StopTracking
 signal stop to tracking thread More...
 
std::mutex m_StopTrackingMutex
 mutex to control access to m_StopTracking More...
 
std::mutex m_TrackingFinishedMutex
 mutex to manage control flow of StopTracking() More...
 
std::mutex m_StateMutex
 mutex to control access to m_State More...
 
RotationMode m_RotationMode
 defines the rotation mode Standard or Transposed, Standard is default More...
 

Additional Inherited Members

- Public Types inherited from mitk::TrackingDevice
enum  RotationMode { RotationStandard, RotationTransposed }
 
enum  TrackingDeviceState { Setup, Ready, Tracking }
 

Detailed Description

An object of this class represents the MicronTracker 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.

Documentation:

Definition at line 38 of file mitkClaronTrackingDevice.h.

Constructor & Destructor Documentation

◆ ClaronTrackingDevice()

mitk::ClaronTrackingDevice::ClaronTrackingDevice ( )
protected

◆ ~ClaronTrackingDevice()

mitk::ClaronTrackingDevice::~ClaronTrackingDevice ( )
overrideprotected

Member Function Documentation

◆ AddTool()

mitk::TrackingTool* mitk::ClaronTrackingDevice::AddTool ( const char *  toolName,
const char *  fileName 
)

Create a new Claron tool with toolName and fileName and add it to the list of tools.

This method will create a new ClaronTool object, load the tool definition file fileName, 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 ClaronTrackingDevice.

Warning
adding tools is not possible in tracking mode, only in setup and ready.

◆ Clone()

Pointer mitk::ClaronTrackingDevice::Clone ( ) const

◆ CloseConnection()

bool mitk::ClaronTrackingDevice::CloseConnection ( )
overridevirtual

Closes the connection and clears all resources.

Implements mitk::TrackingDevice.

◆ DetectTools()

std::vector<ClaronTool::Pointer> mitk::ClaronTrackingDevice::DetectTools ( )
protected

Automatically detects tools in field of measurement of the tracking device. Tools can only be detected if their calibration file is availiable in the directory for calibration files.

Returns
Returns all detected Tools.

◆ GetAllTools()

std::vector<ClaronTool::Pointer> mitk::ClaronTrackingDevice::GetAllTools ( )
protected
Returns
Returns all tools of the tracking device.

◆ GetCalibrationDir()

virtual std::string mitk::ClaronTrackingDevice::GetCalibrationDir ( )
virtual

Gets the current calibration directory.

◆ GetDevice()

ClaronInterface* mitk::ClaronTrackingDevice::GetDevice ( )
protected
Returns
Gives back the device which is represented by an object of the class ClaronInterface.

◆ GetTool()

TrackingTool* mitk::ClaronTrackingDevice::GetTool ( unsigned int  toolNumber) const
overridevirtual
Parameters
toolNumberThe number of the tool which should be given back.
Returns
Returns the tool which the number "toolNumber". Returns nullptr, if there is no tool with this number.

Implements mitk::TrackingDevice.

◆ GetToolCount()

unsigned int mitk::ClaronTrackingDevice::GetToolCount ( ) const
overridevirtual
Returns
Returns the number of tools which have been added to the device.

Implements mitk::TrackingDevice.

◆ InternalAddTool()

bool mitk::ClaronTrackingDevice::InternalAddTool ( ClaronTool::Pointer  tool)
protected

Adds a tool to the tracking device.

Parameters
toolThe tool which will be added.
Returns
Returns true if the tool has been added, false otherwise.

◆ IsDeviceInstalled()

bool mitk::ClaronTrackingDevice::IsDeviceInstalled ( )
overridevirtual
Returns
Returns true if the MicronTracker is installed on this build (means activated in CMAKE). False if not.

Reimplemented from mitk::TrackingDevice.

◆ IsMicronTrackerInstalled()

bool mitk::ClaronTrackingDevice::IsMicronTrackerInstalled ( )
Returns
Returns whether the MicronTracker is installed (means whether the C-Make-Variable "MITK_USE_MICRON_TRACKER" is set), so returns false in this case.
Deprecated:
(as of 2014_03) This method is deprecated, please use the static method IsDeviceInstalled() instead.

◆ mitkClassMacro()

mitk::ClaronTrackingDevice::mitkClassMacro ( ClaronTrackingDevice  ,
TrackingDevice   
)

◆ New()

static Pointer mitk::ClaronTrackingDevice::New ( )
static

◆ OpenConnection()

bool mitk::ClaronTrackingDevice::OpenConnection ( )
overridevirtual

Opens the connection to the device. This have to be done before the tracking is started.

Exceptions
mitk::IGTHardwareExceptionThrows an exception if there is an error during open connection.

Implements mitk::TrackingDevice.

◆ SetCalibrationDir()

virtual void mitk::ClaronTrackingDevice::SetCalibrationDir ( std::string  _arg)
virtual

Sets the directory where the calibration file of the MicronTracker can be found.

◆ StartTracking()

bool mitk::ClaronTrackingDevice::StartTracking ( )
overridevirtual

Starts the tracking.

Returns
Returns true if the tracking is started. Throws an exception if an error occures.
Exceptions
mitk::IGTHardwareExceptionThrows an exception if there is an error during start tracking.

Implements mitk::TrackingDevice.

◆ StopTracking()

bool mitk::ClaronTrackingDevice::StopTracking ( )
overridevirtual

Stops the tracking.

Returns
Returns true if the tracking is stopped.

Reimplemented from mitk::TrackingDevice.

◆ ThreadStartTracking()

void mitk::ClaronTrackingDevice::ThreadStartTracking ( )
protected

◆ TrackTools()

void mitk::ClaronTrackingDevice::TrackTools ( )
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.

Exceptions
mitk::IGTHardwareExceptionThrows an exception if there is an error during tracking of tools.

Member Data Documentation

◆ m_AllTools

std::vector<ClaronTool::Pointer> mitk::ClaronTrackingDevice::m_AllTools
protected

vector holding all tools

Definition at line 154 of file mitkClaronTrackingDevice.h.

◆ m_CalibrationDir

std::string mitk::ClaronTrackingDevice::m_CalibrationDir
protected

The directory where the camera calibration files can be found.

Definition at line 159 of file mitkClaronTrackingDevice.h.

◆ m_Device

ClaronInterface::Pointer mitk::ClaronTrackingDevice::m_Device
protected

represents the interface to the tracking hardware

Definition at line 155 of file mitkClaronTrackingDevice.h.

◆ m_Thread

std::thread mitk::ClaronTrackingDevice::m_Thread
protected

Definition at line 156 of file mitkClaronTrackingDevice.h.

◆ m_ToolfilesDir

std::string mitk::ClaronTrackingDevice::m_ToolfilesDir
protected

The directory where the tool calibration files can be found.

Definition at line 161 of file mitkClaronTrackingDevice.h.


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