# calculate volume under of 3D isosurface plot

13 views (last 30 days)

Show older comments

Abhishek Saini
on 27 Nov 2019

Edited: Constantino Carlos Reyes-Aldasoro
on 29 Nov 2019

I have a 3D matrix data V(201,101,101). I want to calculate the isosurface volume for a particular isovalue.

How to calculate the volume.

I used following code to generate isosurface.

figure;

p = patch(isosurface(x,y,z,V,-2));

isonormals(x,y,z,V,p);

cdata = smooth3(rand(size(V)),'box',7);

isocolors(x,y,z,cdata,p)

p.Facecolor = 'interp';

p.Edgecolor = 'none';

##### 4 Comments

### Accepted Answer

Constantino Carlos Reyes-Aldasoro
on 28 Nov 2019

Edited: Constantino Carlos Reyes-Aldasoro
on 29 Nov 2019

What isosurface and isovalue are doing are generating a surface around those points that are above a certain value. All code you showed is good for visualising, but what you really want here is not a visual display but a number of the volume.

If you want the volume that is the same as how many points satisfy your condition of voxel intensity > value, so what you have to do is the following:

volumeOfInterest = (V >-2 );

That will generate a matrix of same dimensions as V with 1 for those points above the isovalue and 0 below, then simply sum those values

volume = sum (volumeOfInterest(:));

And then, if needed you will need to callibrate that value to the physical quantity of your interest (say mm^3) with a conversion between voxels and that quantity.

Hope that helps

##### 3 Comments

Constantino Carlos Reyes-Aldasoro
on 29 Nov 2019

### More Answers (0)

### See Also

### Categories

### Community Treasure Hunt

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

Start Hunting!