Skip to content

Commit ca99456

Browse files
committed
FIX: Raise informative error if no t1w or t2w found
This is to avoid a less informative unbound local error that will be thrown in workflows.anatomical.outputs.init_anat_derivatives_wf on line 514 because the prior if clauses were never hit and so raw_sources never gets defined
1 parent 3a25507 commit ca99456

File tree

1 file changed

+3
-0
lines changed
  • nibabies/workflows/anatomical

1 file changed

+3
-0
lines changed

nibabies/workflows/anatomical/base.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,9 @@ def init_infant_single_anat_wf(
612612
"This workflow uses only T1w or T2w inputs, but both contrasts are available."
613613
)
614614

615+
if not (t1w or t2w):
616+
raise RuntimeError("This workflow requires either a T1w or T2w, but none were found.")
617+
615618
anat_files = t1w or t2w
616619
num_files = len(anat_files)
617620
workflow = LiterateWorkflow(name=name)

0 commit comments

Comments
 (0)