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 87 self.aux_matrices = {}
88 88 self.state = const.STATE_DEFAULT
89 89  
  90 + self.to_show_aux = ''
  91 +
90 92 self._type_projection = const.PROJECTION_NORMAL
91 93 self.n_border = const.PROJECTION_BORDER_SIZE
92 94  
... ... @@ -534,7 +536,7 @@ class Slice(object):
534 536 self.buffer_slices[orientation].vtk_image = image
535 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 540 m = self.get_aux_slice('watershed', orientation, slice_number)
539 541 tmp_vimage = converters.to_vtk(m, self.spacing, slice_number, orientation)
540 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 697 mask[:, 0, :] = 1
698 698 mask[:, :, 0] = 1
699 699 self._create_mask()
  700 + self.viewer.slice_.to_show_aux = 'watershed'
  701 + self.viewer.OnScrollBar()
700 702  
701 703 def CleanUp(self):
702 704 #self._remove_mask()
703 705 Publisher.unsubscribe(self.expand_watershed, 'Expand watershed to 3D ' + self.orientation)
704 706 self.RemoveAllObservers()
  707 + self.viewer.slice_.to_show_aux = ''
  708 + self.viewer.OnScrollBar()
705 709  
706 710 def _create_mask(self):
707 711 if self.matrix is None:
... ...