Skip to main content

trame-slicer

Welcome to trame-slicer

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.

Test and Release PyPI PyPI - Downloads GitHub stars Documentation Status codecov

Usage

The API Reference documentation provides API-level documentation.

Warning

The API has not been stabilized / reviewed by the 3D Slicer core developers so please use this library with caution.

Installing

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
  • 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

Getting started

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 -m trame_slicer.app.medical_viewer_app

Features

The following subset of 3D Slicer features are currently supported :

Views

  • 3D view
    • Volume rendering
    • Color presets / shift
  • 2D/slice view
    • Scroll/Zoom/Pan
    • Window Leveling (W/L)
    • Multiplanar Reformation (MPR)
    • Slice/slab thickness (MIP, MinIP, AvergageIP)
  • Any other view types (e.g. plotly)

Layouts

  • Conventional, four-up, side-by-side
  • Fullscreen mode
  • Custom layouts

I/O

  • DICOM
    • MRI, CT, US, XR, PET, DWI…
  • Scalar volumes
    • NRRD, NII, TIFF, HDR, IMG, MHA…
  • Segmentation
    • SEG.NRRD, NRRD, SEG.NHDR, NHDR, NII, NII.GZ, HDR…
  • Models/Meshes
    • OBJ, STL, VTK, VTP…
  • 3D Slicer scene
    • MRML, MRB

Segmentation tools

Segmentation effects

  • Paint: free-hand brush, 2D or 3D, varying radius
  • Erase: invert paint
  • Scissors: 2D or 3D sculpting
  • Draw: fill the area of a drawn contour
  • LogicalOperators: binary combination of segments
  • Threshold: create segment based on intensity values
  • Islands: keep largest, smallest… connected-components
  • Smoothing: apply gaussian blur on existing segments
  • Volume Intensity Masking: define a ROI with threshold where other segmentation tools work into
  • Undo/Redo

Markups

Description

  • Fiducials/points
  • Ruler/lines
  • Angle
  • Open curve/spline
  • Close curve
  • Plane
  • ROI/box

Work in progress

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

Troubleshooting

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

Contributing

Contributions are welcomed, please follow the CONTRIBUTING.md file for more information.

License

The library is distributed with a permissive license. Please look at the LICENSE file for more information.

Acknowledgments

This library was funded by the following projects :

This library was created from the trame-cookicutter library.

Contact

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

trame_slicer-1.12.1.tar.gz (2.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

trame_slicer-1.12.1-py3-none-any.whl (1.1 MB view details)

Uploaded Python 3

File details

Details for the file trame_slicer-1.12.1.tar.gz.

File metadata

  • Download URL: trame_slicer-1.12.1.tar.gz
  • Upload date:
  • Size: 2.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for trame_slicer-1.12.1.tar.gz
Algorithm Hash digest
SHA256 35c9df3df30f1ce509d426c3c85607e2ab9f3cb30983251a5f13f754a4e1424b
MD5 28e99d6849221bca13cfa0c4175afb57
BLAKE2b-256 591e0002e51b32c3c122e06216ed22260e4e4c8e0f983823deb279b1c07f3685

See more details on using hashes here.

Provenance

The following attestation bundles were made for trame_slicer-1.12.1.tar.gz:

Publisher: release.yml on KitwareMedical/trame-slicer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file trame_slicer-1.12.1-py3-none-any.whl.

File metadata

  • Download URL: trame_slicer-1.12.1-py3-none-any.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for trame_slicer-1.12.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7d60e21af6bf17a3044acd324ca9a32b1738d43d0edf9e55ea1898001f9efb43
MD5 93dabb4efd0bb7a4d571c5a3fa720b4c
BLAKE2b-256 8ad57e578b317f26900b35839d07167d08674d3b89d26af8b2b3ecdab2cfacd2

See more details on using hashes here.

Provenance

The following attestation bundles were made for trame_slicer-1.12.1-py3-none-any.whl:

Publisher: release.yml on KitwareMedical/trame-slicer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

1.12.3

2 files

1.12.2

2 files

This release

1.12.1 This release

2 files

1.12.0

2 files

1.11.0

2 files

1.10.0

2 files

1.9.0

2 files

1.8.0

2 files

1.7.2

2 files

1.7.1

2 files

1.7.0

2 files

1.6.3

2 files

1.6.2

2 files

1.6.1

2 files

1.6.0

2 files

1.5.1

2 files

1.5.0

2 files

1.4.0

2 files

1.3.0

2 files

1.2.0

2 files

1.1.0

2 files

1.0.0

2 files

0.7.1

2 files

0.7.0

2 files

0.6.0

2 files

0.5.0

2 files

0.4.0

2 files

0.3.0

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page