Preprocessing advice before eddy correction


I’m new to MRtrix and I have a few questions about preprocessing before eddy correction.

1- I’m aware that dwidenoise should be the initial preprocessing step before anything else. But how should my dwi data be organized? Currently my dwi.nii.gz consists of an image with no diffusion every 8 images with diffusion. Can I simply feed dwi.nii.gz to dwidenoise? Shouldn’t I specify bvals somewhere?

2- I assume that B1 field inhomogeneity and Gibbs artifact are not corrected with dwidenoise. Can I still apply dwibiascorrect and mrdegibbs after dwidenoise (but before eddy correction)?

3- are there any other preprocessing steps you would recommend before running eddy?

Thank you!


From my experience, you don’t need to specify bvals and bvecs for dwidenoise, however if you convert your data to .mif as a first step, you don’t need to worry for that anymore (I always use nifti because an old habit).

The ordet in which I apply the commands are (and is the recommended):

  • dwdenoise
  • topup + eddy
  • dwibiascorrect

I don’t use mrdegibbs, I was not sure when I started to process the data because I have partial fourier acquisition, but now I would probably run it after dwidenoise.

I hope this helps.

Best regards,


1 Like

dwidenoise does not use the gradient infomation so you don’t need to provide it. That said, the easiest and most foolproof way of processing your diffusion weighted images is to use .mif files instead of .nii. .mif files can include the gradient info inside the image header, which means you can pass it to any mrtrix command without having to worry about the gradients. The gradients will even be updated automatically, e.g. if you rotate your images. See for details on gradient handling.

The recommended order is:

  • dwidenoise
  • mrdegibbs
  • dwipreproc
  • dwibiascorrect

Thank you for your answers!
I’m using a previous script that runs FSL’s eddy, but I’d like to remove confounds with MRtrix3 before passing the data over to eddy. I suppose I can use mif during the dwidenoise and mrdegibbs calls and then convert it back to nii, right?

However eddy also rotates my bvecs - if dwidenoise updates the gradients, can I still use the standard eddy function? Won’t the bvecs be rotated twice then?


dwidenoise or mrdegibbs don’t use the gradient information, so you can use nifti to both steps. and let eddy alone take carr for the rotations.

Best regards,


Just in case there’s any confusion here: dwipreproc will run FSL’s eddy for you (and optionally topup), and take care of all these issues. You can inspect the exact commands it runs in the background, and the contents of the temporary folder it creates if you want to verify that it does what you expect. I would recommend you use that script unless you have exotic data that it can’t handle – @rsmith had devoted quite a bit of time and effort to making sure that it works correctly in as many use cases as possible. The advantage is that you can pass .mif files to it and get the output in that format too, which means the DW information is kept within the image headers and maintained consistently throughout the pipeline.

Can I ask a related question please?
I have two images without diffusion, one from my dwidata (nodif_AP) and a nodif_PA. I followed the steps in the FSL webpage to create a both_nodif.nii.gz, which combines nodif_AP and nodif_PA. I would like to denoise the dwidata with dwidenoise.
My question is, should I run dwidenoise on both dwidata and nodif_PA (before creating both_nodif) or can I first create both_nodif and then denoise the dwidata?
In the latter case, the images in both_nodif will not have been denoised, whereas the dwidata will be denoised. I’m not sure if this is valid, since I’m passing non-denoised data to topup but then use denoised data in the eddy step…

I think you’ll find answers to that question here…? Hopefully that’s what you were after?