This page assumes you familiar with the ideas described of diffusion tensor imaging (see my class for details), so you may want to read that first. This advanced page describes how FSL’s topup can be used to undistort diffusion images, and provides a matlab script for batch processing large numbers of images with topup and FDT. Topup does an incredible job unwarping images, but the current beta form involves a lot of steps and knowledge about your dataset. This script will automatically detect and separate the B0 images required by topup, simplifying topup. The effects are shown in the images on the left: the top row shows a distorted image, the middle row shows an image distorted in the opposite direction, and the bottom rom shows the pair combined after undistrotion.
Diffusion images are acquired rapidly, and slices are typically acquired using 2D sequences (usually Echo Planar Imaging [EPI]) that acquire an entire 2D slice in a single excitation. Unfortunately, these sequences take a while to read-out the slice, and therefore any field homogeneity errors will cause spatial distortion. While scanner shimming aims to reduce field inhomogeneity, the solutions will be imperfect, particularly where there are different types of tissue present – for the brain this is particularly the sinuses near the orbital frontal cortex and regions near the ear canals. While these distortions are inevitable, we can compensate for them by acquiring two series of images that have opposite phase-encoding direction but identical in all other respects. Each of these images will end up showing distortions of identical magnitude, but opposite direction. Topup compares these two images to the nonlinear midpoint deformation between these two images. The deformation can then be applied to all the images, creating a combined image with minimal spatial distortion. Topup calculates these deformations based on the B0 images (as these are not contaminated by additional eddy current deformations of the directional scans), and then computes a mean image for each pair (positive and negative polarity) of images (so that both the B0 and directional scans are corrected). Therefore the two input series (positive and negative) create a single unwarped series that should have 1.4 times the signal to noise of either original (thanks to signal averaging).
When you run my script ‘dti_1_eddy ’ it expects to to provide positive and negative polarity images (these should be 4D NIfTI format images). For example, if your anterior-to-postrior phased-encoded image is named named “AP.nii” and the posterior-to-anterior image is named “PA.nii” you would run something like ‘./dti_1_eddy.sh “AP” “PA”’. If all works well, the script will run TOPUP followed by Eddy. If you only provide a since image (‘./dti_1_edyy “PA.nii”’) the script will run the legacy eddy_correct (which only does a linear spatial correction). Note that users who have a graphics card set up for CUDA as well as a CUDA-capable version of FSL’s Eddy, there is a much faster way to do the same thing: my script ‘dti_1_eddy_cuda’.
29 May 2013. Chris Rorden with suggestions from Dirk den Ouden and Svetlana Malyutina