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

FIX: Restore --ignore sbref functionality #3180

Merged
merged 1 commit into from
Dec 8, 2023
Merged
Changes from all 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
17 changes: 14 additions & 3 deletions fmriprep/workflows/bold/fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,16 +205,27 @@

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 = []

Check warning on line 223 in fmriprep/workflows/bold/fit.py

View check run for this annotation

Codecov / codecov/patch

fmriprep/workflows/bold/fit.py#L222-L223

Added lines #L222 - L223 were not covered by tests
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