Commit 43d948cad823e9bad674f87da36c344d1de62b34

Authored by tfmoraes
1 parent 5206c479

Only updating 3D slices when they are enabled

Showing 1 changed file with 7 additions and 5 deletions   Show diff stats
invesalius/data/viewer_volume.py
@@ -833,6 +833,7 @@ class SlicePlane: @@ -833,6 +833,7 @@ class SlicePlane:
833 project = prj.Project() 833 project = prj.Project()
834 self.original_orientation = project.original_orientation 834 self.original_orientation = project.original_orientation
835 self.Create() 835 self.Create()
  836 + self.enabled = False
836 self.__bind_evt() 837 self.__bind_evt()
837 838
838 def __bind_evt(self): 839 def __bind_evt(self):
@@ -946,14 +947,15 @@ class SlicePlane: @@ -946,14 +947,15 @@ class SlicePlane:
946 def ChangeSlice(self, pubsub_evt = None): 947 def ChangeSlice(self, pubsub_evt = None):
947 orientation, number = pubsub_evt.data 948 orientation, number = pubsub_evt.data
948 949
949 - if (orientation == "CORONAL"): 950 + if orientation == "CORONAL" and self.plane_y.GetEnabled():
950 ps.Publisher().sendMessage('Update slice 3D', (self.plane_y,orientation)) 951 ps.Publisher().sendMessage('Update slice 3D', (self.plane_y,orientation))
951 - elif(orientation == "SAGITAL"): 952 + self.Render()
  953 + elif orientation == "SAGITAL" and self.plane_x.GetEnabled():
952 ps.Publisher().sendMessage('Update slice 3D', (self.plane_x,orientation)) 954 ps.Publisher().sendMessage('Update slice 3D', (self.plane_x,orientation))
953 - else: 955 + self.Render()
  956 + elif orientation == 'AXIAL' and self.plane_z.GetEnabled() :
954 ps.Publisher().sendMessage('Update slice 3D', (self.plane_z,orientation)) 957 ps.Publisher().sendMessage('Update slice 3D', (self.plane_z,orientation))
955 -  
956 - self.Render() 958 + self.Render()
957 959
958 def UpdateAllSlice(self, pubsub_evt): 960 def UpdateAllSlice(self, pubsub_evt):
959 ps.Publisher().sendMessage('Update slice 3D', (self.plane_y,"CORONAL")) 961 ps.Publisher().sendMessage('Update slice 3D', (self.plane_y,"CORONAL"))