how to Find the total surface area and volume of a mesh plot

I have a 2D matrix (attached) containing the height information of a 3D object. I would like to know how to calculate the volume and total surface area of this mesh plot. considering each square pixel has a side length of 0.1 microns.

3 Comments

I am a total noob, A small code would be helpful.
Thanks in Advance
Check the link..the link got code.

Sign in to comment.

 Accepted Answer

I’ve not done surface or volume integrals in a while, so I went back to Thomas and Finney.
See if this does what you want:
D = load('siddharth rawat h1.mat');
h1 = D.h1;
Vol = trapz(trapz(h1));
DxDy = gradient(h1);
Surface = trapz(trapz(sqrt(DxDy.^2 + DxDy'.^2 + 1)));
Vol =
6668.8
Surface =
11368

7 Comments

As there are no x and y data, the calculations will be done w.r.t indices of the data. Is it accepted?
Thank you very much for the answer, Does this take into account the contribution of all the pixels in the mesh plot or only the pixels having non-zero height values? as most of the pixels have 0 values. how to take 1 pixel= 0.1 micron into this calculation? (the height (z axis) values are already in microns, x,y are in pixels)
That’s the only option at present. If x and y data are later provided, they can be incorporated into the calculation easily enough.
This is a 3D reconstruction of a digital hologram of a diseased red blood cell (RBC) acquired over a CMOS camera, RBCs are doughnut or torus shaped cells, having a mean diameter of 7-8 microns. 0.1 is the resolution factor/ pixel in x-y plane. volume is okay but the surface area of this torus has to be around 100- 300 microns^2 in range. total surface area has to include curved surace area+ base of the RBC (non zero pixels). we are working on disease diagnosis. I have applied Otsu segmentation algorithm to take into account the region covered by cell only,in order to get h1.mat. I thought the explanation is important here.
@siddharth rawat —
My pleasure.
Pixels with zero values will be included in the integration but will not contribute to it, since the integral of zero is zero (or more correctly, the constant of integration, but we’re ignoring that here). The problem with the volume and surface area integrations is that the contour begins at a z-value of about 2.2, not zero. Subtracting 2.2 from all your non-zero pixels might result in approximately correct volume and surface values for half of your erythrocyte. The values for the other half would be a guess. You may want to ask Image Analyst how best to determine the ‘base’ value (my estimate of 2.2 is based on plotting it and then looking at the rotated plot), since image processing is his area of expertise, not mine. (I’m a physician and biomedical engineer.)
When I plotted it, I noticed that it appears to be a cylinder, not a biconcave disk typical of erythrocytes. (It should not go to zero in the centre.) I’m not certain how you want to resolve that, since in my experience, no erythrocytes would ever assume a toroidal shape, since they would be structurally unstable, twist into a low-energy ‘infinity’ shape, and be quickly eliminated in the spleen. Spherocytosis is not uncommon, but that involves the spleen ‘snipping off’ denatured haemoglobin, remnant DNA (Howell-Jolly bodies), malaria merozoites, and other abnormal inclusions, along with the parts of the RBC membrane surrounding them, leaving spherical erythrocytes, not toroidal ones. Yours is obviously not a spherocyte.
The normal mean corpuscular volume (MCV) is 90±8 femtolitres (microns^3), so your data should approximate that. The problem is that you’re only seeing half of your RBC, and assuming symmetry in a diseased RBC is probably not appropriate, although it largely depends on what the disease is.
Also, healthy RBCs are extremely flexible, and their volume changes significantly in the pulmonary and systemic capillaries. This is necessary because oxygen-saturated water has to be squeezed out of RBCs in the systemic capillaries, and quickly enter expanding RBCs in the pulmonary capillaries. Diffusion alone is simply too slow. This is a dynamic process. This is disrupted if the spectrin protein (the RBC ‘skeleton’) is compromised and the RBCs are too rigid to deform effectively, as it is in diabetes mellitus (it’s irreversibly glycosylated, a process analogous to the creation of haemoglobin A1c). I’m not aware of other spectrin abnormalities, although I’ve not researched it recently. You likely need to consider how much your RBCs can deform. Statistics representing a large sample of your RBCs are going to be important in order to account for these variations.
I made a guess on the zero-offset value, and used it to correct the values you posted. The ‘h1c’ matrix is approximately corrected for the offset. The calculation uses ‘logical indexing’ and reshape to correct the offset and then reshape the matrix.
The Code
D = load('siddharth rawat h1.mat');
h1 = D.h1;
h1v = h1(:);
h1c = (h1v .* (h1v == 0)) + ((h1v - 2.171) .* (h1v > 0));
h1c = reshape(h1c, size(h1));
Vol = trapz(trapz(h1c)) * (0.1^3);
DxDy = gradient(h1c);
Surface = trapz(trapz(sqrt(DxDy.^2 + DxDy'.^2 + 1))) * (0.1^2);
fprintf(1, '\n\tVolume (half) = %.4f µ^3\n\tSurface (half) = %.4f µ^2\n\n', Vol, Surface)
Volume (half) = 0.8614 µ^3
Surface (half) = 110.2949 µ^2
The surface looks to be approximately correct, but the volume looks to be off by a factor of 100, so I’ll let you sort that because I don’t entirely understand your scaling. I incorporated factors of (0.1^3) and (0.1^2) in the calculations.
Thanks for the code @star strider. this was really helpful in my research, I really appreciate your help.

Sign in to comment.

More Answers (1)

2 Comments

i want to find out the Mean corpuscular volume (MCV). for mcv we must have volume of red blood cells so my question is how to calculate the volume of red blood cells for which i have also attached the image of normal red blood cell. any answer will highly be appreciated.
It’s not possible to determine Mean corpuscular volume (link) from a peripheral smear.

Sign in to comment.

Categories

Find more on Surfaces, Volumes, and Polygons in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!