Use your 3DConnexion SpaceMouse with 3D Slicer on Linux. This project leverages libspacenav (C) and OpenIGTLink (C++) to make 3DConnexion devices usable with OpenIGTLink on Linux systems.
Tested with:
- SpaceMouse Wireless
- SpaceMouse Compact
- SpaceMouse Pro
- SpaceMouse Pro Wireless
- SpaceMouse Enterprise
Run
mkdir build
cd build
cmake ..
make
and you'll find a spnavigt binary inside this folder. The CMakeLists.txt is written as such that dependencies (libspnav and OpenIGTLink) are installed automatically. Once you run the binary, you can use SlicerIGT (module SlicerIGTIF) to connect and receive a transform called "SpaceMouse".
To install system-wide, run
sudo make install
The two buttons of the SpaceMouse are currently mapped as follows:
- Button 0 (left button): Reset translation
- Button 1 (right button): Reset rotation
3D Slicer needs the OpenIGTLink extension to make this work.
- Open 3D Slicer
- Start spnav-igt
- In Slicer, go to "OpenIGTLinkIF" extension and create a new connection.
- Set the port to the port of spnav-igt (default: 18944).
- Hit the "Active" checkbox.
- Go to "Data" extension, "Transform hierarchy" tab.
- Drag "Camera" (or the camera you want to manipulate) under "SpaceMouse".
- CMake build with FetchContent (auto-install OpenIGTLink)
- Rotations (so far, only translations are supported)
- Flexible configuration via JSON
- System-wide installation
- Use button events
- Command line arguments