Skip to content

Commit

Permalink
Merge pull request #562 from ANTsX/plot-std-img
Browse files Browse the repository at this point in the history
fix issue with plotting negative-sum images
  • Loading branch information
Nick Cullen authored Mar 12, 2024
2 parents ba43328 + fe3783b commit 0ad546f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ants/viz/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 0ad546f

Please sign in to comment.