Commit b2325625ed71df2a6e267b8d71823db73ef95dbb
1 parent
3b3ba257
Exists in
master
and in
68 other branches
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 | 5 | import imagedata_utils as iu |
| 6 | 6 | from project import Project |
| 7 | 7 | import vtk_utils as vu |
| 8 | +import polydata_utils as pu | |
| 8 | 9 | |
| 9 | 10 | class Surface(): |
| 10 | 11 | """ |
| ... | ... | @@ -148,6 +149,9 @@ class SurfaceManager(): |
| 148 | 149 | "Filling polydata...")) |
| 149 | 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 | 155 | # Orient normals from inside to outside |
| 152 | 156 | normals = vtk.vtkPolyDataNormals() |
| 153 | 157 | normals.SetInput(polydata) | ... | ... |