I want to get the section area of the Lumbar pedicle. I had got a the point cloud the section from numpy arrays, and then use code:
def areaSect(points):
""
verts = vtk.vtkPoints()
polygon = vtk.vtkPolygon()
polygon_pid = polygon.GetPointIds()
for i, p in enumerate(points):
verts.InsertNextPoint(*tuple(p))
polygon_pid.InsertNextId(i)
polygon_cell = vtk.vtkCellArray()
polygon_cell.InsertNextCell(polygon)
pd = vtk.vtkPolyData()
pd.SetPoints(verts)
pd.SetPolys(polygon_cell)
model = slicer.mrmlScene.AddNewNodeByClass(
'vtkMRMLModelNode', 'planeMod')
model.CreateDefaultDisplayNodes()
model.SetAndObservePolyData(pd)
tri_converter = vtk.vtkTriangleFilter()
tri_converter.SetInputDataObject(model.GetMesh())
tri_converter.Update()
Mass = vtk.vtkMassProperties()
Mass.SetInputData(tri_converter.GetOutput())
Mass.Update()
return Mass.GetSurfaceArea()
[in]: areaSect(cP[1])
[out]: 49.16256299367866
However, this result(49.16256299367866) is too small for the 19*10 section below
psarr.csv (7.0 KB)
What’s wrong?