WMH Quantification
WMHSegmentationPipeline
WMH Segmentation and Quantification Pipeline
__init__
WMH Segmentation and Quantification Pipeline
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
subject
|
BIDSSubject object |
required | |
session
|
BIDSSession object |
required | |
output_path
|
output directory for the pipeline |
required | |
use_which_t1w
|
str
|
specific string to select T1w image, e.g. 'acq-highres'. If None, T1w image is not used |
None
|
use_which_flair
|
str
|
specific string to select FLAIR image, e.g. 'acq-highres'. If None, FLAIR image is not used |
None
|
seg_method
|
str
|
WMH segmentation method, one of ['LST', 'LSTAI', 'WMHSynthSeg', 'truenet'] |
'LST'
|
seg_threshold
|
float
|
threshold for WMH segmentation (not used for WMHSynthSeg method) |
0.5
|
location_method
|
list
|
list of location method, subset of ['Fazekas', 'bullseye', 'shiva', 'McDonald', 'JHU'] |
['Fazekas']
|
ventmask_method
|
str
|
method to get ventricle mask, one of ['SynthSeg'] |
'SynthSeg'
|
use_bianca_mask
|
bool
|
whether to use BIANCA white matter mask to constrain WMH segmentation |
False
|
normalize_to_mni
|
bool
|
whether to normalize the WMH mask to MNI space |
False
|
shape_features
|
bool
|
whether to calculate shape features for each WMH cluster (need normalize_to_mni=True and location_method contains 'Fazekas') |
False
|
extract_from
|
str
|
Folder name to extract results from |
None
|
check_data_requirements
Check data requirements for the pipeline (At least one FLAIR image or T1w image) :return: bool
A more detailed description:
modalities to use
- T1w
- FLAIR
Note on T1w
If T1w is provided, make sure it is a 3D T1w image. In the following description, we will not specify whether T1w is 2D or 3D, as we assume T1w is 3D by default.
We handle T1w and FLAIR images using the following logic: You can provide either a T1w or a FLAIR image, or both (T1w/FLAIR/T1w+FLAIR). If T1w is provided, the segmentation will be performed on the T1w space (if FLAIR is also provided, FLAIR image will be registered to T1w space and then segmented). The concern here is that if the WMH is segmented on FLAIR image and then transformed to T1w space using a linear registration, the edges of the WMH mask may appear jagged or discontinuous.
segmentation methods
Please refer to the table below for the available segmentation methods and their corresponding modalities and notes.
My advice on method selection:
- The sensitivity of the methods (especially the ability to detect WMH lesions in the deep white matter). More generally, the nature of the WMH lesions in your dataset (CSVD-related WMH, MS lesions, etc.). For instance, LST-LPA and LST-AI are based on MS data.
- Whether the method will identify WMH in corpus callosum or not
- The modalities you have (T1w only, FLAIR only, or both T1w and FLAIR)
Currently, you can only choose one method for WMH segmentation. So a possible way to choose a method is to modify the config file and run the pipeline multiple times with different methods, then compare the results.
| method name | seg_method | modalities | notes |
|---|---|---|---|
| LST-LPA | 'LST' | (2D/3D) FLAIR / (2D/3D) FLAIR + T1w | LST. According to my experience, this method can effectively identify PWMH lesions, but may struggle with smaller DWMH. It is a simple and convenient method for WMH segmentation and is applied in various studies. |
| LST-AI | 'LSTAI' | (2D/3D) FLAIR + T1w | LST-AI. Please specify 'LSTAI' rather than 'LST-AI' in the config file (to avoid extra '-', which conflicts with BIDS style). This method is more sensitive to DWMH detection, but may not identify some PWMH. Additionally, attention should be paid to the selection of thresholds, as the resulting probmap is the average of three models, and many values close to 0.33 or 0.66 may appear in the probmap. |
| WMH-SynthSeg | 'WMHSynthSeg' | (2D/3D) FLAIR / T1w | WMH-SynthSeg. The advantages of this method include the ability to obtain 1mm resolution results, even when the input is 2D FLAIR. However, based on my experience, the segmentation performance varies across different FLAIR sequences, and it may exaggerate WMH. |
| FSL truenet | 'truenet' | 3D FLAIR / T1w / 3D FLAIR + T1w | FSL truenet. The advantages of this method include the provision of multiple models, suitable for single-channel FLAIR and T1w or dual-channel FLAIR + T1w, especially FLAIR + T1w will get very good results, but the preprocessing time is relatively long (because it involves steps such as FAST segmentation). |
truenet
We omit the preprocessing steps because we do not involve fine-tuning the model. This can significantly speed up the processing pipeline while achieving similar results.
bianca mask
If 'use_bianca_mask' is set to True, an inclusion mask is applied after the segmentation step (ref: 'The script below creates an example of inclusion mask from T1 images, which excludes cortical GM and the following structures: putamen, globus pallidus, nucleus accumbens, thalamus, brainstem, cerebellum, hippocampus, amygdala. The cortical GM is excluded from the brain mask by extracting the cortical CSF from single-subject’s CSF pve map, dilating it to reach the cortical GM, and excluding these areas. The other structures are identified in MNI space, non-linearly registered to the single-subjects’ images, and removed from the brain mask.' in FSL BIANCA).
Other WMH segmentation methods not included in the pipeline:
- UBO detector
- SHiVAi
- segcsvd
- MARS-WMH
- FSL BIANCA: not included because it requires training data
lateral ventricle mask
'ventmask_method' is used to specify the method for obtaining the lateral ventricle mask, which is required for the Fazekas location method. You can choose one of the following methods: 'SynthSeg'
- 'SynthSeg': use SynthSeg. Now we use a combined mask (plus a lateral ventricle mask from standard space) for better accuracy (see the figure below).

location methods
You can choose one or more location methods to get the location information of WMH.
- 'Fazekas': classify WMH into periventricular WMH (PWMH) and deep WMH (DWMH) based on the distance to the lateral ventricles of each WMH cluster. WMH lesions totally outside the 10mm distance to the lateral ventricles are classified as DWMH. Those totally within 10mm distance or partially within 10mm distance are classified as PWMH (Theoretical should be divided into periventricular WMH and confluent WMH, but simplified to PWMH. See this Keller et al. 1 for more information).
- 'bullseye': calculate WMH volume according a bullseye parcellation scheme (see Sudre et al. 2). Do this classification need precomputed freesurfer recon-all results.
- 'shiva': calculate WMH volume according to the SHIVA parcellation scheme (Shallow, Deep, Perivetricular, Cerebellar, and Brainstem). See shivai for more information.
- 'McDonald': this utilizes the annotation of WMH clusters in LST-AI. It is more suitable for MS lesions.
- 'JHU': this is achieved by non-linearly registering the JHU atlas in standard space to individual space 3. However, it should be noted that common PWMH may not fall within any ROI (in other words, it may be more suitable for subjects with more severe WMH).
normalization to MNI space
If 'normalize_to_mni' is set to True, the WMH segmentation results will be transformed to MNI space using a non-linear registration (SynthMorph).
shape features
If 'shape_features' is set to True, shape features of PWMH and DWMH will be calculated. We refer to the SMART-MR studies (e.g., Keller et al. 1, Ghaznawi et al. 4) and Han et al. 5.
Methodological issues must be considered:
- The simple hypothesis is that WMH lesions will be more complex and irregular as they grow larger. However, WMH in different locations may have different growth patterns. For example, a normal aging-related PWMH lesion may reveal a cap-like shape along the lateral ventricle (Fazekas score 1, assume have 4 WMH clusters in left/right anterior/posterior horn of lateral ventricle, respectively), these WMH clusters may grow and merge to a single large PWMH lesion (Fazekas score 3). So, compare the small and large PWMH lesions directly may not be appropriate (in another word, the shape features may dramatically change when two or more WMH clusters merge).
- If you want to compare the shape features of WMH between different subjects, is it rational to simplely calculate the mean shape features of all WMH clusters in each subject? It seems OK with DWMH clusters, but not for PWMH clusters (see the above point).
References
-
Jasmin Annica Keller, Sigurdur Sigurdsson, Kelly Klaassen, Lydiane Hirschler, Mark A van Buchem, Lenore J Launer, Matthias JP van Osch, Vilmundur Gudnason, and Jeroen de Bresser. White matter hyperintensity shape is associated with long-term dementia risk. Alzheimer's & Dementia, 19(12):5632–5641, 2023. ↩↩
-
Carol H Sudre, B Gomez Anson, Indran Davagnanam, A Schmitt, Alex F Mendelson, F Prados, Lorna Smith, David Atkinson, Alun D Hughes, N Chaturvedi, and others. Bullseye's representation of cerebral white matter hyperintensities. Journal of Neuroradiology, 45(2):114–122, 2018. ↩
-
J Matthijs Biesbroek, Floor AS De Kort, Devasuda Anblagan, Mark E Bastin, Alexa Beiser, Henry Brodaty, Nishi Chaturvedi, Christopher PLH Chen, Bastian Cheng, Ching-Yu Cheng, and others. Signature white matter hyperintensity locations associated with vascular risk factors derived from 15 653 individuals. Stroke, 56(10):3047–3059, 2025. ↩
-
Rashid Ghaznawi, Mirjam I Geerlings, Myriam G Jaarsma-Coes, Maarten HT Zwartbol, Hugo J Kuijf, Yolanda van der Graaf, Theo D Witkamp, Jeroen Hendrikse, and Jeroen de Bresser. The association between lacunes and white matter hyperintensity features on mri: the smart-mr study. Journal of Cerebral Blood Flow & Metabolism, 39(12):2486–2496, 2019. ↩
-
Ji Won Han, Hyunna Lee, Subin Lee, Haejin Kim, Grace Eun Kim, Jong Bin Bae, Seung Wan Suh, Jae Hyoung Kim, and Ki Woong Kim. Association of the irregular 3-dimensional shape of white matter hyperintensities with cognitive function. European Neurology, 84(4):280–287, 2021. ↩