Commit 4d0b9af27f7e57032f6e85f901aaaec3e56ec690

Authored by Thiago Franco de Moraes
1 parent cf08c213

It was not writting to the file if the mask was edited

Showing 1 changed file with 3 additions and 0 deletions   Show diff stats
invesalius/data/mask.py
@@ -220,6 +220,7 @@ class Mask(): @@ -220,6 +220,7 @@ class Mask():
220 mask['visible'] = self.is_shown 220 mask['visible'] = self.is_shown
221 mask['mask_file'] = mask_filename 221 mask['mask_file'] = mask_filename
222 mask['mask_shape'] = self.matrix.shape 222 mask['mask_shape'] = self.matrix.shape
  223 + mask['edited'] = self.was_edited
223 224
224 plist_filename = filename + '.plist' 225 plist_filename = filename + '.plist'
225 #plist_filepath = os.path.join(dir_temp, plist_filename) 226 #plist_filepath = os.path.join(dir_temp, plist_filename)
@@ -243,6 +244,8 @@ class Mask(): @@ -243,6 +244,8 @@ class Mask():
243 self.is_shown = mask['visible'] 244 self.is_shown = mask['visible']
244 mask_file = mask['mask_file'] 245 mask_file = mask['mask_file']
245 shape = mask['mask_shape'] 246 shape = mask['mask_shape']
  247 + self.was_edited = mask.get('edited', False)
  248 +
246 dirpath = os.path.abspath(os.path.split(filename)[0]) 249 dirpath = os.path.abspath(os.path.split(filename)[0])
247 path = os.path.join(dirpath, mask_file) 250 path = os.path.join(dirpath, mask_file)
248 self._open_mask(path, tuple(shape)) 251 self._open_mask(path, tuple(shape))