ImFusion C++ SDK 4.4.0
NDI Tracking Plugin

The NDI Tracking Plugin enables connectivity with an NDI tracking device, allowing users to control the device and stream tracking data as a TrackingStream into the ImFusion framework. More...

Collaboration diagram for NDI Tracking Plugin:

Detailed Description

The NDI Tracking Plugin enables connectivity with an NDI tracking device, allowing users to control the device and stream tracking data as a TrackingStream into the ImFusion framework.

Introduction

The NDI Tracking Plugin provides an integration with specialized features for NDI systems, extending the general functionality of tracking streams in the ImFusion framework:

  • Acquisition Control: Connect to an NDI tracking device via USB or network.
  • ROM File Handling: Load predefined or custom ROM files into the tracking system.
  • Tracking Streaming: Stream tracking poses and tracking quality metrics into the ImFusion framework for further processing.
  • Single Fiducial Readout: Retrieve positions of individual reflective markers or IR-laser reflections (optical tracking only).

Usage

The NDI tracking functionality is available in both the ImFusion Suite and the C++ SDK.

ImFusion Suite

The NDI Tracking Plugin is integrated into the ImFusion Suite, allowing users to configure the tracking system, visualize tracking instruments, and record tracking data. See the User Documentation for further details.

C++ SDK

With the C++ SDK, the NDI Tracking Plugin can be used to integrate EM or optical tracking into custom applications for navigation, recording, and visualization. Additionally, the hardware can be integrated and used in a custom plugin via the ImFusion plugin system. For an example, refer to the Stream Example Plugin: Stream Example Plugin

Example

Example usage of the tracking stream:

// configure the input stream
// using an alias to select the system type: PolarisAuroraTrackingStream<NDISystemType::PolarisVega>
NDIPolarisTrackingStream ndiTrackingStream;
ndiTrackingStream.setHardwareDevice("192.168.1.42");
ndiTrackingStream.setHardwareIPPort(8765);
ndiTrackingStream.setBinaryQueryMode(true);
ndiTrackingStream.registerTool({ "My Tool", "<path to rom file>"}); // port only relevant for aurora systems
ndiTrackingStream.start();
// add the stream to a view
ImageView3D* view3D = ... // e.g., m_disp->view3D() in a controller
view3D->setVisibleData({&ndiTrackingStream});
// record the stream
StreamRecorderAlgorithm recorder({&ndiTrackingStream});
recorder.start();
recorder.stop();
ndiTrackingStream.stop();
// access the recorded data
auto recordedTrackings = recorder.takeOutput().extractAll<TrackingSequence>();
// ...
void setHardwareDevice(const std::string &s)
Sets the hardware device name, e.g.
T sleep_for(T... args)

Classes

class  ImFusion::NDITrackingController
 Stream algorithm controller to configure NDITrackingStreams. More...
class  ImFusion::NDITrackingStream
 Base class for NDI tracking streams (Polaris/Aurora and Ascension), which share the same controller. More...
class  ImFusion::PolarisAuroraTrackingStream< NDIType >
 TrackingStream wrapping the NDI Polaris/Aurora Tracking API. More...

Typedefs

using ImFusion::NDIAuroraTrackingStream = PolarisAuroraTrackingStream<NDISystemType::Aurora>
 Tracking stream for a NDI Aurora EM tracking system connected via USB.
using ImFusion::NDIPolarisSerialTrackingStream = PolarisAuroraTrackingStream<NDISystemType::PolarisSerial>
 Tracking stream for a NDI Polaris Vicra and Polaris Spectra optical tracking system connected via USB.
using ImFusion::NDIPolarisTrackingStream = PolarisAuroraTrackingStream<NDISystemType::PolarisVega>
 Tracking stream for a NDI Polaris Vega or Polaris Lyra optical tracking system connected via an ethernet network connection.

Typedef Documentation

◆ NDIAuroraTrackingStream

#include <ImFusion/NDI/NDIAuroraTrackingStream.h>

Tracking stream for a NDI Aurora EM tracking system connected via USB.

auroraStream.setHardwareDevice("auto"); // specify COM port like 'COM5' or auto-detect system with keyword 'auto'
auto transferRates = auroraStream.measurementRateOptions();
for (int i = 0; i < transferRates.size(); i++) // select a rate of 115200 for the serial communication
{
if (transferRates == "115200")
{
auroraStream.setMeasurementRate(i);
break;
}
}
// tools are auto-detected upon open
auroraStream.open();
auroraStream.start();
std::vector< std::string > measurementRateOptions() const override
Returns labels for the measurement rate combo box.
void setMeasurementRate(int index) override
Sets the measurements/second of the tracking hardware.
bool start()
Start stream and wait for the operation to complete. Returns whether the operation was successful.
Definition Stream.h:117
bool open()
Open stream and wait for the operation to complete. Returns whether the operation was successful.
Definition Stream.h:111
PolarisAuroraTrackingStream< NDISystemType::Aurora > NDIAuroraTrackingStream
Tracking stream for a NDI Aurora EM tracking system connected via USB.
Definition NDIAuroraTrackingStream.h:32

◆ NDIPolarisTrackingStream

#include <ImFusion/NDI/NDIPolarisTrackingStream.h>

Tracking stream for a NDI Polaris Vega or Polaris Lyra optical tracking system connected via an ethernet network connection.

polarisStream.setHardwareDevice("192.168.1.12"); // IP address of the camera
polarisStream.setHardwareIPPort(8765); // this is the default value
polarisStream.registerTool({"Pointer", "C:/Resources/pointer.rom"});
polarisStream.registerTool({"Reference", "C:/Resources/reference.rom"});
polarisStream.open();
polarisStream.start();
void setHardwareIPPort(int port)
Sets the IP port (only used for Polaris Vega systems).
void registerTool(const NDITrackingInstrumentInfo &info)
Registers an tracking target definition file. Required for Polaris tracking system and for some Auror...
PolarisAuroraTrackingStream< NDISystemType::PolarisVega > NDIPolarisTrackingStream
Tracking stream for a NDI Polaris Vega or Polaris Lyra optical tracking system connected via an ether...
Definition NDIPolarisTrackingStream.h:27
Search Tab / S to search, Esc to close