From 90911e2aec71ee80f5b68ed7ee45f1c3a9589d85 Mon Sep 17 00:00:00 2001 From: tfmoraes Date: Mon, 21 Feb 2011 13:48:25 +0000 Subject: [PATCH] Using vtkDecimatePro --- invesalius/data/surface.py | 2 +- invesalius/data/surface_process.py | 35 +++++++++++++++++------------------ 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/invesalius/data/surface.py b/invesalius/data/surface.py index 1a4f6e3..dfb414f 100644 --- a/invesalius/data/surface.py +++ b/invesalius/data/surface.py @@ -449,7 +449,7 @@ class SurfaceManager(): pipe_in, pipe_out = multiprocessing.Pipe() o_piece = 1 - piece_size = 40 + piece_size = 20 n_pieces = int(round(matrix.shape[0] / piece_size + 0.5, 0)) print "n_pieces", n_pieces, matrix.shape diff --git a/invesalius/data/surface_process.py b/invesalius/data/surface_process.py index 1bac49f..5d73661 100644 --- a/invesalius/data/surface_process.py +++ b/invesalius/data/surface_process.py @@ -90,27 +90,26 @@ class SurfaceProcess(multiprocessing.Process): print "origin is", origin #print "Decimating" - #if self.decimate_reduction: - #decimation = vtk.vtkDecimatePro() - #decimation.SetInput(polydata) - #decimation.SetTargetReduction(0) - #decimation.PreserveTopologyOn() - #decimation.SplittingOff() - #polydata = decimation.GetOutput() - - decimation = vtk.vtkQuadricClustering() + decimation = vtk.vtkDecimatePro() decimation.SetInput(polydata) - decimation.AutoAdjustNumberOfDivisionsOff() - decimation.SetDivisionOrigin(0, 0, 0) - decimation.SetDivisionSpacing(self.spacing) - decimation.SetFeaturePointsAngle(80) - decimation.UseFeaturePointsOn() - decimation.UseFeatureEdgesOn() - decimation.CopyCellDataOn() + decimation.SetTargetReduction(0.3) + decimation.PreserveTopologyOn() + #decimation.SplittingOff() + polydata = decimation.GetOutput() + + #decimation = vtk.vtkQuadricClustering() + #decimation.SetInput(polydata) + #decimation.AutoAdjustNumberOfDivisionsOff() + #decimation.SetDivisionOrigin(0, 0, 0) + #decimation.SetDivisionSpacing(self.spacing) + #decimation.SetFeaturePointsAngle(80) + #decimation.UseFeaturePointsOn() + #decimation.UseFeatureEdgesOn() + #ecimation.CopyCellDataOn() - print "Division", decimation.GetNumberOfDivisions() + #print "Division", decimation.GetNumberOfDivisions() - polydata = decimation.GetOutput() + #polydata = decimation.GetOutput() #if self.smooth_iterations and self.smooth_relaxation_factor: #print "Smoothing" -- libgit2 0.21.2