From b42ffc1c4434714bfb6ced89ac200427f5e754b8 Mon Sep 17 00:00:00 2001 From: tfmoraes Date: Fri, 20 Apr 2012 16:55:41 +0000 Subject: [PATCH] FIX: When the user split, select the largest, or various surface, the vtkMassProperties because the resulting was not a homogenic triangle surface, so it is necessary to apply the vtkTriangleFilter --- invesalius/data/surface.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/invesalius/data/surface.py b/invesalius/data/surface.py index 16d561e..09c59b0 100644 --- a/invesalius/data/surface.py +++ b/invesalius/data/surface.py @@ -271,10 +271,15 @@ class SurfaceManager(): # The following lines have to be here, otherwise all volumes disappear if not volume: + triangle_filter = vtk.vtkTriangleFilter() + triangle_filter.SetInput(polydata) + triangle_filter.Update() + measured_polydata = vtk.vtkMassProperties() - measured_polydata.SetInput(polydata) + measured_polydata.SetInput(triangle_filter.GetOutput()) volume = measured_polydata.GetVolume() surface.volume = volume + print ">>>>", surface.volume else: surface.volume = volume self.last_surface_index = surface.index -- libgit2 0.21.2