Commit 90911e2aec71ee80f5b68ed7ee45f1c3a9589d85
1 parent
47e6e1c3
Exists in
master
and in
67 other branches
Using vtkDecimatePro
Showing
2 changed files
with
18 additions
and
19 deletions
Show diff stats
invesalius/data/surface.py
| @@ -449,7 +449,7 @@ class SurfaceManager(): | @@ -449,7 +449,7 @@ class SurfaceManager(): | ||
| 449 | 449 | ||
| 450 | pipe_in, pipe_out = multiprocessing.Pipe() | 450 | pipe_in, pipe_out = multiprocessing.Pipe() |
| 451 | o_piece = 1 | 451 | o_piece = 1 |
| 452 | - piece_size = 40 | 452 | + piece_size = 20 |
| 453 | 453 | ||
| 454 | n_pieces = int(round(matrix.shape[0] / piece_size + 0.5, 0)) | 454 | n_pieces = int(round(matrix.shape[0] / piece_size + 0.5, 0)) |
| 455 | print "n_pieces", n_pieces, matrix.shape | 455 | print "n_pieces", n_pieces, matrix.shape |
invesalius/data/surface_process.py
| @@ -90,27 +90,26 @@ class SurfaceProcess(multiprocessing.Process): | @@ -90,27 +90,26 @@ class SurfaceProcess(multiprocessing.Process): | ||
| 90 | print "origin is", origin | 90 | print "origin is", origin |
| 91 | 91 | ||
| 92 | #print "Decimating" | 92 | #print "Decimating" |
| 93 | - #if self.decimate_reduction: | ||
| 94 | - #decimation = vtk.vtkDecimatePro() | ||
| 95 | - #decimation.SetInput(polydata) | ||
| 96 | - #decimation.SetTargetReduction(0) | ||
| 97 | - #decimation.PreserveTopologyOn() | ||
| 98 | - #decimation.SplittingOff() | ||
| 99 | - #polydata = decimation.GetOutput() | ||
| 100 | - | ||
| 101 | - decimation = vtk.vtkQuadricClustering() | 93 | + decimation = vtk.vtkDecimatePro() |
| 102 | decimation.SetInput(polydata) | 94 | decimation.SetInput(polydata) |
| 103 | - decimation.AutoAdjustNumberOfDivisionsOff() | ||
| 104 | - decimation.SetDivisionOrigin(0, 0, 0) | ||
| 105 | - decimation.SetDivisionSpacing(self.spacing) | ||
| 106 | - decimation.SetFeaturePointsAngle(80) | ||
| 107 | - decimation.UseFeaturePointsOn() | ||
| 108 | - decimation.UseFeatureEdgesOn() | ||
| 109 | - decimation.CopyCellDataOn() | 95 | + decimation.SetTargetReduction(0.3) |
| 96 | + decimation.PreserveTopologyOn() | ||
| 97 | + #decimation.SplittingOff() | ||
| 98 | + polydata = decimation.GetOutput() | ||
| 99 | + | ||
| 100 | + #decimation = vtk.vtkQuadricClustering() | ||
| 101 | + #decimation.SetInput(polydata) | ||
| 102 | + #decimation.AutoAdjustNumberOfDivisionsOff() | ||
| 103 | + #decimation.SetDivisionOrigin(0, 0, 0) | ||
| 104 | + #decimation.SetDivisionSpacing(self.spacing) | ||
| 105 | + #decimation.SetFeaturePointsAngle(80) | ||
| 106 | + #decimation.UseFeaturePointsOn() | ||
| 107 | + #decimation.UseFeatureEdgesOn() | ||
| 108 | + #ecimation.CopyCellDataOn() | ||
| 110 | 109 | ||
| 111 | - print "Division", decimation.GetNumberOfDivisions() | 110 | + #print "Division", decimation.GetNumberOfDivisions() |
| 112 | 111 | ||
| 113 | - polydata = decimation.GetOutput() | 112 | + #polydata = decimation.GetOutput() |
| 114 | 113 | ||
| 115 | #if self.smooth_iterations and self.smooth_relaxation_factor: | 114 | #if self.smooth_iterations and self.smooth_relaxation_factor: |
| 116 | #print "Smoothing" | 115 | #print "Smoothing" |