MITK-IGT
IGT Extension of MITK
Loading...
Searching...
No Matches
mitkNDIProtocol.h
Go to the documentation of this file.
1/*============================================================================
2
3The Medical Imaging Interaction Toolkit (MITK)
4
5Copyright (c) German Cancer Research Center (DKFZ)
6All rights reserved.
7
8Use of this source code is governed by a 3-clause BSD license that can be
9found in the LICENSE file.
10
11============================================================================*/
12
13
14#ifndef mitkNDIProtocol_h
15#define mitkNDIProtocol_h
16
17#include <itkObject.h>
18#include <itkObjectFactory.h>
19
20#include <MitkIGTExports.h>
22#include "mitkNDIPassiveTool.h"
23
24namespace mitk
25{
26 class NDITrackingDevice;
27
79
86 class MITKIGT_EXPORT NDIProtocol : public itk::Object
87 {
88 public:
93
104 NDIErrorCode APIREV(std::string* revision);
105 NDIErrorCode PHINF(std::string portHandle, std::string* portInfo);
106 NDIErrorCode PSOUT(std::string portHandle, std::string state);
108 NDIErrorCode INIT();
109 NDIErrorCode DSTART();
110 NDIErrorCode DSTOP();
111 NDIErrorCode IRINIT();
112 NDIErrorCode IRCHK(bool* IRdetected);
113 NDIErrorCode PHSR(PHSRQueryType queryType, std::string* portHandles);
114 NDIErrorCode PHF(std::string* portHandle);
115 NDIErrorCode PHRQ(std::string* portHandle);
116 NDIErrorCode PVWR(std::string* portHandle, const unsigned char* sromData, unsigned int sromDataLength);
117 NDIErrorCode PINIT(std::string* portHandle);
118 NDIErrorCode PENA(std::string* portHandle, TrackingPriority prio);
119 NDIErrorCode PDIS(std::string* portHandle);
121 NDIErrorCode BEEP(unsigned char count);
122 NDIErrorCode SFLIST(std::string* info);
123 NDIErrorCode TSTART(bool resetFrameCounter = false);
124 NDIErrorCode TSTOP();
125 NDIErrorCode TX(bool trackIndividualMarkers = false, MarkerPointContainerType* markerPositions = nullptr);
126 NDIErrorCode BX();
127 NDIErrorCode POS3D(MarkerPointContainerType* markerPositions);
129 NDIErrorCode VSEL(mitk::TrackingDeviceData deviceData);
130 NDIErrorCode TX1000(MarkerPointContainerType* markerPositions);
131 unsigned int ByteToNbBitsOn(char& c) const;
132 itkGetConstMacro(UseCRC, bool);
133 itkSetMacro(UseCRC, bool);
135 protected:
136 NDIProtocol();
137 ~NDIProtocol() override;
138
144 NDIErrorCode ParseOkayError();
145
151 NDIErrorCode GenericCommand(const std::string command, const std::string* parameter = nullptr);
152
156 NDIErrorCode GetErrorCode(const std::string* input);
157
159 bool m_UseCRC;
160 };
161} // namespace mitk
162#endif
TrackingPriority
tracking priority for NDI tracking devices
The NDI Protocol class provides building and parsing of command strings and answers to and from a NDI...
mitk::SerialCommunication::DataBits DataBits
Number of data bits used in the serial connection.
itkSetMacro(UseCRC, bool)
Set whether to append a CRC16 checksum to each message.
itkSetObjectMacro(TrackingDevice, NDITrackingDevice)
mitkClassMacroItkParent(NDIProtocol, itk::Object)
itkBooleanMacro(UseCRC)
Set whether to append a CRC16 checksum to each message.
mitk::SerialCommunication::StopBits StopBits
Number of stop bits used in the serial connection.
NDITrackingDevice * m_TrackingDevice
tracking device to which the commands will be send
itkGetConstMacro(UseCRC, bool)
Get whether to append a CRC16 checksum to each message.
bool m_UseCRC
whether to append a CRC16 checksum to each message
mitk::SerialCommunication::Parity Parity
Parity mode used in the serial connection.
mitk::SerialCommunication::PortNumber PortNumber
Port number of the serial connection.
mitk::SerialCommunication::BaudRate BaudRate
Baud rate of the serial connection.
mitk::NDIPassiveTool::TrackingPriority TrackingPriority
Tracking priority used for tracking a tool.
itkFactorylessNewMacro(Self)
mitk::SerialCommunication::HardwareHandshake HardwareHandshake
Hardware handshake mode of the serial connection.
superclass for specific NDI tracking Devices that use serial communication.
Interface for all Tracking Devices.
IGT Exceptions.
IlluminationActivationRate
activation rate of IR illuminator for NDI Polaris tracking device
std::vector< MarkerPointType > MarkerPointContainerType
std::string TrackingDeviceType
NDIErrorCode
Error codes of NDI tracking devices.
@ NDICANTINITIRDIAGNOSTICS
@ NDIINCORRECTNUMBEROFPARAMETERS
@ TRACKINGDEVICERESET
@ NDIINVALIDLED
@ NDIINVALIDOPERATIONFORDEVICE
@ NDIINVALIDPORTDESCRIPTION
@ NDICOMMANDTOOSHORT
@ SROMFILETOOLARGE
@ SERIALINTERFACENOTSET
@ NDIINVALIDVOLUMEPARAMETERS
@ SROMFILETOOSMALL
@ NDIOUTOFHANDLES
@ NDIINVALIDLEDSTATE
@ NDICOMMANDPARAMETEROUTOFRANGE
@ NDIFAILURETOWRITESROM
@ NDIINVALIDPORTHANDLE
@ NDISYSTEMNOTINITIALIZED
@ NDIINCOMPATIBLEFIRMWAREVERSIONS
@ SERIALRECEIVEERROR
@ NDICOMMANDTOOLONG
@ NDICANTSTARTDIAGNOSTICMODE
@ NDICRCDOESNOTMATCH
@ NDIINVALIDCOMMAND
@ NDINOMEMORYAVAILABLE
@ NDIINITIALIZATIONFAILED
@ SERIALSENDERROR
@ NDIUNABLETOSTARTTRACKING
@ NDIUNABLETOSETNEWCOMMPARAMETERS
@ NDIPORTNOTINITIALIZED
@ NDIUNABLETOSTOPTRACKING
@ NDIPORTHASBECOMEUNOCCUPIED
@ UNKNOWNHANDLERETURNED
@ NDICOMMANDINVALIDINCURRENTMODE
@ NDIPORTHANDLENOTALLOCATED
@ NDIUNKNOWNERROR
@ NDIENABLEDTOOLSNOTSUPPORTED
@ NDIUNEXPECTEDREPLY
@ TRACKINGDEVICENOTSET
@ NDIINVALIDTRACKINGPRIORITY
@ NDINOTOOLFORPORT
PHSRQueryType
Query mode for NDI tracking devices.