Commit e0a046a8152f83c94c9b8bd75733a25ca9b42bda

Authored by Thiago Franco de Moraes
1 parent 3aa03487
Exists in workdir

saving working dir after creating a new mask or surface

invesalius/data/mask.py
@@ -317,7 +317,6 @@ class Mask(): @@ -317,7 +317,6 @@ class Mask():
317 print "Creating mask at", self.temp_file 317 print "Creating mask at", self.temp_file
318 shape = shape[0] + 1, shape[1] + 1, shape[2] + 1 318 shape = shape[0] + 1, shape[1] + 1, shape[2] + 1
319 self.matrix = numpy.memmap(self.temp_file, mode='w+', dtype='uint8', shape=shape) 319 self.matrix = numpy.memmap(self.temp_file, mode='w+', dtype='uint8', shape=shape)
320 - proj.save_workdir()  
321 320
322 def clean(self): 321 def clean(self):
323 self.matrix[1:, 1:, 1:] = 0 322 self.matrix[1:, 1:, 1:] = 0
invesalius/project.py
@@ -110,6 +110,7 @@ class Project(object): @@ -110,6 +110,7 @@ class Project(object):
110 """ 110 """
111 index = len(self.mask_dict) 111 index = len(self.mask_dict)
112 self.mask_dict[index] = mask 112 self.mask_dict[index] = mask
  113 + self.save_workdir()
113 return index 114 return index
114 115
115 def RemoveMask(self, index): 116 def RemoveMask(self, index):
@@ -121,6 +122,7 @@ class Project(object): @@ -121,6 +122,7 @@ class Project(object):
121 new_dict[i-1] = self.mask_dict[i] 122 new_dict[i-1] = self.mask_dict[i]
122 new_dict[i-1].index = i-1 123 new_dict[i-1].index = i-1
123 self.mask_dict = new_dict 124 self.mask_dict = new_dict
  125 + self.save_workdir()
124 126
125 def GetMask(self, index): 127 def GetMask(self, index):
126 return self.mask_dict[index] 128 return self.mask_dict[index]
@@ -129,6 +131,7 @@ class Project(object): @@ -129,6 +131,7 @@ class Project(object):
129 #self.last_surface_index = surface.index 131 #self.last_surface_index = surface.index
130 index = len(self.surface_dict) 132 index = len(self.surface_dict)
131 self.surface_dict[index] = surface 133 self.surface_dict[index] = surface
  134 + self.save_workdir()
132 return index 135 return index
133 136
134 def ChangeSurface(self, surface): 137 def ChangeSurface(self, surface):
@@ -144,6 +147,7 @@ class Project(object): @@ -144,6 +147,7 @@ class Project(object):
144 new_dict[i-1] = self.surface_dict[i] 147 new_dict[i-1] = self.surface_dict[i]
145 new_dict[i-1].index = i-1 148 new_dict[i-1].index = i-1
146 self.surface_dict = new_dict 149 self.surface_dict = new_dict
  150 + self.save_workdir()
147 151
148 152
149 def AddMeasurement(self, measurement): 153 def AddMeasurement(self, measurement):