Skip to content

About

Backend segmentation/classification library (using ONNX runtime) for Raidionics

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Repository files navigation

Raidionics Segmentation Backend

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.

PyPI version Python License codecov Paper


Table of contents


Overview

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

Installation

pip install raidionicsseg

Or install the latest development version directly from GitHub:

pip install git+https://github.com/dbouget/raidionics_seg_lib.git

Optional extras (only needed for GPU inference):

pip install raidionicsseg[ort-gpu]   # ONNX Runtime GPU
pip install raidionicsseg[torch]     # PyTorch backend

Quick start

  1. Copy blank_main_config.ini and fill in your input/output paths and model selection.
  2. Run inference:
raidionicsseg /path/to/your_config.ini

That's it — see Usage below for the Python API and Docker equivalents.


Usage

CLI

raidionicsseg CONFIG

CONFIG is a path to an .ini file specifying all runtime parameters, following the structure in blank_main_config.ini.

Python module

from raidionicsseg import run_model

run_model(config_filename="/path/to/main_config.ini")

Docker

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.


Models

Trained models are downloaded automatically when running Raidionics or Raidionics-Slicer. To browse all available models directly, see the Raidionics-models repository.


GPU support

To run inference on GPU:

  1. Configure your machine per the ONNX Runtime CUDA execution provider guide.
  2. Install onnxruntime-gpu matching your driver/CUDA version (compatibility table).
  3. Set the gpu_id parameter in your configuration file to the target GPU.

Development

Run the test suite from within the repository root and your virtual environment:

pip install pytest
pytest tests/

How to cite

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).


License

Distributed under the BSD-2-Clause License.

About

Backend segmentation/classification library (using ONNX runtime) for Raidionics

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages