Normalization HOWTO

How-Tos - Normalization

How do I...


Normalize in SPM?

The suggested protocol below applies only if you're already co-registered your inplane anatomy to the functionals. See CoregistrationHowTos for directions. Don't use this protocol if you haven't done that!

First step: Normalize the anatomy.

The ordering of directions below applies to SPM2. In SPM99, the directions are the same, with two small differences: you explicitly enter in the number of subjects, and you enter the template image last. Otherwise identical.

Hit "Normalize" in the main SPM interface.

http://gablab.stanford.edu/brainiac/screenshots/which_option_normalize.jpg

Which option? Select the default, Determine Parameters and Write Normalized.

Template image? Select the appropriate anatomical template - T1.mnc if the inplane is T1-weighted (generally the case) or T2.mnc if it's T2-weighted. In SPM99, the template images are .img files instead of .mnc files.

Source image, subj 1? Select your anatomy/inplane/V001.img file and click DONE. (This is called "image to determine parameters from" in SPM99).

Images to write, subj 1? Select your anatomy/inplane/V001.img file and click DONE.

Source image, subj 2? You can click "Done" here if you only want to normalize one person at a time. Or, you can repeat the above steps for as many subjects as you like. When you're done, just hit done at a source image prompt.

The normalization will now proceed for the anatomical image. This will find the transformation that maps your inplane anatomy (and anything coregistered with it, like your functionals) into the MNI template brain space. The prefix for normalization in SPM2 is "w," for "warped." The output will thus be a normalized wV001.img anatomy file, as well as a new V001_sn.mat file in the same directory, containing the transformation parameters. (In SPM99, the prefix for normalized is "n", so it'll be an nV001.img file, and the parameter file will be called V001_sn3d.mat.) These will be later applied to all functionals.

Second step: Apply the computed transformation parameters to your functionals.

This is the same for SPM99 and SPM2.

Click the "Normalize" button.

http://gablab.stanford.edu/brainiac/screenshots/which_option_normalize.jpg

Select Write Normalized Only.

Parameters, Subj 1? Select your anatomy/inplane/V001_sn.mat file and click DONE. (For SPM99, this is the _sn3d.mat file.)

Images to write normalized, subj 1? : SCAN1/aV*.img, SCAN2/aV*.img, etc., DONE.

Parameters, Subj 2? You can click "Done" here, or choose other subjects to process by repeating the above steps. In SPM99, this question won't come up - you can only write one set of images at once.

http://gablab.stanford.edu/brainiac/screenshots/interp_method.jpg

(In SPM99 only - SPM2 uses trilinear by default) Which interpolation method? Select Sinc Interpolation(9x9x9).

This step typically take a longish time, from about an hour to several hours, depending on the number of functional files and the computer you are using. It will also create many new files - wV.img {or nV.img with SPM99) files, which will take a considerable amount of space, so it is a good idea before starting this process to make sure that there is enough space on the partition you are using.

Set/choose my defaults for normalization?

SPM2 and SPM99 actually have detailed help information about what all the defaults mean, so you should check that and read it. Type help spm_normalise_ui at the Matlab prompt if you're running SPM2, or help spm_sn3d if you're running SPM99. A couple notes on defaults to pay particular attention to
  • The "weight source images when registering" (or "mask object brain when registering" in SPM99) default allows you to specify a mask to tell the program to avoid "looking at" certain regions when normalizing - this can be helpful if the subject has a focal lesion or tumor.
  • In SPM99, you can specify whether you want SPM to do any nonlinear normalization at all, or if you just want an affine normalization. This eliminates all of the nonlinear warping, which can be helpful if you find your images being strangely distorted in particular areas. In both SPM99 and SPM2, you can also reduce the amount of nonlinear warping by reducing the number of nonlinear iterations that are done. In SPM2, you can't turn off nonlinear normalization altogether - only reduce the number of iterations.
  • The amount of nonlinear regularization (from "light" to "heavy", with the default at "medium") allows you to set the smoothness of the deformation field - the "heavier" it gets, the smoother the nonlinear deformations will become, and the less focused any warping will be. If your images are coming our heavily warped in particular regions, you may want to increase the regularization.
  • Voxel Size: in the "writing normalized" defaults, you can change the voxel size that the normalized images are re-sliced to. By default this is 2x2x2 mm, but if you don't care about having voxels that small, you can change it to another square value or specify your own rectangular value (including your original voxel size, if you like).
  • SPM2 only: SPM2, by default, uses trilinear interpolation for normalization, which is fast. If you want to slightly decrease the potential for interpolation errors, you can re-set the interpolation method to a B-spline method - 2nd or 3rd degree should be plenty accurate. This will significantly slow down the normalization writing process, though.
  • SPM99 only: The "Affine Starting Estimates" in the "Parameter Estimation" section determine whether or not your images are "flipped" during normalization. If your images are coming out of the scanner in radiological convention and you want them flipped over, then leave this at the default. But if you want to leave them in radiological, or if they come out of the scanner in neurological, then change this default to "neurological convention" - that won't flip the images.

Check my normalization?

You can use the "Check Reg" button in SPM's main interface to display two or more images at once with the same axes. Hit that, and then select the template image (usually T1.mnc or T1.img) and the normalized anatomical (and a normalized functional or two, if you'd like). Click around the outlines of the brains and see how well they line up. Deciding what constitutes a "good" normalization is a little arbitrary, but if a normalization has gone wrong, it'll usually go really wrong, and you'll be able to tell on visual inspection pretty easily.

Fix a bad normalization?

Couple ways. It depends a little bit on what's gone wrong. You can try tweaking the defaults (see above) to change the amount and smoothness of nonlinear transformations being applied. If the problem is that local areas are being too heavily warped - or, alternatively, that the gross shape of the brain is okay, but major local landmarks like the central sulcus are totally the wrong shape - those strategies may help. Increasing the regularization and decreasing the number of nonlinear iterations will help in the former case; the opposite changes will help in the latter. If, instead, the problem is that certain types of tissue or areas - like the subcortical gray matter structures - just look "wrong," then it may help to normalize only the gray matter in the brain; see below for directions on that. You might also try some of the methods used in fixing a bad coregistration (see CoregistrationHowTos) - getting better starting estimates for your normalization by manually zooming, rotating, or translating the source brain to better fit the template.

Whatever direction you go in, make sure you delete (or move to another directory) any existing sn.mat or sn3d.mat files that are around. You don't have to delete any wV.img or nV.img files - those will be overwritten.

Normalize only the gray matter in my brain?

Normalizing from the gray matter may be more accurate, especially for basal gray matter structures such as the basal ganglia. So if you want, here's how...

First segment the brain into gray matter, white matter and CSF. See SegmentationHowTos for directions. Your output will be: inplane/V001_seg1.img - the estimated gray matter; inplane/V001_seg2.img - the estimated white matter; inplane/V001_seg3.img - the estimated CSF.

Check to see how the gray matter was segmented with "Display." If you can see skull around the gray matter, create a skull-stripped brain with the Extract Brain module (see SegmentationHowTos for directions). Once you have the skull-stripped image, say, brain_V001.img, you can use ?ImCalc to intersect it with the gray matter image and get a skull-less gray matter image:

Hit "?ImCalc" in the main SPM interface.

Select images to work on : Select inplane/V001_seg1.img, inplane/brain_V001.img, DONE.

Output filename : Type V001_seg1_noskull.

Evaluated function : Select i1.*i2. This will multiply, voxel-by-voxel, the value of the gray matter image with the value of the skull-stripped brain, effectively producing an intersection of the two (since any zero in one will zero out the voxel in the final image).

This will produce a new file, inplane/V001_seg1_noskull.img in anatomy/inplane. Display the image to check how it looks. You can also compared it to inplane/V001_seg1.img using the "Check Reg" button.

Now you can normalize the inplane's gray matter to the MNI template's gray matter image. For this step, use either inplane/V001_seg1.img, or inplane/V001_seg1_noskull.img if you created the latter and it looks better.

First step: Normalize the gray matter image.

Hit "Normalize" in the main SPM interface. The order below is for SPM2; for SPM99, the template image will be selected last and you'll explicitly specify the number of subjects.

Which Option?...: Determine Parameters and Write Normalized

(SPM99 only) Number of subjects : 1

Template images : Go into the /usr/fmri_progs/matlab/spm2/vanilla/apriori directory and select the gray.mnc, DONE. (For SPM99, replace /spm2/ with /spm99/ and choose gray.img.)

Source image, subj 1 : Select anatomy/inplane/V001_seg1_noskull.img, then click DONE. (Or V001_seg1.img if you didn't skull-strip.) (In SPM99, this is called the "image to determine parameters from.")

Images to write, subj 1: Same as the source image.

Source image, subj 2: DONE.

The image will now be normalized. This will produce a new inplane/wV001_seg1_noskull.img, as well as a file with the normalisation parameters, V001_seg1_noskull_sn.mat, which will applied later to all functional images. In SPM99, the output is nV001_seg... and V001..._sn3d.mat.

Second step: Normalize all the functionals with your gray matter parameters.

Hit "Normalize."

Which Option? : Write Normalized Only

Parameter set, subj 1 : Choose anatomy/inplane/V001_seg1_noskull_sn3d.mat, then click DONE.

Images to write normalized, subj 1 : Select SCAN1/aV*.img, SCAN2/aV*.img, etc., then DONE.

Parameter set, subj 2: DONE.

(SPM99 only) Interpolation Method? : Sinc Interpolation(9x9x9)

The functional images will now be normalized, a longish process which may take an hour or a few. The process will also create many new files - wV.img {or nV.img with SPM99) files, which will take a considerable amount of space, so it is a good idea before starting this process to make sure that there is enough space on the partition you are using.

Normalize an elderly brain?

The standard normalization templates are created from healthy young adults, and attempting to normalize an elderly subject's brain to this template may result in a pretty poor normalization. A better way to go is to normalize to a template that's devised from elderly brains, and fortunately the good folks at UCLA have put together such a template: http://www.loni.ucla.edu/~thompson/AD/TEMPLATE/NEW_AFFINE_TEMPLATE/. Some description of the template can be found at http://www.loni.ucla.edu/~thompson/AD/. In order to normalize to this template, simply download it and select it instead of the T1.mnc file you select in the normal normalization. You may want to coregister and reslice the image first to the standard T1 template. Thanks to Arul Thangavel for tracking this down...

Normalize a brain with a lesion or tumor?

Normalizing a brain with a focal region that's abnormal isn't too tricky - you'd just like to ignore that focal region. Brett et. al describe the theory behind this in NormalizationPapers, but it's relatively easy to do by tweaking the defaults. The normalization defaults allows you specify a masking image where you can mask out the focal region, and then that region won't be taken into account during normalization.

First create the masking image. This should be a standard mask image, with only 0 and 1 as values, and it should include the whole brain as 1, with the lesioned/tumor area specified as 0. You can start with a whole brain mask (say, by segmenting the brain and then adding the three output images together - see SegmentationHowTos for directions). You'll then probably need to hand-draw the lesion area with MRIcro or some other image editing utility.

Then go to "Defaults" in the main SPM interface. Choose "Spatial Normalization," and then choose "Parameter Estimation." You'll go through a series of defaults; you can leave most of them. The one you're looking for is called "Weight source images when registering?" (in SPM2) or "Mask object brain when registering?" (in SPM99). In either case, change it to allow weighting/masking. Then run the normalization. You'll be asked to supply a weighting/mask image during your choices, and you should give it the mask image. When the normalization is done, inspect it carefully to make sure it looks all right.


CategoryHowTos