Commit 5b5760de063cfe7925ba7b469b1e2e2f6e896528
1 parent
ca6d22b0
Exists in
master
and in
6 other branches
Forcing indexes to int because of newer numpy
Showing
1 changed file
with
4 additions
and
5 deletions
Show diff stats
invesalius/data/viewer_slice.py
... | ... | @@ -978,7 +978,7 @@ class Viewer(wx.Panel): |
978 | 978 | elif self.orientation == 'SAGITAL': |
979 | 979 | mx = round((y - yi)/self.slice_.spacing[1], 0) |
980 | 980 | my = round((z - zi)/self.slice_.spacing[2], 0) |
981 | - return mx, my | |
981 | + return int(mx), int(my) | |
982 | 982 | |
983 | 983 | def get_coordinate_cursor(self, mx, my, picker=None): |
984 | 984 | """ |
... | ... | @@ -1086,7 +1086,7 @@ class Viewer(wx.Panel): |
1086 | 1086 | px, py = self.get_slice_pixel_coord_by_world_pos(wx, wy, wz) |
1087 | 1087 | x, y, z = self.calcultate_scroll_position(px, py) |
1088 | 1088 | |
1089 | - return (x, y, z) | |
1089 | + return (int(x), int(y), int(z)) | |
1090 | 1090 | |
1091 | 1091 | |
1092 | 1092 | def get_slice_pixel_coord_by_screen_pos(self, mx, my, picker=None): |
... | ... | @@ -1107,9 +1107,8 @@ class Viewer(wx.Panel): |
1107 | 1107 | picker = self.pick |
1108 | 1108 | |
1109 | 1109 | wx, wy, wz = self.get_coordinate_cursor(mx, my, picker) |
1110 | - return self.get_slice_pixel_coord_by_world_pos(wx, wy, wz) | |
1111 | - | |
1112 | - return px, py | |
1110 | + x, y = self.get_slice_pixel_coord_by_world_pos(wx, wy, wz) | |
1111 | + return int(x), int(y) | |
1113 | 1112 | |
1114 | 1113 | def get_slice_pixel_coord_by_world_pos(self, wx, wy, wz): |
1115 | 1114 | """ | ... | ... |