Calculate Volume?

Hello,

I have a more mathematical question:

I have extracted the isosurface from a image stack… how is it possible to calculate the volume of the extracted object?

That means how do I calculate the volume from a point cloud? I would very appreciate if you could help me (links, suggestions,…)

Thanks in advance

chris.

Originally posted by cpb:
[b]Hello,

I have a more mathematical question:

I have extracted the isosurface from a image stack… how is it possible to calculate the volume of the extracted object?

That means how do I calculate the volume from a point cloud? I would very appreciate if you could help me (links, suggestions,…)

Thanks in advance

chris.[/b]

I suck at math, but I know how to google for “volume of isosurface”.

http://www.iavsc.org/repository/avs5/output.html#compute_volume

I think it’s C code, and it’s in a .ZIP format. Let me know if you have any problems with those. :wink:

I hope it helps you out. It took google 0.09 seconds to find it, and I bet you waited over an hour for this reply. :wink:

/Henrik

[This message has been edited by CAD_Swede (edited 05-11-2003).]

convex hull? delaunay trianglulation?

[This message has been edited by oliii (edited 05-11-2003).]

Hi,

Can’t you just count the number of points with their value over the isovalue from the image stack? Well in some cases maybe not, but maybe…

-Ilkka

Uhhh,

seems to be a general problem… I don`t get any further! The problem with the posted program is, that I don’t know which format the data has to be!

c.

I’d say you want to divide the volume into tetrahedra, then sum the volumes of the tets.

Either that or take several slices through the volume, calculate their area and interpolate volumes between slices. It’s a linear difference between slices if the interpolation is linear as it is with a tri mesh so just average the areas of two slices and multiply by the separation between the sices. You need to make sure your have a slice at each vertex position along your slice axis for total accuracy (this guarantees all surface reconstruction interpolations between your chosen slices are linear).

Yeah, seems like if you computed the isosurface from an algorithm like marching cubes or marching tetrahedra, then you’d just want to keep a running total of the volume as you traverse the grid.

Depending on mesh density, the suggestion (by JustHanging) of doing a Riemann sum could also be reasonable.

what do you mean by using the rieman sum… going back to the actual image???

Originally posted by cpb:
[b]what do you mean by using the rieman sum… going back to the actual image???

[/b]

Essentially, I mean, compute the sum:

sum = 0
for all i, j, and k
if scalar[i][j][j] > threshold
sum += cell_size

This is a reasonable zeroth order approxmation, and zeroth order may be sufficient if you have a high grid density and/or you only need a coarse approximation.

Hello,

Since you all wrote the reply on volume calculation from an object file, I was thinking how I could approach this problem… and I didn’t come to any conclusion. Therefore I was thinking if you might help me further… I will attach you 1 Object from the generated isosurface as an object file (or I just paste it).

Could you help me further; I am kind of desperate because this is an important issue for me and I have to solve it!

Thx in advance

c.

Here the object:

V are the actual vertices
F are the faces (ex. f 1 2 3 means vertex 1,2,3 form a triangle)

v 57.600002 19.980001 25.200001
v 57.600002 19.800001 26.775001
v 57.780002 19.800001 25.200001
v 57.600002 19.800001 26.775001
v 57.600002 19.980001 25.200001
v 57.420002 19.800001 25.200001
v 57.600002 19.800001 26.775001
v 57.600002 19.440001 26.775001
v 57.960002 19.440001 26.775001
v 57.600002 19.800001 26.775001
v 57.960002 19.440001 26.775001
v 57.960002 19.620001 25.200001
v 57.780002 19.800001 25.200001
v 57.600002 19.800001 26.775001
v 57.960002 19.620001 25.200001
v 57.600002 19.800001 26.775001
v 57.420002 19.800001 25.200001
v 57.600002 19.440001 26.775001
v 57.780002 19.800001 25.200001
v 57.600002 19.800001 23.625001
v 57.600002 19.980001 25.200001
v 57.600002 19.980001 25.200001
v 57.600002 19.800001 23.625001
v 57.420002 19.800001 25.200001
v 57.960002 19.440001 23.625001
v 57.600002 19.800001 23.625001
v 57.780002 19.800001 25.200001
v 57.960002 19.620001 25.200001
v 57.960002 19.440001 23.625001
v 57.780002 19.800001 25.200001
v 57.600002 19.440001 26.775001
v 57.420002 19.800001 25.200001
v 57.420002 19.440001 25.200001
v 57.420002 19.800001 25.200001
v 57.600002 19.800001 23.625001
v 57.420002 19.440001 25.200001
v 57.960002 19.620001 25.200001
v 57.960002 19.440001 26.775001
v 58.140002 19.440001 25.200001
v 58.140002 19.440001 25.200001
v 57.960002 19.440001 26.775001
v 57.960002 19.260001 25.200001
v 57.600002 19.260001 25.200001
v 57.960002 19.440001 26.775001
v 57.600002 19.440001 26.775001
v 57.960002 19.260001 25.200001
v 57.960002 19.440001 26.775001
v 57.600002 19.260001 25.200001
v 57.600002 19.440001 26.775001
v 57.420002 19.440001 25.200001
v 57.600002 19.260001 25.200001
v 57.960002 19.440001 23.625001
v 57.960002 19.620001 25.200001
v 58.140002 19.440001 25.200001
v 57.960002 19.440001 23.625001
v 57.600002 19.440001 23.625001
v 57.600002 19.800001 23.625001
v 57.600002 19.800001 23.625001
v 57.600002 19.440001 23.625001
v 57.420002 19.440001 25.200001
v 57.960002 19.440001 23.625001
v 58.140002 19.440001 25.200001
v 57.960002 19.260001 25.200001
v 57.960002 19.440001 23.625001
v 57.960002 19.260001 25.200001
v 57.600002 19.440001 23.625001
v 57.600002 19.260001 25.200001
v 57.420002 19.440001 25.200001
v 57.600002 19.440001 23.625001
v 57.600002 19.440001 23.625001
v 57.960002 19.260001 25.200001
v 57.600002 19.260001 25.200001
f 1 2 3
f 4 5 6
f 7 8 9
f 10 11 12
f 13 14 15
f 16 17 18
f 19 20 21
f 22 23 24
f 25 26 27
f 28 29 30
f 31 32 33
f 34 35 36
f 37 38 39
f 40 41 42
f 43 44 45
f 46 47 48
f 49 50 51
f 52 53 54
f 55 56 57
f 58 59 60
f 61 62 63
f 64 65 66
f 67 68 69
f 70 71 72

We experimented and got quite perfect results with taking any pivot point, and creating tetrahedrons from this point to every triangle present. If the face is front-facing to the pivot we subtract the volume, if if it’s back-facing we add the volume. Shouldn’t be too hard to implement that.

Of course it needs to be a closed mesh in order to work.

Then again, what is the volume of a non-closed body?

Excellent, I like the negative volume subtraction. Makes everything very easy & very fast.