Skip to content

Commit 7cf0f05

Browse files
authored
Merge pull request #119 from nipreps/fix_confounds_few_frames
ENH: Update confounds workflow condition for data with few frames
2 parents 3ae01a3 + cf2242c commit 7cf0f05

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

petprep/workflows/pet/base.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,7 @@ def init_pet_wf(
756756
(pet_ref_tacs_wf, ds_ref_tacs, [('outputnode.timeseries', 'in_file')]),
757757
]) # fmt:skip
758758

759-
if nvols > 1: # run these only if 4-D PET
759+
if nvols > 2: # run these only if PET has at least 3 frames
760760
pet_confounds_wf = init_pet_confs_wf(
761761
mem_gb=mem_gb['largemem'],
762762
metadata=all_metadata[0],
@@ -832,6 +832,11 @@ def _last(inlist):
832832
]),
833833
]) # fmt:skip
834834

835+
else:
836+
config.loggers.workflow.warning(
837+
'PET confounds will be skipped - series has only %d frame(s)', nvols
838+
)
839+
835840
# Fill-in datasinks of reportlets seen so far
836841
for node in workflow.list_node_names():
837842
if node.split('.')[-1].startswith('ds_report'):

0 commit comments

Comments
 (0)