Registration & UnwarpingRegistration of EPI and Structural Images (with undistortion) | ![]() |
It is important to understand that EPI registration is difficult because of signal loss and geometric distortion in the images. In addition, partial brain registration is difficult not only for EPI but for any images, and so is particularly difficult in the case of EPI.
In this kind of experiment the following should be collected:
Case 2: Partial brain imaging
In this kind of experiment the following should be collected:
Case 1: Whole brain imaging
Initial processing of the fieldmap acquisition
1 - generate the magnitude (absolute) fieldmap image - which is undistorted
(using FSLCOMPLEX).
2 - remove non-brain structures from the magnitude fieldmap image (using BET)
and save the mask used
3 - run PRELUDE on the initial fieldmap acquisition
4 - save a (true) fieldmap using FUGUE
Register the fieldmap to the EPI (i.e. example_func)
5 - distort the magnitude fieldmap image to match the EPI (using FUGUE).
6 - register the distorted magnitude fieldmap image to the EPI (using FLIRT with 6 dof).
7 - resample the fieldmap to the EPI (using ApplyXFM or FLIRT)
Undistort the EPI
8 - use the registered fieldmap to undistort the EPI (using FUGUE)
Register the EPI and structural
9 - register the undistorted EPI to the structural image (using FLIRT with
6 or 7 dof)
NB: make sure the transformation matrix is saved
Apply the registration and undistortion to any stats images
10 - undistort each statistical image as was done for the EPI (using FUGUE)
11 - apply the transformation from above to the undistorted statistical
images to get them in structural space (using FLIRT or ApplyXFM)
Case 2: Partial brain imaging
Most of the steps above still need to be done, where the EPI refers to the whole brain EPI. However, some modifications are necessary.
Additional steps required:
Register the partial brain EPI to the whole brain EPI
7a - register the distorted partial brain EPI to the distorted whole brain
EPI using a translation-only registration (via a FLIRT schedule file)
7b - combine the registration with the whole brain EPI to fieldmap
registration to get the partial brain EPI registered with the fieldmap
(via ConcatXFM or convert_xfm)
7c - resample the fieldmap to generate an appropriate partial brain fieldmap
(FLIRT)
7d - undistort the partial brain EPI using the fieldmap from 7c (FUGUE)
And in replacement of the above:
Apply registration and undistortion to any stats images
10 - combine the registration from the partial EPI to the whole EPI with
that from the whole EPI to the structural (ConcatXFM or convert_xfm)
11 - apply the transformation to the partial EPI, producing a resulting
image of it in structural space (and check this visually)
12 - undistort each statistical image using the partial brain fieldmap (generated in step 7c) with FUGUE
13 - apply the combined transformation to the undistorted statistical
images to get them in structural space (using FLIRT or ApplyXFM)
Notes for using FEAT
It is suggested that the following procedure be used when modifying FEAT
directories to take account of undistortion:
A - in your .feat/stats directory, make a new subdirectory called "distorted"
and copy all the files into that subdirectory.
B - undistort all the files in the .feat/stats directory (do not touch
the ones in .feat/stats/distorted as these are your originals).
C - in the .feat/reg directory, replace the example_func2highres.mat
and example_func2initial_highres.mat (if it exists).
D - Also replace the example_func and
initial_highres images with the undistorted EPIs.
E - Then regenerate all the appropriate matrices and images for the
FEAT report page. This can be done using the script updatefeatreg
Note that the coordinates in the first level FEAT report are not corrected using this method. However, all images will be corrected, as will subsequent higher level analyses.
Here is a checklist of some things to examine (in fslview):
Solution: try using a different mask in the PRELUDE stages (a default one is always used but it can be poor sometimes, and the BET mask used in the examples below might also be suboptimal).
Solution: try changing the unwarping direction in FUGUE as the default is sometimes wrong. Firstly, try --unwarpdir=y- which uses the same axis but applies the correction in the opposite sense. If this is still wrong, or the axis of the distortion is clearly different then try the --unwarpdir= option with either x, x-, z, z-.
Let the acquired images be: b0map, epi_series, t1struct
The required steps are as follows:
Preliminary Steps
Main Steps
1. fslcomplex -realabs b0map b0map_abs
2. bet b0map_abs b0map_abs -m
3. prelude -c b0map -u phase_unw -m b0map_abs_mask
4. fugue -s 0.5 -p phase_unw --dwell=0.000737 --asym=0.0025 --savefmap=fmap
5. fugue --loadfmap=fmap --dwell=0.000737 --asym=0.0025 -i b0map_abs -w b0map_abs_distorted
6. flirt -in b0map_abs_distorted -ref example_func -dof 6 -omat b0map2epi.mat -out b0map2epi
7. flirt -in fmap -ref example_func -init b0map2epi.mat -applyxfm -out fmap2epi
8. fugue --loadfmap=fmap2epi --dwell=0.000737 --asym=0.0025 -i example_func -u example_func_undist
9. flirt -in example_func_undist -ref t1struct -dof 7 -omat epi2struct.mat -out epi2struct
10. fugue --loadfmap=fmap2epi --dwell=0.000737 --asym=0.0025 -i thresh_zstat1 -u thresh_zstat1_undist
11. flirt -in thresh_zstat1 -ref t1struct -init epi2struct.mat -applyxfm -out thresh_zstat12struct
Case 2: Partial brain imaging
Let the acquired images be: b0map, epi_series, t1struct, whole_brain_epi
The required steps are as follows:
Preliminary Steps
Main Steps
1. fslcomplex -realabs b0map b0map_abs
2. bet b0map_abs b0map_abs -m
3. prelude -c b0map -u phase_unw -m b0map_abs_mask
4. fugue -s 0.5 -p phase_unw --dwell=0.000737 --asym=0.0025 --savefmap=fmap
5. fugue --loadfmap=fmap --dwell=0.000737 --asym=0.0025 -i b0map_abs -w b0map_abs_distorted
6. flirt -in b0map_abs_distorted -ref whole_brain_epi -dof 6 -omat b0map2epi.mat -out b0map2epi
7. flirt -in fmap -ref whole_brain_epi -init b0map2epi.mat -applyxfm -out fmap2epi
7a. flirt -in example_func -ref whole_brain_epi -schedule $FSLDIR/etc/flirtsch/sch3Dtrans_3dof -omat example_func2whole_brain_epi.mat -out example_func2whole_brain_epi
7b. convert_xfm -omat example_func2b0map.mat -concat b0map2epi.mat example_func2whole_brain_epi.mat
7b. convert_xfm -omat b0map2example_func.mat -inverse example_func2b0map.mat
7c. flirt -in fmap -ref example_func -init b0map2example_func.mat -applyxfm -out fmap2example_func
7d. fugue --loadfmap=fmap2example_func --dwell=0.000737 --asym=0.0025 -i example_func -u example_func_undist
8. fugue --loadfmap=fmap2epi --dwell=0.000737 --asym=0.0025 -i whole_brain_epi -u whole_brain_epi_undist
9. flirt -in whole_brain_epi_undist -ref t1struct -dof 7 -omat epi2struct.mat -out epi2struct
10. convert_xfm -omat example_func2struct.mat -concat epi2struct.mat example_func2whole_brain_epi.mat
11. flirt -in example_func -ref t1struct -init example_func2struct.mat -applyxfm -out example_func2struct
12. fugue --loadfmap=fmap2example_func --dwell=0.000737 --asym=0.0025 -i thresh_zstat1 -u thresh_zstat1_undist
13. flirt -in thresh_zstat1 -ref t1struct -init example_func2struct.mat -applyxfm -out thresh_zstat12struct