Segmentation and classification library for MRI/CT volumes, powered by ONNX Runtime.
Use it as a Python package, a CLI tool, or a Docker container — backend engine behind Raidionics and Raidionics-Slicer.
This library provides the inference backend for segmenting and classifying central nervous system tumors (and related structures) in MRI/CT volumes. It runs on ONNX Runtime by default (CPU-only), with optional GPU acceleration via onnxruntime-gpu or PyTorch.
It is designed to be used in three ways:
| Mode | Best for |
|---|---|
| Python module | Integrating segmentation into your own pipeline |
| CLI | Quick, scriptable inference from a config file |
| Docker | Reproducible environments, no local Python setup needed |
pip install raidionicssegOr install the latest development version directly from GitHub:
pip install git+https://github.com/dbouget/raidionics_seg_lib.gitOptional extras (only needed for GPU inference):
pip install raidionicsseg[ort-gpu] # ONNX Runtime GPU
pip install raidionicsseg[torch] # PyTorch backend- Copy
blank_main_config.iniand fill in your input/output paths and model selection. - Run inference:
raidionicsseg /path/to/your_config.iniThat's it — see Usage below for the Python API and Docker equivalents.
raidionicsseg CONFIGCONFIG is a path to an .ini file specifying all runtime parameters, following the structure in blank_main_config.ini.
from raidionicsseg import run_model
run_model(config_filename="/path/to/main_config.ini")docker pull dbouget/raidionics-segmenter:v1.5.0-py39-cpu
docker run \
-v /home/<username>/<resources_path>:/workspace/resources \
-t -i --network=host --ipc=host --user $(id -u) \
dbouget/raidionics-segmenter:v1.5.0-py39-cpu \
-c /workspace/resources/<path>/<to>/main_config.ini -v <verbose>This runs CPU-only inference. For GPU support, an interactive shell, path-mapping details, and troubleshooting, see the full Docker guide.
Trained models are downloaded automatically when running Raidionics or Raidionics-Slicer. To browse all available models directly, see the Raidionics-models repository.
To run inference on GPU:
- Configure your machine per the ONNX Runtime CUDA execution provider guide.
- Install
onnxruntime-gpumatching your driver/CUDA version (compatibility table). - Set the
gpu_idparameter in your configuration file to the target GPU.
Run the test suite from within the repository root and your virtual environment:
pip install pytest
pytest tests/If you use Raidionics in your research, please cite the software and the associated papers. Citation metadata is provided in CITATION.cff — click "Cite this repository" in the sidebar for ready-to-use APA/BibTeX formats, covering both the main software release (Scientific Reports, 2023) and the preliminary validation study (Frontiers in Neurology, 2022).
Distributed under the BSD-2-Clause License.