calculate volume under of 3D isosurface plot

조회 수: 21 (최근 30일)
Abhishek Saini
Abhishek Saini 2019년 11월 27일
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
Abhishek Saini
Abhishek Saini 2019년 11월 28일
편집: Abhishek Saini 2019년 11월 28일
How to get the values of x,y, and z.
I used
p = issurface(x,y,z,V,isovalue).
It returns
p.vertices and
p.faces.
What should I use to calculate the colum and how does it will give volume.
I have attached isosurface image.
Capture.PNG

댓글을 달려면 로그인하십시오.

채택된 답변

Constantino Carlos Reyes-Aldasoro
Constantino Carlos Reyes-Aldasoro 2019년 11월 28일
편집: Constantino Carlos Reyes-Aldasoro 2019년 11월 29일
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
Walter Roberson
Walter Roberson 2019년 11월 29일
Abhishek Saini: please only use Flag to notify the moderators of problems with posts.
Constantino Carlos Reyes-Aldasoro
Constantino Carlos Reyes-Aldasoro 2019년 11월 29일
True, the code I wrote was only calculating the number of voxels, but if you want to callibrate that number into a certain physical quantity, like m^3 or mm^3 you will need to do that multiplication. Will edit my previous response so that it has the complete answer in case someone new arrives to this post.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Scalar Volume Data에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by