# vtk image connectivity filter

**URL:** https://discourse.vtk.org/t/vtk-image-connectivity-filter/3133
**Category:** Support
**Created:** [April 23, 2020, 4:17pm UTC](https://discourse.vtk.org/t/vtk-image-connectivity-filter/3133 "2020-04-23T16:17:42Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [April 23, 2020, 7:29pm UTC](https://discourse.vtk.org/t/vtk-image-connectivity-filter/3133/3 "2020-04-23T19:29:33Z")

</div>

> [@srbn.ghosh99](#):
>
> I could not find any example on image connectivity filter and I am using vtk 5.10 which does not include the function.

First of all, you need to upgrade to a recent VTK version. It is unreasonable to expect help with using a decade old version.

You can find vtkImageConnectivityFilter documentation [here](https://vtk.org/doc/nightly/html/classvtkImageConnectivityFilter.html). All VTK filters have tests, which you can use as examples. See the relevant test [here](https://github.com/Kitware/VTK/blob/master/Imaging/Morphological/Testing/Cxx/TestImageConnectivityFilter.cxx). You can find a Python example in 3D Slicer’s [“Flood filling” Segment Editor effect](https://github.com/lassoan/SlicerSegmentEditorExtraEffects/blob/master/SegmentEditorFloodFilling/SegmentEditorFloodFillingLib/SegmentEditorEffect.py). If you have any specific questions you can ask it here.

There is [no example for this filter on VTK examples website](https://lorensen.github.io/VTKExamples/site/Coverage/CSharpVTKClassesNotUsed/). It would be great if you could write one (based on what you have learnt and you think could be useful for others who are new to VTK) and contribute it as described [here](https://lorensen.github.io/VTKExamples/site/Instructions/ForDevelopers/).

Before you implement _anything_, I would suggest to first create your segmentation workflow in a VTK-based interactive segmentation tool, such as 3D Slicer. Once you know exactly what steps you need to get good-quality segmentation, you can start automating the process.

---

_[View the full topic](https://discourse.vtk.org/t/vtk-image-connectivity-filter/3133)._
