Backend for k-fold cross-validation and metrics computation over 2D-3D medical data.
Part of the Raidionics ecosystem.
This library computes cross-validation performance and segmentation metrics for the Raidionics ecosystem. It supports both 2D and 3D inputs and can run for multiple segmentation classes simultaneously.
It can be used in three ways:
| Mode | Best for |
|---|---|
| Python module | Integrating metrics computation into your own pipeline |
| CLI | Quick, scriptable runs from a config file |
| Docker | Reproducible environments, no local Python setup needed |
⚠️ The only hard requirement is that your data follows the expected folder structure. For custom structures,kfold_model_validation.pyis the place to start adapting the code.
pip install raidionicsvalOr install the latest development version directly from GitHub:
pip install git+https://github.com/dbouget/validation_metrics_computation.gitcd /path/to/validation_metrics_computation
cp blank_main_config.ini main_config.iniEdit main_config.ini with your paths and parameters (see Utils/resources.py for a full description of every field), then run the validation task first, followed by the study task:
raidionicsval -c main_config.iniTwo Jupyter notebooks demonstrate the library end-to-end:
| Notebook | Colab | GitHub |
|---|---|---|
| Validation | View | |
| Study | View |
A sample dataset for testing is available here.
raidionicsval -c CONFIG (-v debug)CONFIG must point to a valid .ini configuration file.
from raidionicsval import compute
compute(config_filename="/path/to/main_config.ini")docker pull dbouget/raidionics-val:v1.1.1-py39-cpu
docker run \
-v /home/<username>/<resources_path>:/workspace/resources \
-t -i --network=host --ipc=host --user $(id -u) \
dbouget/raidionics-val:v1.1.1-py39-cpu \
-c /workspace/resources/<path>/<to>/main_config.ini -v <verbose>For the interactive shell variant, permission notes, and path-mapping details, see the full Docker guide.
Full details on expected folder layouts, naming conventions, and the cross-validation folds file are documented in docs/data_format.md, covering:
- Original data folder structure (index-based and non-index-based)
- Inference results folder structure
- The
cross_validation_folds.txtfile format
If you use Raidionics in your research, please cite the software and 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 validation/metrics methodology (Frontiers in Neurology, 2022) and the main software release (Scientific Reports, 2023).
Distributed under the BSD-2-Clause License.