Commit e532ca4ee14b5e26f8f667af7a79d8bc0f60cbbc
1 parent
a890c988
Exists in
master
and in
37 other branches
Markin the project as changed when edited mask, watershed, clean mask, redo and undo mask
Showing
3 changed files
with
27 additions
and
3 deletions
Show diff stats
invesalius/data/mask.py
| ... | ... | @@ -28,6 +28,7 @@ import vtk |
| 28 | 28 | |
| 29 | 29 | import constants as const |
| 30 | 30 | import imagedata_utils as iu |
| 31 | +import session as ses | |
| 31 | 32 | |
| 32 | 33 | from wx.lib.pubsub import pub as Publisher |
| 33 | 34 | |
| ... | ... | @@ -197,9 +198,17 @@ class Mask(): |
| 197 | 198 | def undo_history(self, actual_slices): |
| 198 | 199 | self.history.undo(self.matrix, actual_slices) |
| 199 | 200 | |
| 201 | + # Marking the project as changed | |
| 202 | + session = ses.Session() | |
| 203 | + session.ChangeProject() | |
| 204 | + | |
| 200 | 205 | def redo_history(self, actual_slices): |
| 201 | 206 | self.history.redo(self.matrix, actual_slices) |
| 202 | 207 | |
| 208 | + # Marking the project as changed | |
| 209 | + session = ses.Session() | |
| 210 | + session.ChangeProject() | |
| 211 | + | |
| 203 | 212 | def on_show(self): |
| 204 | 213 | self.history._config_undo_redo(self.is_shown) |
| 205 | 214 | ... | ... |
invesalius/data/slice_.py
| ... | ... | @@ -396,6 +396,10 @@ class Slice(object): |
| 396 | 396 | self.current_mask.clear_history() |
| 397 | 397 | self.current_mask.was_edited = True |
| 398 | 398 | |
| 399 | + # Marking the project as changed | |
| 400 | + session = ses.Session() | |
| 401 | + session.ChangeProject() | |
| 402 | + | |
| 399 | 403 | def create_temp_mask(self): |
| 400 | 404 | temp_file = tempfile.mktemp() |
| 401 | 405 | shape = self.matrix.shape |
| ... | ... | @@ -486,6 +490,10 @@ class Slice(object): |
| 486 | 490 | roi_m[index] = 1 |
| 487 | 491 | self.buffer_slices[orientation].discard_vtk_mask() |
| 488 | 492 | |
| 493 | + # Marking the project as changed | |
| 494 | + session = ses.Session() | |
| 495 | + session.ChangeProject() | |
| 496 | + | |
| 489 | 497 | |
| 490 | 498 | def GetSlices(self, orientation, slice_number, number_slices, |
| 491 | 499 | inverted=False, border_size=1.0): | ... | ... |
invesalius/data/styles.py
| ... | ... | @@ -30,6 +30,8 @@ from wx.lib.pubsub import pub as Publisher |
| 30 | 30 | import constants as const |
| 31 | 31 | import converters |
| 32 | 32 | import cursor_actors as ca |
| 33 | +import session as ses | |
| 34 | + | |
| 33 | 35 | import numpy as np |
| 34 | 36 | |
| 35 | 37 | from scipy import ndimage |
| ... | ... | @@ -1219,6 +1221,11 @@ class WaterShedInteractorStyle(DefaultInteractorStyle): |
| 1219 | 1221 | |
| 1220 | 1222 | self.viewer.slice_.current_mask.was_edited = True |
| 1221 | 1223 | self.viewer.slice_.current_mask.clear_history() |
| 1224 | + | |
| 1225 | + # Marking the project as changed | |
| 1226 | + session = ses.Session() | |
| 1227 | + session.ChangeProject() | |
| 1228 | + | |
| 1222 | 1229 | Publisher.sendMessage('Reload actual slice') |
| 1223 | 1230 | |
| 1224 | 1231 | def get_coordinate_cursor(self): |
| ... | ... | @@ -1380,9 +1387,9 @@ class WaterShedInteractorStyle(DefaultInteractorStyle): |
| 1380 | 1387 | self.viewer.slice_.current_mask.clear_history() |
| 1381 | 1388 | Publisher.sendMessage('Reload actual slice') |
| 1382 | 1389 | |
| 1383 | - | |
| 1384 | - | |
| 1385 | - | |
| 1390 | + # Marking the project as changed | |
| 1391 | + session = ses.Session() | |
| 1392 | + session.ChangeProject() | |
| 1386 | 1393 | |
| 1387 | 1394 | |
| 1388 | 1395 | def get_style(style): | ... | ... |