Commit 99b12b20d1a1c30def7b5ad2eb98d0d77d94c258
1 parent
c800a6db
Exists in
master
and in
68 other branches
FIX: Image plane turned off to open a new project
Showing
2 changed files
with
18 additions
and
5 deletions
Show diff stats
invesalius/data/viewer_volume.py
@@ -127,13 +127,17 @@ class Viewer(wx.Panel): | @@ -127,13 +127,17 @@ class Viewer(wx.Panel): | ||
127 | ps.Publisher().subscribe(self.OnShowText, | 127 | ps.Publisher().subscribe(self.OnShowText, |
128 | 'Show text actors on viewers') | 128 | 'Show text actors on viewers') |
129 | ps.Publisher().subscribe(self.OnCloseProject, 'Close project data') | 129 | ps.Publisher().subscribe(self.OnCloseProject, 'Close project data') |
130 | - | 130 | + |
131 | + | ||
131 | def OnCloseProject(self, pubsub_evt): | 132 | def OnCloseProject(self, pubsub_evt): |
132 | if self.raycasting_volume: | 133 | if self.raycasting_volume: |
133 | self.raycasting_volume = False | 134 | self.raycasting_volume = False |
134 | if self.slice_plane: | 135 | if self.slice_plane: |
135 | self.slice_plane.Disable() | 136 | self.slice_plane.Disable() |
136 | - #slice_plane_...SetInteractor(self.interactor._Iren) | 137 | + self.slice_plane.DeletePlanes() |
138 | + del self.slice_plane | ||
139 | + ps.Publisher().sendMessage('Uncheck image plane menu') | ||
140 | + | ||
137 | self.mouse_pressed = 0 | 141 | self.mouse_pressed = 0 |
138 | self.on_wl = False | 142 | self.on_wl = False |
139 | 143 | ||
@@ -715,6 +719,11 @@ class SlicePlane: | @@ -715,6 +719,11 @@ class SlicePlane: | ||
715 | self.plane_z.SetPlaneOrientationToZAxes() | 719 | self.plane_z.SetPlaneOrientationToZAxes() |
716 | self.plane_z.SetSliceIndex(number) | 720 | self.plane_z.SetSliceIndex(number) |
717 | 721 | ||
722 | + def DeletePlanes(self): | ||
723 | + del self.plane_x | ||
724 | + del self.plane_y | ||
725 | + del self.plane_z | ||
726 | + | ||
718 | def PointId(self, evt, obj): | 727 | def PointId(self, evt, obj): |
719 | #TODO: add in the code | 728 | #TODO: add in the code |
720 | # picker = vtk.vtkPointPicker() | 729 | # picker = vtk.vtkPointPicker() |
@@ -723,4 +732,3 @@ class SlicePlane: | @@ -723,4 +732,3 @@ class SlicePlane: | ||
723 | x,y = evt.GetLastEventPosition() | 732 | x,y = evt.GetLastEventPosition() |
724 | self.picker.Pick(x, y, 0, self.ren1) | 733 | self.picker.Pick(x, y, 0, self.ren1) |
725 | point_id = self.picker.GetPointId() | 734 | point_id = self.picker.GetPointId() |
726 | - |
invesalius/gui/default_viewers.py
@@ -391,7 +391,8 @@ class VolumeToolPanel(wx.Panel): | @@ -391,7 +391,8 @@ class VolumeToolPanel(wx.Panel): | ||
391 | ps.Publisher().subscribe(self.ChangeButtonColour, | 391 | ps.Publisher().subscribe(self.ChangeButtonColour, |
392 | 'Change volume viewer gui colour') | 392 | 'Change volume viewer gui colour') |
393 | ps.Publisher().subscribe(self.DisablePreset, 'Close project data') | 393 | ps.Publisher().subscribe(self.DisablePreset, 'Close project data') |
394 | - | 394 | + ps.Publisher().subscribe(self.Uncheck, 'Uncheck image plane menu') |
395 | + | ||
395 | def DisablePreset(self, pubsub_evt): | 396 | def DisablePreset(self, pubsub_evt): |
396 | self.off_item.Check(1) | 397 | self.off_item.Check(1) |
397 | 398 | ||
@@ -499,7 +500,11 @@ class VolumeToolPanel(wx.Panel): | @@ -499,7 +500,11 @@ class VolumeToolPanel(wx.Panel): | ||
499 | else: | 500 | else: |
500 | ps.Publisher().sendMessage('Enable plane', label) | 501 | ps.Publisher().sendMessage('Enable plane', label) |
501 | 502 | ||
502 | - | 503 | + def Uncheck(self, pubsub_evt): |
504 | + for item in self.slice_plane_menu.GetMenuItems(): | ||
505 | + if (item.IsChecked()): | ||
506 | + item.Check(0) | ||
507 | + | ||
503 | def ChangeButtonColour(self, pubsub_evt): | 508 | def ChangeButtonColour(self, pubsub_evt): |
504 | colour = [i*255 for i in pubsub_evt.data] | 509 | colour = [i*255 for i in pubsub_evt.data] |
505 | self.button_colour.SetColour(colour) | 510 | self.button_colour.SetColour(colour) |