Dear mrTrix3 experts,
I have aligned a DWI dataset to a whole-head anatomical volume and would like to run a CSD and tractography analysis (dwi2response, dwi2fod, ) on it. My question is how to ensure that the gradients are correctly oriented after applying the alignment to the DWI data header and whether this should be done in NIFTI or MIF format, because this seems to give different results.
My DWI data are in NIFTI format. I’ve ran FSL topup/eddy on the unaligned DWI data and i’m using the rotated bvecs output by FSL eddy. Then I computed the alignment between the eddy/motion-corrected DWI data and the structural data (not using FLIRT) and got the transformation matrix in a text file. If I now want to apply this alignment to the DWI using mrtransform, what’s the best way to do it?
Option 1: I apply the linear transformation to the NIFTI DWI file using mrtransform and then convert it to MIF format (with the -flsgrad option to include my bvals and bvecs in the header).
Option 2: I convert my NIFTI DWI file to the MIF format (also using the fslgrad option) and then applied the linear transformation.
The transformation matrix of the aligned MIF files returned by mrinfo is identical in both cases. However when I extract the gradient orientation from the aligned NIF files using mrInfo, or when I look at the FOD orientations after running the CSD analysis, the orientations are different. I don’t understand why this is happening.
An alternative would be to do the CSD/tractography analysis on my original unaligned DWI data and then align the resulting FODs to the structural data. This is not ideal though because this means that everytime I re-compute the FOD (I want to compare different algorithms), I need to re-align the resulting FOD, whereas if I can correctly align the gradient orientation to the DWI image to start with, I won’t have to worry about it… (Yet another alternative would be to align the structural data to the DWI data instead of the other way around, but I’d rather have everything in the space as the structural image).
In order to illustrate the difference between options 1 and 2 above, I’m attaching the resulting FOD overlaid onto the DWI after applying a 40 deg rotation around the Y axis (I used this instead of my actual alignment so that the difference is obvious).
Upper left is the FOD computed from the unaligned DWI (overlaid on the unaligned DWI), upper right is the same FOD rotated by 40 deg using mrtransform (overlaid on the rotated DWI). I’m assuming this gives the correct result: colors have changed and reflect the 40 deg rotation, but the FOD still have the expected orientation relative to the (rotated) DWI.
The bottom panels show the FOD correspond to option 1 (left) and 2 (right), both overlaid on the rotated DWI data.
Option 1 gives the same results as rotating the FOD, so this suggests that it is the correct method. I find this difficult to understand. If anything, I would have expected that option 2 would be more likely to be correct (since mrtransform is applied to the MIF file which contains the gradient orientations in its header and presumably should rotate them accordingly)?
Sorry for the long message and thanks in advance for any insight.
Cheers
Julien