Skip to content

Commit

Permalink
Merge pull request #347 from scott-huberty/fix_better_error
Browse files Browse the repository at this point in the history
FIX: Raise informative error if no t1w or t2w found
  • Loading branch information
mgxd authored Feb 21, 2024
2 parents 3a25507 + e33c722 commit 1829514
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .maint/contributors.json
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
[]
[
{
"affiliation": "Montreal Neurological Institute, McGill University",
"name": "Huberty, Scott",
"orcid": "0000-0003-2637-031X"
}
]
3 changes: 3 additions & 0 deletions nibabies/workflows/anatomical/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,9 @@ def init_infant_single_anat_wf(
"This workflow uses only T1w or T2w inputs, but both contrasts are available."
)

if not (t1w or t2w):
raise RuntimeError("This workflow requires either a T1w or T2w, but none were found.")

anat_files = t1w or t2w
num_files = len(anat_files)
workflow = LiterateWorkflow(name=name)
Expand Down

0 comments on commit 1829514

Please sign in to comment.