From f4e362c5eb0e9892e3e9bda1e31b8def01ed39c4 Mon Sep 17 00:00:00 2001 From: paulojamorim Date: Tue, 17 Nov 2009 14:16:16 +0000 Subject: [PATCH] FIX: Open inv3, edited case's --- invesalius/data/slice_.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/invesalius/data/slice_.py b/invesalius/data/slice_.py index df665d4..abf4bac 100644 --- a/invesalius/data/slice_.py +++ b/invesalius/data/slice_.py @@ -39,6 +39,7 @@ class Slice(object): self.current_mask = None self.blend_filter = None self.__bind_events() + self.num_gradient = 0 def __bind_events(self): # Slice properties @@ -113,12 +114,15 @@ class Slice(object): self.SetMaskEditionThreshold(index, threshold_range) def __set_current_mask_threshold(self, evt_pubsub): - threshold_range = evt_pubsub.data - index = self.current_mask.index - self.SetMaskThreshold(index, threshold_range) - #Clear edited points - self.current_mask.edited_points = {} - + #FIXME: find a better way to implement this + if (self.num_gradient >= 2): + threshold_range = evt_pubsub.data + index = self.current_mask.index + self.SetMaskThreshold(index, threshold_range) + #Clear edited points + self.current_mask.edited_points = {} + self.num_gradient += 1 + def __set_current_mask_colour(self, pubsub_evt): # "if" is necessary because wx events are calling this before any mask # has been created -- libgit2 0.21.2