Skip to content

Commit

Permalink
FIX: Sort on echo time
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Oct 13, 2023
1 parent 47f305b commit c3dde8a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions fmriprep/workflows/bold/fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,8 +521,11 @@ def init_bold_native_wf(
# Shortest echo first
all_metadata, bold_files, echo_times = zip(
*sorted(
(md := layout.get_metadata(bold_file), bold_file, md.get("EchoTime"))
for bold_file in listify(bold_series)
(
(md := layout.get_metadata(bold_file), bold_file, md.get("EchoTime"))
for bold_file in listify(bold_series)
),
key=lambda _, _, echo_time: echo_time,
)
)
multiecho = len(bold_files) > 1
Expand Down

0 comments on commit c3dde8a

Please sign in to comment.