From 5e0c04d2840332d9d2d850f99bfae4e38b645a60 Mon Sep 17 00:00:00 2001 From: tfmoraes Date: Tue, 14 Dec 2010 17:16:10 +0000 Subject: [PATCH] FIX: separation of pieces to surface_process wasn't working in mac --- invesalius/data/surface.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/invesalius/data/surface.py b/invesalius/data/surface.py index fa4df1a..d5480a9 100644 --- a/invesalius/data/surface.py +++ b/invesalius/data/surface.py @@ -447,13 +447,13 @@ class SurfaceManager(): else: flip_image = True - n_processors = 1 # multiprocessing.cpu_count() + n_processors = multiprocessing.cpu_count() pipe_in, pipe_out = multiprocessing.Pipe() - o_piece = 2 + o_piece = 1 piece_size = 40 - n_pieces = round(mask.matrix.shape[0] / piece_size + 0.5, 0) + n_pieces = int(round(mask.matrix.shape[0] / piece_size + 0.5, 0)) print "n_pieces", n_pieces, mask.matrix.shape q_in = multiprocessing.Queue() @@ -494,16 +494,13 @@ class SurfaceManager(): polydata = polydata_append.GetOutput() - # Orient normals from inside to outside - normals = vtk.vtkPolyDataNormals() - normals.SetInput(polydata) - normals.SetFeatureAngle(80) - normals.AutoOrientNormalsOn() - normals.GetOutput().ReleaseDataFlagOn() + clean = vtk.vtkCleanPolyData() + clean.SetInput(polydata) + clean.PointMergingOn() - # Improve performance + # Improve performance stripper = vtk.vtkStripper() - stripper.SetInput(normals.GetOutput()) + stripper.SetInput(clean.GetOutput()) stripper.PassThroughCellIdsOn() stripper.PassThroughPointIdsOn() -- libgit2 0.21.2