diff --git a/invesalius/data/mask.py b/invesalius/data/mask.py index 0ddbf1a..63c04c4 100644 --- a/invesalius/data/mask.py +++ b/invesalius/data/mask.py @@ -28,6 +28,7 @@ import vtk import constants as const import imagedata_utils as iu +import session as ses from wx.lib.pubsub import pub as Publisher @@ -197,9 +198,17 @@ class Mask(): def undo_history(self, actual_slices): self.history.undo(self.matrix, actual_slices) + # Marking the project as changed + session = ses.Session() + session.ChangeProject() + def redo_history(self, actual_slices): self.history.redo(self.matrix, actual_slices) + # Marking the project as changed + session = ses.Session() + session.ChangeProject() + def on_show(self): self.history._config_undo_redo(self.is_shown) diff --git a/invesalius/data/slice_.py b/invesalius/data/slice_.py index 528b893..e3d7c56 100644 --- a/invesalius/data/slice_.py +++ b/invesalius/data/slice_.py @@ -396,6 +396,10 @@ class Slice(object): self.current_mask.clear_history() self.current_mask.was_edited = True + # Marking the project as changed + session = ses.Session() + session.ChangeProject() + def create_temp_mask(self): temp_file = tempfile.mktemp() shape = self.matrix.shape @@ -486,6 +490,10 @@ class Slice(object): roi_m[index] = 1 self.buffer_slices[orientation].discard_vtk_mask() + # Marking the project as changed + session = ses.Session() + session.ChangeProject() + def GetSlices(self, orientation, slice_number, number_slices, inverted=False, border_size=1.0): diff --git a/invesalius/data/styles.py b/invesalius/data/styles.py index 0731d4d..b0f42f0 100644 --- a/invesalius/data/styles.py +++ b/invesalius/data/styles.py @@ -30,6 +30,8 @@ from wx.lib.pubsub import pub as Publisher import constants as const import converters import cursor_actors as ca +import session as ses + import numpy as np from scipy import ndimage @@ -1219,6 +1221,11 @@ class WaterShedInteractorStyle(DefaultInteractorStyle): self.viewer.slice_.current_mask.was_edited = True self.viewer.slice_.current_mask.clear_history() + + # Marking the project as changed + session = ses.Session() + session.ChangeProject() + Publisher.sendMessage('Reload actual slice') def get_coordinate_cursor(self): @@ -1380,9 +1387,9 @@ class WaterShedInteractorStyle(DefaultInteractorStyle): self.viewer.slice_.current_mask.clear_history() Publisher.sendMessage('Reload actual slice') - - - + # Marking the project as changed + session = ses.Session() + session.ChangeProject() def get_style(style): -- libgit2 0.21.2