From a9726ae0806c3530e3cbc2d85625446f4bd3476d Mon Sep 17 00:00:00 2001 From: Thiago Franco de Moraes Date: Fri, 1 Sep 2017 09:42:54 -0300 Subject: [PATCH] Fix: Reorient image tool not work after open project (Closes #115) --- invesalius/data/slice_.py | 3 ++- invesalius/data/styles.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/invesalius/data/slice_.py b/invesalius/data/slice_.py index b45d452..67b7a20 100644 --- a/invesalius/data/slice_.py +++ b/invesalius/data/slice_.py @@ -1450,7 +1450,8 @@ class Slice(object): self.center = [(s * d/2.0) for (d, s) in zip(self.matrix.shape[::-1], self.spacing)] self.__clean_current_mask(None) - self.current_mask.matrix[:] = 0 + if self.current_mask: + self.current_mask.matrix[:] = 0 for o in self.buffer_slices: self.buffer_slices[o].discard_buffer() diff --git a/invesalius/data/styles.py b/invesalius/data/styles.py index 2d7a89a..d52e904 100644 --- a/invesalius/data/styles.py +++ b/invesalius/data/styles.py @@ -1651,7 +1651,8 @@ class ReorientImageInteractorStyle(DefaultInteractorStyle): Publisher.sendMessage('Update reorient angles', (ax, ay, az)) self._discard_buffers() - self.viewer.slice_.current_mask.clear_history() + if self.viewer.slice_.current_mask: + self.viewer.slice_.current_mask.clear_history() Publisher.sendMessage('Reload actual slice %s' % self.viewer.orientation) self.p0 = self.get_image_point_coord(x, y, z) -- libgit2 0.21.2