diff --git a/invesalius/data/surface.py b/invesalius/data/surface.py index dfb414f..9f38c14 100644 --- a/invesalius/data/surface.py +++ b/invesalius/data/surface.py @@ -496,6 +496,32 @@ class SurfaceManager(): clean.PointMergingOn() polydata = clean.GetOutput() + smoother = vtk.vtkWindowedSincPolyDataFilter() + smoother.SetInput(polydata) + smoother.SetNumberOfIterations(smooth_iterations) + smoother.SetFeatureAngle(120) + smoother.BoundarySmoothingOn() + smoother.SetPassBand(0.1) + #smoother.FeatureEdgeSmoothingOn() + #smoother.NonManifoldSmoothingOn() + #smoother.NormalizeCoordinatesOn() + smoother.Update() + polydata = smoother.GetOutput() + + print "Normals" + normals = vtk.vtkPolyDataNormals() + normals.SetInput(polydata) + normals.SetFeatureAngle(80) + normals.AutoOrientNormalsOn() + polydata = normals.GetOutput() + #decimation = vtk.vtkDecimatePro() + #decimation.SetInput(polydata) + #decimation.SetTargetReduction(0.3) + #decimation.PreserveTopologyOn() + #decimation.SplittingOff() + #decimation.BoundaryVertexDeletionOff() + #polydata = decimation.GetOutput() + # Improve performance stripper = vtk.vtkStripper() stripper.SetInput(polydata) diff --git a/invesalius/data/surface_process.py b/invesalius/data/surface_process.py index 5f27081..0bb166c 100644 --- a/invesalius/data/surface_process.py +++ b/invesalius/data/surface_process.py @@ -71,12 +71,11 @@ class SurfaceProcess(multiprocessing.Process): mcubes.SetInput(image) mcubes.SetValue(0, self.min_value) mcubes.SetValue(1, self.max_value) - mcubes.ComputeScalarsOn() - mcubes.ComputeGradientsOn() - mcubes.ComputeNormalsOn() + mcubes.ComputeScalarsOff() + mcubes.ComputeGradientsOff() + mcubes.ComputeNormalsOff() polydata = mcubes.GetOutput() - triangle = vtk.vtkTriangleFilter() triangle.SetInput(polydata) triangle.Update() @@ -93,7 +92,7 @@ class SurfaceProcess(multiprocessing.Process): decimation = vtk.vtkDecimatePro() decimation.SetInput(polydata) decimation.SetTargetReduction(0.3) - decimation.PreserveTopologyOn() + #decimation.PreserveTopologyOn() decimation.SplittingOff() decimation.BoundaryVertexDeletionOff() polydata = decimation.GetOutput() @@ -133,8 +132,5 @@ class SurfaceProcess(multiprocessing.Process): writer.SetInput(polydata) writer.SetFileName(filename) writer.Write() - print filename - - time.sleep(1) self.q_out.put(filename) -- libgit2 0.21.2