From 03d9dea41c98050216ea9bbb9fd861e373e95ecb Mon Sep 17 00:00:00 2001 From: tfmoraes Date: Tue, 14 Dec 2010 16:04:53 +0000 Subject: [PATCH] FIX: Showing and hidding mask is working again --- invesalius/data/slice_.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/invesalius/data/slice_.py b/invesalius/data/slice_.py index 7c8bbd8..06e5d3a 100644 --- a/invesalius/data/slice_.py +++ b/invesalius/data/slice_.py @@ -487,7 +487,7 @@ class Slice(object): proj = Project() proj.mask_dict[index].is_shown = value if (index == self.current_mask.index): - for buffer_ in self.buffer_slices: + for buffer_ in self.buffer_slices.values(): buffer_.discard_vtk_mask() buffer_.discard_mask() ps.Publisher().sendMessage('Reload actual slice') @@ -775,7 +775,7 @@ class Slice(object): ps.Publisher().sendMessage('Update slice viewer') def do_ww_wl(self, image): - print self.window_width, self.window_level + print "WW, WL", self.window_width, self.window_level print image.GetScalarRange() colorer = vtk.vtkImageMapToWindowLevelColors() colorer.SetInput(image) @@ -792,8 +792,7 @@ class Slice(object): given slice_matrix. """ thresh_min, thresh_max = self.current_mask.threshold_range - m = numpy.zeros(slice_matrix.shape, self.current_mask.matrix.dtype) - m[numpy.logical_and(slice_matrix >= thresh_min, slice_matrix <= thresh_max)] = 255 + m= numpy.logical_and(slice_matrix >= thresh_min, slice_matrix <= thresh_max) * 255 return m def do_colour_mask(self, imagedata): -- libgit2 0.21.2