MATLAB: How to get the volume of a 3D concave shape

concave shapeImage Processing Toolboxvolume

Hi smart guys,
I am wondering if anyone knows how to get the volume of a 3D concave shape? The Matlab build-in function can only calculate the volume of a convex shape. For example,
[K, V] = convhulln(shape.vertices);
V is the volume. Here the shape is defined by a mesh with vertices and faces.
Thanks very much.
Best, Aaronne.

Best Answer

I would recommend voxelizing it and then just summing the resulting three dimensional volumetric image. There are a few utilities on the FEX that do this: