This repository contains implementations of segmentation pipelines proposed by the NeuroPoly lab for the MICCAI 2021 MS New Lesions Segmentation Challenge. The goal of the challenge was to segment the new lesions given two fluid attenuated inversion recovery (FLAIR) images (baseline and follow-up). You can also check our arXiv paper and poster.
This repo has been tested with Python 3.8. Follow the steps below to use this repo:
git clone https://github.com/ivadomed/ms-challenge-2021
cd ms-challenge-2021/
virtualenv -p python3.8 .env
source .env/bin/activate
pip install -r requirements.txt
modeling/README.md
provides documentation on how to run training and evaluation using the codebase.You need
installed for the preprocessing pipeline.
Check this to
see how ANIMA
should be installed and configured in your system.
We used the following script to curate the dataset and make it compatible with the Brain Imaging Data Structure (BIDS) specification:
python scripts/curate_msseg_challenge_2021.py -d PATH_TO_msseg_challenge_2021_DATASET
The preprocessing pipeline for each subject can be found in preprocessing/preprocess_data.sh
.
The quality control (QC) script for this pipeline is preprocessing/qc_preprocess.py
.
Section 3.2 of our arXiv paper describes this pipeline in detail.
You can also check our quality-control (QC) visualizations.
You can find an example preprocessing visualization for a subject below.
The preprocessing steps include:
sct_deepseg_sc
on both sessionsses-01 -> ses-02
) using sct_register_multimodal
with the help of SC segmentation masksbet2
on second sessionses-01 -> ses-02
) using antsRegistration
animaN4BiasCorrection
on both sessionsWe are using sct_run_batch
to perform preprocessing on all subjects:
sct_run_batch -path-data PATH_DATA -path-output PATH_OUTPUT -script preprocessing/preprocess_data.sh -script-args "bet2"
where PATH_DATA
is the path to the BIDS data folder, and PATH_OUTPUT
is where the output of
preprocessing will be saved to. PATH_OUTPUT
will contain data_processed
and qc
(among others) directories after a successful run.
Additionally, you might want to play around with -jobs
and -itk-threads
arguments of
sct_run_batch
to gain speed-ups. -jobs 16 -itk-threads 16
was what we used in joplin
.
After a successful run, next step is to do quality-control (QC):
python preprocessing/qc_preprocess.py -s PATH_OUTPUT -mv
The QC script checks for:
and outputs the following to QC i) brain + SC extraction and ii) registration:
All modeling efforts can be found in modeling/
. modeling/README.md
and section 3.4 of our arXiv paper describe the deep learning architectures used in detail.
Location of the data:
git+ssh://data.neuro.polymtl.ca:msseg_challenge_2021
--> this is the BIDS-converted dataset.