In order to observe brain activity, we need to collect rapidly acquire images of the brain. Echo Planar Imaging (EPI) is the most popular technique for rapid MRI acquisition. However, EPI images often exhibit substantial signal dropout and spatial distortion in regions where the magnetic field is inhomogenous (for the brain, this means the fontal cortex and medial temporal lobe). We can not recover the lost signal, but we can attempt to undistort our images if we collect field maps (that measure the field inhomogeneity). These field maps take about a minute to acquire, and have the same positioning and image dimensions as our fMRI data. Undistortion can be accomplished with FUGUE (FSL) or the Fieldmap Toolbox (SPM). Both expect your data to be in NIfTI format, so if your images are in DICOM format, you will need to convert them (e.g. use dcm2nii or SPM’s conversion functions).
There are two reasons that reduced distortion may be important for fMRI studies. First, for any fMRI study, undistortion will make the shape of a each individual’s fMRI data more similar to their anatomical scan – this improves the quality of the normalization leading to improved group level statistics throughout the brain (see Cusack & Papadakis, 2002). Second, EPI unwarping is often helpful in studies where we want to examine brain regions known to have severe homogeneity issues (frontal pole, orbito-frontal cortex, medial temporal lobe [esp hippocampus]). If your goal is the second, you should really attempt to tune your protocol to reduce artifacts prior to collecting any data. The reason for this is that homogeneity errors cause both signal loss and spatial distortion. Fieldmaps only help correct the shape of your EPI image, and do not recover missing signal. Also, the field maps are pretty smooth, and often do not accurately model the sharp inhomogeneities at the edge of the brain. In general, undistortion will have a minimal benefit for scans acquired on modern MRI scanners with highly optimizing shimming methods (e.g. a Siemens Trio), but may be helpful for boutique or high field applications.
The sample EPI data on this web page actually was intentionally designed to have relatively low spatial distortion at the cost of signal to noise. Specifically, the following techniques were all used to reduce spatial distortion and signal loss:
An additional reason for minimal distortion (though without a cost in signal) is that the images were acquired on a scanner with very sophisticated shimming algorithms (Siemens Trio). You should consider similar measures if you are interested in susceptible regions. If you use more traditional techniques, you will see more spatial distortion and the fieldmap correction will be more substantial.
This tutorial describes how to use the Fieldmap Toolbox (created by Jesper Andersson and Chloe Hutton) that is included with SPM. For this tutorial, we will need to have the following files:
Here are the steps for undistortion with SPM’s Fieldmap Toolbox.
The method described above uses SPM’s fieldmap toolbox. One can accomplish similar goals using FSL’s FUGUE . Both the FieldMap toolbox and FUGUE require you to acquire a fieldmap on your scanner. However you can also correct for spatial distortions seen in fMRI using FSL’s TOPUP . The basic idea with TOPUP is that you acquire two sets of scans where the phase-encoding direction is reversed between sets. This leads to images with disortion of identical magnitude but opposite direction. TOPUP is able to use these images to compute a non-linear undsitortion. There is one wrinkle with regards to fMRI: TOPUP is typically employed in DTI sequences use spin-echo sequences, yet fMRI typically uses gradient echo scans. With spin echo scans the signal is moved (bunched-up in some regions pulled apart in others) whereas inhomogenous areas of gradient echo scans exhibit both spatial distortion and signal dropout. This makes it challenging to directly compute the spatial distortion using only GE images. To solve this, you would acquire your typical GE fMRI data, and next acquire a few SE volumes with identical parameters and positioning, finally you acquire a third set with a few SE volumes with identical parameters except reverse phase encoding. You use TOPUP to compute the coefficients for the SE images and than apply these (using applytopup) to the fMRI data.
Note that tools like FUGUE expect you to provide the magnitude and phase images. If you are setting up your acquisition, you should request these images on the scanner console. However, if you are dealing with archival data, you should be able to recognize and convert different forms of images. For example, consider the ADNI participant 130_S_4405 who was scanned in 2012 and again in 2017. The 2012 sequence only saved the image as imaginary (image below, 1st column) and real (2nd column) components of the complex image. In this case, you can use the FSL tool fslcomplex to create the magnitude (3rd column) and phase image (right column).
The Fieldmap Toolbox web page is a great source of information. Also, note that the toolbox has a ‘help’ button which displays a useful manual.
By default, when the toolbox converts an image to radians it attempts to scale the minimum intensity to -pi and the maximum to +pi. This is usually pretty accurate, but often has small errors when the phase map does not have extreme values. If you have Siemens data (where scaled values -4096..+4096 denote -pi..+pi), you can edit your Fieldmap.m file to get the precise conversion. The sample dataset includes the code you would need to insert.