White Matter Hypointensities lesions for T1-weighted MRI images.
It relies on a Convolutional Neural Network pre-trained on FLAIR segmentations using the large JPSC-AD cohort.
For background and technical details about its creation, refers to this corresponding Human Brain Mapping manuscript: http://doi.org/10.1002/hbm.25899
This program requires Python 3, with the PyTorch library
No GPU is required
Just clone or download this repository.
If you have the uv packaging tool ( https://docs.astral.sh/uv/ ), you can do
uv run deepwmh.py t1_image.nii.gz
which should take care of downloading the dependencies in the first run.
Otherwise, you need to setup a python3 environment on your machine : in addition to PyTorch, scipy and nibabel are required.
If not pre-installed, you could use uv or Anaconda ( https://www.anaconda.com ) to to install python3, then
- install scipy and nibabel (
conda install scipy nibabel
orpip install scipy nibabel
) - get pytorch for Python/CPU from
https://pytorch.org/get-started/locally/
. CUDA is not necessary.
To use the program, simply call:
./deepwmh.sh t1_image.nii.gz
(or it can be added to your PATH)
To process multiple subjects, pass them as multiple arguments.
deepwmh.sh subject_*.nii.gz
.
(or uv run deepwmh.py subject_*.nii.gz
)
The resulting WMH segmentation mask will be named t1_image_mask_wmh.nii.gz, and t1_image_mask_ROIs.nii.gz for the region labels (periventricular, deep-white, infracortical). The lesion total and regional volumes statistics are available in t1_image_wmh_in_lrois.csv.
If multiple input images were specified, a summary table is generated as all_subjects_wmh_report.csv
Optionally, adding "-v" (verbose) in the command line will output more images, including the non-thresholded (probabilistic, 0-255) WMH-lesion segmentation output, named t1_image_prob_wmh.nii.gz , as well as an approximate brain mask (the same as hippodeep).
This program is MIT Licensed
Please consider citing the Human Brain Mapping manuscript: http://doi.org/10.1002/hbm.25899