From 778ff902ebf2384887bdf6b3dd7f6f50b8e4e2ce Mon Sep 17 00:00:00 2001 From: Thiago Franco de Moraes Date: Sun, 26 Mar 2017 12:40:28 -0300 Subject: [PATCH] Forcing indexes to int in editor and watershed tools --- invesalius/data/slice_.py | 8 ++++---- invesalius/data/styles.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/invesalius/data/slice_.py b/invesalius/data/slice_.py index 09f731b..af70f59 100644 --- a/invesalius/data/slice_.py +++ b/invesalius/data/slice_.py @@ -463,10 +463,10 @@ class Slice(object): cx = index.shape[1] / 2 + 1 cy = index.shape[0] / 2 + 1 - xi = px - index.shape[1] + cx - xf = xi + index.shape[1] - yi = py - index.shape[0] + cy - yf = yi + index.shape[0] + xi = int(px - index.shape[1] + cx) + xf = int(xi + index.shape[1]) + yi = int(py - index.shape[0] + cy) + yf = int(yi + index.shape[0]) if yi < 0: index = index[abs(yi):,:] diff --git a/invesalius/data/styles.py b/invesalius/data/styles.py index 07d09a3..681157e 100644 --- a/invesalius/data/styles.py +++ b/invesalius/data/styles.py @@ -1276,10 +1276,10 @@ class WaterShedInteractorStyle(DefaultInteractorStyle): cx = index.shape[1] / 2 + 1 cy = index.shape[0] / 2 + 1 - xi = px - index.shape[1] + cx - xf = xi + index.shape[1] - yi = py - index.shape[0] + cy - yf = yi + index.shape[0] + xi = int(px - index.shape[1] + cx) + xf = int(xi + index.shape[1]) + yi = int(py - index.shape[0] + cy) + yf = int(yi + index.shape[0]) if yi < 0: index = index[abs(yi):,:] -- libgit2 0.21.2