From fe3783bfd0b8da0c71c11a1ff6b180df0c7eb534 Mon Sep 17 00:00:00 2001 From: ncullen93 Date: Tue, 12 Mar 2024 08:53:13 +0100 Subject: [PATCH] fix issue with plotting z-scored images --- ants/viz/plot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ants/viz/plot.py b/ants/viz/plot.py index 5b1a9faf..ca58f90c 100644 --- a/ants/viz/plot.py +++ b/ants/viz/plot.py @@ -228,7 +228,7 @@ def reorient_slice(x, axis): if not isinstance(image, iio.ANTsImage): raise ValueError("image argument must be an ANTsImage") - if not image.sum() > 0: + if sum(sum(image != 0)) == 0: warnings.warn("Image must be non-zero. will not plot.") return