Connected component filter/ConnectedThresholdImageFilter


I have labeled 3D image with two different pixel values. I want to apply image connectivity filter to remove the other noises within the labeling which are creating problems to create a simple surface extraction in the next level.I have got so many islands and noises in the surface mesh because there are very small holes within the label.

If I can put a seed point and and radious value to feel the small holes in the labels something like this.

Please suggest to me how I can I use that.
I could not find any example on image connectivity filter.

I have attached screenshots.
1 2

I want to fill those small holes so that the shared boundary of two labels stay intact.


Filling such holes is hard to do well, but MorphologicalClosing should help.

when I am applying this filter, a blank image output is generating.