Commit 03d9dea41c98050216ea9bbb9fd861e373e95ecb

Authored by tfmoraes
1 parent 62eb28d3

FIX: Showing and hidding mask is working again

Showing 1 changed file with 3 additions and 4 deletions   Show diff stats
invesalius/data/slice_.py
@@ -487,7 +487,7 @@ class Slice(object): @@ -487,7 +487,7 @@ class Slice(object):
487 proj = Project() 487 proj = Project()
488 proj.mask_dict[index].is_shown = value 488 proj.mask_dict[index].is_shown = value
489 if (index == self.current_mask.index): 489 if (index == self.current_mask.index):
490 - for buffer_ in self.buffer_slices: 490 + for buffer_ in self.buffer_slices.values():
491 buffer_.discard_vtk_mask() 491 buffer_.discard_vtk_mask()
492 buffer_.discard_mask() 492 buffer_.discard_mask()
493 ps.Publisher().sendMessage('Reload actual slice') 493 ps.Publisher().sendMessage('Reload actual slice')
@@ -775,7 +775,7 @@ class Slice(object): @@ -775,7 +775,7 @@ class Slice(object):
775 ps.Publisher().sendMessage('Update slice viewer') 775 ps.Publisher().sendMessage('Update slice viewer')
776 776
777 def do_ww_wl(self, image): 777 def do_ww_wl(self, image):
778 - print self.window_width, self.window_level 778 + print "WW, WL", self.window_width, self.window_level
779 print image.GetScalarRange() 779 print image.GetScalarRange()
780 colorer = vtk.vtkImageMapToWindowLevelColors() 780 colorer = vtk.vtkImageMapToWindowLevelColors()
781 colorer.SetInput(image) 781 colorer.SetInput(image)
@@ -792,8 +792,7 @@ class Slice(object): @@ -792,8 +792,7 @@ class Slice(object):
792 given slice_matrix. 792 given slice_matrix.
793 """ 793 """
794 thresh_min, thresh_max = self.current_mask.threshold_range 794 thresh_min, thresh_max = self.current_mask.threshold_range
795 - m = numpy.zeros(slice_matrix.shape, self.current_mask.matrix.dtype)  
796 - m[numpy.logical_and(slice_matrix >= thresh_min, slice_matrix <= thresh_max)] = 255 795 + m= numpy.logical_and(slice_matrix >= thresh_min, slice_matrix <= thresh_max) * 255
797 return m 796 return m
798 797
799 def do_colour_mask(self, imagedata): 798 def do_colour_mask(self, imagedata):