# Connected component filter/ConnectedThresholdImageFilter

**URL:** https://discourse.itk.org/t/connected-component-filter-connectedthresholdimagefilter/3001
**Category:** Uncategorized
**Created:** [April 24, 2020, 6:03pm UTC](https://discourse.itk.org/t/connected-component-filter-connectedthresholdimagefilter/3001 "2020-04-24T18:03:32Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![srbn.ghosh89](https://discourse.itk.org/letter_avatar_proxy/v4/letter/s/3ec8ea/32.png) [@srbn.ghosh89](https://discourse.itk.org/u/srbn.ghosh89)
#### Post date: [April 24, 2020, 6:03pm UTC](https://discourse.itk.org/t/connected-component-filter-connectedthresholdimagefilter/3001/1 "2020-04-24T18:03:32Z")

</div>

Hi,

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](https://discourse.itk.org/uploads/default/original/2X/d/d692a9b48027529eda9f34dcffca1df14e062acf.jpeg) ![2](https://discourse.itk.org/uploads/default/original/2X/6/6bf9bb7e1474a6ace9d581e7fff02676b26753da.jpeg)

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

Thanks

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [April 24, 2020, 10:38pm UTC](https://discourse.itk.org/t/connected-component-filter-connectedthresholdimagefilter/3001/2 "2020-04-24T22:38:10Z")

</div>

Filling such holes is hard to do well, but [MorphologicalClosing](https://itk.org/Doxygen/html/classitk_1_1BinaryMorphologicalClosingImageFilter.html) should help.

---

<div class="post-metadata">

### Author: ![srbn.ghosh89](https://discourse.itk.org/letter_avatar_proxy/v4/letter/s/3ec8ea/32.png) [@srbn.ghosh89](https://discourse.itk.org/u/srbn.ghosh89)
#### Post date: [April 26, 2020, 1:40pm UTC](https://discourse.itk.org/t/connected-component-filter-connectedthresholdimagefilter/3001/3 "2020-04-26T13:40:22Z")

</div>

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