MITK-IGT
IGT Extension of MITK
|
An object of this class represents the Optitrack 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. 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 <mitkOptitrackTrackingDevice.h>
Public Types | |
typedef mitk::TrackingDeviceType | OptiTrackTrackingDeviceType |
![]() | |
enum | RotationMode { RotationStandard , RotationTransposed } |
enum | TrackingDeviceState { Setup , Ready , Tracking } |
Public Member Functions | |
mitkClassMacro (OptitrackTrackingDevice, mitk::TrackingDevice) | |
itkNewMacro (Self) | |
bool | IsDeviceInstalled () override |
bool | OpenConnection () override |
Open the Connection with the Tracker. Calls LoadCalibration function and set the system up with the calibration file. Remember that you have to set a calibration file first to open a correct connection to the Optical Tracking System. | |
bool | CloseConnection () override |
Close the Connection with the Tracker. Also CleanUp the Optitrack variables using the API: TT_CleanUp and TT_ShutDown. Sometimes API does not work properly and some problems during the Clean Up has been reported. | |
bool | StartTracking () override |
Start to Track the tools already defined. If no tools are defined for this tracker, it returns an error. Tools can be added using either AddToolByDescriptionFile or AddToolsByConfigurationFiles. | |
bool | StopTracking () override |
Stop the Tracking Thread and tools will not longer be updated. | |
TrackingTool * | GetTool (unsigned int toolNumber) const override |
Return the tool pointer of the tool number toolNumber. | |
OptitrackTrackingTool * | GetOptitrackTool (unsigned int toolNumber) const |
Return the tool pointer of the tool number toolNumber. | |
unsigned int | GetToolCount () const override |
Returns the number of defined tools. | |
itkSetMacro (Exp, int) | |
Sets the directory where the calibration file of the MicronTracker can be found. | |
itkGetMacro (Exp, int) | |
Gets the current calibration directory. | |
itkSetMacro (Led, int) | |
Sets the directory where the calibration file of the MicronTracker can be found. | |
itkGetMacro (Led, int) | |
Gets the current calibration directory. | |
itkSetMacro (Thr, int) | |
Sets the directory where the calibration file of the MicronTracker can be found. | |
itkGetMacro (Thr, int) | |
Gets the current calibration directory. | |
void | SetCalibrationPath (std::string calibrationPath) |
Sets the file where the calibration of the OptitrackTracker can be found. | |
itkGetMacro (calibrationPath, std::string) | |
Gets the current calibration file. | |
void | ThreadStartTracking () |
Start the Tracking Thread for the tools. | |
void | TrackTools () |
Update each tool location in the list m_AllTools. | |
bool | LoadCalibration () |
Load the Calibration file to the Optitrack System and set the cameras in calibrated locations. | |
bool | SetCameraParams (int exposure, int threshold, int intensity, int videoType=4) |
Set the Cameras Exposure, Threshold and Intensity of IR LEDs. By Default it set the Video type to 4: Precision Mode for tracking //== VideoType: //== 0 = Segment Mode //== 1 = Grayscale Mode //== 2 = Object Mode //== 4 = Precision Mode //== 6 = MJPEG Mode (V100R2 only) | |
bool | InitializeCameras () |
Initialize the Optitrack System. | |
bool | AddToolByDefinitionFile (std::string fileName) |
Add a new tool using a text file which described the tool. The file must to have the next structure 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. | |
![]() | |
mitkClassMacroItkParent (TrackingDevice, itk::Object) | |
virtual mitk::TrackingTool * | GetToolByName (std::string name) const |
Returns the tool with the given tool name. | |
virtual void | SetRotationMode (RotationMode r) |
itkGetConstMacro (RotationMode, RotationMode) | |
TrackingDeviceState | GetState () const |
return current object state (Setup, Ready or Tracking) | |
TrackingDeviceType | GetType () const |
Deprecated! Use the more specific getData or GetTrackingDeviceName instead. return device type identifier. | |
void | SetType (TrackingDeviceType type) |
Deprecated! Use the more specific setDeviceData instead. set device type. | |
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. | |
TrackingDeviceData | GetData () const |
return device data | |
void | SetData (TrackingDeviceData data) |
set device type | |
virtual bool | AutoDetectToolsAvailable () |
virtual bool | AddSingleToolIsAvailable () |
virtual mitk::NavigationToolStorage::Pointer | AutoDetectTools () |
Protected Member Functions | |
OptitrackTrackingDevice () | |
~OptitrackTrackingDevice () override | |
![]() | |
void | SetState (TrackingDeviceState state) |
change object state | |
TrackingDevice () | |
~TrackingDevice () override | |
Friends | |
class | OptitrackTrackingTool |
Additional Inherited Members | |
![]() | |
TrackingDeviceData | m_Data |
current device Data | |
bool | m_StopTracking |
signal stop to tracking thread | |
std::mutex | m_StopTrackingMutex |
mutex to control access to m_StopTracking | |
std::mutex | m_TrackingFinishedMutex |
mutex to manage control flow of StopTracking() | |
std::mutex | m_StateMutex |
mutex to control access to m_State | |
RotationMode | m_RotationMode |
defines the rotation mode Standard or Transposed, Standard is default | |
An object of this class represents the Optitrack 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. Remember that it will be necessary to to have a license for using the Optitrack System. See https://www.naturalpoint.com/ for details.
Documentation:
Definition at line 52 of file mitkOptitrackTrackingDevice.h.
Definition at line 67 of file mitkOptitrackTrackingDevice.h.
|
protected |
Definition at line 596 of file mitkOptitrackTrackingDevice.cpp.
|
overrideprotected |
Definition at line 606 of file mitkOptitrackTrackingDevice.cpp.
bool mitk::OptitrackTrackingDevice::AddToolByDefinitionFile | ( | std::string | fileName | ) |
Add a new tool using a text file which described the tool. The file must to have the next structure 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.
mitk::IGTException | Throws an exception if Tool could not be added or System is not Initialized |
Definition at line 728 of file mitkOptitrackTrackingDevice.cpp.
|
overridevirtual |
Close the Connection with the Tracker. Also CleanUp the Optitrack variables using the API: TT_CleanUp and TT_ShutDown. Sometimes API does not work properly and some problems during the Clean Up has been reported.
mitk::IGTException | Throws an exception if the System cannot ShutDown now or was not initialized. |
Implements mitk::TrackingDevice.
Definition at line 649 of file mitkOptitrackTrackingDevice.cpp.
mitk::OptitrackTrackingTool * mitk::OptitrackTrackingDevice::GetOptitrackTool | ( | unsigned int | toolNumber | ) | const |
Return the tool pointer of the tool number toolNumber.
toolNumber | The number of the tool which should be given back. |
mitk::IGTException | Throws an exception if there is the required tool does not exist. |
Definition at line 684 of file mitkOptitrackTrackingDevice.cpp.
|
overridevirtual |
Return the tool pointer of the tool number toolNumber.
toolNumber | The number of the tool which should be given back. |
Implements mitk::TrackingDevice.
Definition at line 719 of file mitkOptitrackTrackingDevice.cpp.
|
overridevirtual |
Returns the number of defined tools.
Implements mitk::TrackingDevice.
Definition at line 693 of file mitkOptitrackTrackingDevice.cpp.
bool mitk::OptitrackTrackingDevice::InitializeCameras | ( | ) |
Initialize the Optitrack System.
mitk::IGTException | Throws an exception if the Optitrack Tracking System cannot be initialized |
Definition at line 623 of file mitkOptitrackTrackingDevice.cpp.
|
overridevirtual |
Reimplemented from mitk::TrackingDevice.
Definition at line 588 of file mitkOptitrackTrackingDevice.cpp.
mitk::OptitrackTrackingDevice::itkGetMacro | ( | calibrationPath | , |
std::string | ) |
Gets the current calibration file.
mitk::OptitrackTrackingDevice::itkGetMacro | ( | Exp | , |
int | ) |
Gets the current calibration directory.
mitk::OptitrackTrackingDevice::itkGetMacro | ( | Led | , |
int | ) |
Gets the current calibration directory.
mitk::OptitrackTrackingDevice::itkGetMacro | ( | Thr | , |
int | ) |
Gets the current calibration directory.
mitk::OptitrackTrackingDevice::itkNewMacro | ( | Self | ) |
mitk::OptitrackTrackingDevice::itkSetMacro | ( | Exp | , |
int | ) |
Sets the directory where the calibration file of the MicronTracker can be found.
mitk::OptitrackTrackingDevice::itkSetMacro | ( | Led | , |
int | ) |
Sets the directory where the calibration file of the MicronTracker can be found.
mitk::OptitrackTrackingDevice::itkSetMacro | ( | Thr | , |
int | ) |
Sets the directory where the calibration file of the MicronTracker can be found.
bool mitk::OptitrackTrackingDevice::LoadCalibration | ( | ) |
Load the Calibration file to the Optitrack System and set the cameras in calibrated locations.
mitk::IGTException | Throws an exception if Calibration Path is empty, the System cannot load a calibration file or System is not ready for load a calibration file because it has not been initialized yet |
Definition at line 632 of file mitkOptitrackTrackingDevice.cpp.
mitk::OptitrackTrackingDevice::mitkClassMacro | ( | OptitrackTrackingDevice | , |
mitk::TrackingDevice | ) |
|
overridevirtual |
Open the Connection with the Tracker. Calls LoadCalibration function and set the system up with the calibration file. Remember that you have to set a calibration file first to open a correct connection to the Optical Tracking System.
mitk::IGTException | Throws an exception if InitializeCameras or LoadCalibration failed. |
Implements mitk::TrackingDevice.
Definition at line 614 of file mitkOptitrackTrackingDevice.cpp.
void mitk::OptitrackTrackingDevice::SetCalibrationPath | ( | std::string | calibrationPath | ) |
Sets the file where the calibration of the OptitrackTracker can be found.
Definition at line 641 of file mitkOptitrackTrackingDevice.cpp.
bool mitk::OptitrackTrackingDevice::SetCameraParams | ( | int | exposure, |
int | threshold, | ||
int | intensity, | ||
int | videoType = 4 ) |
Set the Cameras Exposure, Threshold and Intensity of IR LEDs. By Default it set the Video type to 4: Precision Mode for tracking //== VideoType: //== 0 = Segment Mode //== 1 = Grayscale Mode //== 2 = Object Mode //== 4 = Precision Mode //== 6 = MJPEG Mode (V100R2 only)
mitk::IGTException | Throws an exception if System is not Initialized |
Definition at line 710 of file mitkOptitrackTrackingDevice.cpp.
|
overridevirtual |
Start to Track the tools already defined. If no tools are defined for this tracker, it returns an error. Tools can be added using either AddToolByDescriptionFile or AddToolsByConfigurationFiles.
mitk::IGTException | Throws an exception if the System is not in State Ready . |
Implements mitk::TrackingDevice.
Definition at line 658 of file mitkOptitrackTrackingDevice.cpp.
|
overridevirtual |
Stop the Tracking Thread and tools will not longer be updated.
mitk::IGTException | Throws an exception if System is not in State Tracking. |
Reimplemented from mitk::TrackingDevice.
Definition at line 667 of file mitkOptitrackTrackingDevice.cpp.
void mitk::OptitrackTrackingDevice::ThreadStartTracking | ( | ) |
Start the Tracking Thread for the tools.
Definition at line 676 of file mitkOptitrackTrackingDevice.cpp.
void mitk::OptitrackTrackingDevice::TrackTools | ( | ) |
Update each tool location in the list m_AllTools.
mitk::IGTException | Throws an exception if the getting data operation failed for a defined tool |
Definition at line 702 of file mitkOptitrackTrackingDevice.cpp.
|
friend |
Definition at line 55 of file mitkOptitrackTrackingDevice.h.