# How to delete connected areas less than a certain threshold

**URL:** <https://discourse.vtk.org/t/how-to-delete-connected-areas-less-than-a-certain-threshold/9032>\
**Category:** Development\
**Created:** [July 28, 2022, 3:21am UTC](https://discourse.vtk.org/t/how-to-delete-connected-areas-less-than-a-certain-threshold/9032 "2022-07-28T03:21:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![1215](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/1/ba9def/32.png) [@1215](https://discourse.vtk.org/u/1215)\
**Post date:** [July 28, 2022, 3:21am UTC](https://discourse.vtk.org/t/how-to-delete-connected-areas-less-than-a-certain-threshold/9032/1 "2022-07-28T03:21:56Z")

</div>

Using setextractionmodetolargestregion() of vtkpolydataconnectivityfilter can get the largest connected area, but other smaller connected areas that you want to keep have also been deleted. I want to reserve connected domains that are greater than a certain threshold, or delete connected domains that are less than a certain threshold. How should I achieve this?
