FmExample - MRC CBU Imaging Wiki
location: FmExample

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

Siemens step-by-step example

First, get the Siemens example dataset (2MB) (thanks to Michael Benharrosh and Marlene Richter at Princeton University for this).

Unzip it and you should have three images in analyze format: an EPI, and the phase and magnitude from a gre_fieldmapping sequence.

When you've installed the tool, at the matlab prompt type

>> fieldmap_undistort_v3

Then, in the SPM window, choose the following options

Accept all defaults


Start at which stage

Reco (default)

Which option?

Siemens gre_fieldmapping

Realign fieldmaps to com

Yes (default)

Shift EPI forward by

0 (default)

Evolution time

2.46 (default)

Slice angle of EPIs relative to fieldmaps

0 (default)



Axis of phase encoding (undistortion)

y (default)

Constrain coregistration

Translations only (default)

Type of interpolation

sinc (default)

Maximum shift allowed

9999 (default)

Adjust mean displacement?

Force mean to zero (default)

Directory for fieldmap files

Choose a blank directory (e.g., fieldmaps)

Choose GRE phase map


Choose GRE magnitude map


Choose EPI to coregister to


Choose EPIs to undistort


The EPI before and after undistortion should look like this:

There's nothing that can be done about the dropout, but even the large distortion produced by this mis-shimming is mostly corrected.

If you are going to collect your own data on a Siemens machine and your system doesn't allow you to reconstruct both mag and phase simultaneously, you'll need to change one line in your pulse sequence. Contact Stefan Thesen at Siemens [his surname] who'll probably be able to help.)

Bruker step-by-step example

First, get the Bruker example dataset (34MB)

Run by typing fieldmap_undistort at the SPM prompt, and choose the following options. Where requested, choose the directories and files from your copy of the data.

Accept all defaults:


Choose Directory of Phase Map:


Choose Directory of Phase 1a:


Choose Directory of Phase 1b:


Choose Directory of Phase 1c:


Choose EPI header file (IMND or brkhdr):

example_dataset/epis/000484 m03_04_EPI.brkhdr

Choose EPI to register to:


Choose EPI to undistort:


The undistorted EPIs will be in the same directory as the raw EPIs, with the added suffix ā€˜uā€™.

CbuImaging: FmExample (last edited 2013-03-07 21:24:05 by localhost)