NOTES FOR RUNNING VOXEL-BASED MORPHOMETRY (VBM)
These tools are based on scripts of John Ashburner and were modified for own use to have some more options.
These updates and notes are from Christian Gaser.  You need SPM2 to run this code.


Creating customized template

It is recommended to use your own templates because:
1) The contrast of your MR images might differ from the existing template.
2) The demographics of your subject population might differ from those used to generate the existing template.
3) Each scanner introduces specific non-uniformities in image intensity and inhomogeneities in B0 field.

The function cg_create_template.m will create a customized template (T1.img) and prior images of gray and white 
matter and CSF (gray.img/white.img/csf.img). These images are already smoothed with FWHM of 8 mm for use with 
cg_vbm_optimized.m.

After starting cg_create_template.m you will be asked to either segment images and create template and prior 
images or to use previously segmented images to create template and priors. The first option will calculate your 
template and the priors, but will also save the temporary (warped and the segmented) images. If you have created 
your template and your are not satisfied with this result you can use the second option to exclude some images 
from template calculation.

This function will save the following files:
T1.imgcustomized T1 template, smoothed with FWHM of 8mm
gray.imggray matter prior image, smoothed with FWHM of 8mm
white.imgwhite matter prior image, smoothed with FWHM of 8mm
csf.imgCSF prior image, smoothed with FWHM of 8mm

and the temporary files (which can be removed after finishing the template calculation):
w*.imgwarped raw imagew*_seg1.imggray matter of warped image
w*_seg2.imgwhite matter of warped imagew*_seg3.imgCSF of warped image

Optimized VBM procedure
The modified procedure of Good et al., 2001 extends the VBM procedure by the following ideas:
1) Improving spatial normalization by use of gray matter images and a gray matter template rather than anatomical (T1) images
2) Cleaning up of partitions by applying morphological operations
3) Optional modulation of partitions to preserve the total amount of signal in the images

The function cg_vbm_optimized.m will normalize and segment your raw images according to the optimized VBM 
procedure. You are asked for the raw (non-normalized) images to be analyzed and the template and prior images. 
If you have used cg_create_template.m select the new created T1.img image as T1 template for nonlinear normalization 
and the gray/white/csf.img images as prior images respectively. Pay attention to the right order of your selections. 
The use of own prior images is recommended if the gray and white matter distribution is very different from a normal 
population (e.g. children, Alzheimer's disease).

This function will save the following files:
  w*.img       warped raw image
 Gw*.img      gray matter of warped raw image
 Ww*.img      white matter of warped raw image
 Cw*.img      CSF of warped raw image
 m[GWC]w*.img    modulated segmented image of warped raw image
 avgT1.img    average of warped T1 images

Modulation:
Areas that are expanded during warping are correspondingly reduced in intensity. John Ashburner recommends the 
modulation step if you are more interested in volume changes than differences in concentration (or density). However, 
modulation is optional and use of this step depends on your data and what are you interested in. If you decide to use 
modulation all images will be saved modulated and non-modulated. In case of doubts make two different statistical 
analyses with and without modulation.


Some practical hints
First of all you should build your own template and possibly prior images because the quality of normalization needed 
for segmentation depends on these images. I would recommend to use all raw (non-normalized) image of your sample 
and not only control subjects to prevent sample bias in normalization. In the following cg_vbm_optimized.m function 
select the new T1 template and the gray matter prior image and your raw (non-normalized) images. The use of own 
prior images is recommended if the gray and white matter distribution of your sample differs from a normal population 
(e.g. children, Alzheimer's disease). Otherwise there is no real need to use own prior images.

Image Orientation:
Keep in mind to set the proper image orientation in spm2. The handedness of your raw images is indicated in 
spm_defaults.m. If you have radiological oriented images (L is R) these images are left-handed and defaults.analyze.flip 
should be set to 1. There is also some more information on the spm2 website about that issue.

Spatial Normalization:
I would recommend the following parameters for non-linear normalization:
1) 25 mm cutoff
2) Medium regularization (1)
3) 16 iterations

However, you can try a higher value for the cutoff which results in a lower resolution of the non-linear normalization, 
but sometimes may give better results of non-linear normalization (Salmond, et al.; 2002). This depends on your data. 
Keep in mind to always check the quality of your normalized and segmented images!

Smoothing:
For the first trial I would start with a FWHM of 12 mm. The filter width depends on what you want to see according to 
the Matched Filter Theorem. You can increase signal-to-noise ratio of your signal that is in the order of your filter size. 
For more focal effects you can decrease the filter width and if you expect larger effects try a larger filter size.

Statistical Analysis:
For the following statistical analysis you can use the "basic models" in spm2. You should use an absolute threshold 
for masking around 0.1..0.15 (and finally up to 0.2). This prevents that you get (opposite) results in white matter 
although you only made an analysis for gray matter. This effect is due to the negative correlation of gray and white 
matter intensity values around the border between gray and white matter. If you choose an absolute threshold masking 
you will only compute your statistic in those areas that are above this threshold. Areas below this threshold will be 
excluded. Be careful if you get any result in white matter although you made an analysis of gray matter. These 
results are suspected to show an opposite effect.

Some useful basic models:

One way Anova (with constant)- to compare two or more populations
- for differential contrasts between your populations (e.g. [-1 1] for population1 < population2)

One way Anova- same as above, but the contrast term in the last column of the design matrix is not modeled
- additional contrasts for the effect in just one population or for all populations possible (e.g. [1 0] for population1 > 0)
- use non-sphericity correction if efficiency of your contrasts differs

One way Anova (within subjects)- for repeated measures (e.g. follow-up scans in a longitudinal study)Simple regression- for correlation to one parameter (e.g. age)

Multiple regression (with constant)- for correlation to one or more parameters

AnCova- to compare two populations, but additionally removes variance explained by one (ore more) parameter


References to VBM

Ashburner J, Friston KJ (2000). Voxel-based morphometry--the methods. Neuroimage 11:805-21. 
doi:10.1006/nimg.2000.0582 

Ashburner J, Friston KJ (2001). Why voxel-based morphometry should be used. Neuroimage 14:1238-1243. 
doi:10.1006/nimg.2001.0961
 
Good CD, Johnsrude IS, Ashburner J, Henson RN, Friston KJ, Frackowiak RS (2001). A voxel-based morphometric 
study of ageing in 465 normal adult human brains. Neuroimage 14:21-36. doi:10.1006/nimg.2001.0786 

Salmond CH, Ashburner J, Vargha-Khadem F, Conelly A, Gadian DG, Friston KJ (2002). The Precision of 
Anatomical Normalization in the Medial Temporal Lobe Using Spatial Basis Functions. Neuroimage 17: 507-512. 
doi:10.1006/nimg.2002.1191 
  
Christian Gaser 2004-09-08

  

Note: This bug in spm_normalise is FIXED at Gablab .
There is a problem with the nonlinear spatial normalisation of SPM2, when using Matlab 6.5 (R13). This is 
because of a bug in Matlab 6.5's reshape
function (see http://www.mathworks.com/support/solutions/data/32884.shtml). What this means is that nonlinear 
deformations in the y and z directions are underestimated by a factor of 1/512. Therefore, the spatial 
normalisation was doing affine and nonlinear warping in x, but a transform that is pretty close to affine only in y and z.

You can check whether your Matlab version is affected with this small matlab function: test_reshape.m. 
Please save this function and run it from the matlab command line.
There is now a fix for this available from:
ftp://ftp.fil.ion.ucl.ac.uk/spm/spm2_updates/spm_normalise.m
You can either update your Matlab version to 6.5.1 (R13SP1) or use the updated version of spm_normalise.m (version 2.10).
