Commit 778ff902ebf2384887bdf6b3dd7f6f50b8e4e2ce
1 parent
991392d7
Exists in
master
Forcing indexes to int in editor and watershed tools
Showing
2 changed files
with
8 additions
and
8 deletions
Show diff stats
invesalius/data/slice_.py
@@ -463,10 +463,10 @@ class Slice(object): | @@ -463,10 +463,10 @@ class Slice(object): | ||
463 | 463 | ||
464 | cx = index.shape[1] / 2 + 1 | 464 | cx = index.shape[1] / 2 + 1 |
465 | cy = index.shape[0] / 2 + 1 | 465 | cy = index.shape[0] / 2 + 1 |
466 | - xi = px - index.shape[1] + cx | ||
467 | - xf = xi + index.shape[1] | ||
468 | - yi = py - index.shape[0] + cy | ||
469 | - yf = yi + index.shape[0] | 466 | + xi = int(px - index.shape[1] + cx) |
467 | + xf = int(xi + index.shape[1]) | ||
468 | + yi = int(py - index.shape[0] + cy) | ||
469 | + yf = int(yi + index.shape[0]) | ||
470 | 470 | ||
471 | if yi < 0: | 471 | if yi < 0: |
472 | index = index[abs(yi):,:] | 472 | index = index[abs(yi):,:] |
invesalius/data/styles.py
@@ -1276,10 +1276,10 @@ class WaterShedInteractorStyle(DefaultInteractorStyle): | @@ -1276,10 +1276,10 @@ class WaterShedInteractorStyle(DefaultInteractorStyle): | ||
1276 | 1276 | ||
1277 | cx = index.shape[1] / 2 + 1 | 1277 | cx = index.shape[1] / 2 + 1 |
1278 | cy = index.shape[0] / 2 + 1 | 1278 | cy = index.shape[0] / 2 + 1 |
1279 | - xi = px - index.shape[1] + cx | ||
1280 | - xf = xi + index.shape[1] | ||
1281 | - yi = py - index.shape[0] + cy | ||
1282 | - yf = yi + index.shape[0] | 1279 | + xi = int(px - index.shape[1] + cx) |
1280 | + xf = int(xi + index.shape[1]) | ||
1281 | + yi = int(py - index.shape[0] + cy) | ||
1282 | + yf = int(yi + index.shape[0]) | ||
1283 | 1283 | ||
1284 | if yi < 0: | 1284 | if yi < 0: |
1285 | index = index[abs(yi):,:] | 1285 | index = index[abs(yi):,:] |