spinalcordtoolbox / disc-labeling-hourglass

Labeling of intervertebral discs using the Hourglass deep learning architecture.
GNU Lesser General Public License v2.1
1 stars 0 forks source link

⚠️‎‎‎ For more information regarding state-of-the-art disc labeling techniques, a recent initiative has led to the creation of an open-source benchmark: the code is available here https://github.com/spinalcordtoolbox/disc-labeling-benchmark

Intervertebral disc labeling with the hourglass approach

Description

This is the continuation of the work made by Reza Azad, Lucas Rouhier, and Julien Cohen-Adad on a deeplearning based architecture called Stacked Hourglass Network to detect and classify vertebral discs automatically on MR images.

Their work was published in a paper called "Stacked Hourglass Network with a Multi-level Attention Mechanism: Where to Look for Intervertebral Disc Labeling" for a MICCAI Workshop in 2021

This repository will be used to train and test the Stacked Hourglass Network in different MR case scenario.

Cross references

In this section are referenced repositories and issues related to this work.

Issues

Older repositories

Getting Started

To get started with this repository, follow the steps below:

  1. Clone the repository to your local machine using the command:

    git clone https://github.com/spinalcordtoolbox/disc-labeling-hourglass.git
    cd disc-labeling-hourglass/
  2. Set up the required environment and dependencies.

    conda create -n myenv python=3.8
    conda activate myenv
    pip install -r requirements.txt
    pip install -e .

    (in development) --> cf https://github.com/spinalcordtoolbox/disc-labeling-hourglass/issues/18

  3. Gather only the relevant images for the training in a TEXT file (The input dataset needs to be in BIDS format): The free multi-center spinegeneric dataset is available in https://github.com/spine-generic/data-multi-subject.

    find ~+ -type f -name *_label*.nii.gz | grep -v MTS | sort > ../../data_config/spinegeneric_vert.txt
    python src/dlh/data_management/init_data_config.py --txt CONFIG_DATA --type LABEL
  4. Train hourglass on the vertebral data

    🐝 Currently the training is monitored using wandb (please check here). Please log using wandb login in the command or train offline with wandb offline before training.

In this example T2 weighted images will be used and 15 classes corresponding to the 15 first discs will be identified by the hourglass network.

python src/dlh/train/main.py --datapath VERTEBRAL_DATA -c t2 --ndiscs 15

Contributions and Feedback

Contributions to this repository are welcome. If you have developed a new method or have improvements to existing methods, please submit a pull request. Additionally, feedback and suggestions for improvement are highly appreciated. Feel free to open an issue to report bugs, propose new features, or ask questions.

License

For more information regarding the license, please refere to the LICENSE file.