Medical Imaging Interaction Toolkit  2016.11.0
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
 
virtual bool IsDeviceInstalled () override
 
virtual bool StartTracking () override
 Starts the tracking. More...
 
virtual bool StopTracking () override
 Stops the tracking. More...
 
virtual bool OpenConnection () override
 Opens the connection to the device. This have to be done before the tracking is started. More...
 
virtual bool CloseConnection () override
 Closes the connection and clears all resources. More...
 
virtual 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 getDeviceData instead. return device type identifier. More...
 
void SetType (TrackingDeviceType type)
 Deprecated! Use the more specific setDeviceData instead. set device type. More...
 
TrackingDeviceData GetData () const
 return device data More...
 
void SetData (TrackingDeviceData data)
 set device type More...
 

Static Public Member Functions

static Pointer New ()
 

Protected Member Functions

 ClaronTrackingDevice ()
 
 ~ClaronTrackingDevice ()
 
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 ()
 
- Protected Member Functions inherited from mitk::TrackingDevice
void SetState (TrackingDeviceState state)
 change object state More...
 
 TrackingDevice ()
 
virtual ~TrackingDevice ()
 

Static Protected Member Functions

static ITK_THREAD_RETURN_TYPE ThreadStartTracking (void *data)
 

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...
 
itk::MultiThreader::Pointer m_MultiThreader
 
int m_ThreadID
 
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...
 
itk::FastMutexLock::Pointer m_StopTrackingMutex
 mutex to control access to m_StopTracking More...
 
itk::FastMutexLock::Pointer m_TrackingFinishedMutex
 mutex to manage control flow of StopTracking() More...
 
itk::FastMutexLock::Pointer 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 42 of file mitkClaronTrackingDevice.h.

Constructor & Destructor Documentation

mitk::ClaronTrackingDevice::~ClaronTrackingDevice ( )
protected

Definition at line 66 of file mitkClaronTrackingDevice.cpp.

Member Function Documentation

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.

Definition at line 71 of file mitkClaronTrackingDevice.cpp.

References mitk::ClaronTool::New().

Pointer mitk::ClaronTrackingDevice::Clone ( ) const
bool mitk::ClaronTrackingDevice::CloseConnection ( )
overridevirtual

Closes the connection and clears all resources.

Implements mitk::TrackingDevice.

Definition at line 198 of file mitkClaronTrackingDevice.cpp.

References Setup().

std::vector< mitk::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.

Definition at line 92 of file mitkClaronTrackingDevice.cpp.

References mitk::ClaronTool::New().

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

Definition at line 220 of file mitkClaronTrackingDevice.cpp.

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

Gets the current calibration directory.

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

Definition at line 214 of file mitkClaronTrackingDevice.cpp.

mitk::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 NULL, if there is no tool with this number.

Implements mitk::TrackingDevice.

Definition at line 160 of file mitkClaronTrackingDevice.cpp.

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

Implements mitk::TrackingDevice.

Definition at line 154 of file mitkClaronTrackingDevice.cpp.

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.

Definition at line 85 of file mitkClaronTrackingDevice.cpp.

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.

Definition at line 59 of file mitkClaronTrackingDevice.cpp.

References mitk::ClaronInterface::New().

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.

Definition at line 309 of file mitkClaronTrackingDevice.cpp.

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

Definition at line 169 of file mitkClaronTrackingDevice.cpp.

References mitkThrowException, mitk::ClaronInterface::New(), and Setup().

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

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

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.

Definition at line 108 of file mitkClaronTrackingDevice.cpp.

References mitk::IGTTimeStamp::GetInstance(), mitkThrowException, and mitk::IGTTimeStamp::Start().

bool mitk::ClaronTrackingDevice::StopTracking ( )
overridevirtual

Stops the tracking.

Returns
Returns true if the tracking is stopped.

Reimplemented from mitk::TrackingDevice.

Definition at line 145 of file mitkClaronTrackingDevice.cpp.

ITK_THREAD_RETURN_TYPE mitk::ClaronTrackingDevice::ThreadStartTracking ( void *  data)
staticprotected

Definition at line 315 of file mitkClaronTrackingDevice.cpp.

References 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.

Definition at line 226 of file mitkClaronTrackingDevice.cpp.

References mitk::IGTTimeStamp::GetInstance(), and mitkThrowException.

Referenced by ThreadStartTracking().

Member Data Documentation

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

vector holding all tools

Definition at line 158 of file mitkClaronTrackingDevice.h.

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

The directory where the camera calibration files can be found.

Definition at line 164 of file mitkClaronTrackingDevice.h.

Referenced by ClaronTrackingDevice().

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

represents the interface to the tracking hardware

Definition at line 159 of file mitkClaronTrackingDevice.h.

Referenced by ClaronTrackingDevice().

itk::MultiThreader::Pointer mitk::ClaronTrackingDevice::m_MultiThreader
protected

Definition at line 160 of file mitkClaronTrackingDevice.h.

Referenced by ClaronTrackingDevice().

int mitk::ClaronTrackingDevice::m_ThreadID
protected

Definition at line 161 of file mitkClaronTrackingDevice.h.

Referenced by ClaronTrackingDevice().

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

The directory where the tool calibration files can be found.

Definition at line 166 of file mitkClaronTrackingDevice.h.

Referenced by ClaronTrackingDevice().


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