Commit 778ff902ebf2384887bdf6b3dd7f6f50b8e4e2ce

Authored by Thiago Franco de Moraes
1 parent 991392d7
Exists in master

Forcing indexes to int in editor and watershed tools

invesalius/data/slice_.py
... ... @@ -463,10 +463,10 @@ class Slice(object):
463 463  
464 464 cx = index.shape[1] / 2 + 1
465 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 471 if yi < 0:
472 472 index = index[abs(yi):,:]
... ...
invesalius/data/styles.py
... ... @@ -1276,10 +1276,10 @@ class WaterShedInteractorStyle(DefaultInteractorStyle):
1276 1276  
1277 1277 cx = index.shape[1] / 2 + 1
1278 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 1284 if yi < 0:
1285 1285 index = index[abs(yi):,:]
... ...