Medical Imaging Interaction Toolkit  2023.12.00
Medical Imaging Interaction Toolkit
mitk::NDIProtocol Class Reference

The NDI Protocol class provides building and parsing of command strings and answers to and from a NDI tracking device. More...

#include <mitkNDIProtocol.h>

Inheritance diagram for mitk::NDIProtocol:
Collaboration diagram for mitk::NDIProtocol:

Public Types

typedef mitk::SerialCommunication::PortNumber PortNumber
 Port number of the serial connection. More...
 
typedef mitk::SerialCommunication::BaudRate BaudRate
 Baud rate of the serial connection. More...
 
typedef mitk::SerialCommunication::DataBits DataBits
 Number of data bits used in the serial connection. More...
 
typedef mitk::SerialCommunication::Parity Parity
 Parity mode used in the serial connection. More...
 
typedef mitk::SerialCommunication::StopBits StopBits
 Number of stop bits used in the serial connection. More...
 
typedef mitk::SerialCommunication::HardwareHandshake HardwareHandshake
 Hardware handshake mode of the serial connection. More...
 
typedef mitk::NDIPassiveTool::TrackingPriority TrackingPriority
 Tracking priority used for tracking a tool. More...
 

Public Member Functions

 mitkClassMacroItkParent (NDIProtocol, itk::Object)
 
Pointer Clone () const
 
virtual void SetTrackingDevice (NDITrackingDevice *_arg)
 
NDIErrorCode APIREV (std::string *revision)
 Gives information about the tool which is assosiated with the port handle. Writes portInfo to the string. More...
 
NDIErrorCode PHINF (std::string portHandle, std::string *portInfo)
 
NDIErrorCode PSOUT (std::string portHandle, std::string state)
 Set GPIO Output (Aurora) More...
 
NDIErrorCode COMM (mitk::SerialCommunication::BaudRate baudRate, mitk::SerialCommunication::DataBits dataBits, mitk::SerialCommunication::Parity parity, mitk::SerialCommunication::StopBits stopBits, mitk::SerialCommunication::HardwareHandshake hardwareHandshake)
 Change Serial Communication Parameters. More...
 
NDIErrorCode INIT ()
 Initialize the Measurement System. More...
 
NDIErrorCode DSTART ()
 Start the Diagnostic Mode. More...
 
NDIErrorCode DSTOP ()
 Stop the Diagnostic Mode. More...
 
NDIErrorCode IRINIT ()
 Initialize the System to Check for Infrared. More...
 
NDIErrorCode IRCHK (bool *IRdetected)
 This version of IRCHK uses only the simple "presence of infrared light" call, that returns a binary "IR detected/no IR detected" answer. More...
 
NDIErrorCode PHSR (PHSRQueryType queryType, std::string *portHandles)
 Port Handle Search. Will write returned port handles to the string portHandles. More...
 
NDIErrorCode PHF (std::string *portHandle)
 Port Handle Free. Frees the port handle. More...
 
NDIErrorCode PHRQ (std::string *portHandle)
 Port Handle Request. Will request a Port Handle for a wireless tool and return it in the string portHandle. More...
 
NDIErrorCode PVWR (std::string *portHandle, const unsigned char *sromData, unsigned int sromDataLength)
 Port Virtual Write. Writes an SROM Image data to a tool. More...
 
NDIErrorCode PINIT (std::string *portHandle)
 Port Initialize. Will initialize a Port that has been acquired with PHRQ and has been assigned a SROM File with PVWR. More...
 
NDIErrorCode PENA (std::string *portHandle, TrackingPriority prio)
 Port Enable. Will enable a port that has been initialized with PINIT. More...
 
NDIErrorCode PDIS (std::string *portHandle)
 Port Disable. Will disable a port that has been enabled with PENA. More...
 
NDIErrorCode IRATE (IlluminationActivationRate rate)
 Setting the illuminator rate. Will set the refresh rate for the illuminator for wireless tools. More...
 
NDIErrorCode BEEP (unsigned char count)
 Sounding the measurement system beeper. The tracking system will beep one to nine times. More...
 
NDIErrorCode SFLIST (std::string *info)
 Returns information about the supported feature of the tracking system. More...
 
NDIErrorCode TSTART (bool resetFrameCounter=false)
 Start Tracking Mode. The tracking system must be in setup mode and must be initialized. More...
 
NDIErrorCode TSTOP ()
 Stop Tracking Mode. The tracking system must be in Tracking mode. More...
 
NDIErrorCode TX (bool trackIndividualMarkers=false, MarkerPointContainerType *markerPositions=nullptr)
 Report transformations in text mode. Optionally, individual markers can be tracked. More...
 
NDIErrorCode BX ()
 Report transformations in binary mode. More...
 
NDIErrorCode POS3D (MarkerPointContainerType *markerPositions)
 Report 3D Positions of single markers. can only be used in diagnostics mode. More...
 
NDIErrorCode VER (mitk::TrackingDeviceType &t)
 returns if the tracking device is a Polaris or an Aurora system More...
 
NDIErrorCode VSEL (mitk::TrackingDeviceData deviceData)
 Sets the tracking volume to the given type. Check available tracking volumes with SFLIST first. More...
 
NDIErrorCode TX1000 (MarkerPointContainerType *markerPositions)
 Report transformations in text mode. More...
 
unsigned int ByteToNbBitsOn (char &c) const
 
virtual bool GetUseCRC () const
 
virtual void SetUseCRC (bool _arg)
 Get whether to append a CRC16 checksum to each message. More...
 
virtual void UseCRCOn ()
 Set whether to append a CRC16 checksum to each message. More...
 
virtual void UseCRCOff ()
 

Static Public Member Functions

static Pointer New ()
 

Protected Member Functions

 NDIProtocol ()
 Set whether to append a CRC16 checksum to each message. More...
 
 ~NDIProtocol () override
 
NDIErrorCode ParseOkayError ()
 
NDIErrorCode GenericCommand (const std::string command, const std::string *parameter=nullptr)
 
NDIErrorCode GetErrorCode (const std::string *input)
 returns the error code for an Error String returned from the NDI tracking device More...
 

Protected Attributes

NDITrackingDevicem_TrackingDevice
 tracking device to which the commands will be send More...
 
bool m_UseCRC
 whether to append a CRC16 checksum to each message More...
 

Detailed Description

The NDI Protocol class provides building and parsing of command strings and answers to and from a NDI tracking device.

Documentation

Definition at line 86 of file mitkNDIProtocol.h.

Member Typedef Documentation

◆ BaudRate

Baud rate of the serial connection.

Definition at line 95 of file mitkNDIProtocol.h.

◆ DataBits

Number of data bits used in the serial connection.

Definition at line 96 of file mitkNDIProtocol.h.

◆ HardwareHandshake

Hardware handshake mode of the serial connection.

Definition at line 99 of file mitkNDIProtocol.h.

◆ Parity

Parity mode used in the serial connection.

Definition at line 97 of file mitkNDIProtocol.h.

◆ PortNumber

Port number of the serial connection.

Definition at line 92 of file mitkNDIProtocol.h.

◆ StopBits

Number of stop bits used in the serial connection.

Definition at line 98 of file mitkNDIProtocol.h.

◆ TrackingPriority

Tracking priority used for tracking a tool.

Definition at line 100 of file mitkNDIProtocol.h.

Constructor & Destructor Documentation

◆ NDIProtocol()

mitk::NDIProtocol::NDIProtocol ( )
protected

Set whether to append a CRC16 checksum to each message.

◆ ~NDIProtocol()

mitk::NDIProtocol::~NDIProtocol ( )
overrideprotected

Member Function Documentation

◆ APIREV()

NDIErrorCode mitk::NDIProtocol::APIREV ( std::string *  revision)

Gives information about the tool which is assosiated with the port handle. Writes portInfo to the string.

◆ BEEP()

NDIErrorCode mitk::NDIProtocol::BEEP ( unsigned char  count)

Sounding the measurement system beeper. The tracking system will beep one to nine times.

◆ BX()

NDIErrorCode mitk::NDIProtocol::BX ( )

Report transformations in binary mode.

◆ ByteToNbBitsOn()

unsigned int mitk::NDIProtocol::ByteToNbBitsOn ( char &  c) const

◆ Clone()

Pointer mitk::NDIProtocol::Clone ( ) const

◆ COMM()

Change Serial Communication Parameters.

◆ DSTART()

NDIErrorCode mitk::NDIProtocol::DSTART ( )

Start the Diagnostic Mode.

◆ DSTOP()

NDIErrorCode mitk::NDIProtocol::DSTOP ( )

Stop the Diagnostic Mode.

◆ GenericCommand()

NDIErrorCode mitk::NDIProtocol::GenericCommand ( const std::string  command,
const std::string *  parameter = nullptr 
)
protected

Documentation Sends the command command to the tracking system and checks for OKAY and ERROR as replies This is used by commands like INIT, DSTART, DSTOP,... that do not need parameters or special parsing of replies

◆ GetErrorCode()

NDIErrorCode mitk::NDIProtocol::GetErrorCode ( const std::string *  input)
protected

returns the error code for an Error String returned from the NDI tracking device

Documentation

◆ GetUseCRC()

virtual bool mitk::NDIProtocol::GetUseCRC ( ) const
virtual

◆ INIT()

NDIErrorCode mitk::NDIProtocol::INIT ( )

Initialize the Measurement System.

◆ IRATE()

NDIErrorCode mitk::NDIProtocol::IRATE ( IlluminationActivationRate  rate)

Setting the illuminator rate. Will set the refresh rate for the illuminator for wireless tools.

◆ IRCHK()

NDIErrorCode mitk::NDIProtocol::IRCHK ( bool *  IRdetected)

This version of IRCHK uses only the simple "presence of infrared light" call, that returns a binary "IR detected/no IR detected" answer.

◆ IRINIT()

NDIErrorCode mitk::NDIProtocol::IRINIT ( )

Initialize the System to Check for Infrared.

◆ mitkClassMacroItkParent()

mitk::NDIProtocol::mitkClassMacroItkParent ( NDIProtocol  ,
itk::Object   
)

◆ New()

static Pointer mitk::NDIProtocol::New ( )
static

◆ ParseOkayError()

NDIErrorCode mitk::NDIProtocol::ParseOkayError ( )
protected

Documentation Reads the reply from the tracking device and checks if it is either "OKAY" or "ERROR##". if it reads an error, it returns the equivalent NDIErrorCode Replies other than OKAY or ERROR result in an NDIUNEXPECTEDREPLY

◆ PDIS()

NDIErrorCode mitk::NDIProtocol::PDIS ( std::string *  portHandle)

Port Disable. Will disable a port that has been enabled with PENA.

◆ PENA()

NDIErrorCode mitk::NDIProtocol::PENA ( std::string *  portHandle,
TrackingPriority  prio 
)

Port Enable. Will enable a port that has been initialized with PINIT.

◆ PHF()

NDIErrorCode mitk::NDIProtocol::PHF ( std::string *  portHandle)

Port Handle Free. Frees the port handle.

◆ PHINF()

NDIErrorCode mitk::NDIProtocol::PHINF ( std::string  portHandle,
std::string *  portInfo 
)

◆ PHRQ()

NDIErrorCode mitk::NDIProtocol::PHRQ ( std::string *  portHandle)

Port Handle Request. Will request a Port Handle for a wireless tool and return it in the string portHandle.

◆ PHSR()

NDIErrorCode mitk::NDIProtocol::PHSR ( PHSRQueryType  queryType,
std::string *  portHandles 
)

Port Handle Search. Will write returned port handles to the string portHandles.

◆ PINIT()

NDIErrorCode mitk::NDIProtocol::PINIT ( std::string *  portHandle)

Port Initialize. Will initialize a Port that has been acquired with PHRQ and has been assigned a SROM File with PVWR.

◆ POS3D()

NDIErrorCode mitk::NDIProtocol::POS3D ( MarkerPointContainerType markerPositions)

Report 3D Positions of single markers. can only be used in diagnostics mode.

◆ PSOUT()

NDIErrorCode mitk::NDIProtocol::PSOUT ( std::string  portHandle,
std::string  state 
)

Set GPIO Output (Aurora)

◆ PVWR()

NDIErrorCode mitk::NDIProtocol::PVWR ( std::string *  portHandle,
const unsigned char *  sromData,
unsigned int  sromDataLength 
)

Port Virtual Write. Writes an SROM Image data to a tool.

◆ SetTrackingDevice()

virtual void mitk::NDIProtocol::SetTrackingDevice ( NDITrackingDevice _arg)
virtual

◆ SetUseCRC()

virtual void mitk::NDIProtocol::SetUseCRC ( bool  _arg)
virtual

Get whether to append a CRC16 checksum to each message.

◆ SFLIST()

NDIErrorCode mitk::NDIProtocol::SFLIST ( std::string *  info)

Returns information about the supported feature of the tracking system.

◆ TSTART()

NDIErrorCode mitk::NDIProtocol::TSTART ( bool  resetFrameCounter = false)

Start Tracking Mode. The tracking system must be in setup mode and must be initialized.

◆ TSTOP()

NDIErrorCode mitk::NDIProtocol::TSTOP ( )

Stop Tracking Mode. The tracking system must be in Tracking mode.

◆ TX()

NDIErrorCode mitk::NDIProtocol::TX ( bool  trackIndividualMarkers = false,
MarkerPointContainerType markerPositions = nullptr 
)

Report transformations in text mode. Optionally, individual markers can be tracked.

◆ TX1000()

NDIErrorCode mitk::NDIProtocol::TX1000 ( MarkerPointContainerType markerPositions)

Report transformations in text mode.

◆ UseCRCOff()

virtual void mitk::NDIProtocol::UseCRCOff ( )
virtual

◆ UseCRCOn()

virtual void mitk::NDIProtocol::UseCRCOn ( )
virtual

Set whether to append a CRC16 checksum to each message.

◆ VER()

NDIErrorCode mitk::NDIProtocol::VER ( mitk::TrackingDeviceType t)

returns if the tracking device is a Polaris or an Aurora system

◆ VSEL()

NDIErrorCode mitk::NDIProtocol::VSEL ( mitk::TrackingDeviceData  deviceData)

Sets the tracking volume to the given type. Check available tracking volumes with SFLIST first.

Member Data Documentation

◆ m_TrackingDevice

NDITrackingDevice* mitk::NDIProtocol::m_TrackingDevice
protected

tracking device to which the commands will be send

Definition at line 158 of file mitkNDIProtocol.h.

◆ m_UseCRC

bool mitk::NDIProtocol::m_UseCRC
protected

whether to append a CRC16 checksum to each message

Definition at line 159 of file mitkNDIProtocol.h.


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