# Algorithm used for growing seeds

**URL:** <https://discourse.slicer.org/t/algorithm-used-for-growing-seeds/11817>\
**Category:** Support\
**Tags:** segmentation\
**Created:** [June 1, 2020, 5:43pm UTC](https://discourse.slicer.org/t/algorithm-used-for-growing-seeds/11817 "2020-06-01T17:43:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![flaviu2](https://avatars.discourse-cdn.com/v4/letter/f/74df32/32.png) [@flaviu2](https://discourse.slicer.org/u/flaviu2)\
**Post date:** [June 1, 2020, 5:43pm UTC](https://discourse.slicer.org/t/algorithm-used-for-growing-seeds/11817/1 "2020-06-01T17:43:46Z")

</div>

Hello everyone. I saw on youtube an interesting liver segmentation done it by growing by seeds: [https://www.youtube.com/watch?v=R-lBsqAvSTA](https://www.youtube.com/watch?v=R-lBsqAvSTA) (at the ending of the movie is liver segmentation).

Is there any way to know what ITK filters has been used for this “ **growing from seeds** ” approach ? I really need to do in my project. As you see, the user must define _an inside organ seeds_, **AND** _outside the organ seeds_. In which ITK filters can I use those two seeds array, one from inside organ, another one from outside of organ ? Can you guide me a little bit please ?

Regards,  
Flaviu.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [June 1, 2020, 5:55pm UTC](https://discourse.slicer.org/t/algorithm-used-for-growing-seeds/11817/2 "2020-06-01T17:55:45Z")

</div>

There are region growing based segmentation algorithms in ITK, but in “Grows from seeds” effect we use a custom grow-cut based method, which was implemented from scratch many years ago and has been continuously improved based on lots of user feedback.

The simplest is to use it from Python, either [using segment editor effect API](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#How_to_run_segment_editor_effects_from_a_script) or as a plain VTK image filter (`slicer.vtkImageGrowCutSegment`).

If you work in C++ then you can use the filter as is (it is a VTK filter that has no other dependency than VTK) or with a little work you should be able to port it to an ITK remote module. See source code [here](https://github.com/Slicer/Slicer/blob/master/Modules/Loadable/Segmentations/Logic/vtkImageGrowCutSegment.h).
