Commit 22751b3f0c39aa8442f55cb6fb91efefc38d942b
1 parent
36bdc3c7
Exists in
master
and in
68 other branches
ENH: Improvements in progress to generate surface
Showing
1 changed file
with
7 additions
and
1 deletions
Show diff stats
invesalius/data/surface.py
| ... | ... | @@ -188,7 +188,7 @@ class SurfaceManager(): |
| 188 | 188 | if imagedata_resolution: |
| 189 | 189 | imagedata = iu.ResampleImage3D(imagedata, imagedata_resolution) |
| 190 | 190 | |
| 191 | - pipeline_size = 2 | |
| 191 | + pipeline_size = 5 | |
| 192 | 192 | if decimate_reduction: |
| 193 | 193 | pipeline_size += 1 |
| 194 | 194 | if (smooth_iterations and smooth_relaxation_factor): |
| ... | ... | @@ -230,18 +230,24 @@ class SurfaceManager(): |
| 230 | 230 | |
| 231 | 231 | # Orient normals from inside to outside |
| 232 | 232 | normals = vtk.vtkPolyDataNormals() |
| 233 | + normals.AddObserver("ProgressEvent", lambda obj,evt: | |
| 234 | + UpdateProgress(obj, _("Generating 3D surface..."))) | |
| 233 | 235 | normals.SetInput(polydata) |
| 234 | 236 | normals.SetFeatureAngle(80) |
| 235 | 237 | normals.AutoOrientNormalsOn() |
| 236 | 238 | normals.GetOutput().ReleaseDataFlagOn() |
| 237 | 239 | |
| 238 | 240 | stripper = vtk.vtkStripper() |
| 241 | + stripper.AddObserver("ProgressEvent", lambda obj,evt: | |
| 242 | + UpdateProgress(obj, _("Generating 3D surface..."))) | |
| 239 | 243 | stripper.SetInput(normals.GetOutput()) |
| 240 | 244 | stripper.PassThroughCellIdsOn() |
| 241 | 245 | stripper.PassThroughPointIdsOn() |
| 242 | 246 | |
| 243 | 247 | # Map polygonal data (vtkPolyData) to graphics primitives. |
| 244 | 248 | mapper = vtk.vtkPolyDataMapper() |
| 249 | + mapper.AddObserver("ProgressEvent", lambda obj,evt: | |
| 250 | + UpdateProgress(obj, _("Generating 3D surface..."))) | |
| 245 | 251 | mapper.SetInput(stripper.GetOutput()) |
| 246 | 252 | mapper.ScalarVisibilityOff() |
| 247 | 253 | ... | ... |