removing one-voxel bridges between clusters?

Say I have a 3D computed tomography (CT) image, which I convert to a binary image of ones and zeros. I would like to remove one-voxel bridges that attach two larger clusters of ones together to get two seperate clusters instead of one. How would I go about this?

Réponses (1)

Matt J
Matt J le 27 Mar 2023

0 votes

Perhaps using imopen?

5 commentaires

I am unsure how to go about this
Matt J
Matt J le 28 Mar 2023
Modifié(e) : Matt J le 28 Mar 2023
As an example,
load BWImage
figure;
imshow(BW);
figure
imshow(imopen(BW,strel('disk',3)));
Or perhaps
strel('sphere',1)
since the image is volumetric
This seems to remove clusters smaller clusters smaller then 9 voxels in size. What if I would like to keep those?
Matt J
Matt J le 30 Mar 2023
Modifié(e) : Matt J le 30 Mar 2023
Save the smaller clusters to a separate image using bwareafilt or bwareaopen. Then use that image to restore them later.

Connectez-vous pour commenter.

Modifié(e) :

le 30 Mar 2023

Community Treasure Hunt

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

Start Hunting!

Translated by