Computation of the volume of a mesh

AIMS library and commands usage

Moderators: denghien, riviere

Post Reply
Antonio_Moreno
Posts: 3
Joined: Fri Jul 06, 2007 7:58 am
Location: NeuroSpin, Saclay, France
Contact:

Computation of the volume of a mesh

Post by Antonio_Moreno »

Hi!

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!

Antonio
User avatar
riviere
Site Admin
Posts: 1361
Joined: Tue Jan 06, 2004 12:21 pm
Location: CEA NeuroSpin, Saint Aubin, France
Contact:

Post by riviere »

Hi Antonio,
The development version of AimsMeshArea does so. The stable one only outputs the surface area.
It only works on closed meshes, of course.
Denis
Antonio_Moreno
Posts: 3
Joined: Fri Jul 06, 2007 7:58 am
Location: NeuroSpin, Saclay, France
Contact:

Post by Antonio_Moreno »

Thank you very much, Denis! I will try with the development version of AimsMeshArea then.

Antonio
User avatar
Jean-Francois Mangin
Posts: 337
Joined: Mon Mar 01, 2004 10:24 am
Location: Neurospin, CEA, France
Contact:

Post by Jean-Francois Mangin »

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.
Antonio_Moreno
Posts: 3
Joined: Fri Jul 06, 2007 7:58 am
Location: NeuroSpin, Saclay, France
Contact:

Post by Antonio_Moreno »

Hi Jeff,

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.

Antonio
User avatar
riviere
Site Admin
Posts: 1361
Joined: Tue Jan 06, 2004 12:21 pm
Location: CEA NeuroSpin, Saint Aubin, France
Contact:

Post by riviere »

Hi,

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.

Denis
User avatar
Jean-Francois Mangin
Posts: 337
Joined: Mon Mar 01, 2004 10:24 am
Location: Neurospin, CEA, France
Contact:

Post by Jean-Francois Mangin »

You mean it is based on the cutting mesh algorithm?
User avatar
riviere
Site Admin
Posts: 1361
Joined: Tue Jan 06, 2004 12:21 pm
Location: CEA NeuroSpin, Saint Aubin, France
Contact:

Post by riviere »

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).
That's all.
The mesh has to be closed otherwise there will be some missing cylinders and the volume will be all wrong.
Denis
Post Reply