Skip to content

Commit 1829514

Browse files
authored
Merge pull request #347 from scott-huberty/fix_better_error
FIX: Raise informative error if no t1w or t2w found
2 parents 3a25507 + e33c722 commit 1829514

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.maint/contributors.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1-
[]
1+
[
2+
{
3+
"affiliation": "Montreal Neurological Institute, McGill University",
4+
"name": "Huberty, Scott",
5+
"orcid": "0000-0003-2637-031X"
6+
}
7+
]

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)