Commit 7b83d3d4be72196d638f51ebb0f4c7044bbdd615

Authored by Thiago Franco de Moraes
1 parent 4e363877
Exists in watershed

showing (hidding) watershed marks when enabled (disabled)

invesalius/data/slice_.py
@@ -87,6 +87,8 @@ class Slice(object): @@ -87,6 +87,8 @@ class Slice(object):
87 self.aux_matrices = {} 87 self.aux_matrices = {}
88 self.state = const.STATE_DEFAULT 88 self.state = const.STATE_DEFAULT
89 89
  90 + self.to_show_aux = ''
  91 +
90 self._type_projection = const.PROJECTION_NORMAL 92 self._type_projection = const.PROJECTION_NORMAL
91 self.n_border = const.PROJECTION_BORDER_SIZE 93 self.n_border = const.PROJECTION_BORDER_SIZE
92 94
@@ -534,7 +536,7 @@ class Slice(object): @@ -534,7 +536,7 @@ class Slice(object):
534 self.buffer_slices[orientation].vtk_image = image 536 self.buffer_slices[orientation].vtk_image = image
535 self.buffer_slices[orientation].vtk_mask = mask 537 self.buffer_slices[orientation].vtk_mask = mask
536 538
537 - if self.state == const.SLICE_STATE_WATERSHED and self.current_mask.is_shown: 539 + if self.to_show_aux == 'watershed' and self.current_mask.is_shown:
538 m = self.get_aux_slice('watershed', orientation, slice_number) 540 m = self.get_aux_slice('watershed', orientation, slice_number)
539 tmp_vimage = converters.to_vtk(m, self.spacing, slice_number, orientation) 541 tmp_vimage = converters.to_vtk(m, self.spacing, slice_number, orientation)
540 cimage = self.do_custom_colour(tmp_vimage, {0: (0.0, 0.0, 0.0, 0.0), 542 cimage = self.do_custom_colour(tmp_vimage, {0: (0.0, 0.0, 0.0, 0.0),
invesalius/data/styles.py
@@ -697,11 +697,15 @@ class WaterShedInteractorStyle(DefaultInteractorStyle): @@ -697,11 +697,15 @@ class WaterShedInteractorStyle(DefaultInteractorStyle):
697 mask[:, 0, :] = 1 697 mask[:, 0, :] = 1
698 mask[:, :, 0] = 1 698 mask[:, :, 0] = 1
699 self._create_mask() 699 self._create_mask()
  700 + self.viewer.slice_.to_show_aux = 'watershed'
  701 + self.viewer.OnScrollBar()
700 702
701 def CleanUp(self): 703 def CleanUp(self):
702 #self._remove_mask() 704 #self._remove_mask()
703 Publisher.unsubscribe(self.expand_watershed, 'Expand watershed to 3D ' + self.orientation) 705 Publisher.unsubscribe(self.expand_watershed, 'Expand watershed to 3D ' + self.orientation)
704 self.RemoveAllObservers() 706 self.RemoveAllObservers()
  707 + self.viewer.slice_.to_show_aux = ''
  708 + self.viewer.OnScrollBar()
705 709
706 def _create_mask(self): 710 def _create_mask(self):
707 if self.matrix is None: 711 if self.matrix is None: