diff --git a/invesalius/data/slice_.py b/invesalius/data/slice_.py index 8c227f0..af3978b 100644 --- a/invesalius/data/slice_.py +++ b/invesalius/data/slice_.py @@ -899,6 +899,10 @@ class Slice(with_metaclass(utils.Singleton, object)): proj.mask_dict[index].is_shown = value proj.mask_dict[index].on_show() + if value: + threshold_range = proj.mask_dict[index].threshold_range + Publisher.sendMessage('Set edition threshold gui', threshold_range=threshold_range) + if (index == self.current_mask.index): for buffer_ in self.buffer_slices.values(): buffer_.discard_vtk_mask() diff --git a/invesalius/gui/task_slice.py b/invesalius/gui/task_slice.py index 6a6de71..21d45b2 100644 --- a/invesalius/gui/task_slice.py +++ b/invesalius/gui/task_slice.py @@ -772,6 +772,7 @@ class EditionTools(wx.Panel): Publisher.subscribe(self.ChangeMaskColour, 'Change mask colour') Publisher.subscribe(self.SetGradientColour, 'Add mask') Publisher.subscribe(self._set_brush_size, 'Set edition brush size') + Publisher.subscribe(self._set_threshold_range_gui, 'Set edition threshold gui') def ChangeMaskColour(self, colour): self.gradient_thresh.SetColour(colour) @@ -822,6 +823,9 @@ class EditionTools(wx.Panel): # Strangelly this is being called twice Publisher.sendMessage('Set edition brush size', size=self.spin.GetValue()) + def _set_threshold_range_gui(self, threshold_range): + self.SetThresholdValues(threshold_range) + def _set_brush_size(self, size): self.spin.SetValue(size) -- libgit2 0.21.2