Skip to main content

DLMUSE - Deep Learning MUlti-atlas region Segmentation utilizing Ensembles of registration algorithms and parameters

Project description

DLMUSE - Deep Learning MUlti-atlas region Segmentation utilizing Ensembles of registration algorithms and parameters

Overview

DLMUSE uses a trained nnUNet model to compute the segmentation of the brain into MUSE ROIs from the nifti image of the Intra Cranial Volume (ICV - see DLICV method), oriented in LPS orientation. It produces the segmented brain, along with a .csv file of the calculated volumes of each ROI.

Installation

As a python package

pip install DLMUSE

Directly from this repository

git clone https://github.com/CBICA/DLMUSE
cd DLMUSE
conda create -n DLMUSE -y python=3.8 && conda activate DLMUSE
pip install .

Using docker

docker pull aidinisg/dlmuse:0.0.0

Usage

A pre-trained nnUNet model can be found in the DLMUSE-0.0.0 release as an artifact. Feel free to use it under the package's license.

Import as a python package

from DLMUSE.compute_icv import compute_volume

# Assuming your nifti file is named 'input.nii.gz'
volume_image = compute_volume("input.nii.gz", "output.nii.gz", "path/to/model/")

From the terminal

DLMUSE --input input.nii.gz --output output.nii.gz --model path/to/model

Replace the input.nii.gz with the path to your input nifti file, as well as the model path.

Example:

Assuming a file structure like so:

.
├── in   ├── input1.nii.gz
│   ├── input2.nii.gz
│   └── input3.nii.gz
├── model
│   ├── fold_0
│   ├── fold_2
│      ├── debug.json
│      ├── model_final_checkpoint.model
│      ├── model_final_checkpoint.model.pkl
│      ├── model_latest.model
│      ├── model_latest.model.pkl
│   └── plans.pkl
└── out

An example command might be:

DLMUSE --input path/to/input/ --output path/to/output/ --model path/to/model/

Using the docker container

In the docker container, the default model is included, but you can also provide your own.

Without providing a model:

docker run --gpus all -it --rm -v /path/to/local/input:/workspace/input \
                               -v /path/to/local/output:/workspace/output \
                               aidinisg/dlmuse:0.0.0  -i input/ -o output/

Providing a model:

docker run --gpus all -it --rm -v /path/to/local/model:/workspace/model \
                               -v /path/to/local/input:/workspace/input \
                               -v /path/to/local/output:/workspace/output \
                               aidinisg/dlmuse:0.0.0  -i input/ -o output/  --model model/

Contact

For more information, please contact CBICA Software.

For Developers

Contributions are welcome! Please refer to our CONTRIBUTING.md for more information on how to report bugs, suggest enhancements, and contribute code.

If you're a developer looking to contribute, you'll first need to set up a development environment. After cloning the repository, you can install the development dependencies with:

pip install -r requirements-test.txt

This will install the packages required for running tests and formatting code. Please make sure to write tests for new code and run them before submitting a pull request.

Running Tests

You can run the test suite with the following command:

pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

DLMUSE-0.0.1.tar.gz (14.0 kB view hashes)

Uploaded Source

Built Distribution

DLMUSE-0.0.1-py3-none-any.whl (14.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page