Commit c04408d689c9df5600f762c604d4f988be618d51

Authored by tatiana
1 parent 8d05dc3e

ENH: Set progress on measure step of the pipeline

Showing 1 changed file with 3 additions and 1 deletions   Show diff stats
invesalius/data/surface.py
@@ -231,7 +231,7 @@ class SurfaceManager(): @@ -231,7 +231,7 @@ class SurfaceManager():
231 if imagedata_resolution: 231 if imagedata_resolution:
232 imagedata = iu.ResampleImage3D(imagedata, imagedata_resolution) 232 imagedata = iu.ResampleImage3D(imagedata, imagedata_resolution)
233 233
234 - pipeline_size = 3 234 + pipeline_size = 4
235 if decimate_reduction: 235 if decimate_reduction:
236 pipeline_size += 1 236 pipeline_size += 1
237 if (smooth_iterations and smooth_relaxation_factor): 237 if (smooth_iterations and smooth_relaxation_factor):
@@ -341,6 +341,8 @@ class SurfaceManager(): @@ -341,6 +341,8 @@ class SurfaceManager():
341 341
342 # The following lines have to be here, otherwise all volumes disappear 342 # The following lines have to be here, otherwise all volumes disappear
343 measured_polydata = vtk.vtkMassProperties() 343 measured_polydata = vtk.vtkMassProperties()
  344 + measured_polydata.AddObserver("ProgressEvent", lambda obj,evt:
  345 + UpdateProgress(obj, _("Generating 3D surface...")))
344 measured_polydata.SetInput(polydata) 346 measured_polydata.SetInput(polydata)
345 volume = measured_polydata.GetVolume() 347 volume = measured_polydata.GetVolume()
346 surface.volume = volume 348 surface.volume = volume