From a90e2efe8dc9f76ba1b944da6f73bb172937c3b0 Mon Sep 17 00:00:00 2001
From: Harry Carey <38996929+PolarBean@users.noreply.github.com>
Date: Sun, 10 Sep 2023 15:02:32 +0000
Subject: [PATCH] Fixed issue where negative coordinates where displayed as
 repeating elements

---
 PyNutil/generate_target_slice.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/PyNutil/generate_target_slice.py b/PyNutil/generate_target_slice.py
index 074fcca..9cd83c7 100644
--- a/PyNutil/generate_target_slice.py
+++ b/PyNutil/generate_target_slice.py
@@ -29,7 +29,8 @@ def generate_target_slice(alignment, volume):
     Z_Coords = np.round(Z_Coords).astype(int)
 
     out_bounds_Coords = (
-        (X_Coords > bounds[0]) | (Y_Coords > bounds[1]) | (Z_Coords > bounds[2])
+        (X_Coords > bounds[0]) | (Y_Coords > bounds[1]) | (Z_Coords > bounds[2]) 
+        | (X_Coords < 0) | (Y_Coords < 0) | (Z_Coords < 0)
     )
     X_pad = X_Coords.copy()
     Y_pad = Y_Coords.copy()
-- 
GitLab