Algorithm to predict ischemic stroke lesions from MRI data.
This repository contains an ensemble algorithm devised in the context of the ISLES'22 MICCAI Challenge (https://isles22.grand-challenge.org/). The top-3 leading algorithms are used in a majority-voting scheme to predict outputs.
1.1) Clone this repository.
git clone https://github.com/Tabrisrei/ISLES22_Ensemble.git
cd ISLES22_Ensemble
1.2) Create a conda environment and install dependencies. Note: Mandatory Python version 3.8.0 (!)
conda create --name isles_ensemble python=3.8.0 pip=23.3.1
conda activate isles_ensemble
conda install pytorch==1.11.0 torchvision==0.12.0 torchaudio==0.11.0 cudatoolkit=11.3 -c pytorch
conda install -c conda-forge openslide-python
conda install python=3.8.0 # important, since pytorch triggers the installation of later python versions
pip install -e ./src/SEALS/
pip install -e ./src/FACTORIZER/model/factorizer/
pip install -e ./src/HD-BET
pip install -r requirements.txt
If successfully installed all required packages, you can follow the steps below to download and place the checkpoints.
1.3) Download the model weights from here and decompress the file inside this repo. Your directory should look like:
ISLES22_Ensemble/
├── weights/
│ ├── SEALS/
│ │ └── (...)
│ ├── NVAUTO/
│ │ └── (...)
│ └── FACTORIZER/
│ └── (...)
- Input formats:
.dcm
,.nii
,.nii.gz
,.mha
. - Processing: The algorithm works directly in the native image space — no additional preprocessing required.
- DWI (b=1000): Required
- ADC: Required
- FLAIR: Required for ensemble (optional for single algorithm outputs)
From Python
ENSEMBLE_PATH = 'path-to-isles-ensemble-repo'
import sys
from isles22_ensemble import IslesEnsemble
sys.path.append(ENSEMBLE_PATH)
INPUT_FLAIR = 'path-to-flair.nii.gz'
INPUT_ADC = 'path-to-adc.nii.gz'
INPUT_DWI = 'path-to-dwi.nii.gz'
OUTPUT_PATH = 'path-to-output-folder'
stroke_segm = IslesEnsemble()
stroke_segm.predict_ensemble(ensemble_path=ENSEMBLE_PATH,
input_dwi_path=INPUT_DWI,
input_adc_path=INPUT_ADC,
input_flair_path=INPUT_FLAIR,
output_path=OUTPUT_PATH)
skull_strip
:True
/False
(default:False
) — Perform skull stripping on input images.fast
:True
/False
(default:False
) — Run a single model for faster execution.parallelize
:True
/False
(default:True
) — Up to 50% faster inference on GPUs with ≥12 GB memory.save_team_outputs
:True
/False
(default:False
) — Save outputs of individual models before ensembling.results_mni
:True
/False
(default:False
) — Save images and outputs in MNI.
Try out our algorithm running:
python scripts/predict_scan.py
The example scan belongs to the ISLES'22 dataset (Hernandez Petzsche et al., Sci Data 2022).
If you use this repository, please cite the following publications:
-
de la Rosa, E., Reyes, M., Liew, S. L., Hutton, A., Wiest, R., Kaesmacher, J., ... & Wiestler, B. (2024).
A Robust Ensemble Algorithm for Ischemic Stroke Lesion Segmentation: Generalizability and Clinical Utility Beyond the ISLES Challenge.
arXiv preprint: arXiv:2403.19425 -
Hernandez Petzsche, M. R., de la Rosa, E., Hanning, U., Wiest, R., Valenzuela, W., Reyes, M., ... & Kirschke, J. S. (2022).
ISLES 2022: A multi-center magnetic resonance imaging stroke lesion segmentation dataset.
Scientific Data, 9(1), 762.
-
Algorithm SWAN is based on FACTORIZER. Git repo
Please contact Ezequiel de la Rosa (ezequiel.delarosa@uzh.ch).
- We thank all ISLES'22 challenge participants, collaborators and organizers for allowing this work to happen. We also thank all developers and maintaners of the repos herein used.
- Skull-stripping is done with HD-BET.
- The used FLAIR-MNI atlas is obtained from this paper (https://zenodo.org/records/3379848).