Issue in co-registration of FA data after QSIPrep and DTIfit and its white matter mask via FSL flirt and MRtrix

Hi everyone, I have a question about the way to co-register the FA imaging after QSIPrep and DTIfit with its white matter mask imaging. When I used fsl header to check their coordinate system information, they are in different space (as following).

Now, I wanna use flirt from FSL to register the FA imaging to T1w image. The code is as follows (T1w image is in the same space with white matter mask imaging):

flirt -in FA.nii.gz -ref T1w.nii.gz -interp trilinear -dof 12 -omat diff2struct_fsl.mat

transformconvert diff2struct_fsl.mat FA.nii.gz T1w.nii.gz flirt_import diff2struct_mrtrix.txt 

mrconvert FA.nii.gz FA.mif

mrtransform FA.mif -linear diff2struct_mrtrix.txt  -inverse registered_FA.mif

mrconvert registered_FA.mif registered_FA.nii.gz

After getting the registered nifti file, I checked the coordinate system with fsl header. The coordinate system is still in the different space and the coordinate system of output image is chaotic.

The following is the header information of each file.
white matter mask:

qform_name Scanner Anat
qform_code 1
qto_xyz:1 -1.000000 0.000000 0.000000 96.000000
qto_xyz:2 0.000000 -1.000000 0.000000 96.000000
qto_xyz:3 0.000000 0.000000 1.000000 -78.000000
qto_xyz:4 0.000000 0.000000 0.000000 1.000000
qform_xorient Right-to-Left
qform_yorient Anterior-to-Posterior
qform_zorient Inferior-to-Superior
sform_name Scanner Anat
sform_code 0
sto_xyz:1 0.000000 0.000000 0.000000 0.000000
sto_xyz:2 0.000000 0.000000 0.000000 0.000000
sto_xyz:3 0.000000 0.000000 0.000000 0.000000
sto_xyz:4 0.000000 0.000000 0.000000 1.000000
sform_xorient Unknown
sform_yorient Unknown
sform_zorient Unknown

FA.nii.gz:

qform_name Scanner Anat
qform_code 1
qto_xyz:1 -1.300000 0.000000 0.000000 95.850006
qto_xyz:2 0.000000 -1.300000 0.000000 102.550011
qto_xyz:3 0.000000 0.000000 1.300000 -86.150002
qto_xyz:4 0.000000 0.000000 0.000000 1.000000
qform_xorient Right-to-Left
qform_yorient Anterior-to-Posterior
qform_zorient Inferior-to-Superior
sform_name Scanner Anat
sform_code 1
sto_xyz:1 -1.300000 0.000000 0.000000 95.850006
sto_xyz:2 0.000000 -1.300000 0.000000 102.550011
sto_xyz:3 0.000000 0.000000 1.300000 -86.150002
sto_xyz:4 0.000000 0.000000 0.000000 1.000000
sform_xorient Right-to-Left
sform_yorient Anterior-to-Posterior
sform_zorient Inferior-to-Superior

T1w.nii.gz:

qto_xyz:1 -1.000000 0.000000 0.000000 96.000000
qto_xyz:2 0.000000 -1.000000 0.000000 96.000000
qto_xyz:3 0.000000 0.000000 1.000000 -78.000000
qto_xyz:4 0.000000 0.000000 0.000000 1.000000
qform_xorient Right-to-Left
qform_yorient Anterior-to-Posterior
qform_zorient Inferior-to-Superior
sform_name Scanner Anat
sform_code 0
sto_xyz:1 0.000000 0.000000 0.000000 0.000000
sto_xyz:2 0.000000 0.000000 0.000000 0.000000
sto_xyz:3 0.000000 0.000000 0.000000 0.000000
sto_xyz:4 0.000000 0.000000 0.000000 1.000000
sform_xorient Unknown
sform_yorient Unknown
sform_zorient Unknown

registered_FA.nii.gz:

qform_name Unknown
qform_code 0
qto_xyz:1 1.293750 0.000000 0.000000 0.000000
qto_xyz:2 0.000000 1.296040 0.000000 0.000000
qto_xyz:3 0.000000 0.000000 1.286560 0.000000
qto_xyz:4 0.000000 0.000000 0.000000 1.000000
qform_xorient Left-to-Right
qform_yorient Posterior-to-Anterior
qform_zorient Inferior-to-Superior
sform_name Unknown
sform_code 1
sto_xyz:1 -1.293750 -0.001792 -0.000289 95.579117
sto_xyz:2 -0.000000 -1.296037 -0.000152 101.986671
sto_xyz:3 0.000000 -0.002012 1.286560 -85.043640
sto_xyz:4 0.000000 0.000000 0.000000 1.000000
sform_xorient Right-to-Left
sform_yorient Anterior-to-Posterior
sform_zorient Inferior-to-Superior

Does anyone know why does it happen? Are there anything wrong with the flirt and MRtrix code? Or let me know if you have any suggestions.

Thank you!!! Looking forward to your reply:D

Hi @Jose, and welcome to Neurostars!

You might want to use the reorient_fslstd recon spec if you are using FSL afterwards on your preprocessed files. Keep in mind that other recon specifications (e.g., the DIPY DKI and DSI Studio) can also export scalars such as FA. The subject DWI and T1 should be aligned by QSIPrep without user intervention.

Best,
Steven