⚠️ 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
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.
In this section are referenced repositories and issues related to this work.
- Summary issue by @joshuacwnewton on the work previously done to replace the current
sct_label_vertebrae
.
- Original hourglass work done by @rezazad68.
- Method comparison between hourglass and the current non deepllearning based method
sct_label_vertebrae
implemented in the spinalcordtoolbox. - Retrained model by @joshuacwnewton to fix straight vs. curved input data issues.
To get started with this repository, follow the steps below:
- Clone the repository to your local machine using the command:
git clone https://github.com/spinalcordtoolbox/disc-labeling-hourglass.git
cd disc-labeling-hourglass/
- 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 #18
- 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
- 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 withwandb 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 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.
For more information regarding the license, please refere to the LICENSE file.