iMSTK
iMSTK copied to clipboard
Mirror of https://gitlab.kitware.com/iMSTK/iMSTK
iMSTK - Interactive Medical Simulation Toolkit
- About
- Overview
- Participants
- Licensing
- Resources
- Documentation
- Discourse
- Issue tracker
- Prerequisites
- Getting started with iMSTK
- Getting the source code
- Setting up your SSH key
- Building iMSTK
- On Linux/macOS
- On Windows
- Phantom Omni Support
- Haply Inverse3 Support
- VRPN Support
- Offscreen Rendering
- Renderless
About
Overview
iMSTK is a C++ based free & open-source toolkit that aids rapid prototyping of real-time multi-modal surgical simulation scenarios. Surgical simulation scenarios involve algorithms from areas such as haptics, advanced rendering, computational geometry, computational mechanics, virtual reality and parallel computing. iMSTK employs a highly modular and extensible design to enable the use of libraries and codes from these areas in a given application thereby reducing the development time.
Participants
Funding support:
This project is supported in part by the following grants 9R44OD018334, 1R44EB019802, 1R44AR075481 , 1R01EB025247, 2R44DK115332
Disclaimer: The content is solely the responsibility of the authors and does not necessarily represent the official views of the NIH and its institutes.
Licensing
iMSTK is licensed under Apache 2.0
Resources
Documentation
Click here for user documentation.
Click here for doxygen code documentation.
Click here for iMSTK coding style
Click here to view information about iMSTK maintenance tasks
Dashboard
Click here for nightly build & MR results.
Discourse
The iMSTK Users and Developers can post questions and discuss relevant topics at the Discourse.
Issue-tracker
Designed more specifically for developers, the issue tracker allows developers to list and discuss issues & enhancements:
https://gitlab.kitware.com/iMSTK/iMSTK/issues
Assign labels to the issues. The description of each label can be found HERE.
bug compilation critical enhancement optimization clean up refactor testcase visualization mechanics device documentation support discussion
Prerequisites
- Git
- Git LFS
- Python (if using Uncrustify, default on)
- CMake 3.15 or higher
On Linux:
sudo apt-get install build-essential libgl1-mesa-dev libxt-dev libusb-1.0-0-dev git-lfs
Getting started with iMSTK
1. Getting the source code
To be able to contribute back to the iMSTK project, the preferred way is to use Git for code version control. You can use the following command in the terminal for Linux/macOS, or in Git Bash for Windows.
git clone https://gitlab.kitware.com/iMSTK/iMSTK.git
OR
git clone [email protected]:iMSTK/iMSTK.git
2. Optional: Setting up your SSH key
If cloning with HTTPS, skip this step. If cloning with SSH the build process will check out external dependency sources with the SSH protocol to avoid manually entering credentials during the build process. To allow this, make sure you set up your ssh key in your profile HERE. You can find documentation on how to generate and retrieve your public ssh key HERE.
3. Building iMSTK
We use CMake to configure the project on every platform. See how to run it HERE.
-
On Linux/macOS
Type the following commands from the same location you cloned the code. This will configure the build in a directory adjacent to the source directory. To easily change some configuration variables like
CMAKE_BUILD_TYPE, useccmakeinstead ofcmake.mkdir iMSTK-build cd iMSTK-build cmake ../iMSTK #/path/to/source/directory make -j4 #to build using 4 coresYou can also use Ninja for a faster build instead of Unix Makefiles. To do so, configure the cmake project with
-GNinja:cmake -GNinja ../iMSTK ninjaThis will checkout, build and link all iMSTK dependencies. When making changes to iMSTK base source code, you can then build from the
Innerbuilddirectory. -
On Windows
Run CMake-GUI and follow the directions described HERE. You will have to choose which version of Visual Studio you'd like to use when configuring the project, make sure to select Microsoft Visual Studio 2017, 2019 or 2022. CMake will generate a
iMSTK.slnsolution file for Visual Studio at the top level for what is called the Superbuild. Open this file and build all targets, which will checkout, build and link all iMSTK dependencies. Make sure the build mode is set toReleaseorRelWithDebInfo, iMSTK is not very usable inDebugmode. The switches IMSTK_BUILD_EXAMPLES, IMSTK_BUILD_TESTING and IMSTK_BUILD_VISUAL_TESTING should be on as well. When making changes to iMSTK base source code, you can then build from theiMSTK.slnsolution file located in theInnerbuilddirectory. If you would like to build on multiple cores add /MP[N] to CMAKE_CXX_FLAGS in CMake-GUI, where N is optional representing the number of cores (without N supplied, the build will use as many cores as available on the device). If you check out the unit tests or the examples make sure to rungit install lfsto make sure thatgit lfsis installed. -
3DSystems Touch Support
To support the 3DSystems Touch (formerly Geomagic Touch or Sensable Phantom Omni) haptic device, follow the steps below:
- Install the OpenHaptics SDK as well as the device drivers:
- Reboot your system.
- Configure your CMake project with the variable
iMSTK_USE_OpenHapticsset toON. - After configuration, the CMake variable
OPENHAPTICS_ROOT_DIRshould be set to the OpenHaptics path on your system.
-
Haply Support
To support the Haply Inverse3 haptic device, follow the steps below:
- Acquire the C++ Haply Hardware API from here.
- Add the Haply Hardware API to your system path with variable name: Haply_SDK_BASE.
- Configure your CMake project with the variable
iMSTK_USE_HAPLYset toON.
Please note the Haply Hardware API is in early stages of development and will be deprecated & changed in the future.
-
VRPN Support
The
VRPNDeviceModuleenables access to a large number devices supported by VRPN. TheVRPNDeviceModuleexpects avrpn_serverto be running. The iMSTK superbuild builds and installs a server with some default settings but if you want to configure a specific server it might be easier to separately build a server. The fileCMake\External\External_VRPN.cmakeshows how to pass configuration into VRPN in case you want to modify the modules enabled and disabled by the buildThe
vrpn.cfgthat is installed by default doesn't have any devices enabled, before use you will need to uncomment the devices that you would like to use. If you use the one inside the iMSTK install directory please note that it will be overwritten every time the superbuild is run.Currently iMSTK supports VRPN
Analog,ButtonandTrackerdevices. Future support will depend on user demand. -
Offscreen Rendering
To render without the usage of a GPU or without the usage of a screen on linux (or WSL), iMSTK's VTK renderer may be built with OSMesa.
- Install osmesa libraries via:
sudo apt install mesa-common-dev libosmesa6-dev libglu1-mesa-dev`- Set
iMSTK_USE_VTK_OSMESAtoON - Proceed to build iMSTK
-
Renderless
To build iMSTK without any rendering & completely as a physics backend, use:
- Set
iMSTK_USE_RENDERING_VTKtoOFF - Set
iMSTK_BUILD_VISUAL_TESTINGtoOFF
- Set