FSL FLIRT Alignment Issue

Hi there!

I am very new to FSL and am trying to use FLIRT to align neuromelanin images to a reference image. When the FLIRT command is finished running, only about half of the images look correct. The other half appear just like the image I’ve attached below. I’ve tried around with different FLIRT options and different reference images but so far nothing has worked. Anyone have any idea what could be causing this issue?

Thank you!

Hi @Annie.c123, can you share the flirt command that is failing, and some screenshots of the source and reference images?

Hi Paul,
Here is the flirt command I’ve been using:

cmd = f'flirt -in {nm_file} -ref {os.path.join(lc_dir, reference_image)} -out {output_file} -interp spline -dof 6'

It appears I can only upload one image at a time since I am a new user, so I will attach the source images in a separate reply.

Reference image:

Something I noticed was that there seems to be a lot of noise (I am not sure what the correct name for this is) transcending out of the brain in roughly half of the neuromelanin images. Along with this, the transformation matrices of the images that look odd (like the one in my original post) are very different from the other images that look correct. Here is an example of one of the odd transformation matrices:

0.002069 -0.176993 -0.590245 100.921339
0.541678 0.327313 -0.090532 33.741744
0.344711 -0.513277 0.145803 53.424420
0.000000 0.000000 0.000000 1.000000

Thank you!

An example of one of the source images where noise is transcending out of the brain:

An example of one of the source images with high contrast:

Hi @Annie.c123, I can’t tell what is going on here. Is there any chance you could share one of the problematic data sets (both the source and reference image) on dropbox, google drive, etc?