AD: Distortion Correction
If your subjects' DTI and/or fMRI images are distorted you should perform distortion correction before proceeding with preprocessing in the ‘Preclinical’ GUI (i.e. you should perform distortion correction on DTI and fMRI images in native space, before they are realigned/coregistered).
Create a new folder and name it ‘Distortion Correction’.
Create a subject sub-folder and in this sub-folder, create the following folders: ‘clean’, ‘DTI’, fMRI', 'headers'.
Copy and paste the newly created subject folder for as many subjects as you have i.e. if you have a total of 50 subjects, copy and paste the folder 50 times and then rename each folder with it’s subject’s name. This saves you from having to create all of these subfolders for each subject (would be very time consuming).
Open the first subject folder and copy in the Bruker Field Map nifti file from your ‘Converted data’ folder.
Convert the field map from nifti to img/hdr format in CSPM → ‘Image' → 'Convert img/hdr to nii (or vice versa)'. Rename both newly created files 'fpm’.
Copy in the following files from your ‘Converted Data’ folder into each subject’s sub-folders:
Folder | Files |
---|---|
clean |
|
DTI |
|
fMRI_resting |
|
fMRI_1st_stimulation | same as above, but using the 4D first stimulation fMRI file |
fMRI_2nd_stimulation | same as above, but using the 4D second stimulation fMRI file |
headers |
|
In SPM12, open the ‘FieldMap’ GUI:
Click the ‘Load’ button next to ‘Precalculated field map’ and copy in the file path of one of the subject’s folders in your ‘Distortion Correction' folder, and select the subject’s ‘fpm.img’ file. It will appear to the right, as highlighted in the below example, and a ‘vdm5_fpm.img’ file will be created in the subject’s folder.
Select the parameters ‘Yes’, ‘-ve’ and ‘No’ for ‘EPI-based field map’, ‘Polarity of phase-encode blips’ and ‘Apply Jacobian modulation’, respectively. Note that ‘Polarity of phase-encode blips’ may instead be positive, depending on how your data was collected (check the method file in raw data DWI folder; if scans were collected anterior to posterior, ‘Polarity of phase-encode blips’ will be positive and vice versa). The formula to work out the ‘Total EPI readout time’ is ‘Echo Spacing x J space’. Note: the value for echo spacing can be found in the aforementioned method file, whereas J space can be found by opening the EPI fieldmap image in MRIcron and clicking the 'i' icon which will give you the relevant information (e.g. matrix dimension and voxel size etc.).
Click the ‘Load EPI image’ and select your 4D DWI file from the subject’s ‘clean’ folder (ignore the error message).
Click the ‘Write unwarped’ button. This will create a mean unwarped image in your ‘clean’ folder, with the prefix 'u'.
Visually inspect the ‘u' image for correction of spatial distortion by comparing it to the original 4D DWI image. It should no longer appear to be distorted. For example, below you can see that the cerebellum looks far less squashed in the second distortion-corrected image (i.e. the 'u’ image), compared to the original image:
Then compare the ‘u' image to that subject’s T2map, by clicking View → Yoke and then opening the T2map and clicking View → Yoke. Place the crosshairs at the back of the cerebellum in the T2map and see if the position of the crosshairs in the ‘u' image match. Place the crosshairs at the front of the brain (i.e. where the brain begins) in the T2map and see if they match, then on each side of the brain, the front of the cerebellum and so on. If the crosshair positions in the T2map match the crosshair positions in the 'u’ image reasonably well (i.e. the distortion correction was successful), proceed to the next step.
If it did not adequately fix your DTI images, refer to steps 5a-h in the ‘Preclinical Preprocessing’ page.
To apply these distortion correction parameters to all of the 82 DTI images, open SPM12 → ‘Realign and unwarp’.
Select the 82 DTI files from the ‘DTI’ folder in the subject’s folder. Enter that subject’s ‘vdm5_fpm.img’ file in the ‘Phase map’ box and the distortion corrected ‘u' image in the 'Weighting’ box, along with the following parameters which are highlighted below.
Save the batch to the subject’s DTI folder and click run (i.e. the green triangle icon in the top left hand corner). This will create 82 distortion corrected DTI images in the subject’s DTI folder (with a 'u' prefix).
Copy the 82 distortion corrected DTI images (i.e. those with a ‘u' prefix) into the subject’s ‘raw’ folder in projects\CONTROL\*subject name*\DTI.
Repeat steps 9-16 for the resting fMRI, first stimulation fMRI and second stimulation fMRI of that subject, using with the following parameters:
Repeat DTI and fMRI distortion correction on all subjects. Note that even if only some of your subjects have distorted DTI/fMRI images, you must still perform distortion correction on all subjects in your dataset.
Compare each subject’s distortion corrected image to it’s T2map, as you go, to confirm distortion correction was successful.
You are now ready to resume with the steps outlined in the AD: File/Folder Setup and Preparation for Preprocessing page (i.e. step 9 and onwards), using these distortion corrected images.