Commit 10ed1e320d854819a1723fff16487a9b5e66a96c
1 parent
87ab4cc4
Exists in
master
verifying if there is an mask visible when setting threshold
Showing
1 changed file
with
4 additions
and
0 deletions
Show diff stats
invesalius/data/slice_.py
... | ... | @@ -350,6 +350,8 @@ class Slice(metaclass=utils.Singleton): |
350 | 350 | self.SetMaskEditionThreshold(index, threshold_range) |
351 | 351 | |
352 | 352 | def __set_current_mask_threshold(self, threshold_range): |
353 | + if self.current_mask is None: | |
354 | + return | |
353 | 355 | index = self.current_mask.index |
354 | 356 | self.num_gradient += 1 |
355 | 357 | self.current_mask.matrix[:] = 0 |
... | ... | @@ -390,6 +392,8 @@ class Slice(metaclass=utils.Singleton): |
390 | 392 | Publisher.sendMessage("Reload actual slice") |
391 | 393 | |
392 | 394 | def __set_current_mask_threshold_actual_slice(self, threshold_range): |
395 | + if self.current_mask is None: | |
396 | + return | |
393 | 397 | index = self.current_mask.index |
394 | 398 | for orientation in self.buffer_slices: |
395 | 399 | self.buffer_slices[orientation].discard_vtk_mask() | ... | ... |