Name | raidionicsseg JSON |
Version |
1.4.2
JSON |
| download |
home_page | None |
Summary | Raidionics segmentation and classification back-end with ONNX runtime |
upload_time | 2025-07-10 07:47:03 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.9 |
license | BSD-2-Clause |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Raidionics backend for segmentation and classification
[](https://opensource.org/licenses/BSD-2-Clause)
[](https://www.python.org/downloads/)
[](https://www.frontiersin.org/articles/10.3389/fneur.2022.932219/full)
[](https://codecov.io/gh/dbouget/raidionics_seg_lib)
[](https://pypi.org/project/raidionicsseg/)
The code corresponds to the segmentation or classification backend of MRI/CT volumes, using ONNX runtime for inference.
The module can either be used as a Python library, as CLI, or as Docker container. By default, inference is performed on CPU only.
## [Installation](https://github.com/dbouget/raidionics_seg_lib#installation)
```
pip install raidionicsseg
(or)
pip install git+https://github.com/dbouget/raidionics_seg_lib.git
```
## [How to cite](https://github.com/dbouget/raidionics_seg_lib#how-to-cite)
If you are using Raidionics in your research, please cite the following references.
The final software including updated performance metrics for preoperative tumors and introducing postoperative tumor segmentation:
```
@article{bouget2023raidionics,
author = {Bouget, David and Alsinan, Demah and Gaitan, Valeria and Holden Helland, Ragnhild and Pedersen, André and Solheim, Ole and Reinertsen, Ingerid},
year = {2023},
month = {09},
pages = {},
title = {Raidionics: an open software for pre-and postoperative central nervous system tumor segmentation and standardized reporting},
volume = {13},
journal = {Scientific Reports},
doi = {10.1038/s41598-023-42048-7},
}
```
For the preliminary preoperative tumor segmentation validation and software features:
```
@article{bouget2022preoptumorseg,
title={Preoperative Brain Tumor Imaging: Models and Software for Segmentation and Standardized Reporting},
author={Bouget, David and Pedersen, André and Jakola, Asgeir S. and Kavouridis, Vasileios and Emblem, Kyrre E. and Eijgelaar, Roelant S. and Kommers, Ivar and Ardon, Hilko and Barkhof, Frederik and Bello, Lorenzo and Berger, Mitchel S. and Conti Nibali, Marco and Furtner, Julia and Hervey-Jumper, Shawn and Idema, Albert J. S. and Kiesel, Barbara and Kloet, Alfred and Mandonnet, Emmanuel and Müller, Domenique M. J. and Robe, Pierre A. and Rossi, Marco and Sciortino, Tommaso and Van den Brink, Wimar A. and Wagemakers, Michiel and Widhalm, Georg and Witte, Marnix G. and Zwinderman, Aeilko H. and De Witt Hamer, Philip C. and Solheim, Ole and Reinertsen, Ingerid},
journal={Frontiers in Neurology},
volume={13},
year={2022},
url={https://www.frontiersin.org/articles/10.3389/fneur.2022.932219},
doi={10.3389/fneur.2022.932219},
issn={1664-2295}
}
```
# [Usage](https://github.com/dbouget/raidionics_seg_lib#usage)
## [1. CLI](https://github.com/dbouget/raidionics_seg_lib#cli)
```
raidionicsseg CONFIG
```
CONFIG should point to a configuration file (*.ini), specifying all runtime parameters,
according to the pattern from [**blank_main_config.ini**](https://github.com/dbouget/raidionics-seg-lib/blob/master/blank_main_config.ini).
## [2. Python module](https://github.com/dbouget/raidionics_seg_lib#python-module)
```
from raidionicsseg import run_model
run_model(config_filename="/path/to/main_config.ini")
```
## [3. Docker](https://github.com/dbouget/raidionics_seg_lib#docker)
When calling Docker images, the --user flag must be properly used in order for the folders and files created inside
the container to inherit the proper read/write permissions. The user ID is retrieved on-the-fly in the following
examples, but it can be given in a more hard-coded fashion if known by the user.
:warning: The following Docker image can only perform inference using the CPU. Another Docker image has been created, able to leverage
the GPU (see further down below). If the CUDA version does not match your machine, a new Docker image can be built manually,
simply modifying the base torch image to pull from inside Dockerfile_gpu.
```
docker pull dbouget/raidionics-segmenter:v1.4-py39-cpu
```
For opening the Docker image and interacting with it, run:
```
docker run --entrypoint /bin/bash -v /home/<username>/<resources_path>:/workspace/resources -t -i --network=host --ipc=host --user $(id -u) dbouget/raidionics-segmenter:v1.4-py39-cpu
```
The `/home/<username>/<resources_path>` before the column sign has to be changed to match a directory on your local
machine containing the data to expose to the docker image. Namely, it must contain folder(s) with images you want to
run inference on, as long as a folder with the trained models to use, and a destination folder where the results will
be placed.
For launching the Docker image as a CLI, run:
```
docker run -v /home/<username>/<resources_path>:/workspace/resources -t -i --network=host --ipc=host --user $(id -u) dbouget/raidionics-segmenter:v1.4-py39-cpu -c /workspace/resources/<path>/<to>/main_config.ini -v <verbose>
```
The `<path>/<to>/main_config.ini` must point to a valid configuration file on your machine, as a relative path to the `/home/<username>/<resources_path>` described above.
For example, if the file is located on my machine under `/home/myuser/Data/Segmentation/main_config.ini`,
and that `/home/myuser/Data` is the mounted resources partition mounted on the Docker image, the new relative path will be `Segmentation/main_config.ini`.
The `<verbose>` level can be selected from [debug, info, warning, error].
For running models on the GPU inside the Docker image, run the following CLI, with the gpu_id properly filled in the configuration file:
```
docker run -v /home/<username>/<resources_path>:/workspace/resources -t -i --runtime=nvidia --network=host --ipc=host --user $(id -u) dbouget/raidionics-segmenter:v1.4-py39-cuda12.4 -c /workspace/resources/<path>/<to>/main_config.ini -v <verbose>
```
# [Models](https://github.com/dbouget/raidionics_seg_lib#models)
The trained models are automatically downloaded when running Raidionics or Raidionics-Slicer.
Alternatively, all existing Raidionics models can be browsed [here](https://github.com/dbouget/Raidionics-models) directly.
# [Developers](https://github.com/dbouget/raidionics_seg_lib#developers)
For running inference on GPU, your machine must be properly configured (cf. [here](https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html))
In the configuration file, the gpu_id parameter should then point to the GPU that is to be used during inference.
To run the unit tests, type the following within your virtual environment and within the raidionics_seg_lib folder:
```
pip install pytest
pytest tests/
```
Raw data
{
"_id": null,
"home_page": null,
"name": "raidionicsseg",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": null,
"author": null,
"author_email": "David Bouget <david.bouget@sintef.no>",
"download_url": "https://files.pythonhosted.org/packages/6a/e6/669a2d5d858586c86346a86d569fc2df3824f3e0a7e5d8a9175e2b31e2a3/raidionicsseg-1.4.2.tar.gz",
"platform": null,
"description": "# Raidionics backend for segmentation and classification\n\n[](https://opensource.org/licenses/BSD-2-Clause)\n[](https://www.python.org/downloads/)\n[](https://www.frontiersin.org/articles/10.3389/fneur.2022.932219/full)\n[](https://codecov.io/gh/dbouget/raidionics_seg_lib)\n[](https://pypi.org/project/raidionicsseg/)\n\n\nThe code corresponds to the segmentation or classification backend of MRI/CT volumes, using ONNX runtime for inference. \nThe module can either be used as a Python library, as CLI, or as Docker container. By default, inference is performed on CPU only.\n\n## [Installation](https://github.com/dbouget/raidionics_seg_lib#installation)\n\n```\npip install raidionicsseg\n(or)\npip install git+https://github.com/dbouget/raidionics_seg_lib.git\n```\n\n## [How to cite](https://github.com/dbouget/raidionics_seg_lib#how-to-cite)\nIf you are using Raidionics in your research, please cite the following references.\n\nThe final software including updated performance metrics for preoperative tumors and introducing postoperative tumor segmentation:\n```\n@article{bouget2023raidionics,\n author = {Bouget, David and Alsinan, Demah and Gaitan, Valeria and Holden Helland, Ragnhild and Pedersen, Andr\u00e9 and Solheim, Ole and Reinertsen, Ingerid},\n year = {2023},\n month = {09},\n pages = {},\n title = {Raidionics: an open software for pre-and postoperative central nervous system tumor segmentation and standardized reporting},\n volume = {13},\n journal = {Scientific Reports},\n doi = {10.1038/s41598-023-42048-7},\n}\n```\n\nFor the preliminary preoperative tumor segmentation validation and software features:\n```\n@article{bouget2022preoptumorseg,\n title={Preoperative Brain Tumor Imaging: Models and Software for Segmentation and Standardized Reporting},\n author={Bouget, David and Pedersen, Andr\u00e9 and Jakola, Asgeir S. and Kavouridis, Vasileios and Emblem, Kyrre E. and Eijgelaar, Roelant S. and Kommers, Ivar and Ardon, Hilko and Barkhof, Frederik and Bello, Lorenzo and Berger, Mitchel S. and Conti Nibali, Marco and Furtner, Julia and Hervey-Jumper, Shawn and Idema, Albert J. S. and Kiesel, Barbara and Kloet, Alfred and Mandonnet, Emmanuel and M\u00fcller, Domenique M. J. and Robe, Pierre A. and Rossi, Marco and Sciortino, Tommaso and Van den Brink, Wimar A. and Wagemakers, Michiel and Widhalm, Georg and Witte, Marnix G. and Zwinderman, Aeilko H. and De Witt Hamer, Philip C. and Solheim, Ole and Reinertsen, Ingerid},\n journal={Frontiers in Neurology},\n volume={13},\n year={2022},\n url={https://www.frontiersin.org/articles/10.3389/fneur.2022.932219},\n doi={10.3389/fneur.2022.932219},\n issn={1664-2295}\n}\n```\n\n# [Usage](https://github.com/dbouget/raidionics_seg_lib#usage)\n\n## [1. CLI](https://github.com/dbouget/raidionics_seg_lib#cli)\n```\nraidionicsseg CONFIG\n```\n\nCONFIG should point to a configuration file (*.ini), specifying all runtime parameters,\naccording to the pattern from [**blank_main_config.ini**](https://github.com/dbouget/raidionics-seg-lib/blob/master/blank_main_config.ini).\n\n## [2. Python module](https://github.com/dbouget/raidionics_seg_lib#python-module)\n```\nfrom raidionicsseg import run_model\nrun_model(config_filename=\"/path/to/main_config.ini\")\n```\n\n## [3. Docker](https://github.com/dbouget/raidionics_seg_lib#docker)\nWhen calling Docker images, the --user flag must be properly used in order for the folders and files created inside\nthe container to inherit the proper read/write permissions. The user ID is retrieved on-the-fly in the following\nexamples, but it can be given in a more hard-coded fashion if known by the user.\n\n:warning: The following Docker image can only perform inference using the CPU. Another Docker image has been created, able to leverage\nthe GPU (see further down below). If the CUDA version does not match your machine, a new Docker image can be built manually, \nsimply modifying the base torch image to pull from inside Dockerfile_gpu.\n\n```\ndocker pull dbouget/raidionics-segmenter:v1.4-py39-cpu\n```\n\nFor opening the Docker image and interacting with it, run: \n```\ndocker run --entrypoint /bin/bash -v /home/<username>/<resources_path>:/workspace/resources -t -i --network=host --ipc=host --user $(id -u) dbouget/raidionics-segmenter:v1.4-py39-cpu\n```\n\nThe `/home/<username>/<resources_path>` before the column sign has to be changed to match a directory on your local \nmachine containing the data to expose to the docker image. Namely, it must contain folder(s) with images you want to \nrun inference on, as long as a folder with the trained models to use, and a destination folder where the results will \nbe placed.\n\nFor launching the Docker image as a CLI, run: \n```\ndocker run -v /home/<username>/<resources_path>:/workspace/resources -t -i --network=host --ipc=host --user $(id -u) dbouget/raidionics-segmenter:v1.4-py39-cpu -c /workspace/resources/<path>/<to>/main_config.ini -v <verbose>\n```\n\nThe `<path>/<to>/main_config.ini` must point to a valid configuration file on your machine, as a relative path to the `/home/<username>/<resources_path>` described above.\nFor example, if the file is located on my machine under `/home/myuser/Data/Segmentation/main_config.ini`, \nand that `/home/myuser/Data` is the mounted resources partition mounted on the Docker image, the new relative path will be `Segmentation/main_config.ini`. \nThe `<verbose>` level can be selected from [debug, info, warning, error].\n\nFor running models on the GPU inside the Docker image, run the following CLI, with the gpu_id properly filled in the configuration file:\n```\ndocker run -v /home/<username>/<resources_path>:/workspace/resources -t -i --runtime=nvidia --network=host --ipc=host --user $(id -u) dbouget/raidionics-segmenter:v1.4-py39-cuda12.4 -c /workspace/resources/<path>/<to>/main_config.ini -v <verbose>\n```\n\n# [Models](https://github.com/dbouget/raidionics_seg_lib#models)\n\nThe trained models are automatically downloaded when running Raidionics or Raidionics-Slicer. \nAlternatively, all existing Raidionics models can be browsed [here](https://github.com/dbouget/Raidionics-models) directly.\n\n\n# [Developers](https://github.com/dbouget/raidionics_seg_lib#developers)\nFor running inference on GPU, your machine must be properly configured (cf. [here](https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html)) \nIn the configuration file, the gpu_id parameter should then point to the GPU that is to be used during inference.\n\nTo run the unit tests, type the following within your virtual environment and within the raidionics_seg_lib folder:\n```\npip install pytest\npytest tests/\n```\n",
"bugtrack_url": null,
"license": "BSD-2-Clause",
"summary": "Raidionics segmentation and classification back-end with ONNX runtime",
"version": "1.4.2",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "0f94842c2c3b99631c122f416dd1c15ecaa3563a2af39ab4a476e0b6c44a19e6",
"md5": "fec69c8bee408c6f7f23bf57587afe47",
"sha256": "08e4e036da297ebac00f5e1a660a8c550ccd84e8fbda34b42dfc9b6185f9f992"
},
"downloads": -1,
"filename": "raidionicsseg-1.4.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "fec69c8bee408c6f7f23bf57587afe47",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 36035,
"upload_time": "2025-07-10T07:47:02",
"upload_time_iso_8601": "2025-07-10T07:47:02.918090Z",
"url": "https://files.pythonhosted.org/packages/0f/94/842c2c3b99631c122f416dd1c15ecaa3563a2af39ab4a476e0b6c44a19e6/raidionicsseg-1.4.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "6ae6669a2d5d858586c86346a86d569fc2df3824f3e0a7e5d8a9175e2b31e2a3",
"md5": "11273dde8ec63a670ea6265c27569fd8",
"sha256": "ac05b81ce0b589dee3904fdb47ff8456e49a9da267ae870e5df3d5b925a5d0c2"
},
"downloads": -1,
"filename": "raidionicsseg-1.4.2.tar.gz",
"has_sig": false,
"md5_digest": "11273dde8ec63a670ea6265c27569fd8",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 28561,
"upload_time": "2025-07-10T07:47:03",
"upload_time_iso_8601": "2025-07-10T07:47:03.994002Z",
"url": "https://files.pythonhosted.org/packages/6a/e6/669a2d5d858586c86346a86d569fc2df3824f3e0a7e5d8a9175e2b31e2a3/raidionicsseg-1.4.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-10 07:47:03",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "raidionicsseg"
}