I am looking for the EPI->T1 transform. Specifically, I am looking for the transform from the first run’s EPI reference image to the the subject’s anatomical. I came across this post but I am still a little confused. I was hoping someone could clarify.
In the workdir, I see several transforms in the folder …/bold_reg_wf/bbreg_wf/:
bbregister/
fsl2itk_fwd/
lta2fsl_fwd/
Are these different formats of the same transform, or altogether different transforms? I see there is a folder named “compare_transforms” so I am guessing the latter - the above are compared and then the “best” one is selected?
Is this “best transform” stored in the /mri_coreg/ folder?
Cheers!
(Apologies for reposting this from my reply to the linked post, but there was no follow up there, maybe because that post was outdated.)
I suspect your last post got drowned in notifications over the holidays. Sorry. Thanks for opening a new one.
There are three equivalent transforms (I think I have the extensions correct):
LTA (FreeSurfer): lta_concat/*.lta
FSL: lta2fsl_fwd/*.mat
ITK: fsl2itk_fwd/*.txt
You should not use the mri_coreg or bbregister results directly, since they don’t account for differences between FreeSurfer’s T1.mgz and fMRIPrep’s output desc-preproc_T1w.nii.gz. Further, we also check whether the boundary-based refinement (bbregister) is too far from the initial, rigid coregistration (mri_coreg). If the disparity is too great, we fall-back to the initial coregistration (see EPI to T1w registration. Because of this, it’s not clear which one will be correct.
Fortunately lta_concat combines the selected transform with the update to account for FreeSurfer-fMRIPrep differences, solving both problems.
However something seems to be off - most likely my understanding.
A bit more background.
I run fmriprep using --output-spaces func. I do all my analysis in that space. For visualization, I project on to the subject’s cortex (using pycortex). For this I need to know the transform from the EPI to the subjects own anatomical image.
Am I correct in saying that this transform is located here:
tkregister2 is something of black magic to me, and I can’t give you good suggestions. As a vague guess, it’s possible that you need to invert the registration, as most transforms can be conceived of forwards or backwards. If you’d like to work with it, the FreeSurfer list is going to have much better feedback than I can give.
What I would do is to resample with mri_vol2surf, and see what that gets you. I’ve found the logic of these tools very predictable. Hopefully you have some simple result where you expect to see a big blob that you can project and make sure it appears correct on the surface?
I see. Thanks for the suggestion. I might try the FreeSurfer list.
Could I just get you to clarify one thing - what did you mean by
You should not use the mri_coreg or bbregister results directly, since they don’t account for differences between FreeSurfer’s T1.mgz and fMRIPrep’s output desc-preproc_T1w.nii.gz .
Are these two anatomicals not aligned with each other?
Typically they are, but if users provide pre-run FreeSurfer directories, we can’t guarantee that, so we also perform a registration to account for any differences.
It is very often the identity transform, but we don’t assume it. That bit us a while back when users might have multiple T1w images, which might be combined differently depending on the order they are entered into FreeSurfer.
My call to tkregister2 was incorrect (I did not correctly use the lta flag). The transform looks alright with the correct args. The documentation on tkregister2 is a bit confusing, so for others’ benefit the transform can be assessed using the following tkregisterfv call:
I am still a bit confused though. If I manually use bbreg to estimate a transform from the boldref to the subjecst T1 it looks like this (.dat format).
One thing I noticed is that the func bold_ref images (e.g. /fmriprep/sub-001/ses-1/func/sub-001_ses-1_task-perceptDecouple_acq-TR1000_run-1_boldref.nii.gz) use radiological convention, while the subj anatomical T1 (preproc_T1w) (as well as the bold T1 ref (space-T1w_boldref) use neurological convention.
Perhaps this difference in convention is taken into account in the manual bbreg I preformed but not in lta_concat?