I’m looking at the vtkMassProperties class. How is the mass computed with no knowledge of the pixel or slice spacing of the PolyData?
Points of a polydata are not defined on a rectilinear grid, so there are no pixels or slices. Instead, point coordinates are floating-point values, defined directly in the world coordinate system.
If you create polydata from image (e.g., using marching cubes) then the conversion algorithm takes into account pixel and slice spacing.
@lassoan so if my units are mm in my image and I’m looking at this example:
https://lorensen.github.io/VTKExamples/site/Cxx/Utilities/MassProperties/
What units would the volume output be in? L or mL? or mm^3?
Thanks,
~Shane
Volume = length * length * length, so if your length unit is mm then volume unit is mm * mm * mm.
1 Like