Commit 03d9dea41c98050216ea9bbb9fd861e373e95ecb
1 parent
62eb28d3
Exists in
master
and in
5 other branches
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 | 487 | proj = Project() |
488 | 488 | proj.mask_dict[index].is_shown = value |
489 | 489 | if (index == self.current_mask.index): |
490 | - for buffer_ in self.buffer_slices: | |
490 | + for buffer_ in self.buffer_slices.values(): | |
491 | 491 | buffer_.discard_vtk_mask() |
492 | 492 | buffer_.discard_mask() |
493 | 493 | ps.Publisher().sendMessage('Reload actual slice') |
... | ... | @@ -775,7 +775,7 @@ class Slice(object): |
775 | 775 | ps.Publisher().sendMessage('Update slice viewer') |
776 | 776 | |
777 | 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 | 779 | print image.GetScalarRange() |
780 | 780 | colorer = vtk.vtkImageMapToWindowLevelColors() |
781 | 781 | colorer.SetInput(image) |
... | ... | @@ -792,8 +792,7 @@ class Slice(object): |
792 | 792 | given slice_matrix. |
793 | 793 | """ |
794 | 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 | 796 | return m |
798 | 797 | |
799 | 798 | def do_colour_mask(self, imagedata): | ... | ... |