ISOSURFACE: identifying the connected faces
Mostrar comentarios más antiguos
Dear All,
I have extracted the isosurfaces of variable "A" in a 3D volume data. For a specific value of "A", say A=1, I get three connected series of faces which are separated from each other. In other words, there are three different and isolated regions in the domain where A=1.
I am trying to identify these three regions and save them into three different variables. I would be grateful if someone could give me a hint on how I can achieve this goal.
Thanks,
Ahmad
2 comentarios
Sean de Wolski
el 19 de Oct. de 2012
What do you plan to do with these variables after?
Respuestas (2)
Matt J
el 19 de Oct. de 2012
0 votos
Use BWCONNCOMP or REGIONPROPS
10 comentarios
AP
el 19 de Oct. de 2012
Not sure why you think they won't handle n-dimensional data (unless possibly you have a really old version of MATLAB). Here's a simple example on a 3D volume
>> v=false(3,3,3); v(1)=1; v(end)=1
v(:,:,1) =
1 0 0
0 0 0
0 0 0
v(:,:,2) =
0 0 0
0 0 0
0 0 0
v(:,:,3) =
0 0 0
0 0 0
0 0 1
>> S=regionprops(v,'PixelList'); S.PixelList
ans =
1 1 1
ans =
3 3 3
The output should not be a 1250x3 numeric array. It should be a structure array. Make sure your input to regionprops is a logical array, e.g., as in
S=regionprops( (A==1), 'PixelList');
Each S(i) will correspond to a different connected region where A=1.
AP
el 19 de Oct. de 2012
But you will inevitably have a logical array. You said you were looking for regions for example where A equals 1. If so, you will have to compute the logical array A==1
More generally, you will always have to apply some logical test that identifies the regions you're looking for.
Matt J
el 22 de Oct. de 2012
Well how do you find the isosurface? If it isn't A==1, I assume it's something like
A<=1.5 & A>=0.5
or some other logical test.
AP
el 22 de Oct. de 2012
naomy_yf
el 31 de Oct. de 2022
regionprops is the precondition for using BWCONNCOMP
Sachin Ganjare
el 19 de Oct. de 2012
0 votos
Categorías
Más información sobre Surface and Mesh Plots en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!