Medical Imaging Interaction Toolkit
2018.4.99-389bf124
Medical Imaging Interaction Toolkit
|
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 <mitkOpenIGTLinkTrackingDevice.h>
Public Member Functions | |
mitkClassMacro (OpenIGTLinkTrackingDevice, TrackingDevice) | |
Pointer | Clone () const |
void | SetPortNumber (int portNumber) |
void | SetHostname (std::string hostname) |
int | GetPortNumber () |
std::string | GetHostname () |
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 |
TrackingTool * | GetTool (unsigned int toolNumber) const override |
bool | DiscoverTools (int WaitingTime=10000) |
Discover the tools available from the connected OpenIGTLink device and adds these tools to this tracking device. Therefore, a connection is opened, the tools are discovered and added. More... | |
mitk::TrackingTool * | AddTool (const char *toolName, const char *fileName) |
Create a new OpenIGTLink tool with toolName and fileName and add it to the list of tools. More... | |
bool | AutoDetectToolsAvailable () override |
mitk::NavigationToolStorage::Pointer | AutoDetectTools () override |
bool | IsDeviceInstalled () override |
virtual void | SetUpdateRate (int _arg) |
virtual int | GetUpdateRate () const |
Sets the update rate of the device in fps. Default value is 60 fps. More... | |
![]() | |
mitkClassMacroItkParent (TrackingDevice, itk::Object) | |
virtual mitk::TrackingTool * | GetToolByName (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 | AddSingleToolIsAvailable () |
Static Public Member Functions | |
static Pointer | New () |
Protected Member Functions | |
OpenIGTLinkTrackingDevice () | |
Returns the update rate of the device in fps. More... | |
~OpenIGTLinkTrackingDevice () override | |
bool | InternalAddTool (OpenIGTLinkTrackingTool::Pointer tool) |
Adds a tool to the tracking device. More... | |
void | UpdateTools () |
mitk::IGTLMessage::Pointer | ReceiveMessage (int waitingTime) |
std::vector< OpenIGTLinkTrackingTool::Pointer > | GetAllTools () |
![]() | |
void | SetState (TrackingDeviceState state) |
change object state More... | |
TrackingDevice () | |
~TrackingDevice () override | |
Protected Attributes | |
unsigned long | m_MessageReceivedObserverTag |
mitk::IGTLClient::Pointer | m_OpenIGTLinkClient |
mitk::IGTLTrackingDataDeviceSource::Pointer | m_IGTLDeviceSource |
mitk::IGTLMessageToNavigationDataFilter::Pointer | m_IGTLMsgToNavDataFilter |
std::vector< OpenIGTLinkTrackingTool::Pointer > | m_AllTools |
vector holding all tools More... | |
int | m_UpdateRate |
holds the update rate in FPS (will be set automatically when the OpenIGTLink connection is established) More... | |
![]() | |
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 | |
![]() | |
enum | RotationMode { RotationStandard, RotationTransposed } |
enum | TrackingDeviceState { Setup, Ready, Tracking } |
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 36 of file mitkOpenIGTLinkTrackingDevice.h.
|
protected |
Returns the update rate of the device in fps.
Definition at line 32 of file mitkOpenIGTLinkTrackingDevice.cpp.
References mitk::OpenIGTLinkTypeInformation::GetDeviceDataOpenIGTLinkTrackingDeviceConnection(), mitk::TrackingDevice::m_Data, m_IGTLDeviceSource, m_OpenIGTLinkClient, and mitk::IGTLTrackingDataDeviceSource::New().
|
overrideprotected |
Definition at line 45 of file mitkOpenIGTLinkTrackingDevice.cpp.
mitk::TrackingTool * mitk::OpenIGTLinkTrackingDevice::AddTool | ( | const char * | toolName, |
const char * | fileName | ||
) |
Create a new OpenIGTLink tool with toolName and fileName and add it to the list of tools.
Note that tools are usually provided by the OpenIGTLink connection. In most cases, the method DiscoverTools() should be used instead which automatically finds the provided tools. If you use this method to manually add tools be sure that you add the same number and type of tools that are provided by the connected device. Otherwise problems might occur when you try to start tracking.
Definition at line 213 of file mitkOpenIGTLinkTrackingDevice.cpp.
References InternalAddTool().
|
overridevirtual |
Autodetects tools from the current OpenIGTLink connection and returns them as a navigation tool storage.
Reimplemented from mitk::TrackingDevice.
Definition at line 59 of file mitkOpenIGTLinkTrackingDevice.cpp.
References k(), m_IGTLDeviceSource, m_OpenIGTLinkClient, MITK_INFO, MITK_WARN, mitk::NavigationToolStorage::New(), mitk::IGTLTrackingDataDeviceSource::QTDATA, ReceiveMessage(), mitk::IGTLTrackingDataDeviceSource::TDATA, mitk::IGTLTrackingDataDeviceSource::TRANSFORM, and mitk::IGTLTrackingDataDeviceSource::UNKNOWN.
|
overridevirtual |
Reimplemented from mitk::TrackingDevice.
Definition at line 54 of file mitkOpenIGTLinkTrackingDevice.cpp.
Pointer mitk::OpenIGTLinkTrackingDevice::Clone | ( | ) | const |
|
overridevirtual |
Closes the connection and clears all resources.
Implements mitk::TrackingDevice.
Definition at line 457 of file mitkOpenIGTLinkTrackingDevice.cpp.
References mitk::TrackingDevice::GetState(), m_IGTLDeviceSource, MITK_WARN, mitk::TrackingDevice::Ready, mitk::TrackingDevice::SetState(), and mitk::TrackingDevice::Setup.
bool mitk::OpenIGTLinkTrackingDevice::DiscoverTools | ( | int | WaitingTime = 10000 | ) |
Discover the tools available from the connected OpenIGTLink device and adds these tools to this tracking device. Therefore, a connection is opened, the tools are discovered and added.
WaitingTime | Defines how long the method waits for an answer from the server (in milliseconds). Default value is 10000 (10 seconds). |
Definition at line 228 of file mitkOpenIGTLinkTrackingDevice.cpp.
References m_IGTLDeviceSource, m_OpenIGTLinkClient, MITK_INFO, MITK_WARN, and ReceiveMessage().
Referenced by mitk::OpenIGTLinkTypeInformation::CreateTrackingDeviceSource().
|
protected |
Definition at line 481 of file mitkOpenIGTLinkTrackingDevice.cpp.
References m_AllTools.
std::string mitk::OpenIGTLinkTrackingDevice::GetHostname | ( | ) |
Definition at line 193 of file mitkOpenIGTLinkTrackingDevice.cpp.
References m_OpenIGTLinkClient.
int mitk::OpenIGTLinkTrackingDevice::GetPortNumber | ( | ) |
Definition at line 49 of file mitkOpenIGTLinkTrackingDevice.cpp.
References m_OpenIGTLinkClient.
|
overridevirtual |
toolNumber | The number of the tool which should be given back. |
Implements mitk::TrackingDevice.
Definition at line 427 of file mitkOpenIGTLinkTrackingDevice.cpp.
References GetToolCount(), and m_AllTools.
|
overridevirtual |
Implements mitk::TrackingDevice.
Definition at line 422 of file mitkOpenIGTLinkTrackingDevice.cpp.
References m_AllTools.
Referenced by GetTool(), and StartTracking().
|
virtual |
Sets the update rate of the device in fps. Default value is 60 fps.
|
protected |
Adds a tool to the tracking device.
tool | The tool which will be added. |
Definition at line 222 of file mitkOpenIGTLinkTrackingDevice.cpp.
References m_AllTools.
Referenced by AddTool(), and ReceiveMessage().
|
overridevirtual |
Note that some tracking systems communicate via a standard interface (e.g., serial port) and don't need any library or installation. These devices are always "installed".
Reimplemented from mitk::TrackingDevice.
Definition at line 208 of file mitkOpenIGTLinkTrackingDevice.cpp.
mitk::OpenIGTLinkTrackingDevice::mitkClassMacro | ( | OpenIGTLinkTrackingDevice | , |
TrackingDevice | |||
) |
|
static |
Referenced by QmitkOpenIGTLinkWidget::GetTrackingDevice().
|
overridevirtual |
Opens the connection to the device. This have to be done before the tracking is started.
mitk::IGTHardwareException | Throws an exception if there is an error during open connection. |
Implements mitk::TrackingDevice.
Definition at line 435 of file mitkOpenIGTLinkTrackingDevice.cpp.
References mitk::TrackingDevice::GetState(), m_IGTLDeviceSource, MITK_WARN, mitk::TrackingDevice::Ready, mitk::TrackingDevice::SetState(), and mitk::TrackingDevice::Setup.
|
protected |
Receives one message from the OpenIGTLink connection. Starts the tracking stream if required.
Definition at line 273 of file mitkOpenIGTLinkTrackingDevice.cpp.
References mitk::OpenIGTLinkTypeInformation::GetDeviceDataOpenIGTLinkTrackingDeviceConnection(), InternalAddTool(), m_IGTLDeviceSource, m_OpenIGTLinkClient, m_UpdateRate, MITK_INFO, mitk::OpenIGTLinkTrackingTool::New(), mitk::IGTLMessage::New(), and mitk::NavigationTool::New().
Referenced by AutoDetectTools(), and DiscoverTools().
void mitk::OpenIGTLinkTrackingDevice::SetHostname | ( | std::string | hostname | ) |
Sets the hostname for the Open IGT Link connection. Default value is 127.0.0.1 (localhost).
Definition at line 203 of file mitkOpenIGTLinkTrackingDevice.cpp.
References m_OpenIGTLinkClient.
void mitk::OpenIGTLinkTrackingDevice::SetPortNumber | ( | int | portNumber | ) |
Sets the port number for the Open IGT Link connection. Default value is -1 (invalid).
Definition at line 198 of file mitkOpenIGTLinkTrackingDevice.cpp.
References m_OpenIGTLinkClient.
|
virtual |
|
overridevirtual |
Starts the tracking.
mitk::IGTHardwareException | Throws an exception if there is an error during start tracking. |
Implements mitk::TrackingDevice.
Definition at line 357 of file mitkOpenIGTLinkTrackingDevice.cpp.
References mitk::TrackingDevice::GetState(), GetToolCount(), m_IGTLDeviceSource, m_IGTLMsgToNavDataFilter, m_MessageReceivedObserverTag, m_OpenIGTLinkClient, MITK_WARN, mitk::IGTLMessageToNavigationDataFilter::New(), mitk::TrackingDevice::Ready, mitk::TrackingDevice::SetState(), mitk::TrackingDevice::Tracking, and UpdateTools().
|
overridevirtual |
Stops the tracking.
Reimplemented from mitk::TrackingDevice.
Definition at line 397 of file mitkOpenIGTLinkTrackingDevice.cpp.
References mitk::TrackingDevice::GetState(), m_IGTLDeviceSource, m_MessageReceivedObserverTag, m_OpenIGTLinkClient, MITK_WARN, mitk::TrackingDevice::Ready, mitk::TrackingDevice::SetState(), and mitk::TrackingDevice::Tracking.
|
protected |
Updates the tools from the open IGT link connection. Is called every time a message received event is invoked.
Definition at line 330 of file mitkOpenIGTLinkTrackingDevice.cpp.
References mitk::TrackingDevice::GetState(), m_AllTools, m_IGTLMsgToNavDataFilter, MITK_ERROR, and mitk::TrackingDevice::Tracking.
Referenced by StartTracking().
|
protected |
vector holding all tools
Definition at line 154 of file mitkOpenIGTLinkTrackingDevice.h.
Referenced by GetAllTools(), GetTool(), GetToolCount(), InternalAddTool(), and UpdateTools().
|
protected |
Definition at line 151 of file mitkOpenIGTLinkTrackingDevice.h.
Referenced by AutoDetectTools(), CloseConnection(), DiscoverTools(), OpenConnection(), OpenIGTLinkTrackingDevice(), ReceiveMessage(), StartTracking(), and StopTracking().
|
protected |
Definition at line 152 of file mitkOpenIGTLinkTrackingDevice.h.
Referenced by StartTracking(), and UpdateTools().
|
protected |
Definition at line 136 of file mitkOpenIGTLinkTrackingDevice.h.
Referenced by StartTracking(), and StopTracking().
|
protected |
Definition at line 148 of file mitkOpenIGTLinkTrackingDevice.h.
Referenced by AutoDetectTools(), DiscoverTools(), GetHostname(), GetPortNumber(), OpenIGTLinkTrackingDevice(), ReceiveMessage(), SetHostname(), SetPortNumber(), StartTracking(), and StopTracking().
|
protected |
holds the update rate in FPS (will be set automatically when the OpenIGTLink connection is established)
Definition at line 156 of file mitkOpenIGTLinkTrackingDevice.h.
Referenced by ReceiveMessage().