Mrregister changes the signal values

Hi experts!
I’m going to do a motion correction for one set of data,but I found dwifslpreproc doesn’t work. Then I extract every single 3d volume of all diffusion encoding directions to do mrregister making every dwi align with the 5th dwi which is well-aligned with b0 image.After realizing poor effect without additional information , I put the brain mask of the pair dwi and I got good result.
mrregister -type rigid -rigid_init_translation geometric \ 1.nii.gz 5.nii.gz \ -mask1 1_bm_mask.nii.gz \ -mask2 5_bm_mask.nii.gz \ -transformed t1.nii.gz \ -datatype float64le -force

My problem is that after registration the intensity values of the dwi appears negative value. I have known it maybe caused by mrresize after reading this topic but still don’t know how to fix it. While I’m planning to resample the dwi intensity using spherical harmonics, the results of the data with negative values was poor.

So I was wondering if there exists a way to resolve the negative values rather than ignoring them?

Thank you,

Hi @yoyo,

OK, my first reaction would be ask why dwifslpreproc doesn’t work for you, and whether there is an easy fix to get it work. That would avoid you having to come up with an alternative ad-hoc method like this…

But to answer your specific question: the issue is indeed with the use of cubic interpolation for the regridding, which can introduce negative values where there were none before. One option is to set negative values to zero afterwards:

mrcalc t1.nii.gz 0 -max t1_fixed.nii.gz

This assumes t1.nii.gz was the regridded output that needs fixing.

Alternatively, you could perform the regridding using linear interpolation instead. It tends to introduce a bit more blurring, but it shouldn’t introduce negative values. The problem is that there is no option within mrregister to set the interpolation method used for the -transformed output, so you’ll need to run the registration in two steps, one to get the transformation, and then another to apply the transformation. Something like this ought to do the trick:

mrregister -type rigid -rigid_init_translation geometric \
  1.nii.gz 5.nii.gz \
  -mask1 1_bm_mask.nii.gz \
  -mask2 5_bm_mask.nii.gz \
  -rigid R.txt 
mrtransform 1.nii.gz -linear R.txt -template 5.nii.gz -interp linear t1.nii.gz 

Hope this helps,