Commit 7fd9f32b2b6c13ba1bb1c73b386597c89dcc33fe

Authored by Thiago Franco de Moraes
1 parent 6e9eeb39
Exists in master

updating edition threshold range when changing mask (closes #157)

invesalius/data/slice_.py
... ... @@ -899,6 +899,10 @@ class Slice(with_metaclass(utils.Singleton, object)):
899 899 proj.mask_dict[index].is_shown = value
900 900 proj.mask_dict[index].on_show()
901 901  
  902 + if value:
  903 + threshold_range = proj.mask_dict[index].threshold_range
  904 + Publisher.sendMessage('Set edition threshold gui', threshold_range=threshold_range)
  905 +
902 906 if (index == self.current_mask.index):
903 907 for buffer_ in self.buffer_slices.values():
904 908 buffer_.discard_vtk_mask()
... ...
invesalius/gui/task_slice.py
... ... @@ -772,6 +772,7 @@ class EditionTools(wx.Panel):
772 772 Publisher.subscribe(self.ChangeMaskColour, 'Change mask colour')
773 773 Publisher.subscribe(self.SetGradientColour, 'Add mask')
774 774 Publisher.subscribe(self._set_brush_size, 'Set edition brush size')
  775 + Publisher.subscribe(self._set_threshold_range_gui, 'Set edition threshold gui')
775 776  
776 777 def ChangeMaskColour(self, colour):
777 778 self.gradient_thresh.SetColour(colour)
... ... @@ -822,6 +823,9 @@ class EditionTools(wx.Panel):
822 823 # Strangelly this is being called twice
823 824 Publisher.sendMessage('Set edition brush size', size=self.spin.GetValue())
824 825  
  826 + def _set_threshold_range_gui(self, threshold_range):
  827 + self.SetThresholdValues(threshold_range)
  828 +
825 829 def _set_brush_size(self, size):
826 830 self.spin.SetValue(size)
827 831  
... ...