Coder Social home page Coder Social logo

henrykrumb / spacenav-igt Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 30 KB

Use 3DConnexion SpaceMouse devices in 3D Slicer (IGTLink)

License: BSD 3-Clause "New" or "Revised" License

C++ 86.93% CMake 13.07%
3dconnexion 3dslicer igtlink openigtlink spacemouse spacenav libspacenav spacemouse-wireless

spacenav-igt's Introduction

Spacenav IGT

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

GitHub Actions Workflow Status

Installation and Usage

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

Buttons

The two buttons of the SpaceMouse are currently mapped as follows:

  • Button 0 (left button): Reset translation
  • Button 1 (right button): Reset rotation

Usage in 3D Slicer

3D Slicer needs the OpenIGTLink extension to make this work.

  1. Open 3D Slicer
  2. Start spnav-igt
  3. In Slicer, go to "OpenIGTLinkIF" extension and create a new connection.
  4. Set the port to the port of spnav-igt (default: 18944).
  5. Hit the "Active" checkbox.
  6. Go to "Data" extension, "Transform hierarchy" tab.
  7. Drag "Camera" (or the camera you want to manipulate) under "SpaceMouse".

TODOs

  • 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

spacenav-igt's People

Contributors

henrykrumb avatar

Stargazers

 avatar

Watchers

 avatar

spacenav-igt's Issues

React on buttons

Send IGTLink messages if buttons are pressed. We could either send STRING type messages or COMMAND messages, however, COMMAND type is part of IGTLink protocol version 3, which is so far not supported by pyigtl.

The message type could be made configurable.

Load configuration (from JSON)

Make the following parameters configurable via JSON:

  • Sensitivity per axis (x, y, z, ax, ay, az)
  • Lock axes (true / false)
  • Default IGTLink host and port

There should be a hierarchy of config files being loaded:

  1. Load project-local config
  2. Load system-wide config in $PREFIX/share/spacenav-igt/config.json
  3. Load user config in ~/.config/spacenav-igt/config.json

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.