MaskedEpiNormalization - MRC CBU Imaging Wiki
location: MaskedEpiNormalization

Masking for EPI normalization

Our functional images differ from the SPM EPI template that is used for normalization, because in our functional images the susceptibility artefacts are more pronounced. This leads to errors in the normalization, especially when nonlinear warping is carried out. To avoid this, you can mask out regions of your functional images where susceptibility artefacts occurred. These areas will not be taken into account during the normalization - see Brett et al (2001).You may want to use the structural images to decide which areas of your functional images are affected by susceptibility. To do this, coregister your structural image to your mean functional image as described in the FMRI defaults page. Here you will want to use the resliced version of the structural, as MRIcro cannot use the .mat files for the original structural image.

Open the images in MRIcro. The easiest way to do this is to double-click on the mean image and your coregistered structural image in the 'Windows explorer' - this should automatically open 2 windows of MRIcro, one showing the mean image and the other the coregistered structural. Yoke both images by ticking the box "Yoke" in the toolbar section "Slice Viewer". In the window that shows the coregistered structural, tick the box "Xbars" in the toolbar section "Slice Viewer". If you now click at a brain area in the functional image you will see the corresponding area in the structural (indicated by the crosshairs).

Go through all the slices and mask the areas affected by susceptibility in each affected slice. These are areas where you see brain in your structural images but not your functional images. We have an example of an EPI mean image with an MRIcro ROI mask that roughly defines the areas to be masked for the normalization.

To change slices use the scroll bar or the text box immediately under the title 'Slice Viewer'. To mask a region, choose the buttons under 'Region of interest'. Find the four lowest buttons on the right. When you click the first button on the left, the 'closed pen tool' is enabled. You can draw an outline around a region you wish to mask. If you press the 'shift'-key, you can delete the outline. When you click the third button on the left, you enable the 'filling tool'. This allows to fill an outlined region. If you press the 'shift'-key, you can delete the filled area and its outline.

Alternatively (and more quickly), use the left and right mouse buttons for masking. First click the 'closed pen tool' (or press F3). Then use the left mouse button to draw an outline and the right mouse button to fill the outline. If you click into the textbox that specifies the slice number (underneath the title 'Slice Viewer') you can use the arrow keys of your keyboard to change slices.

To save the mask, chose "File", "Export ROI as smoothed analyze image". In the next small window you can choose the smoothing. Choose 8 mm, since this is the smoothing SPM applies during normalization. The threshold should be 0.001. Keep the default "Adjust sides in Z-plane only" and make sure that the final drop down box is set for "ROI is 0 [SPM object mask]. To save the mask, CBU imagers should choose 'Save as sun'. You will then be asked to save the roi. Afterwards the mask is saved with the prefix "m" (thus mmean*.img).

Note that earlier versions of MRIcro do not write mat-files. These contain information about the image orientation, e.g. the flipping. Therefore it is crucial to provide such a mat-file for the mask image (the mmean*.img). Copy the mat-file of the mean image (meana*.mat) into the directory that contains the mask image and rename it by adding the prefix "m". After doing this you should now have a mask image, header and mat-file with the same name (a mmeana*.img, a mmeana*.hdr and a mmeana*.mat).


First you will need to change the defaults for normalization, if you have not done so already. Scalp masking during the normalization needs to be disabled. Masking of the brain areas using the mask created with MRIcro needs to be enabled.

  • For SPM5: Click on Normalise button. Add a new Normalise: Estimate set of options from the panel at the top right of the graphics window. Navigate to the Data branch of this job, and add a new subject. Add the mean image as the source image for this subject, and the masking image as the source weighting image. Navigate to the Estimation options in the Normalise: Estimate tree, and check that Template Weighting image is set to <NONE>. Run the job.

  • For SPM2: Click on the "Defaults" button, choose "Spatial normalization", then Defaults for parameter estimation. Choose No weighting for Weight template when registering, and Weight sources at Weight source images when registering. Other defaults leave or modify to taste. Next click on Normalize, choose Determine parameters only, select EPI.mnc as the template image, then select the subject's EPI mean image as Source image. Choose your mmean*.img (mask created in MRIcro) when asked for Source weighting image.

  • For SPM99: Click on the "Defaults" button, choose Spatial normalization, then Defaults for parameter estimation. Accept all the defaults, except the last two. For the Mask brain when registering? choose No brain mask. For the question Mask object brain when registering? choose Mask object. Next click on Normalize, choose Determine parameters only, select the mean image as image to determine parameters from. Choose your mmean*.img (mask created in MRIcro) when asked select object masking image, and the EPI.img as the template.

Wait a little.

In the graphics window you should have a display of the normalization. Check it is OK. If not, oh dear. If the normalization is OK, then reslice your functional images with the same parameters: click "Normalize", choose "Write normalised", select the "mean*sn3d.mat" file that has just been created in the same directory as the mean image, by the normalization (when asked for the Normalization parameter set). Select all the slice timing corrected functionals when asked for "images to write normalised". Bilinear interpolation. Wait, wait, wait - a long time.

Anja Dove, 24/1/01, Matthew Brett 29/01/02

CbuImaging: MaskedEpiNormalization (last edited 2013-03-07 21:22:55 by localhost)