Page 1 of 1
Computation of the volume of a mesh
Posted: Fri Jul 06, 2007 9:11 am
I'd like to know if there is a way to compute the volume contained inside a mesh with the Aims commands.
I'm interested in computing the difference in volume (in mm³) of a binary image (number of voxels x volume of one voxel) with the mesh generated from this volume. I'd like to quantify the error of this conversion volume-->mesh.
If you have any idea, it will be welcome!!
Thanks in advance!
Posted: Fri Jul 06, 2007 5:37 pm
The development version of AimsMeshArea does so. The stable one only outputs the surface area.
It only works on closed meshes, of course.
Posted: Fri Jul 06, 2007 7:56 pm
Thank you very much, Denis! I will try with the development version of AimsMeshArea then.
Posted: Sat Jul 07, 2007 5:16 pm
I wonder why you consider the mesh based volume as the one with errors. I do not know the way the volume of this mesh is computed,
but in my opinion, it could be closer to reality than the volume of a binary image.
Posted: Sat Jul 07, 2007 6:51 pm
You are true. In fact it depends on the way the binary image is computed... I should say that I want to quantify the difference in volume of the voxel-based object and its mesh. The error can come from the conversion in both directions: volume-->mesh or mesh-->volume.
Posted: Sun Jul 08, 2007 2:53 pm
I guess in every case the mesh is computed from the volume, not the contrary, at least if you are using meshes computed by our tools. But I think what Jeff means is that the mesh, with its smoothing effect, may after all be closer to reality than the volume with its voxel quantization from which it is extracted, because mesh triangles can cut across voxels and compensate a kind of "partial volume effect".
Anyway I think the values are close (for reasonably big objects at least). I have not performed any statistics on this but I have compared both values on several objects when I wrote the mesh volume calculation, to debug it and check that values are comparable. So, try and tell us...
To answer Jeff, the mesh volume is calculated directly from the mesh triangles, not through any voxelization process. It's a sum of cylinder volumes, one cylinder under each triangle.
Posted: Tue Jul 10, 2007 8:44 pm
You mean it is based on the cutting mesh algorithm?
Posted: Tue Jul 10, 2007 10:01 pm
No it's very simple actually: take a given, fixed direction (z axis for instance). Project every triangle onto a plane orthogonal to this direction (x,y plane). For each triangle, count the volume of the cylinder under this projected triangle, either positively if the triangle normal has the same direction as the projection->triangle vector (or consider the signed volume multiplicated by the sign of the dot product of the normal with the z direction).
The mesh has to be closed otherwise there will be some missing cylinders and the volume will be all wrong.