Distortion correction

From Hodaie Lab
Jump to: navigation, search

Non-linear EPI distortions can be corrected by two means:

  • Field map acquisition and then correct with FSL fugue command
  • Reversed-blip acquisition and then correct with FSL topup command

In theory the distortion correction should occur BEFORE motion correction.

Reverse-blip correction with TOPUP

The steps to perform topup is a bit complicated, please go over the TOPUP documentation carefully: TOPUP DOC

command examples:

   # extract all b0 volumes (first two volumes in dwi)
   fslselectvols -i dwi.nii.gz -o b0s.nii.gz --vols=0,1
   # extract all downblip direction (just the first volume)
   fslselectvols -i dwi.nii.gz -o downblip.nii.gz --vols=1
   # extract all upblip direction (pass in a txt to include all volume indicies except the 1st one)
   fslselectvols -i dwi.nii.gz -o upblip.nii.gz --vols=upblip.txt
   # calculate corrections based on the b0s 
   topup --imain=b0s.nii.gz --datain=aq_params.txt --config=b02b0.cnf --out=topup --fout=topup_field --iout=topup_unwarped
   # apply the corrections to the upblip images
   applytopup --imain=upblip --datain=aq_params.txt --inindex=1 --topup=topup -o dwi_topup_corrected.nii.gz --method=jac

Example aq_params.txt:

0 -1 0 0.108
0 1 0 0.108 

The 0.108 is the asymetrical spin echo time in seconds DO NOT use this as a default, it's for the Tractogram challenge 2015 settings. Look up the DWI acquisition parameter.

Be sure to remove the downspin (first reversed blip volume) from the bvec and bval file. after doing topup.