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?

Answers (1)

Perhaps using imopen?

5 Comments

I am unsure how to go about this
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 on 30 Mar 2023
Edited: Matt J on 30 Mar 2023
Save the smaller clusters to a separate image using bwareafilt or bwareaopen. Then use that image to restore them later.

Sign in to comment.

Categories

Asked:

on 27 Mar 2023

Edited:

on 30 Mar 2023

Community Treasure Hunt

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

Start Hunting!