How are flirt and mcflirt different?

Hi,

I have a hard time understanding how flirt and mcflirt are different. Don’t both align all volumes to the reference volume?

Is mcflirt an extra step to run after registering the volumes with flirt?

Thanks for your time

FLIRT is a general linear image registration tool. MCFLIRT uses FLIRT techniques to perform motion correction.

Could you please explain the difference? Is it that mcflirt takes 4D input and flirt does not?

I am trying to register two different runs acquired at two sessions, and I have tried both flirt, and mcflirt, using the first volume of the first run as the reference volume to make them realigned, but I don’t know how it works. Could you please advise on it? How can I use command line to register runs?

Could you please explain the difference? Is it that mcflirt takes 4D input and flirt does not?

Yes I think that pretty much summarize it, mcflirt works of 4D input and may be using flirt several times to register each subvolume with the reference volume. (I am not totally sure of the exact implementation of mcflirt, as I am not a FSL developper).

I am trying to register two different runs acquired at two sessions, and I have tried both flirt, and mcflirt, using the first volume of the first run as the reference volume to make them realigned, but I don’t know how it works. Could you please advise on it? How can I use command line to register runs?
One way to do so would be to concatenate your two runs with fslmerge and then run mcflirt on the concatenated run mentioning that you use the first volume as a reference.

Here is a basic example with two fmri runs named run1.nii.gz and run2.nii.gz with N_vol volumes each

fslmerge -t run1run2.nii.gz run1.nii.gz run2.nii.gz
mcflirt -in run1run2.nii.gz -out mc_run1run2.nii.gz -refvol 0
fslroi mc_run1run2.nii.gz mc_run1.nii.gz 0 N_vol
fslroi mc_run1run2.nii.gz mc_run2.nii.gz N_vol N_vol 

This a a very simple example, other programs such as SPM allow for the motion and susceptibility distorsion correction simultaneously (Realign and Unwarp function) which may be a more complete approach.

EDIT: on the other hand, one can use epi_reg from FSL for simultaneous coregistration and fieldmap unwarping.

Thanks for your reply.
I have tried this before, but fslmerge gives me the following warning:

WARNING:: Inconsistent orientations for individual images when attempting to merge.
Merge will use voxel-based orientation which is probably incorrect - PLEASE CHECK!

I am trying to put the runs in the same space (orientation) before merging them.
I also have tried to register all the runs to the structural, and then realign them, but that doesn’t seem right (and wise) because of needless up-sampling and down-sampling, and memory issues.

I see. If your two runs are not in the same space, fslmerge would indeed not work properly I guess.

Are the orientations of the two runs very different? Or is it a rounding error difference between the two orientations? If it is the latter, you may copy the header of one run to the other and proceed with fslmerge. But be very careful to check that the orientations are very close if you choose this strategy.

Otherwise, you may go for a “FMRIPREP”-like approach where each fMRI run is individually realigned (you could chose the 1st volume of each run as reference or register to the mean), corrected for susceptibility distorsion correction and registered to the T1w space.

I don’t want to register them to the T1 at this stage. I just want the runs preprocessed and concatenated.

This is the overlay information from fsleyes, and the transformation matrices are different only on the last column, which I think is the problem, right?

First run of the first session:

Another run in the second session:

Should these matrices completely match? I am not very sure if I understand them thoroughly, so I have not manipulated them.

I should have asked at the beginning: What do yo mean by session? Did the subject move out of the scanner between those two sessions? Or is it more like a run, where you repeat the same acquisition while the subject stay at the same position in the scanner?

The last column is telling about the position of origin of the images in world space. So in your case those images are really not in the same space.

In general I don’t think that you should merge the two sessions for preprocessing as there is a “session effect” that you will need to model in the GLM. I am not an expert in fMRI analysis, but I heard that for each run, you get a slightly different steady state of your magnetization and this affects each run differently and this should be taken account in the analysis.

1 Like

Yes, I have different sessions, and each session has several runs. Participants moved out of the scanner between sessions, but not between runs.

I am really struggling with figuring out how to do registration and merging of all the runs, and any hint and guidance are highly appreciated.

I wonder if I can manipulate the transformation matrices and make all of them have the same one from the first session? Does that just move the head in space? And would the merging the runs after this be valid?

Thank you for the explanation. The terminology you use is correct.

If the head has a different position, which is expected between different sessions, then you have to be aware that the distorsions are likely to be different between sessions, that is why in general people acquire one fieldmap for each session, in order to assess the distorsion field for every fMRI of each session.

I don’t think that you should attempt to manipulate the transformation matrices of each run/session out of the standard registration tool.

I am reaching the end of my expertise on this topic, but you should look at the user manual of tools such as FSL FEAT.
For instance:

https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/FEAT/UserGuide#First-level_or_Higher-level_Analysis.3F

First-level or Higher-level Analysis?
Use First-level analysis for analysing each session’s data - i.e. the time-series analysis of the raw 4D FMRI data.
Use Higher-level analysis for combining first-level analyses. You can use this hierarchically - for example at second-level to analyse across several sessions and then at third-level to analyse across several subjects

From what I understand, analysing across session falls into a higher level analysis and you should preprocess your sessions separately.

An additional discussion on this topic here:

https://www.researchgate.net/post/FMRI-First-level-analysis-in-SPM-do-i-have-to-separate-sessions

1 Like

Thanks a lot.

Yes, I did try using FEAT GUI before I figure out sessions are processed in higher level analysis. I do not have any contrasts to look at in FEAT and the higher level analyses require statistic tabs to be provided. That’s why I decided to use command line instead, which has been unfortunately unsuccessful. Do you know if I can do higher level analysis with FEAT GUI without any statistical model?

And thanks a lot for your time and help.

When you say that you have no contrast to look at, is it because you are dealing with resting state fMRI?

I am not a user of FEAT myself, I can’t provide more guidance here. Let’s wait to see what others are recommending.

If you are doing a resting state fMRI study, may be some information on this page may be useful to you to use FEAT with your data?

https://neuroimaging-core-docs.readthedocs.io/en/latest/pages/fsl_fmri_restingstate-sbc.html