Skip to content

Commit

Permalink
FIX: Restore --ignore sbref functionality (#3180)
Browse files Browse the repository at this point in the history
This got lost in the shuffle.
  • Loading branch information
effigies committed Dec 8, 2023
1 parent 3ee6a1f commit 0e8e17f
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions fmriprep/workflows/bold/fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,16 +204,27 @@ def init_bold_fit_wf(

layout = config.execution.layout

# Fitting operates on the shortest echo
# This could become more complicated in the future
bold_file = bold_series[0]

# Collect sbref files, sorted by EchoTime
sbref_files = get_sbrefs(
bold_series,
entity_overrides=config.execution.get().get('bids_filters', {}).get('sbref', {}),
layout=layout,
)

# Fitting operates on the shortest echo
# This could become more complicated in the future
bold_file = bold_series[0]
basename = os.path.basename(bold_file)
sbref_msg = f"No single-band-reference found for {basename}."
if sbref_files and "sbref" in config.workflow.ignore:
sbref_msg = f"Single-band reference file(s) found for {basename} and ignored."
sbref_files = []
elif sbref_files:
sbref_msg = "Using single-band reference file(s) {}.".format(
",".join([os.path.basename(sbf) for sbf in sbref_files])
)
config.loggers.workflow.info(sbref_msg)

# Get metadata from BOLD file(s)
entities = extract_entities(bold_series)
Expand Down

0 comments on commit 0e8e17f

Please sign in to comment.