Flirt error

Hi everyone,

I’m using Mrtrix3 to do the fixel-based analysis, and I want to register the wmfod_template.mif to the MNI. When I run this with my test dataset, which only contained 2 subjects of all, it went successfully, whereas, when I run the same commands with all my subjuects, something wrong happened, and I’ve searched in the FSL email list, I didn’t find anything helpful there.
The outcome template2mni.mat is full of nan, I was wondering what might cause this error?
Here is my command:

# extract the I=0
mrconvert wmfod_template.mif wmfod_template_bad_strides.nii.gz
mrconvert wmfod_template_bad_strides.nii.gz wmfod_template.nii.gz -strides -1,2,3,4
mrconvert wmfod_template.nii.gz I0image.nii.gz -coord 3 0

# register 
flirt -ref MNI152_T1_1mm_brain.nii.gz -in I0image.nii.gz -omat template2mni.mat -dof 12

Any help would be greatly appreciated! Thanks in advance

Yuting

Hi,

Could it be that your I0image has NaN values? If so, use fslmaths -nan to replace with zeros before running flirt.

For debugging purposes, perhaps also output the transformed image from flirt and check whether the registration was satisfactory.

Cheers,
Nick

Hi, Nick
I have retried with your suggestion, and it worked great!! Thank you a lot!

Best wishes,
Yuting

1 Like