# How should I write a function for (flood filled image function iterator) ?

**URL:** <https://discourse.itk.org/t/how-should-i-write-a-function-for-flood-filled-image-function-iterator/4965>\
**Category:** Uncategorized\
**Created:** [May 5, 2022, 8:48pm UTC](https://discourse.itk.org/t/how-should-i-write-a-function-for-flood-filled-image-function-iterator/4965 "2022-05-05T20:48:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oddone-Scatena](https://discourse.itk.org/user_avatar/discourse.itk.org/oddone-scatena/32/2651_2.png) [@Oddone-Scatena](https://discourse.itk.org/u/Oddone-Scatena)\
**Post date:** [May 5, 2022, 8:48pm UTC](https://discourse.itk.org/t/how-should-i-write-a-function-for-flood-filled-image-function-iterator/4965/1 "2022-05-05T20:48:26Z")

</div>

I would like to write a new function for the floodfilledimagefunctioniterator but I don’t know how should I write one.

I am following what has been suggested here: [Floodfill segmentation or is there an other possibillity in itk (narkive.com)](https://insight-users.itk.narkive.com/ejONQ5El/floodfill-segmentation-or-is-there-an-other-possibillity-in-itk).

Is there any example that I could follow?

Thank you in advance,

Rafael

---

<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:** [May 23, 2022, 9:10am UTC](https://discourse.itk.org/t/how-should-i-write-a-function-for-flood-filled-image-function-iterator/4965/2 "2022-05-23T09:10:44Z")

</div>

I am not sure there is an example. Maybe heed advice in this [mailing list post](https://itk.org/pipermail/insight-users/2008-March/025178.html), and look at code of `itk::ConnectedThresholdImageFilter`.
