Commit b2325625ed71df2a6e267b8d71823db73ef95dbb

Authored by tfmoraes
1 parent 3b3ba257

ADD: Calculating Area and Volume in the polydata pipeline

Showing 1 changed file with 4 additions and 0 deletions   Show diff stats
invesalius/data/surface.py
@@ -5,6 +5,7 @@ import constants as const @@ -5,6 +5,7 @@ import constants as const
5 import imagedata_utils as iu 5 import imagedata_utils as iu
6 from project import Project 6 from project import Project
7 import vtk_utils as vu 7 import vtk_utils as vu
  8 +import polydata_utils as pu
8 9
9 class Surface(): 10 class Surface():
10 """ 11 """
@@ -148,6 +149,9 @@ class SurfaceManager(): @@ -148,6 +149,9 @@ class SurfaceManager():
148 "Filling polydata...")) 149 "Filling polydata..."))
149 polydata = filled_polydata.GetOutput() 150 polydata = filled_polydata.GetOutput()
150 151
  152 + print "Area: %f mm2" % pu.CalculateSurfaceArea(polydata)
  153 + print "Volume: %f mm3" % pu.CalculateSurfaceVolume(polydata)
  154 +
151 # Orient normals from inside to outside 155 # Orient normals from inside to outside
152 normals = vtk.vtkPolyDataNormals() 156 normals = vtk.vtkPolyDataNormals()
153 normals.SetInput(polydata) 157 normals.SetInput(polydata)