Skip to content
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

ENH: Flexibilize "sophisticated" pepolar to allow monomodal execution #3393

Merged
merged 3 commits into from
Nov 3, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion fmriprep/workflows/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,19 @@ def init_single_subject_wf(subject_id: str):
suffices = [s.suffix for s in estimator.sources]

if estimator.method == fm.EstimatorType.PEPOLAR:
if len(suffices) == 2 and all(suf in ('epi', 'bold', 'sbref') for suf in suffices):
# "Sophisticated" PEPOLAR schemes should be run "manually" with SDCFlows
# The following two cases are not considered sophisticated:
# 1. All PEPOLAR entities are the same modality
# (typically, more than two EPI PE directions), or
# 2. Two modalities are involved, with at most two images to pass
# into FSL TOPUP.
if (
len(set(suffices)) == 1
or (
len(suffices) == 2
and all(suf in ('epi', 'bold', 'sbref') for suf in suffices)
)
):
wf_inputs = getattr(fmap_wf.inputs, f'in_{estimator.bids_id}')
wf_inputs.in_data = [str(s.path) for s in estimator.sources]
wf_inputs.metadata = [s.metadata for s in estimator.sources]
Expand Down
Loading