Commit baf0e949ddf0fa3e1fc6a93703876b4343f6c69c
1 parent
63c55bed
Exists in
master
and in
6 other branches
FIX: Using the vtkWorldPointPicker instead vtkCellPicker in slice viewer, it has better results
Showing
1 changed file
with
11 additions
and
5 deletions
Show diff stats
invesalius/data/viewer_slice.py
... | ... | @@ -66,7 +66,7 @@ class Viewer(wx.Panel): |
66 | 66 | self.text = None |
67 | 67 | # VTK pipeline and actors |
68 | 68 | #self.__config_interactor() |
69 | - self.pick = vtk.vtkCellPicker() | |
69 | + self.pick = vtk.vtkWorldPointPicker() | |
70 | 70 | |
71 | 71 | self.__bind_events() |
72 | 72 | self.__bind_events_wx() |
... | ... | @@ -883,9 +883,15 @@ class Viewer(wx.Panel): |
883 | 883 | slice_number = slice_data.number |
884 | 884 | actor_bound = slice_data.actor.GetBounds() |
885 | 885 | |
886 | - yz = [actor_bound[1] + 1 + slice_number, y, z] | |
887 | - xz = [x, actor_bound[3] - 1 - slice_number, z] | |
888 | - xy = [x, y, actor_bound[5] + 1 + slice_number] | |
886 | ||
887 | + print self.orientation | |
888 | + print x, y, z | |
889 | + print actor_bound | |
890 | ||
891 | + | |
892 | + xy = [x, y, actor_bound[0]] | |
893 | + yz = [actor_bound[2], y, z] | |
894 | + xz = [x, actor_bound[4], z] | |
889 | 895 | |
890 | 896 | proj = project.Project() |
891 | 897 | orig_orien = proj.original_orientation |
... | ... | @@ -927,7 +933,7 @@ class Viewer(wx.Panel): |
927 | 933 | else: |
928 | 934 | coordinates = {"SAGITAL": yz, "CORONAL": xz, "AXIAL": xy} |
929 | 935 | |
930 | - slice_data.cursor.SetPosition(coordinates[self.orientation]) | |
936 | + slice_data.cursor.SetPosition((x, y, z)) | |
931 | 937 | |
932 | 938 | def SetOrientation(self, orientation): |
933 | 939 | self.orientation = orientation | ... | ... |