trame-slicer is a Python library bringing 3DSlicer components in trame as a composable library.
It uses 3D Slicer's python wrapping and adds a thin wrapping to make it available with the trame framework.
The API Reference documentation provides API-level documentation.
The API has not been stabilized / reviewed by the 3D Slicer core developers so please use this library with caution.
The library can be installed in a Python environment as follows:
- Setup a Python 3.10-3.13 (included) virtualenv and activate it
- From PyPI
- Use
pip install trame-slicer[standalone]to install the latest release
- Use
- From GitHub
- Git clone the library
- cd into the library
- Use the
pip install -e .[standalone]command to install the library along it's dependencies
- For optimal performances, you should install turbo-jpeg
To get started using trame, please have a look at the introductory trame course.
To start using the trame-slicer library, have a look and run the medical viewer app:
python examples/medical_viewer_app.pyThe following subset of 3D Slicer features are currently supported :
- (limited) file loading
- Volume files (DCM, NRRD, NIFTI, ...)
- Model files (STL, OBJ)
- MRML / MRB files
- Segmentations (NRRD, NIFTI, ...)
- Display
- 2D/3D with 3D Slicer UI manipulation
- Volume Rendering preset / shift
- Bare bone access to 3D Slicer MRML scene and Core logic components
To make it easier for users to use trame-slicer, the following work are in progress :
- Slicer wheel generation merge into 3D Slicer's preview release
- CI changes to build the Slicer wheel along 3D Slicer's release
- 3D Slicer extension to install trame-slicer and launch a trame-slicer server directly from 3D Slicer
ERROR: No matching distribution found for slicer-core
slicer-core is only supported on specific platforms, please check that your OS and Python version are listed on pypi
Contributions are welcomed, please follow the CONTRIBUTING.md file for more information.
The library is distributed with a permissive license. Please look at the LICENSE file for more information.
This library was funded by the following projects :
- Cure Overgrowth Syndromes (COSY) RHU Project (ANR-18-RHUS-005).
- Handling heterogeneous Imaging and signal data for analysing the Neurodevelopmental Trajectories of premature newborns (HINT) ANR project (ANR-22-CE45-0034)
This library was created from the trame-cookicutter library.
If you are interested in learning how you can use trame-slicer for your use case in the near future, or want to get an early start using the framework, don't hesitate to contact us. Or reach out in the issue tracker and 3DSlicer discourse community.
