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