Hi, Ajay--
Just as a followup regarding MRTrix3 for the FSL format (http://mrtrix.readthedocs.io/en/latest/concepts/dw_scheme.html)
"It is important to note that in this format, the gradient vectors are provided with respect to the image axes, not in real or scanner coordinates (actually, it’s a little bit more complicated than that, refer to the FSL wiki for details). This is a rich source of confusion, since seemingly innocuous changes to the image can introduce inconsistencies in the b-vectors. For example, simply reformatting the image from sagittal to axial will effectively rotate the b-vectors, since this operation changes the image axes. It is also important to remember that a particular bvals/bvecs pair is only valid for the particular image that it corresponds to."
I can output the files in " real formats".
"It is important to note that in this format, the direction vectors are assumed to be provided with respect to real or scanner coordinates. This is the same convention as is used in the DICOM format."
Does the "FSL" or real format match better to 3dAllineate to apply rotation of bvecs?
Offhand, I don't know. Changing formats across softwares can be *really* tough, indeed, just because different assumptions are made-- not even with one being right/wrong, just different (and *those* seem to be the hardest to catch). One has to look at data very closely and know what to expect in some test cases when doing this.
I mainly use dcm2nii(x) for converting DICOM to NIFTI+text files. I can see where changing an image from RAI -> AIR or something would have a big effect, because the order of coordinates is effectively changed. I would only want to deal with things where everything is in (x,y,z)-type order, I think, for ease of envisioning what is happening, and I would imagine that that would be the easiest for dealing with 3dAllineate with the grads, as well. Note that the "expected" order for transformation values is usually specified in a program, though; I think, for example, that 3dvolreg uses a slightly different order for its size parameters than those six would appear in standard 3dAllineate format. However, I don't know that I have had to do this for anything.
--pt