Hi everyone,
I’m working with diffusion MRI data and generating FA maps using two different tools:
- FA1: computed with MRtrix (3.0.7) (
dwi2tensorand thentensor2metric) - FA2: computed with DIPY
I then register both FA maps to MNI space using FSL’s flirt (v.6.0), with a standard MNI FA template as the reference (template proposed by TractSeg:
flirt -ref template_path -in in_fa_nii_path -out fa_mni_path -omat omat_path -dof 6 -cost mutualinfo -searchcost mutualinfo
Problem
Registration works correctly for FA2 (not perfect but it is coherent), but FA1 consistently gives a bad alignment, even though both FA maps appear to be in the same scanner coordinate system.
For FA1, the transformation matrix shows that flirt did not apply any angular transformation.
Example for one subject:
1 0 0 -0.370660454
0 1 0 0.6984151602
0 0 1 1.238892198
0 0 0 1
Header differences
I inspected the NIfTI headers with fslhd. The qform and sform matrices of FA1 and FA2 are identical. Here are the differences (FA1 (MRtrix) / FA2 (DIPY)):
- data_type FLOAT32 / FLOAT64
- vox_units mm / Unknown
- time_units s / Unknown
- datatype 16 / 64
- nbyper 4 / 8
- bitpix 32 / 64
- pixdim4 to 7 0.0 / 1.0
- qform_code 1 / 0
- sform_code 1 / 2
I supposed that the issue come from the differences in qform_code / sform_code that cause FSL to interpret FA1’s header as less reliable (and maybe leading to orientation or axis-handling heuristics that break the registration).
I tried to change qform/sform for FA1 with fslorient :
fslorient -setsformcode 2 -setqformcode FA1
And then used flirt but it is not working. I also tried fslreorient2std without success.
I feel a bit lost and I do not know what I missing !
Could the differences between pixdim4 and 7 explain the problem?
Do you have any recommended methods for cleaning or normalising the NIfTI header before running ‘flirt’?
Thank you for your help,
Best,
Emmanuelle