https://github.com/cbica/nichart_dlmuse

https://github.com/cbica/nichart_dlmuse

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.6%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

Basic Info
Statistics
  • Stars: 4
  • Watchers: 4
  • Forks: 6
  • Open Issues: 10
  • Releases: 0
Created over 3 years ago · Last pushed 10 months ago
Metadata Files
Readme License

README.rst

NiChart_DLMUSE
==============

.. image:: https://codecov.io/gh/CBICA/NiChart_DLMUSE/graph/badge.svg?token=i5Vyjayoct
   :target: https://codecov.io/gh/CBICA/NiChart_DLMUSE
   :alt: Code Coverage

.. image:: https://github.com/CBICA/NiChart_DLMUSE/actions/workflows/macos_build.yml/badge.svg
   :target: https://github.com/CBICA/NiChart_DLMUSE/actions/workflows/macos_build.yml
   :alt: macOS Build

.. image:: https://github.com/CBICA/NiChart_DLMUSE/actions/workflows/ubuntu_build.yml/badge.svg
   :target: https://github.com/CBICA/NiChart_DLMUSE/actions/workflows/ubuntu_build.yml
   :alt: Ubuntu Build

.. image:: https://img.shields.io/pypi/v/NiChart_DLMUSE
   :target: https://pypi.org/project/NiChart_DLMUSE/
   :alt: PyPI Stable

Overview
--------

**NiChart_DLMUSE** is a package that allows the users to process their brain imaging (sMRI) data easily and efficiently.

NiChart_DLMUSE offers easy ICV (Intra-Cranial Volume) mask extraction, and brain segmentation into ROIs. This is achieved through the `DLICV `_ and `DLMUSE `_ methods. Intermediate step results are saved for easy access to the user.

Given an input (sMRI) scan, NiChart_DLMUSE extracts the following:

  1. ICV mask
  2. Brain MUSE ROI segmentation
  3. ROI volumes in a .csv format
  4. Individual ROI mask (optionally).

This package uses `nnU-Net v2 `_ as a basis model architecture for the deep learning parts, and various other `libraries `_.

Installation
------------

******************************
As a locally installed package
******************************

You can install NiChart DLMUSE from source: ::

    $ git clone https://github.com/CBICA/NiChart_DLMUSE.git
      cd NiChart_DLMUSE
      python3 -m pip install -e .

Or from out latest stable PyPI wheel: ::

    $ pip install NiChart_DLMUSE

(If needed for your system) Install PyTorch with compatible CUDA.
You only need to run this step if you experience errors with CUDA while running NiChart_DLMUSE.
Run "pip uninstall torch torchaudio torchvision".
Then follow the `PyTorch installation instructions `_ for your CUDA version. 
Specific versions are needed for full compatibility. On Linux, download Torch 2.3.1, on Windows install 2.5.1. For example, after installing NiChart_DLMUSE: ::

   $ pip uninstall torch torchvision torchaudio
     pip install torch==2.3.1 --index-url https://download.pytorch.org/whl/cu121

******************
Run NiChart_DLMUSE
******************

Example usage below: ::

    $ NiChart_DLMUSE   -i                    /path/to/input     \
                       -o                    /path/to/output    \
                       -d                    cpu/cuda/mps

Docker/Singularity/Apptainer-based build and installation
---------------------------------------------------------

************
Docker build
************

The package comes already pre-built as a `docker container `_, for convenience. Please see `Usage <#usage>`_ for more information on how to use it. Alternatively, you can build the docker image
locally from the source repo, like so: ::

  $ docker build -t cbica/nichart_dlmuse .

**************************************
(OUTDATED) Singularity/Apptainer build
**************************************

Singularity and Apptainer images can be built for NiChart_DLMUSE, allowing for frozen versions of the pipeline and easier installation for end-users.
Note that the Singularity project recently underwent a rename to "Apptainer", with a commercial fork still existing under the name "Singularity" (confusing!).
Please note that while for now these two versions are largely identical, future versions may diverge. It is recommended to use the AppTainer distribution. For now, these instructions apply to either.

First install `the container engine `_.
Then, from the cloned project repository, run: ::

  $ singularity build nichart_dlmuse.sif singularity.def

This will take some time, but will build a containerized version of your current repo. Be aware that this includes any local changes!
The nichart_dlmuse.sif file can be distributed via direct download, or pushed to a container registry that accepts SIF images.

*****
Usage
*****

Pre-trained nnUNet models for the skull-stripping can be found in `HuggingFace nichart/DLICV `_ and segmentation tasks
can be found in `HuggingFace nichart/DLMUSE `_. Feel free to use it under the package's `license `_.

******************************
As a locally installed package
******************************

A complete command would be (run from the directory of the package): ::

  $ NiChart_DLMUSE -i                    /path/to/input     \
                   -o                    /path/to/output    \
                   -d                    cpu/cuda/mps

For further explanation please refer to the complete documentation: ::

    $ NiChart_DLMUSE -h

Troubleshooting model download failures
---------------------------------------

Our model download process creates several deep directory structures. If you are running on Windows and your model download process fails, it may be due to Windows file path limitations.

To enable long path support in Windows 10, version 1607, and later, the registry key `HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\FileSystem LongPathsEnabled (Type: REG_DWORD)` must exist and be set to 1.

If this affects you, we recommend re-running NiChart_DLMUSE with the `--clear_cache` flag set on the first run.

Using the docker container
--------------------------

Using the file structure explained above, an example command using the `docker container `_ is the following: ::

  # Pull the image for your CUDA version (as needed)
  $ CUDA_VERSION=11.8 docker pull cbica/nichart_dlmuse:1.0.1-cuda${CUDA_VERSION}
  # or, for CPU:
  $ docker pull cbica/nichart_dlmuse:1.0.1

  # Run the container with proper mounts, GPU enabled
  # Place input in /path/to/input/on/host.
  # Replace "-d cuda" with "-d mps" or "-d cpu" as needed...
  # or don't pass at all to automatically use CPU.
  # Each "/path/to/.../on/host" is a placeholder, use your actual paths!
  $ docker run -it --name DLMUSE_inference --rm
      --mount type=bind,source=/path/to/input/on/host,target=/input,readonly
      --mount type=bind,source=/path/to/output/on/host,target=/output
      --gpus all cbica/nichart_dlmuse -d cuda


(OUTDATED) singularity container
------------------------------------------

To use the singularity container, you can just do: ::

    $ singularity run --nv --containall --bind /path/to/.\:/workspace/ nichart_dlmuse.simg NiChart_DLMUSE -i /workspace/temp/nnUNet_raw_data_base/nnUNet_raw_data/ -o /workspace/temp/nnUNet_out -p structural --derived_ROI_mappings_file /NiChart_DLMUSE/shared/dicts/MUSE_mapping_derived_rois.csv --MUSE_ROI_mappings_file /NiChart_DLMUSE/shared/dicts/MUSE_mapping_consecutive_indices.csv --nnUNet_raw_data_base /workspace/temp/nnUNet_raw_data_base/ --nnUNet_preprocessed /workspace/temp/nnUNet_preprocessed/ --model_folder /workspace/temp/nnUNet_model/ --all_in_gpu True --mode fastest --disable_tta

Owner

  • Name: Center for Biomedical Image Computing & Analytics (CBICA)
  • Login: CBICA
  • Kind: organization
  • Email: software@cbica.upenn.edu
  • Location: Philadelphia, PA

CBICA focuses on the development and application of advanced computation techniques.

GitHub Events

Total
  • Issues event: 21
  • Watch event: 1
  • Delete event: 1
  • Issue comment event: 41
  • Push event: 332
  • Pull request event: 29
  • Pull request review event: 14
  • Fork event: 3
  • Create event: 8
Last Year
  • Issues event: 21
  • Watch event: 1
  • Delete event: 1
  • Issue comment event: 41
  • Push event: 332
  • Pull request event: 29
  • Pull request review event: 14
  • Fork event: 3
  • Create event: 8

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 17
  • Total pull requests: 36
  • Average time to close issues: about 2 months
  • Average time to close pull requests: 4 days
  • Total issue authors: 10
  • Total pull request authors: 6
  • Average comments per issue: 1.53
  • Average comments per pull request: 0.42
  • Merged pull requests: 21
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 14
  • Pull requests: 29
  • Average time to close issues: 4 days
  • Average time to close pull requests: 5 days
  • Issue authors: 9
  • Pull request authors: 6
  • Average comments per issue: 1.57
  • Average comments per pull request: 0.52
  • Merged pull requests: 18
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • spirosmaggioros (3)
  • toomanycats (3)
  • euroso97 (3)
  • yuhancui (2)
  • AlexanderGetka-cbica (1)
  • ashishsingh18 (1)
  • tien-tong (1)
  • tientong98 (1)
  • dhivsrin (1)
  • ncbss (1)
Pull Request Authors
  • spirosmaggioros (21)
  • AlexanderGetka-cbica (7)
  • gurayerus (4)
  • euroso97 (2)
  • tien-tong (1)
  • Ouzaixin (1)
Top Labels
Issue Labels
bug (1) docker (1)
Pull Request Labels
enhancement (3) bug (3) parallelization (3) optimization (1) documentation (1) I/O (1)

Packages

  • Total packages: 2
  • Total downloads:
    • pypi 45 last-month
  • Total dependent packages: 0
    (may contain duplicates)
  • Total dependent repositories: 0
    (may contain duplicates)
  • Total versions: 11
  • Total maintainers: 2
pypi.org: ncdlmuse

NCDLMUSE - A BIDS-App wrapper for NiChart DLMUSE for brain segmentation and ICV extraction

  • Homepage: https://github.com/CBICA/BIDS_NiChart_DLMUSE
  • Documentation: https://cbica.github.io/NiChart_DLMUSE
  • License: Copyright (c) 2020-2023, the PENNLINC developers team. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of NiChart_DLMUSE nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  • Latest release: 0.1.0
    published about 1 year ago
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 15 Last month
Rankings
Dependent packages count: 9.0%
Average: 29.9%
Dependent repos count: 50.8%
Maintainers (1)
Last synced: 10 months ago
pypi.org: nichart-dlmuse

Run NiChart_DLMUSE on your data (currently only structural pipeline is supported).

  • Versions: 10
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 30 Last month
Rankings
Dependent packages count: 10.4%
Average: 34.6%
Dependent repos count: 58.8%
Maintainers (1)
Last synced: 10 months ago

Dependencies

.github/workflows/github-repo-stats.yml actions
  • jgehrcke/github-repo-stats RELEASE composite
Dockerfile docker
  • pytorch/pytorch 2.0.1-cuda11.7-cudnn8-runtime build
pyproject.toml pypi
requirements.txt pypi
  • JsonForm ==0.0.2
  • JsonSir ==0.0.2
  • Keras-Preprocessing ==1.1.2
  • Markdown ==3.4.3
  • MarkupSafe ==2.1.3
  • MedPy ==0.4.0
  • Pillow ==9.5.0
  • PyWavelets ==1.4.1
  • PyYAML ==6.0
  • Python-EasyConfig ==0.1.7
  • Resource ==0.2.1
  • SimpleITK ==2.2.1
  • Werkzeug ==2.3.6
  • absl-py ==1.4.0
  • astunparse ==1.6.3
  • attrs ==23.1.0
  • batchgenerators ==0.25
  • cachetools ==5.3.1
  • certifi ==2023.5.7
  • charset-normalizer ==3.1.0
  • ci-info ==0.3.0
  • click ==8.1.3
  • cloudpickle ==2.2.1
  • cycler ==0.11.0
  • decorator ==4.4.2
  • dicom2nifti ==2.4.8
  • dill ==0.3.4
  • etelemetry ==0.3.0
  • filelock ==3.12.2
  • future ==0.18.3
  • gast ==0.3.3
  • google-auth ==2.20.0
  • google-auth-oauthlib ==0.4.6
  • google-pasta ==0.2.0
  • grpcio ==1.54.2
  • h5py ==2.10.0
  • hyperopt ==0.2.5
  • idna ==3.4
  • imageio ==2.31.1
  • importlib-metadata ==6.6.0
  • importlib-resources ==5.12.0
  • isodate ==0.6.1
  • joblib ==1.2.0
  • jsonschema ==4.17.3
  • keras ==2.6.0
  • kiwisolver ==1.4.4
  • linecache2 ==1.0.0
  • looseversion ==1.2.0
  • lxml ==4.9.2
  • matplotlib ==3.3.3
  • networkx ==2.5.1
  • nibabel ==3.2.1
  • nipype ==1.8.6
  • nnunet ==1.7.1
  • numpy ==1.18.5
  • nvidia-cublas-cu11 ==11.10.3.66
  • nvidia-cuda-nvrtc-cu11 ==11.7.99
  • nvidia-cuda-runtime-cu11 ==11.7.99
  • nvidia-cudnn-cu11 ==8.5.0.96
  • oauthlib ==3.2.2
  • opt-einsum ==3.3.0
  • packaging ==23.1
  • pandas ==1.2.5
  • pathlib ==1.0.1
  • pkgutil_resolve_name ==1.3.10
  • protobuf ==3.17.3
  • prov ==2.0.0
  • pyasn1 ==0.5.0
  • pyasn1-modules ==0.3.0
  • pydicom ==2.4.0
  • pydot ==1.4.2
  • pymongo ==3.12.0
  • pyparsing ==3.0.9
  • pyrsistent ==0.19.3
  • python-dateutil ==2.8.2
  • python-gdcm ==3.0.22
  • pytz ==2023.3
  • rdflib ==6.3.2
  • requests ==2.31.0
  • requests-oauthlib ==1.3.1
  • rsa ==4.9
  • scikit-image ==0.19.3
  • scikit-learn ==0.24.2
  • scipy ==1.5.4
  • simplejson ==3.19.1
  • six ==1.16.0
  • tensorboard ==2.11.2
  • tensorboard-data-server ==0.6.1
  • tensorboard-plugin-wit ==1.8.1
  • tensorflow ==2.3.3
  • tensorflow-addons ==0.13.0
  • tensorflow-estimator ==2.3.0
  • termcolor ==2.3.0
  • threadpoolctl ==3.1.0
  • tifffile ==2023.4.12
  • torch ==1.13.1
  • tqdm ==4.65.0
  • traceback2 ==1.4.0
  • traits ==6.3.2
  • typeguard ==4.0.0
  • typing_extensions ==4.6.3
  • unittest2 ==1.1.0
  • urllib3 ==1.26.16
  • wrapt ==1.15.0
  • zipp ==3.15.0
setup.py pypi
  • batchgenerators >=0.23
  • dicom2nifti *
  • dill >=0.3.4
  • h5py *
  • hyperopt ==0.2.5
  • keras ==2.6.0
  • matplotlib >=3.3.3
  • medpy *
  • networkx >=2.5.1
  • nibabel ==3.2.1
  • nipype *
  • nnunet *
  • numpy *
  • pandas ==1.2.5
  • pathlib *
  • protobuf ==3.17.3
  • pymongo ==3.12.0
  • requests *
  • resource ==0.2.1
  • scikit-image >=0.14
  • scikit-learn *
  • scipy *
  • setuptools *
  • tifffile *
  • torch *
  • torch ==1.10
  • tqdm *