# DLMUSE - Deep Learning MUlti-atlas region Segmentation utilizing Ensembles of registration algorithms and parameters
## Overview
DLMUSE uses a trained [nnUNet](https://github.com/MIC-DKFZ/nnUNet/tree/nnunetv1) model to compute the segmentation of the brain into [MUSE](https://www.med.upenn.edu/cbica/sbia/muse.html) ROIs from the nifti image of the Intra Cranial Volume (ICV - see [DLICV method](https://github.com/CBICA/DLICV)), 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
```bash
pip install DLMUSE
```
### Directly from this repository
```bash
git clone https://github.com/CBICA/DLMUSE
cd DLMUSE
conda create -n DLMUSE -y python=3.8 && conda activate DLMUSE
pip install .
```
### Using docker
```bash
docker pull aidinisg/dlmuse:0.0.0
```
## Usage
A pre-trained nnUNet model can be found in the [DLMUSE-0.0.0 release](https://github.com/CBICA/DLMUSE/releases/tag/v0.0.0) as an [artifact](https://github.com/CBICA/DLMUSE/releases/download/v0.0.0/model.zip). Feel free to use it under the package's [license](LICENSE).
### Import as a python package
```python
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
```bash
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:
```bash
.
├── 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:
```bash
DLMUSE --input path/to/input/ --output path/to/output/ --model path/to/model/
```
### Using the docker container
In the [docker container](https://hub.docker.com/repository/docker/aidinisg/dlmuse/general), the default model is included, but you can also provide your own.
Without providing a model:
```bash
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:
```bash
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](mailto:software@cbica.upenn.edu).
## For Developers
Contributions are welcome! Please refer to our [CONTRIBUTING.md](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:
```bash
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:
```bash
pytest
```
Raw data
{
"_id": null,
"home_page": "https://github.com/CBICA/DLMUSE/",
"name": "DLMUSE",
"maintainer": "George Aidinis",
"docs_url": null,
"requires_python": "",
"maintainer_email": "aidinisg@pennmedicine.upenn.edu",
"keywords": "deep learning,image segmentation,semantic segmentation,medical image analysis,medical image segmentation,nnU-Net,nnunet",
"author": "Ashish Singh, Guray Erus, Vishnu Bashyam, George Aidinis",
"author_email": "software@cbica.upenn.edu",
"download_url": "https://files.pythonhosted.org/packages/db/60/3eaea25dba744ef14d17a76b119925ec633c96377fc84d97128a4526e4f0/DLMUSE-0.0.1.tar.gz",
"platform": null,
"description": "# DLMUSE - Deep Learning MUlti-atlas region Segmentation utilizing Ensembles of registration algorithms and parameters\n\n## Overview\n\nDLMUSE uses a trained [nnUNet](https://github.com/MIC-DKFZ/nnUNet/tree/nnunetv1) model to compute the segmentation of the brain into [MUSE](https://www.med.upenn.edu/cbica/sbia/muse.html) ROIs from the nifti image of the Intra Cranial Volume (ICV - see [DLICV method](https://github.com/CBICA/DLICV)), oriented in _**LPS**_ orientation. It produces the segmented brain, along with a .csv file of the calculated volumes of each ROI. \n\n## Installation\n\n### As a python package\n\n```bash\npip install DLMUSE\n```\n\n### Directly from this repository\n\n```bash\ngit clone https://github.com/CBICA/DLMUSE\ncd DLMUSE\nconda create -n DLMUSE -y python=3.8 && conda activate DLMUSE\npip install .\n```\n\n### Using docker\n\n```bash\ndocker pull aidinisg/dlmuse:0.0.0\n```\n\n## Usage\n\nA pre-trained nnUNet model can be found in the [DLMUSE-0.0.0 release](https://github.com/CBICA/DLMUSE/releases/tag/v0.0.0) as an [artifact](https://github.com/CBICA/DLMUSE/releases/download/v0.0.0/model.zip). Feel free to use it under the package's [license](LICENSE).\n\n### Import as a python package\n\n```python\nfrom DLMUSE.compute_icv import compute_volume\n\n# Assuming your nifti file is named 'input.nii.gz'\nvolume_image = compute_volume(\"input.nii.gz\", \"output.nii.gz\", \"path/to/model/\")\n```\n\n### From the terminal\n\n```bash\nDLMUSE --input input.nii.gz --output output.nii.gz --model path/to/model\n```\n\nReplace the `input.nii.gz` with the path to your input nifti file, as well as the model path.\n\nExample:\n\nAssuming a file structure like so:\n\n```bash\n.\n\u251c\u2500\u2500 in\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 input1.nii.gz\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 input2.nii.gz\n\u2502\u00a0\u00a0 \u2514\u2500\u2500 input3.nii.gz\n\u251c\u2500\u2500 model\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 fold_0\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 fold_2\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 debug.json\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 model_final_checkpoint.model\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 model_final_checkpoint.model.pkl\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 model_latest.model\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 model_latest.model.pkl\n\u2502\u00a0\u00a0 \u2514\u2500\u2500 plans.pkl\n\u2514\u2500\u2500 out\n```\n\nAn example command might be:\n\n```bash\nDLMUSE --input path/to/input/ --output path/to/output/ --model path/to/model/\n```\n\n### Using the docker container\n\nIn the [docker container](https://hub.docker.com/repository/docker/aidinisg/dlmuse/general), the default model is included, but you can also provide your own.\n\nWithout providing a model:\n\n```bash\ndocker run --gpus all -it --rm -v /path/to/local/input:/workspace/input \\\n -v /path/to/local/output:/workspace/output \\\n aidinisg/dlmuse:0.0.0 -i input/ -o output/\n```\n\nProviding a model:\n\n```bash\ndocker run --gpus all -it --rm -v /path/to/local/model:/workspace/model \\\n -v /path/to/local/input:/workspace/input \\\n -v /path/to/local/output:/workspace/output \\\n aidinisg/dlmuse:0.0.0 -i input/ -o output/ --model model/\n```\n\n## Contact\n\nFor more information, please contact [CBICA Software](mailto:software@cbica.upenn.edu).\n\n## For Developers\n\nContributions are welcome! Please refer to our [CONTRIBUTING.md](CONTRIBUTING.md) for more information on how to report bugs, suggest enhancements, and contribute code.\n\nIf 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:\n\n```bash\npip install -r requirements-test.txt\n```\n\nThis 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.\n\n### Running Tests\n\nYou can run the test suite with the following command:\n\n```bash\npytest\n```\n",
"bugtrack_url": null,
"license": "By installing/using DeepMRSeg, the user agrees to the following license: See https://www.med.upenn.edu/cbica/software-agreement-non-commercial.html",
"summary": "DLMUSE - Deep Learning MUlti-atlas region Segmentation utilizing Ensembles of registration algorithms and parameters",
"version": "0.0.1",
"project_urls": {
"Download": "https://github.com/CBICA/DLMUSE/",
"Homepage": "https://github.com/CBICA/DLMUSE/"
},
"split_keywords": [
"deep learning",
"image segmentation",
"semantic segmentation",
"medical image analysis",
"medical image segmentation",
"nnu-net",
"nnunet"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "54ca06008db63fec233521e5be336304021f99b7b4894292dc65d3c7a8c97870",
"md5": "dc52d07cb82094b210569722d23752be",
"sha256": "c652f645a93391b36199e799d8d2e7c1d10bf6c678f8a3a541f594ec428cad5c"
},
"downloads": -1,
"filename": "DLMUSE-0.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "dc52d07cb82094b210569722d23752be",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 14863,
"upload_time": "2023-11-09T21:41:42",
"upload_time_iso_8601": "2023-11-09T21:41:42.088347Z",
"url": "https://files.pythonhosted.org/packages/54/ca/06008db63fec233521e5be336304021f99b7b4894292dc65d3c7a8c97870/DLMUSE-0.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "db603eaea25dba744ef14d17a76b119925ec633c96377fc84d97128a4526e4f0",
"md5": "4f7f86536ec7bc87ff3c2dc748844f5b",
"sha256": "4e868d23896c1ff990431338f9355a15ae97bb0104967d8dff8061afb8f2ef79"
},
"downloads": -1,
"filename": "DLMUSE-0.0.1.tar.gz",
"has_sig": false,
"md5_digest": "4f7f86536ec7bc87ff3c2dc748844f5b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 14039,
"upload_time": "2023-11-09T21:41:43",
"upload_time_iso_8601": "2023-11-09T21:41:43.522391Z",
"url": "https://files.pythonhosted.org/packages/db/60/3eaea25dba744ef14d17a76b119925ec633c96377fc84d97128a4526e4f0/DLMUSE-0.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-11-09 21:41:43",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "CBICA",
"github_project": "DLMUSE",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "dlmuse"
}