From 7b83d3d4be72196d638f51ebb0f4c7044bbdd615 Mon Sep 17 00:00:00 2001 From: Thiago Franco de Moraes Date: Mon, 23 Jun 2014 11:12:54 -0300 Subject: [PATCH] showing (hidding) watershed marks when enabled (disabled) --- invesalius/data/slice_.py | 4 +++- invesalius/data/styles.py | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/invesalius/data/slice_.py b/invesalius/data/slice_.py index 659b5aa..4475efd 100644 --- a/invesalius/data/slice_.py +++ b/invesalius/data/slice_.py @@ -87,6 +87,8 @@ class Slice(object): self.aux_matrices = {} self.state = const.STATE_DEFAULT + self.to_show_aux = '' + self._type_projection = const.PROJECTION_NORMAL self.n_border = const.PROJECTION_BORDER_SIZE @@ -534,7 +536,7 @@ class Slice(object): self.buffer_slices[orientation].vtk_image = image self.buffer_slices[orientation].vtk_mask = mask - if self.state == const.SLICE_STATE_WATERSHED and self.current_mask.is_shown: + if self.to_show_aux == 'watershed' and self.current_mask.is_shown: m = self.get_aux_slice('watershed', orientation, slice_number) tmp_vimage = converters.to_vtk(m, self.spacing, slice_number, orientation) cimage = self.do_custom_colour(tmp_vimage, {0: (0.0, 0.0, 0.0, 0.0), diff --git a/invesalius/data/styles.py b/invesalius/data/styles.py index 38011c0..82975b0 100644 --- a/invesalius/data/styles.py +++ b/invesalius/data/styles.py @@ -697,11 +697,15 @@ class WaterShedInteractorStyle(DefaultInteractorStyle): mask[:, 0, :] = 1 mask[:, :, 0] = 1 self._create_mask() + self.viewer.slice_.to_show_aux = 'watershed' + self.viewer.OnScrollBar() def CleanUp(self): #self._remove_mask() Publisher.unsubscribe(self.expand_watershed, 'Expand watershed to 3D ' + self.orientation) self.RemoveAllObservers() + self.viewer.slice_.to_show_aux = '' + self.viewer.OnScrollBar() def _create_mask(self): if self.matrix is None: -- libgit2 0.21.2