Need correction of tensors/bvecs if doing b0 to T1 inhomogeneity correction?


I am using the following commands to correct for b0 inhomogeneities by warping the post eddy corrected b0 volume to a subjects T1 and then applying that warp to the diffusion weighted image as discussed in this paper -d 3 -i ${dwi_dir}/${subj}/dmri/lowb_brain.nii.gz -r ${SUBJECTS_DIR}/${subj}/mri/brainmask.mgz -x ${SUBJECTS_DIR}/${subj}/mri/brainmask.mgz -w template -o ${dwi_dir}/${subj}/dmri/B0toT1SmallWarp -t 2

antsApplyTransforms -d 3 -e 3 -i ${dwi_dir}/${subj}/dmri/dwi.nii.gz -n BSpline -r ${SUBJECTS_DIR}/${subj}/mri/brainmask.mgz -o ${dwi_dir}/${subj}/dmri/dwi_corrected.nii.gz -t ${dwi_dir}/${subj}/dmri/B0toT1SmallWarp1Warp.nii.gz -t ${dwi_dir}/${subj}/dmri/B0toT1SmallWarp0GenericAffine.mat

dtifit -k ${dwi_dir}/${subj}/dmri/dwi_corrected.nii.gz -m ${dwi_dir}/${subj}/dmri/B0toT1SmallWarpanatomical.nii.gz -r ${dwi_dir}/${subj}/dmri/bvecs -b ${dwi_dir}/${subj}/dmri/bvals -o ${dwi_dir}/${subj}/dmri/dtifit

My question is are there any modifications to the tensors or b-values that I have to make before estimating the tensor values with dtifit? Are there any other factors I should take into consideration or be wary of? The technique seems to have greatly improved the b0 inhomogeneities in my dwi images.

Daniel Callow


As you are applyng a translation and a rotation to your diffusion image, you need to rotate the bvecs after that. I just found this code that supose to do this for you.

Best regards,


Also, when trying to convert a .mat linear transformation matrix from ANTS I am having trouble getting the matrix into mrtrix format.

See below the error I am getting.

transformconvert /Volumes/DANIEL/dti_pin/trac/APOE.124/dmri/B0toT1SmallWarp0GenericAffine.mat itk_import /Volumes/DANIEL/dti_pin/trac/APOE.124/dmri/B0toT1SmallWarp0GenericAffine

transformconvert: [ERROR] invalid first line for key/value file “/Volumes/DANIEL/dti_pin/trac/APOE.124/dmri/B0toT1SmallWarp0GenericAffine.mat” (expected “#Insight Transform File V1.0”)

Thank you, It seems that all the options only address applying linear rotations. Is there a way/do I need to correct for the nonlinear ants warp I am applying.


I think you only have to apply the rotation to the bvecs, the affine matrix. The warp shouldn’t affect to the bvecs orientation.

Best regards,