FmReference - MRC CBU Imaging Wiki
location: FmReference

Using a field-map to undistort EPIs
Improvement in power!
Acquiring fieldmaps
What you'll need to undistort an EPI data series
Guide and reference
Step-by-step example
Batch mode

Describing the procedure


If you use the field-map undistortion tool, you'll probably find it easiest to cite the following publications to explain what you've done:

Cusack, R., Brett, M. & Osswald, K. (2003) "An evaluation of the use of magnetic field maps to undistort echo-planar images" NeuroImage 18, 127-142. Cusack, R., & Papadakis, N. (2002) "New robust 3-d phase unwrapping algorithms: application to magnetic field mapping and undistorting echoplanar images" NeuroImage 16, 754-764. Jezzard, P. and Balaban, R.S. (1995). "Correction for Geometric Distortion in Echo Planar Images from B0 Field Variations" Magnetic Resonance in Medicine 34: 65-73.

You might like to include something like the following.

METHODS: general details

A map of the magnetic field was acquired and then used to correct for distortion to the EPIs resulting from inhomogeneities in the field (Jezzard & Balaban, 1995). This procedure has been shown to improve anatomical localisation and increase the power of group studies by achieving better spatial registration between the data from different subjects (Cusack, Brett & Osswald, 2003).

METHODS: acquisition

The field-map data were acquired using a 3D gradient echo sequence with a matrix size of 64 x 256 x 64 and a field of view 256 x 256 x 256 mm. Two volumes were acquired, differing only in their TE, which was either 1 ms or 10.104 ms. The difference between these maps was chosen to be a whole multiple of the precession time for the fat signal at 3 Tesla. Each acquisition took 2 mins 6 secs.

METHODS: processing

The magnetic field strength at each voxel is encoded in the phase difference between the two field-map acquisitions. Phase unwrapping was performed on this phase difference using the procedure described by Cusack & Papadakis (2002). The unwrapped phase and magnitude of the field maps were then spatially processed and scaled as described in Cusack, Brett & Osswald (2003), and then the EPIs undistorted using the pixel shift method. Undistortion was applied after realignment.

General guide

First steps

  1. Make sure you preserve the field map raw data, and the IMND or .brkhdr file from one of the EPI data series
  2. Realign and reslice your EPI data series
  3. For each subject, make an empty directory, which will receive the processed field-map files
  4. Type fieldmap_undistort at the SPM >> prompt, or choose fmundistort from the Toolbox menu.

Before trying a dataset of your own, why not follow the step-by-step example ?

Image orientation

Your EPIs should be in standard SPM orientation. The voxel sizes should be correct. The latest version of the undistortion code will detect a flip in the .mat file and reverse undistortion appropriately, so you do not have to use yaw180 to reorient images; if you prefer you may use DISPLAY in SPM. However, you must still reslice your images after realignment.


You should be able to accept the defaults for all of the options in this section.

Prompt given



||<^>Accept all defaults?||Yes No||Click yes to accept all defaults|| ||<^>Start at which stage?||<^>Reco Unwrapping Skull stripping Expansion Rotation & Reslicing Generate distorted magnitude Coregistration Undistortion||<^>Stage of processing to start at. If you're processing a dataset for the first time, this will be the first option, reco. If you later come back and want to undistort an extra image or two, then choose Undistortion||

Which option

Locally reconstruct WBIC reconstruction Oxford phase maps

Specify whether you wish to reconstruct your Cambridge field maps here, whether you wish to use WBIC reconstructed maps (very unusual) or Oxford phase maps.

||<^>Phase map pair to use||<^>ab phasemap ac phasemap

Choose whether you'd like to use field maps phase1a and phase1b or phase1a and phase1c

||<^>Realign to COM||Yes No ||<^>If yes, field maps will be shifted so that their centre of mass is in the middle of image. If you specify no, and your field maps are (unusually) near the edge of the field of view, then when the forward distortion process happens, the image may be shifted outside the field of view.||

Shift EPI forward by

[any number]

||<^>Evolution time of map||3 12 2.276 9.104 2.5

Specify the difference in TEs between the two field maps you've chosen

||<^>Constrain coregistration?||<^>No Translations only

Choose whether to constrain the coregistration of forward distorted field map & EPI. Default is Translations only.

Max shift (mm)

[any number]

Specify maximum shift to be applied in undistortion process. Voxels with a shift greater than this will be masked to zero.

||<^>Interpolation||<^>Sinc Linear

Type of interpolation in undistortion


Directory for field map files.

Various processed field map files will be written to this directory. You should create a different directory for each subject - perhaps called fieldmaps.

Directory for phase1a

The numbered directory that contains the raw data for phase1a

Directory for phase1b

The numbered directory that contains the raw data for phase1b

Directory for phase1c

The numbered directory that contains the raw data for phase1c

EPI header file

This should be the .brkhdr or IMND file from one of your EPI data series. If you use pvconv, it will make a .brkhdr file for each of your series - choose one with the _EPI suffix. If you use ImageJ, pick the IMND file from the numbered directory that contains your raw data

Choose EPI to coregister to

This should be the mean EPI file generated by realignment (e.g., meana000484_EPI_0001.img)

Choose the EPIs you wish to undistort

Choose all of the individual EPI scans, and the mean. Choose the resliced files with the prefix 'r'.

CbuImaging: FmReference (last edited 2013-03-07 21:24:00 by localhost)