Dwibiascorrect doesn't do a good job


Hello all,

I used dwibiascorrect with -ant switch on my single shell dwi data but it data looks better without bias correction.
Please see before bias correction:

and this is after:

Any idea what’s going wrong?



This sounds suspiciously like this issue, which seems specific to MRtrix3 version 3.0_RC2. Which version are you using? In 3.0_RC3, the default parameters for the ants algorithm were adjusted, so it might work better in that version. In addition, support was added for overriding them on the command line, which should at least allow you to tweak the parameters to the underlying ANTs command, N4BiasFieldCorrection, to hopefully get a decent result.


Thanks for your response.
Here is the version that I use:
MRtrix 3.0_RC3-83-g538f905c dwibiascorrect bin version: 3.0_RC3-83-g538f905c

Also, my data is from an infant cohorts.
Is there any any assumption in the pipeline that the data must be from adults? if so, where can I modify that?



OK, yes there’s a good chance neonatal data might need to be handled slightly differently. There is at least one parameter that springs to mind, assuming you’re using the ANTs algorithm: the b parameter sets the scale in mm. You can adjust that at the dwibiascorrect command-line using the -ants.b parameter. You’ll note its current default is set for the adult human brain, try a lower value, and see if that helps?


What age range are we talking about?

Also, looking at your original images, the problem may be that the bias field is a little “too” extreme before, which will result in a sub-optimal brain mask created withing dwibiascorrect, which can in turn result in the “overcorrected” result you got (e.g. if that overly bright region after the “correction” was actually outside the initial mask). What do you get when you run dwi2mask on the data before bias field correction? If you’re able to correct that mask (even manually), you can feed it to the -mask option of dwibiascorrect. Alternatively (and this may sound a bit weird): run dwi2mask on the data before bias field correction, as well as on the data you currently get after bias field correction, and then combine both masks into a single one (via mrcalc), and then run dwibiascorrect again on the original data, but now with the newly obtained mask via the -mask option. This strategy may provide you in a semi-automated way with a more complete mask to feed to dwibiascorrect, potentially without having to resort to manual edits.