# Preprocessing advice before eddy correction

**URL:** https://community.mrtrix.org/t/preprocessing-advice-before-eddy-correction/2904
**Category:** Uncategorized
**Created:** [October 11, 2019, 5:56pm UTC](https://community.mrtrix.org/t/preprocessing-advice-before-eddy-correction/2904 "2019-10-11T17:56:51Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![mkv](https://community.mrtrix.org/letter_avatar_proxy/v4/letter/m/bc79bd/32.png) [@mkv](https://community.mrtrix.org/u/mkv)
#### Post date: [October 11, 2019, 5:56pm UTC](https://community.mrtrix.org/t/preprocessing-advice-before-eddy-correction/2904/1 "2019-10-11T17:56:51Z")

</div>

Hello,

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!

---

<div class="post-metadata">

### Author: ![mblesac](https://community.mrtrix.org/user_avatar/community.mrtrix.org/mblesac/32/2210_2.png) [@mblesac](https://community.mrtrix.org/u/mblesac)
#### Post date: [October 11, 2019, 6:22pm UTC](https://community.mrtrix.org/t/preprocessing-advice-before-eddy-correction/2904/2 "2019-10-11T18:22:08Z")

</div>

Hi,

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,

Manuel

---

<div class="post-metadata">

### Author: ![bjeurissen](https://community.mrtrix.org/user_avatar/community.mrtrix.org/bjeurissen/32/28_2.png) [@bjeurissen](https://community.mrtrix.org/u/bjeurissen)
#### Post date: [October 11, 2019, 6:34pm UTC](https://community.mrtrix.org/t/preprocessing-advice-before-eddy-correction/2904/3 "2019-10-11T18:34:17Z")

</div>

> [@mkv](#):
>
> 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?

`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 [Diffusion gradient scheme handling — MRtrix3 3.0 documentation](https://mrtrix.readthedocs.io/en/latest/concepts/dw_scheme.html) for details on gradient handling.

> [@mkv](#):
>
> 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?

The recommended order is:

- dwidenoise
- mrdegibbs
- dwipreproc
- dwibiascorrect

---

<div class="post-metadata">

### Author: ![mkv](https://community.mrtrix.org/letter_avatar_proxy/v4/letter/m/bc79bd/32.png) [@mkv](https://community.mrtrix.org/u/mkv)
#### Post date: [October 13, 2019, 8:03am UTC](https://community.mrtrix.org/t/preprocessing-advice-before-eddy-correction/2904/4 "2019-10-13T08:03:45Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![mblesac](https://community.mrtrix.org/user_avatar/community.mrtrix.org/mblesac/32/2210_2.png) [@mblesac](https://community.mrtrix.org/u/mblesac)
#### Post date: [October 13, 2019, 9:47am UTC](https://community.mrtrix.org/t/preprocessing-advice-before-eddy-correction/2904/5 "2019-10-13T09:47:34Z")

</div>

Hi,

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,

Manuel

---

<div class="post-metadata">

### Author: ![jdtournier](https://community.mrtrix.org/user_avatar/community.mrtrix.org/jdtournier/32/2594_2.png) [@jdtournier](https://community.mrtrix.org/u/jdtournier)
#### Post date: [October 13, 2019, 11:51am UTC](https://community.mrtrix.org/t/preprocessing-advice-before-eddy-correction/2904/6 "2019-10-13T11:51:46Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![mkv](https://community.mrtrix.org/letter_avatar_proxy/v4/letter/m/bc79bd/32.png) [@mkv](https://community.mrtrix.org/u/mkv)
#### Post date: [January 17, 2020, 10:53am UTC](https://community.mrtrix.org/t/preprocessing-advice-before-eddy-correction/2904/7 "2020-01-17T10:53:10Z")

</div>

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…

---

<div class="post-metadata">

### Author: ![jdtournier](https://community.mrtrix.org/user_avatar/community.mrtrix.org/jdtournier/32/2594_2.png) [@jdtournier](https://community.mrtrix.org/u/jdtournier)
#### Post date: [January 17, 2020, 11:00am UTC](https://community.mrtrix.org/t/preprocessing-advice-before-eddy-correction/2904/8 "2020-01-17T11:00:12Z")

</div>

I think you’ll find [answers to that question here](https://community.mrtrix.org/t/processing-of-volumes-prior-to-dwipreproc/2112)…? Hopefully that’s what you were after?
