Skip to content

Commit

Permalink
Merge pull request #2843 from mgxd/fix/sbref-filtering
Browse files Browse the repository at this point in the history
FIX: Filter sbrefs by BIDS filters if available
  • Loading branch information
mgxd committed Sep 6, 2022
1 parent e963b77 commit a37c90d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions fmriprep/workflows/bold/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,14 @@ def init_func_preproc_wf(bold_file, has_fieldmap=False):
)

# Find associated sbref, if possible
entities["suffix"] = "sbref"
entities["extension"] = [".nii", ".nii.gz"] # Overwrite extensions
sbref_files = layout.get(return_type="file", **entities)
overrides = {
"suffix": "sbref",
"extension": [".nii", ".nii.gz"],
}
if config.execution.bids_filters:
overrides.update(config.execution.bids_filters.get('sbref', {}))
sb_ents = {**entities, **overrides}
sbref_files = layout.get(return_type="file", **sb_ents)

sbref_msg = f"No single-band-reference found for {os.path.basename(ref_file)}."
if sbref_files and "sbref" in config.workflow.ignore:
Expand Down

0 comments on commit a37c90d

Please sign in to comment.