A C++ application that bridges NatNet motion capture data to OpenIGTLinkIO for real-time tracking communication with medical imaging software like 3D Slicer.
- VTK (Visualization Toolkit)
- OpenIGTLink - Communication protocol for medical imaging
- OpenIGTLinkIO - I/O library for OpenIGTLink
- NatNet SDK - OptiTrack's motion capture SDK (included in project)
- TinyXML2 - XML parsing library (included in project)
NatNetToOIGTLIO/
├── main.cpp # Main application entry point
├── utils.cpp # Utility functions
├── utils.h # Utility headers
├── xmlReader.cpp # XML configuration reader
├── xmlReader.h # XML reader headers
├── config.xml # Configuration file
├── include/ # NatNet SDK headers
│ ├── NatNetCAPI.h
│ ├── NatNetClient.h
│ └── NatNetTypes.h
├── lib/ # NatNet SDK libraries
│ ├── NatNetLib.dll
│ └── NatNetLib.lib
├── tinyxml2/ # TinyXML2 library
│ ├── tinyxml2.cpp
│ └── tinyxml2.h
├── CMakeLists.txt # Build configuration
└── README.md # This file
- Build the following libraries from source:
- VTK - Follow VTK build instructions
- OpenIGTLink - Build from OpenIGTLink repository
- OpenIGTLinkIO - Build from OpenIGTLinkIO repository
- Start Motive: Ensure OptiTrack Motive is running and streaming data
- Configure Network: Make sure both applications are on the same network
- Run Application: Execute the built executable
Edit config.xml to configure tools and network settings. The application will automatically use the rigid body names from Motive that match the configured tool names.
- Press 'q' or 'Q': Quit the application
- Console Output: Shows connection status and frame rate statistics
- NatNet Client receives rigid body data from Motive
- Data Handler processes each frame of motion capture data
- Transform Conversion converts quaternion/position to 4x4 matrix
- OpenIGTLink Server streams transforms to connected clients
- Frame Rate Monitoring displays performance statistics
- Install OpenIGTLink Extension in 3D Slicer
- Create IGTLink Connector in Slicer
- Set Connection: localhost:18944