Hi all,
I am a beginner and I don’t have much experience with the 3DSlicer environment and vtk libraries. I have already followed the various tutorials to get started.
My problem is the following.
I am trying to use python to retrieve model information, particularly Surface Area and Volume.
The ModelNode in my case is a Surface Mesh (vtkPolyData).
I don’t know if this is the best approach but I found the solution for my problem using the vtkMassProperties
Mass = vtk.vtkMassProperties()
Mass.SetInputData(mesh)
Mass.Update()
Surface_Area=Mass.GetSurfaceArea()
Volume=Mass.GetVolume()
If you check Slicer’s code they pass the polydata by a triangleFilter with a specific option before using massProperties. I don’t know why they do it but when I have to calculate a surfaceArea or volume I do it too