Bron et al.

From CADDementia
Jump to: navigation, search

Dementia classification of AD, MCI and controls for the CADDementia dataset

E.E. Bron, M. Smits, J.C. van Swieten, W.J. Niessen, S. Klein (Erasmus MC, Rotterdam, the Netherlands)


This algorithm uses features based on voxel-based morphometry and classification using an hard-margin linear SVM classifier. Gray matter density maps of the subjects are computed by multiplying the Jacobian determinant of the deformation field of the transformation from a subject’s scan to template space with the GM probabilistic segmentation. The template space used is a group specific template based on the average of 150 scans. For training, the 30 CADDementia training and in addition 509 subjects from the ADNI database were used. The cohort is adopted from [Cuingnet et al., 2011] and consists of AD patients (n=137), MCI patients (n=210) and CN (n=162). Binary one-versus-one classification were performed with a linear SVM and combined by multiplication and renormalization of the output probabilities.

Stepwise explanation

The complete pipeline can be found in the following scripts: (step 1-4), and (step 5-8). These scripts are available for download.

A step by step description:

1. Run brain extraction (BET)

Explanation: A brain mask is created with BET. This brain mask is suboptimal, and therefore we create a new mask in step 4. But instep 2 and step 4, the BET brain mask is used.

Software: The brain extraction tool (BET) from the FSL Library:


               'bet %s %s -m -n -f 0.5 -B -d'% (in_file, out_file) 

or using

               brain_extraction_and_nuc.main(input_dir, cc, threads,work_subdir)

2. Run N3 non-uniformity correction

Explanation: The T1w scans are non-uniformity corrected. The corrected scans are used only in step 4. The BET brain mask from step 1 is used as input for this step.

Software: N4 bias correction:


               /programs/n4 3 -v 2 -s 4 -c [150,0.00001] -b [50] -i t1w_file –x mask_file -o out_file

or using

               brain_extraction_and_nuc.main(input_dir, cc, threads, work_subdir)

3. Tissue segmentation of WM, GM and CSF with SPM

Explanation: The T1w scans are segmented into the three tissue types.

Software: Unified tissue segmentation method [Ashburner and Friston, 2005] of SPM8 (Statistical Parametric Mapping, London, UK).

Command: SPM batch:


or using

               spm_tissue_segmentation.main(input_dir, cc, threads, work_subdir)

which calls a Matlab function that runs SPM: the scan is registered to MNI space, segmented, and the resulting segmentations are transformed back to the original subject space.

4. Register Hammers atlas to training set

Explanation: The 30 atlas images were registered to the subject’s T1w image using a rigid, affine, and nonrigid B-spline transformation model consecutively. For initialization, the dilated BET brain masks were rigidly registered. Labels were fused using a majority voting algorithm. We use this to make exclude the cerebellum and brain stem from the brain mask. Full explanation can be found in Bron et al. [2014], Section Materials and Methods: Common Template Space and Individual Regions-of-Interest (ROIs).

Software: Elastix ( ) for registration, 30 atlasses with manual outlines ROIs [Hammers et al., 2003; Gousias et al., 2008]

Command: Using

               hammers_registration_subject_mask.main(input_dir, cc, threads, work_subdir, performance, roi_list)

5. Create template space based on 150 T1w images (81 CN, 69 AD) from ADNI.

Explanation: The template space was constructed using a procedure that avoids bias towards any of the individual T1w images. In this approach, the coordinate transformations from the template space to the subject’s T1w space were derived from pairwise image registrations: every scan was registered to every other scan. These pairwise transformations were averaged and used to transform very subject scan to the group average: the template space. The pairwise registrations were performed using a similarity, affine, and nonrigid B spline transformation model consecutively. A similarity transformation is a rigid transformation including isotropic scaling. We defined a common GM mask in template space by combining the GM segmentations of all subjects using majority vote.

Full explanation can be found in Bron et al. [2014], Section Materials and Methods: Common Template Space and Individual Regions-of-Interest (ROIs).

Software: Elastix ( for registration

Command: Using

               create_atlas_cuingnet.main(input_dir, cc,  threads, work_subdir, performance,nomask)

6. Transform other ADNI images and the CADDementia images to the template space

Explanation: Pairwise registrations to the 150 images used in step 5. The average of these transformations were used to transform the other ADNI images and the CADDementia images to template space.

Software: Elastix ( ) for registration

Command: Using

               train_atlas_cuingnet.main(input_dir, train_dir, cc,  threads, work_subdir, performance,nomask)

7. Make GM hard segmentation using SPM probalistic segmentations

Explanation: SPM output probabilistic segmentation for GM, WM, CSF. A hard GM segmentation is made by checking the highest probability for each voxel.

Software: Simple Matlab function

Command: Using

               './hard_gm_segmentation_cluster %s 0' % (input_dir)

8. Transform tissue segmentations to template space

Explanation: Tissue segmentation outputs are transformed to the template space from step 5-6. Software: Elastix (

Command: Using

               transform_tissue_segm.main( input_dir, cc, threads, work_subdir, performance, nomask, use_hard_segmentation, roi_list )

9. Compute features

Explanation: The Jacobian determinant of the deformation field of the transformation to template space of every scan is used. This Jacobian determinant is multiplied by the probabilistic GM segmentation in template space. This value for every voxel in the brain (GM vote mask excluding the cerebellum and brain stem) is used as feature for the classification in the next step.

Software: Elastix (

Command: Using

               construct_voxelwise_features.main( input_dir, cc, threads, work_subdir, performance, nomask, use_hard_segmentation )

10. Do classification

Explanation: A linear SVM classifier is trained on the ADNI subject and the 30 CADDementia train subjects. Three binary classification are made: AD/CN, AD/MCI, and MCI/CN.

Software: Matlab do_classification.mat functions and LibSVM (


               do_classification('gm','vbm','study','process_challenge', 'groups', groups,'cvalue','10000') 

with group in


For running on a computation cluster, the Matlab function could be compiled and ran from a Python script (

Compilation of the Matlab do_classification.m function:

               mcc -R -nodesktop -R -nosplash -I .. -I ~/Matlab/Nifti/ -I ~/Matlab/prtools/prtools/ -I ~/Matlab/libsvm-mat/ -I ~/Matlab/roc/ -m do_classification.m

Submit classification jobs:


The Python script will submit 3x3 jobs: the three pairwise classifications 1) without correction for confounders (but with ICV correction of the features), 2) with correction for age and sex using kernel regression, 3) with correction for age, sex and icv using kernel regression.

The binary classifications should be combined with predict_process_challenge.m. The locations of the output files should be edited in this script. This script will output a file in the format requested by the challenge and can directly be evaluated with the challenge software.


  • Python
  • Matlab, step 3+7+10
  • and by Hakim Achterberg, these parts are specific for our computation cluster and could be replaced.

Download scripts

Scripts are available at the bitbucket repository: Classification scripts (step 10) are not yet included in the repository, but will be added soon.


  • Ashburner J, Friston KJ (2005): Unified segmentation. Neuroimage 26:839–851.
  • Bron EE, Steketee RME, Houston G, Oliver RA, Achterberg HC, Loog M, Van Swieten JC, Hammers A, Niessen WJ, Smits M, Klein S (2014): Diagnostic classification of arterial spin labeling and structural MRI in presenile early-stage dementia. Hum Brain Mapp 35:4916-4931.
  • Cuingnet R, Gerardin E, Tessieras J, Auzias G, Lehericy S, Habert MO, Chupin M, Benali H, Colliot O (2011): Automatic classification of patients with Alzheimer’s disease from structural MRI: A comparison of ten methods using the ADNI database. Neuroimage 56:766–781.
  • Gousias IS, Rueckert D, Heckemann RA, Dyet LE, Boardman JP, Edwards AD, Hammers A (2008): Automatic segmentation of brain MRIs of 2-year-olds into 83 regions of interest. Neuroimage 40:672–684.
  • Hammers A, Allom R, Koepp MJ, Free SL, Myers R, Lemieux L, Mitchell TN, Brooks DJ, Duncan JS (2003): Three-dimensional maximum probability atlas of the human brain, with particular reference to the temporal lobe. Hum Brain Mapp 19:224–247.


If you use this methodology or any of the scripts we would appreciate if you cite the following article:

For questions on the method, please contact Esther Bron,