bwlabeln 3D connections not a subset of its 2D connections
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Brian Frost
el 17 de Mayo de 2022
Comentada: Brian Frost
el 18 de Mayo de 2022
Hi all -
I am trying to use bwlabeln to connect a single flat membrane apparent in a large OCT volume scan. When I use bwconnect on cross-section, or bwlabeln with either 4 or 8 as the connect parameter, all is well. Of course, this is undesirable as it means my connected regions are only in-plane.
However, when I use 6, 26 or any other 3D parameter for connect, I do not get the desired result. I find this confusing, because my understanding is that if two pixels are connected in 2D, they ought still be connected in 3D. As such, the connected region using '4' should be a subset of that using '6'. Am I incorrect here? How can I achieve the desired result.
Here is my code, and the figures generated. I have labeled the membrane I want to connect.
label4 = bwlabeln(VThresh2,4);
label26 = bwlabeln(VThresh2,26);
figure;
subplot(3,2,1)
imagesc(VThresh2(:,:,256))
colormap('gray')
title('Slice 256 Binary Image')
subplot(3,2,2)
imagesc(VThresh2(:,:,257))
colormap('gray')
title('Slice 257 Binary Image')
subplot(3,2,[3 5])
imagesc(label4(:,:,256))
title('Slice 256 Connected Regions using connect=4')
subplot(3,2,[4 6])
imagesc(label26(:,:,256))
title('Slice 256 Connected Regions using connect=26')
0 comentarios
Respuesta aceptada
Matt J
el 18 de Mayo de 2022
Editada: Matt J
el 18 de Mayo de 2022
My guess is that the 4-connected regions are indeed subsets of the 26-connected regions, as you expect. However, in the 26-connected case, you now have a wider range of labels per slice. Therefore, the grayscale range of your image displays is wider, thereby hiding some of the blobs.
Más respuestas (1)
Image Analyst
el 18 de Mayo de 2022
If an blob is 4-connected to a voxel then it will be 6-connected to the same voxel. However the converse is not true. A blob that is 6-connected in 3-D may not appear to have any 4-connected blobs if you look at just a single slice. A slice may have two separate, unconnected blobs in that particular slice, however you may be connected vertically by a, let's call it, "bridge" in adjacent slices. Like there may be a path up from the centroid of blob 2 in that slice up to the slice above and then a path over to just above the blob #1 and then goes down to blob #1 to make them connected. So the one slice it seems like there are 2 unconnected blobs but because of bridge connecting them in other slices, they are still 6-connected in 3-D.
0 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!