Skip to main content

GlioMODA

Python Versions Stable Version Documentation Status tests codecov License

Features

Installation

With a Python 3.10+ environment, you can install gliomoda directly from PyPI:

pip install gliomoda

Data Requirements

GlioMODA is trained on BraTS (Brain Tumor Segmentation) preprocessed images. This preprocessing typically includes co-registration to the T1c, skull stripping (brain extraction), and registration to the SRI-24 brain atlas (template).

We recommend using the preprocessing package, part of the BrainLesion Suite, to design custom preprocessing pipelines tailored to your specific needs.

Alternatively, if you have the full set of MRI modalities (T1, T1c, T2, FLAIR), you can use glioma-specific preprocessing functions from the BraTS Orchestrator.

Use Cases and Tutorials

A minimal example to create a segmentation could look like this:

from gliomoda import Inferer

inferer = Inferer()

# Save NIfTI files
inferer.infer(
    t1c="path/to/t1c.nii.gz",
    t2f="path/to/t2f.nii.gz",
    t1n="path/to/t1n.nii.gz",
    t2w="path/to/t2w.nii.gz",
    segmentation_file="path/to/segmentation.nii.gz",
)

# Or directly use pre-loaded NumPy data. (Both works as well)
segmentation_np = inferer.infer(
    t1c=t1c_np,
    t2f=t2f_np,
    t1n=t1n_np,
    t2w=t2w_np,
)

[!NOTE] If you're interested in the GlioMODA package, the BraTS Adult Glioma Segmentation may also be of interest.

Citation

If you use GlioMODA in your research, please cite it to support the development!

TODO: citation will be added asap

Trouble shoot

Multiprocessing error

If you get an error related to something like this:

RuntimeError: 
        An attempt has been made to start a new process before the
        current process has finished its bootstrapping phase.

        This probably means that you are not using fork to start your
        child processes and you have forgotten to use the proper idiom
        in the main module:

            if __name__ == '__main__':
                freeze_support()
                ...

        The "freeze_support()" line can be omitted if the program
        is not going to be frozen to produce an executable.

        To fix this issue, refer to the "Safe importing of main module"
        section in https://docs.python.org/3/library/multiprocessing.html

Please ensure you properly wrap your script:

if __name__ == "__main__":
    inferer = Inferer()
    ...

Contributing

We welcome all kinds of contributions from the community!

Reporting Bugs, Feature Requests and Questions

Please open a new issue here.

Code contributions

Nice to have you on board! Please have a look at our CONTRIBUTING.md file.

Metadata

Release files for gliomoda 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gliomoda 0.0.4
File Size Uploaded
gliomoda-0.0.4.tar.gz 11.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gliomoda 0.0.4
File Interpreter ABI Platform
gliomoda-0.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 22.7 kB

Release files / gliomoda-0.0.4.tar.gz

Download URL gliomoda-0.0.4.tar.gz
Size 11.0 kB
Tags Source
SHA-256 checksum
How to use checksums
359984e363d5c050e40bcf3fce486c2c3a465b2e4026779a793f00ac3d8285b0
BLAKE2b-256 checksum
How to use checksums
6f1e4c60e43741faa975798707e8eb08191ffc70f89e4b77fe6c24fdb3473aef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Release files / gliomoda-0.0.4-py3-none-any.whl

Download URL gliomoda-0.0.4-py3-none-any.whl
Size 11.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
15e2e76d825cf7292dee0f1765bbd9a9c2dae9b6b491b7d51d9a48f2d0250a80
BLAKE2b-256 checksum
How to use checksums
d687e1fe602f0d0a46389729ecf805f02af254ccf768cbdb0916cc5809e5af4a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Release history Release notifications | RSS feed

This release

0.0.4 This release

2 release files

0.0.3

2 release files

0.0.2

1 release file

0.0.1

1 release file

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