SPM Masking Toolbox

This page provides software to accompany the article:

Ridgway et al., (2009)
Ridgway, G.; Omar, R.; Ourselin, S.; Hill, D.; Warren, J. & Fox, N. (2009)
Issues with threshold masking in voxel-based morphometry of atrophied brains.
NeuroImage 44(1):99-111

In essence, the paper highlights a problem with the use of absolute or relative threshold masking in SPM, and proposes two alternative solutions: an automatic mask-creation strategy that attempts to find an optimal threshold to binarise an average image; and a more flexible method that allows expert control of the mask.

The toolbox implements both these strategies, in the functions opt_thresh and make_majority_mask. These MATLAB functions should work under SPM2, SPM5, and SPM8. They are unlikely to work in SPM99 or earlier.

Under SPM5 and SPM8 there is a GUI for the automatic optimal-thresholding method. Under SPM2, or to use the majority-masking strategy with any version of SPM, you will need to call the functions from the MATLAB command window.

The resultant mask should be specified as an explicit mask when setting up the statistical model in SPM.

Go explicit... you'll sleep better at night. — Tom Nichols, 28 Feb 2006, SPM mailing list post.

Please cite the above paper if you find the toolbox useful. Please also cite Luo & Nichols (2003), the paper describing the SPMd Toolbox, if you use the anti-mode method of automatic thresholding instead of the default correlation-based one.

Downloading and using


Please contact me if you find any bugs, or have any suggestions to improve the toolbox.

Valid XHTML 1.0 Transitional Valid CSS!