comparing volume of two 3d matrices

조회 수: 2 (최근 30일)
Alan AF
Alan AF 2012년 2월 14일
편집: a 2013년 10월 12일
I have two 3d matrices called ORIGINAL and RECONSTRUCTED, size 500x500x500.
  • ORIGINAL [Solid intensity: 0 black , 1 white]
  • RECONSTRUCTED [intensity: 0 black to 1 white]
each matrix contain an object that can be viewed using command : isosurface(Volum,0.5);
How can I compare the size of those two object in Matlab?
Is there a way to combine the two matrix together and draw an isosurface of the two Objects after combination?
Thanks

채택된 답변

Sean de Wolski
Sean de Wolski 2012년 2월 14일
If the objects are convex then you can use the second output of convhulln to give you the volume directly. If not, then you have a few options:
You can just sum the images:
v1 = sum(sum(sum(original)));
v2 = sum(sum(sum(original)));
You could use a more fancy approach such as this:
And there are other ways.
For my masters thesis that did quite a bit of CT volume analysis, I just summed - it was a good enough approximation and there were many other attributes in the image that cause more error than this (reconstruction/downsampling bits/binarizing/noise, etc).
  댓글 수: 2
Alan AF
Alan AF 2012년 2월 14일
Thank you Sean for your brilliant answer
Actually I am interested in measuring the errors resulted from reconstruction, (I.e finding the changes and error that a reconstruction method (such as Wanted Back Projection) suffers from).
the first Matrix contains a sphere that is placed in the middle with solid intensity Original(x,y,z), while the other Matrix is a result from reconstruction that contains sphere shifted to the right with many artefacts and continuous intensity.
I thought of converting the two matrices in to indix imagies matrices with different colours and then combining them but did not know how to do it :(
Is there a way to combine the two matrix together and draw an isosurface of the two Objects after combination? or at least to find visually if the resulted object have different volume.
Many thanks
Sean de Wolski
Sean de Wolski 2012년 2월 14일
You could do a Venn diagramesque combo, sure.
V = uint8(Original); %original is label 1, background is zero
V(logical(recon))) = 2; % recon is label 2
V(logical(original)&logical(recon)) = 3; %both
Now isosurface based on equality, i.e:
isosurface(V==1,0) %isosurface of first object
Or if you want total isosurface
isosurface(V>0,0);
etc. Logical indexing is your friend!
Is this what you want?

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

추가 답변 (0개)

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by