From 5fe4b34c8a941aa567cf1fd095a52552a7c829cf Mon Sep 17 00:00:00 2001 From: tatiana Date: Wed, 27 Jan 2010 00:30:06 +0000 Subject: [PATCH] FIX: Mask visibility consistency when opening a project (fix #128) --- invesalius/control.py | 3 +++ invesalius/data/slice_.py | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/invesalius/control.py b/invesalius/control.py index 674c08d..a7cbf5c 100755 --- a/invesalius/control.py +++ b/invesalius/control.py @@ -317,6 +317,8 @@ class Controller(): def LoadProject(self): proj = prj.Project() + mask_index = len(proj.mask_dict) -1 + const.THRESHOLD_OUTVALUE = proj.threshold_range[0] const.THRESHOLD_INVALUE = proj.threshold_range[1] const.WINDOW_LEVEL[_('Default')] = (proj.window, proj.level) @@ -337,6 +339,7 @@ class Controller(): ps.Publisher().sendMessage('Show content panel') ps.Publisher().sendMessage('Update AUI') ps.Publisher().sendMessage('Load slice plane') + ps.Publisher().sendMessage('Change mask selected', mask_index) ps.Publisher().sendMessage('End busy cursor') def CreateAnalyzeProject(self, imagedata): diff --git a/invesalius/data/slice_.py b/invesalius/data/slice_.py index 72c26e6..7921f50 100644 --- a/invesalius/data/slice_.py +++ b/invesalius/data/slice_.py @@ -335,16 +335,15 @@ class Slice(object): #--------------------------------------------------------------------------- def SelectCurrentMask(self, index): "Insert mask data, based on given index, into pipeline." - # This condition is not necessary in Linux, only under mac and windows # because combobox event is binded when the same item is selected again. #if index != self.current_mask.index: if self.current_mask and self.blend_filter: proj = Project() future_mask = proj.GetMask(index) - + future_mask.is_shown = True self.current_mask = future_mask - + colour = future_mask.colour index = future_mask.index self.SetMaskColour(index, colour, update=False) @@ -353,9 +352,10 @@ class Slice(object): self.img_colours_mask.SetInput(imagedata) if self.current_mask.is_shown: + print 1 self.blend_filter.SetOpacity(1, self.current_mask.opacity) else: - + print 2 self.blend_filter.SetOpacity(1, 0) self.blend_filter.Update() -- libgit2 0.21.2