New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoiding sbrefs for the coregistration reference causes poor registration in low contrast multiband sequences #3056
Comments
I'm not even sure SBRefs should be used at all. We probably want to dismiss them totally: for realignment (head-motion estimation, if you want to be precise) I have the impression that a monomodal cost function (with monomodal inputs, i.e., the time series and a reference extracted FROM the time series) should be generally way more reliable than a multimodal cost function (as mutual information) against the SBRef. I'd advocate for using SBRefs only in fieldmap estimation by SDCFlows. WDYT? |
I agree that we should stop using sbref for head motion estimation and sbref for SDC. I think we want to use the fieldmap-corrected sbref for coregistration, as it should have better gray/white contrast for boundary-based registration. |
Here's my current thinking (updated from #3058): graph TB;
sbref.nii---->desc-intermediate_boldref.nii;
bold.nii --> desc-hmc_boldref.nii;
desc-hmc_boldref.nii--->desc-intermediate_boldref.nii;
bold.nii --> from-orig_to-boldref_xfm.txt;
desc-hmc_boldref.nii-->from-orig_to-boldref_xfm.txt;
fmap.nii----->from-fmap_to-boldref_xfm.txt;
desc-intermediate_boldref.nii-->from-fmap_to-boldref_xfm.txt;
fmap.nii---->space-boldref_fmap.nii;
from-fmap_to-boldref_xfm.txt-->space-boldref_fmap.nii;
space-boldref_fmap.nii-->desc-coreg_boldref.nii;
desc-intermediate_boldref.nii-->desc-coreg_boldref.nii;
desc-coreg_boldref.nii-->from-boldref_to-T1w_xfm.txt;
|
I would suggest something like: graph TB;
bold.nii --> desc-hmc_boldref.nii;
bold.nii --> from-orig_to-boldref_xfm.txt;
bold.nii--->desc-hmc+sdc_boldref.nii;
sbref.nii --> fmap.nii;
epi.nii --> fmap.nii;
sbref.nii --> fmapref.nii;
epi.nii --> fmapref.nii;
desc-hmc_boldref.nii --> from-orig_to-boldref_xfm.txt;
from-orig_to-boldref_xfm.txt--->desc-hmc+sdc_bold.nii;
fmapref.nii--->from-fmap_to-boldref_xfm.txt;
fmap.nii--->desc-hmc+sdc_bold.nii;
desc-hmc_boldref.nii--->from-fmap_to-boldref_xfm.txt;
from-fmap_to-boldref_xfm.txt--->desc-hmc+sdc_bold.nii;
desc-hmc+sdc_bold.nii--->desc-hmc+sdc_boldref.nii;
desc-hmc+sdc_boldref.nii--->from-boldref_to-T1w.xfm;
With the following variations, (1) if all PEs are encoded by EPIs under graph TB;
bold.nii --> desc-hmc_boldref.nii;
bold.nii --> from-orig_to-boldref_xfm.txt;
bold.nii--->desc-hmc+sdc_boldref.nii;
dir-AP_epi.nii --> fmap.nii;
dir-PA_epi.nii --> fmap.nii;
dir-AP_epi.nii --> fmapref.nii;
dir-PA_epi.nii --> fmapref.nii;
desc-hmc_boldref.nii --> from-orig_to-boldref_xfm.txt;
from-orig_to-boldref_xfm.txt--->desc-hmc+sdc_bold.nii;
fmapref.nii--->from-fmap_to-boldref_xfm.txt;
fmap.nii--->desc-hmc+sdc_bold.nii;
desc-hmc_boldref.nii--->from-fmap_to-boldref_xfm.txt;
from-fmap_to-boldref_xfm.txt--->desc-hmc+sdc_bold.nii;
desc-hmc+sdc_bold.nii--->desc-hmc+sdc_boldref.nii;
desc-hmc+sdc_boldref.nii--->from-boldref_to-T1w.xfm;
If the fieldmap comes from a phasediff: graph TB;
bold.nii --> desc-hmc_boldref.nii;
bold.nii --> from-orig_to-boldref_xfm.txt;
bold.nii--->desc-hmc+sdc_boldref.nii;
phasediff.nii --> fmap.nii;
magnitude.nii --> fmapref.nii;
desc-hmc_boldref.nii --> from-orig_to-boldref_xfm.txt;
from-orig_to-boldref_xfm.txt--->desc-hmc+sdc_bold.nii;
fmapref.nii--->from-fmap_to-boldref_xfm.txt;
fmap.nii--->desc-hmc+sdc_bold.nii;
desc-hmc_boldref.nii--->from-fmap_to-boldref_xfm.txt;
from-fmap_to-boldref_xfm.txt--->desc-hmc+sdc_bold.nii;
desc-hmc+sdc_bold.nii--->desc-hmc+sdc_boldref.nii;
desc-hmc+sdc_boldref.nii--->from-boldref_to-T1w.xfm;
|
But why do we not want to use |
Fair point. I'll try to see if that automatically translates my proposal into yours. |
Also, a lot of these details about pepolar/phasediff should be abstracted by sdcflows. But if we take fmapref and fmap as given, my graph becomes: graph TB;
bold.nii --> desc-hmc_boldref.nii;
sbref.nii--->desc-intermediate_boldref.nii;
desc-hmc_boldref.nii-->desc-intermediate_boldref.nii;
bold.nii --> from-orig_to-boldref_xfm.txt;
desc-hmc_boldref.nii-->from-orig_to-boldref_xfm.txt;
fmapref.nii---->from-fmap_to-boldref_xfm.txt;
desc-intermediate_boldref.nii-->from-fmap_to-boldref_xfm.txt;
fmap.nii----->space-boldref_fmap.nii;
from-fmap_to-boldref_xfm.txt-->space-boldref_fmap.nii;
space-boldref_fmap.nii-->desc-coreg_boldref.nii;
desc-intermediate_boldref.nii-->desc-coreg_boldref.nii;
desc-coreg_boldref.nii-->from-boldref_to-T1w_xfm.txt;
Where the intermediate boldref is either the HMC boldref or the sbref, with preference to sbref. |
Hi @effigies and @oesteban -- apologies if this should be a new issue, but I'd like to throw out one additional consideration with respect to sbrefs, coregistration, motion correction, and distortion correction. This is probably an edge case -- and for context note there was some discussion of this issue on the heudiconv page (see nipy/heudiconv#549 (comment)) -- but when users are collecting phase and magnitude images for their functionals (e.g., multi-echo sequences), it looks like fmriprep averages across the sbref images and then uses the average phase and magnitude image as Running fmriprep with Running fmriprep after deleting I know the fmriprep team is still working out how it handles sbref images (#1511), but hopefully this isn't too much of an edge case to merit some attention sooner rather than later. I'd be happy to share some data if it's helpful. Thanks! |
Yes, we should update our queries to take part mag or None. That's a quick fix, and you can use it in a BIDS filter file (see FAQ) already. |
Great, thanks! I'll create a
This should be much better/easier than deleting and renaming various files. Thanks again! |
This won't work:
You'll need to specify the
That will accept files that either do not have a Also, you only need to update the filters that you're changing from the default, so your whole file could be: {
"sbref": {"datatype": "func", "suffix": "sbref", "part": [null, "mag"]}
} |
Wonderful! Thanks for the fix! |
Hi @effigies @oesteban I just wanted to confirm that until this is changed, strategies like this one https://neurostars.org/t/fmriprep-coregistration-within-sessions/5891/6 won't work to align bold across sessions right? |
@effigies sorry to bother you! but we want to implement something where we can ensure good cross-session registration of BOLD data in the same subject like here (https://neurostars.org/t/fmriprep-coregistration-within-sessions/5891/6). Ideally we'd like to use fmriprep since thats what we already use and I am hoping there is some way I can implement it. Do you have any suggestions? |
Hi @zachladwig, I think that approach should still work, since you won't be depending on using the sbrefs for their contrast, just their position. |
got it, so because it uses the sbref for HMC, it will align all of the runs to each other (if I pass it in a fake mean sbref). But, it will not use them for registration. So all of the runs will be aligned to each other (via HMC), but their registration to T1 will be sub-optimal because I will not have the high contrast from the sbref. Right? |
The registration will use a boldref created from each BOLD series aligned to your fake sbref. So the registration should be fine. The current problem is not with how realignment happens, just with using suboptimal contrasts. |
ah okay i think I understand. thank you for your help |
This is fixed in |
great! |
What happened?
Reported in https://neurostars.org/t/poor-func-anatomical-registration-with-fmriprep-21-0-2-on-multi-echo-data-set/26217, coregistration is poor. We currently use sbrefs for the initial boldref, but not for the final, which means that we have the benefit of high contrast for HMC, where it matters less, and not for coregistration, where it matters more.
What command did you use?
What version of fMRIPrep are you running?
21.0.2 and 23.0.2
How are you running fMRIPrep?
Singularity
Is your data BIDS valid?
Yes
Are you reusing any previously computed results?
No
Please copy and paste any relevant log output.
No response
Additional information / screenshots
No response
The text was updated successfully, but these errors were encountered: