Skip to content

Commit 0e8e17f

Browse files
authored
FIX: Restore --ignore sbref functionality (#3180)
This got lost in the shuffle.
1 parent 3ee6a1f commit 0e8e17f

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

fmriprep/workflows/bold/fit.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,16 +204,27 @@ def init_bold_fit_wf(
204204

205205
layout = config.execution.layout
206206

207+
# Fitting operates on the shortest echo
208+
# This could become more complicated in the future
209+
bold_file = bold_series[0]
210+
207211
# Collect sbref files, sorted by EchoTime
208212
sbref_files = get_sbrefs(
209213
bold_series,
210214
entity_overrides=config.execution.get().get('bids_filters', {}).get('sbref', {}),
211215
layout=layout,
212216
)
213217

214-
# Fitting operates on the shortest echo
215-
# This could become more complicated in the future
216-
bold_file = bold_series[0]
218+
basename = os.path.basename(bold_file)
219+
sbref_msg = f"No single-band-reference found for {basename}."
220+
if sbref_files and "sbref" in config.workflow.ignore:
221+
sbref_msg = f"Single-band reference file(s) found for {basename} and ignored."
222+
sbref_files = []
223+
elif sbref_files:
224+
sbref_msg = "Using single-band reference file(s) {}.".format(
225+
",".join([os.path.basename(sbf) for sbf in sbref_files])
226+
)
227+
config.loggers.workflow.info(sbref_msg)
217228

218229
# Get metadata from BOLD file(s)
219230
entities = extract_entities(bold_series)

0 commit comments

Comments
 (0)