Correct dMRI Preprocessing steps order

Dear MRtrix experts,

I have a dMRI preprocessing script using MRtrix/FSL commands and custom python scripts and I wanted to know if the pre-processing steps I am following are correct:

  1. Detect Physically Implausible Signal (PIS)
  2. Detect if a gradient direction flip exists and fix it
  3. Denoise
  4. Gibbs ringing correction
  5. Eddy current and motion correction
  6. Distortion correction
  7. Bias field correction
  8. AC-PC alignment
  9. Resampling

I am particularly interested in the detection of PIS because it is done at the beginning but maybe I should be getting these voxels after the motion correction.

What are your thoughts?

Thank you for your time.

Looks fine to me, except for your steps 5 and 6. Motion and distortion correction are closely related, so the exact separation can be confusing. But since you refer to FSL I assume that your step 6 refers to Topup, which estimates the B0 field map. If this is indeed what you mean, then it needs to be run first, and its output needs to be passed to FSL Eddy (motion and eddy current correction). In other words, the order of steps 5 and 6 needs to be reversed. The dwipreproc will wrap these two commands for you.

Thanks for your answer, Daan.
What if I have the field maps already, then it is OK to have eddy run before the distortion correction?

Hi Marklar,

If you say “PIS” what are you referring to exactly?


That changes the matter. The field map needs (to a first order approximation) be aligned with the subject pose, so I can see the argument for your pipeline. However, because the distortion can change with subject motion, I also can’t recommend motion correction in distorted images. You’ll just need to make a judgement call based on your results.

Physically Implausible Signal is a known artifact that appears in diffusion images where directional volumes get higher values than the b0 volumes and cause intensity values higher than 1 on FA. I correct that using the Gibbs Ringing correction mrdegibbs command.

They are aligned to the diffusion data (to the averaged b0s to be exact), but it’s tricky to correct for motion when it is distorted.

Just to clarify, at the step of distortion I am using FSL’s fugue as I have gradient field maps from SIEMENS scanners (magnitude and phase). I do not have blip-up and blip-down data to use with topup.

You can provide eddy the prepared aligned fieldmap via commandline parameter --field
which enables to do eddy-current and distortion correction simultaneously. However, the caveat is that the fieldmap has to be invertible (topup fieldmaps are guaranteed invertible, which is not the case of gradient fieldmaps), because if it not the case, the distortion correction will fail.
I have discussed this matter with Jesper Andersson, I attach his comment in case you are interested:

I have had a look at your data and I have figured out what the problem is. As part of the internal calculations eddy will invert the total field (the sum of the susceptibility field and the eddy current field). That means that the field must be invertible, and in practice this means that the field must be reasonably smooth and not have discontinuities along the PE-direction.

The way you have created your fieldmaps means that this is not true. If you for example look at the top or bottom slice of the fieldmap for the data you sent me you can see that at some point the field goes sharply to zero. This is because of the way you have registered your fieldmaps to the diffusion data, and where this “jump” is caused by missing data in these slices. The same is true at the very edges of the other slices.

The recommended way of avoiding things like this would be to always acquire your GE-based fieldmap with a more generous FOV than the data you intend to correct, so that the field is defined in all parts of the images you want to correct.

If that is not an option you can try to apply a little bit of smoothing (using fslmaths) to the registered fieldmaps such that the field becomes invertible. It is not ideal since it means you end up with a less faithful (smoothed) representation of the field, but it might help you save data that you have already acquired. I tried that trick myself on your data and the results looks alright to the eye. And all the strange distortions are gone.


1 Like

@marklar, is the AC-PC alignment done on the dwi dataset? Is there a particular reason why you chose to run this step so late in the preprocessing?

I do the alignment to ACPC after all the corrections to avoid bias or distortion affect the alignment of the EPI volume to the template or the T1 I am using as reference.