# using the itk : GeodesicActiveContour

**URL:** https://discourse.itk.org/t/using-the-itk-geodesicactivecontour/3642
**Category:** Uncategorized
**Created:** [November 21, 2020, 11:04am UTC](https://discourse.itk.org/t/using-the-itk-geodesicactivecontour/3642 "2020-11-21T11:04:21Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![abir](https://discourse.itk.org/user_avatar/discourse.itk.org/abir/32/1031_2.png) [@abir](https://discourse.itk.org/u/abir)
#### Post date: [November 21, 2020, 11:04am UTC](https://discourse.itk.org/t/using-the-itk-geodesicactivecontour/3642/1 "2020-11-21T11:04:21Z")

</div>

I used the MRI dataset provided by Left Atrial Segmentation Challenge 2013which was part of the STACOM’13 workshop  
this is the data I used  
[test\_data](https://figshare.com/articles/dataset/Left_Atrial_Segmentation_Challenge_2013_MRI_testing/1492989)  
[training\_data](https://figshare.com/articles/dataset/Left_Atrial_Segmentation_Challenge_2013_MRI_training/1492978)  
I am suppose to segment the left atrium wall (epicrdium and endocardium ) using deep learning approach and geodesic active contour  
So I did segment the epicardium with the deep learning approach and I got my generated labels .  
the result of the first segmentation should be the input for the GeodesicactiveContour to perform the segmentation of the epicardium ! I am a bit confused how should I give it as the input ?  
my work is similar to this task  
[shuman Jia et al](https://hal.inria.fr/hal-01373238/document)  
Could anyone help me please ?

---

<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: [November 23, 2020, 6:23pm UTC](https://discourse.itk.org/t/using-the-itk-geodesicactivecontour/3642/2 "2020-11-23T18:23:53Z")

</div>

Did you take a look at the [example](https://itk.org/ITKExamples/src/Segmentation/LevelSets/SegmentWithGeodesicActiveContourLevelSet/Documentation.html)? It uses only one seed point, but you can use all the voxels of your segmentation as seeds. Or maybe erode your mask and use the remainder as sees.

I don’t like level sets, because it is hard to tweak their parameters to work well.

---

<div class="post-metadata">

### Author: ![abir](https://discourse.itk.org/user_avatar/discourse.itk.org/abir/32/1031_2.png) [@abir](https://discourse.itk.org/u/abir)
#### Post date: [November 23, 2020, 6:44pm UTC](https://discourse.itk.org/t/using-the-itk-geodesicactivecontour/3642/3 "2020-11-23T18:44:35Z")

</div>

yes in the example it uses a region growing approach ‘flood fill’ as the first approach and then the result of it’s segmentation is used as the initial contour for the geodesic active contour  
but I am using a deep learning approach and I have my segmentation result  
my problem is how to provide my results to the geodesic active contour to use it as the initial contour and reache the outer boundary ???

---

<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: [November 23, 2020, 6:50pm UTC](https://discourse.itk.org/t/using-the-itk-geodesicactivecontour/3642/4 "2020-11-23T18:50:52Z")

</div>

Remove fast marching filter and replace the line

```auto
geodesicActiveContour->SetInput(fastMarching->GetOutput());

```

by something like

```auto
geodesicActiveContour->SetInput(segmentationFromDeepLearning);

```

---

<div class="post-metadata">

### Author: ![abir](https://discourse.itk.org/user_avatar/discourse.itk.org/abir/32/1031_2.png) [@abir](https://discourse.itk.org/u/abir)
#### Post date: [November 29, 2020, 11:01am UTC](https://discourse.itk.org/t/using-the-itk-geodesicactivecontour/3642/5 "2020-11-29T11:01:23Z")

</div>

thank you for the reply ! from what I understand there has to be a learning phase first or how can the contour stop evolving when it reaches th borders of the object ?

---

<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: [November 30, 2020, 5:32pm UTC](https://discourse.itk.org/t/using-the-itk-geodesicactivecontour/3642/6 "2020-11-30T17:32:31Z")

</div>

You pre-set number of iterations, and tune it to your problem.
