ISOSURFACE: identifying the connected faces

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 件のコメント

Sean de Wolski
Sean de Wolski 2012 年 10 月 19 日
What do you plan to do with these variables after?
AP
AP 2012 年 10 月 19 日
編集済み: AP 2012 年 10 月 19 日
The domain that I have has noise in it. So, when I plot an isosurface of some value, I get a few little islands in the plot beside the main one. I want to have the biggest isosurface. This may be solved by smoothing but I want to avoid using it as it changes my results.

サインインしてコメントする。

回答 (2 件)

Matt J
Matt J 2012 年 10 月 19 日

0 投票

Use BWCONNCOMP or REGIONPROPS

10 件のコメント

AP
AP 2012 年 10 月 19 日
Matt,
These are for images. I have 3D objects.
Matt J
Matt J 2012 年 10 月 19 日
編集済み: Matt J 2012 年 10 月 19 日
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
AP
AP 2012 年 10 月 19 日
編集済み: AP 2012 年 10 月 19 日
Thank you for clarification. I would be grateful if you could let me know how I should interpret the results. For my case, I get an array of size 1250x3. How this result can be used to differentiate between isolated objects? I can see in the plot that there are three separated objects but I don't see its connection with the result of S.PixelList. One of the isolated objects is much bigger than the other two but the results of S.PixelList is an array of size 1250x3.
Matt J
Matt J 2012 年 10 月 19 日
編集済み: Matt J 2012 年 10 月 19 日
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
AP 2012 年 10 月 19 日
I think this is good only for images or logical arrays. It does not work well for real valued arrays. We may have different regions very close to each other which prevents regionprops in resulting an accurate result.
Matt J
Matt J 2012 年 10 月 19 日
編集済み: Matt J 2012 年 10 月 19 日
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.
AP
AP 2012 年 10 月 22 日
編集済み: AP 2012 年 10 月 22 日
I think the way isosurface function works is different from setting A==1.
Can I send you the MAT file? For A==1 I get nothing as the result of S.PixelList although I can see two separate surfaces in the plot.
Matt J
Matt J 2012 年 10 月 22 日
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
AP 2012 年 10 月 22 日
I had tested this before by defining a tolerance but unfortunately I don't get the results of S.PixelList similar to that of isosurface function.
Can I send you the MAT file? You may find the source of discrepancy.
naomy_yf
naomy_yf 2022 年 10 月 31 日
regionprops is the precondition for using BWCONNCOMP

サインインしてコメントする。

質問済み:

AP
2012 年 10 月 19 日

コメント済み:

2022 年 10 月 31 日

Community Treasure Hunt

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

Start Hunting!

Translated by