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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.