From 10ed1e320d854819a1723fff16487a9b5e66a96c Mon Sep 17 00:00:00 2001 From: Thiago Franco de Moraes Date: Fri, 3 Jul 2020 12:18:04 -0300 Subject: [PATCH] verifying if there is an mask visible when setting threshold --- invesalius/data/slice_.py | 4 ++++ 1 file changed, 4 insertions(+), 0 deletions(-) diff --git a/invesalius/data/slice_.py b/invesalius/data/slice_.py index 0e8ac7e..0ed9066 100644 --- a/invesalius/data/slice_.py +++ b/invesalius/data/slice_.py @@ -350,6 +350,8 @@ class Slice(metaclass=utils.Singleton): self.SetMaskEditionThreshold(index, threshold_range) def __set_current_mask_threshold(self, threshold_range): + if self.current_mask is None: + return index = self.current_mask.index self.num_gradient += 1 self.current_mask.matrix[:] = 0 @@ -390,6 +392,8 @@ class Slice(metaclass=utils.Singleton): Publisher.sendMessage("Reload actual slice") def __set_current_mask_threshold_actual_slice(self, threshold_range): + if self.current_mask is None: + return index = self.current_mask.index for orientation in self.buffer_slices: self.buffer_slices[orientation].discard_vtk_mask() -- libgit2 0.21.2