Commit 1e5b55c82dc6dbc3394203b63a85bf2e57900929
1 parent
00691478
Exists in
master
and in
68 other branches
FIX: Original imagedata affected if edited
Showing
1 changed file
with
8 additions
and
1 deletions
Show diff stats
invesalius/data/surface.py
@@ -58,8 +58,12 @@ class SurfaceManager(): | @@ -58,8 +58,12 @@ class SurfaceManager(): | ||
58 | quality='Optimal' | 58 | quality='Optimal' |
59 | mode = 'CONTOUR' # 'GRAYSCALE' | 59 | mode = 'CONTOUR' # 'GRAYSCALE' |
60 | 60 | ||
61 | + imagedata_tmp = None | ||
61 | if (edited_points): | 62 | if (edited_points): |
62 | - imagedata = BuildEditedImage(imagedata, edited_points) | 63 | + imagedata_tmp = vtk.vtkImageData() |
64 | + imagedata_tmp.DeepCopy(imagedata) | ||
65 | + imagedata_tmp.Update() | ||
66 | + imagedata = BuildEditedImage(imagedata_tmp, edited_points) | ||
63 | 67 | ||
64 | if quality in const.SURFACE_QUALITY.keys(): | 68 | if quality in const.SURFACE_QUALITY.keys(): |
65 | imagedata_resolution = const.SURFACE_QUALITY[quality][0] | 69 | imagedata_resolution = const.SURFACE_QUALITY[quality][0] |
@@ -226,6 +230,9 @@ class SurfaceManager(): | @@ -226,6 +230,9 @@ class SurfaceManager(): | ||
226 | surface.colour, surface.volume, | 230 | surface.colour, surface.volume, |
227 | surface.transparency)) | 231 | surface.transparency)) |
228 | 232 | ||
233 | + #Destroy Copy original imagedata | ||
234 | + if(imagedata_tmp): | ||
235 | + del imagedata_tmp | ||
229 | 236 | ||
230 | def RemoveActor(self, index): | 237 | def RemoveActor(self, index): |
231 | """ | 238 | """ |