Thank you Frank, I was using the original fa file, which has a different transformation matrix in the header. So either the header of the tract density image needs to be adjusted or the fa.nii. That makes sense.
Last question, whenever you apply the linear transformation to the coordinates in the .trk files, do you just multiple the 3x3 with the coordinates to rotate them? what do you do with the linear translation?
I apologize for the many questions, this switching between coordinate systems and different programs has been a very frustrating problem to fix and there is very little documentation on how to do it correctly.
My best,
Emilie