Skip to content

Commit 3dec938

Browse files
committed
FIX: Fix merge_rois node crash
1 parent 73b2f03 commit 3dec938

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

fmriprep/workflows/pet/confounds.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -382,8 +382,8 @@ def init_pet_confs_wf(
382382
(acompcor_tfm, acompcor_bin, [('output_image', 'in_file')]),
383383
(acompcor_bin, merge_rois, [
384384
(('out_mask', _last), 'in3'),
385-
(('out_mask', lambda masks: masks[0]), 'in1'),
386-
(('out_mask', lambda masks: masks[1]), 'in2'),
385+
(('out_mask', _first), 'in1'),
386+
(('out_mask', _second), 'in2'),
387387
]),
388388
(merge_rois, signals, [('out', 'label_files')]),
389389

@@ -615,12 +615,23 @@ def _last(inlist):
615615
return inlist[-1]
616616

617617

618+
def _first(inlist):
619+
"""Return the first element of a list."""
620+
621+
return inlist[0]
622+
623+
624+
def _second(inlist):
625+
"""Return the second element of a list."""
626+
627+
return inlist[1]
628+
618629
def _select_cols(table):
619630
"""Return confound columns excluding a/tCompCor and std_dvars."""
620631
import pandas as pd
621632

622633
return [
623634
col
624635
for col in pd.read_table(table, nrows=2).columns
625-
if not col.startswith(("a_comp_cor_", "t_comp_cor_", "std_dvars"))
636+
if not col.startswith(('a_comp_cor_', 't_comp_cor_', 'std_dvars'))
626637
]

0 commit comments

Comments
 (0)