# FastMarchingSegmentation Graphical Interface?

**URL:** https://discourse.itk.org/t/fastmarchingsegmentation-graphical-interface/2225
**Category:** Uncategorized
**Created:** [September 5, 2019, 2:00pm UTC](https://discourse.itk.org/t/fastmarchingsegmentation-graphical-interface/2225 "2019-09-05T14:00:54Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![ral\_san](https://discourse.itk.org/user_avatar/discourse.itk.org/ral_san/32/236_2.png) [@ral\_san](https://discourse.itk.org/u/ral_san)
#### Post date: [September 5, 2019, 2:00pm UTC](https://discourse.itk.org/t/fastmarchingsegmentation-graphical-interface/2225/1 "2019-09-05T14:00:54Z")

</div>

Hi Guys,

I want to apply the FastMarchingSegmentation Filter. In the documentation  
[https://simpleitk.readthedocs.io/en/master/Examples/FastMarchingSegmentation/Documentation.html](https://simpleitk.readthedocs.io/en/master/Examples/FastMarchingSegmentation/Documentation.html) is mentioned that it’s possible to view the output over time

> A graphical interface can be constructed to show the contour propagation over time, enabling a user to select a the desired segmentation.

What kind of graphical interface? It’s there an algorithm/library already implemented for the GUI? I don’t even know where to begin.

Many thanks.

Thank

---

<div class="post-metadata">

### Author: ![blowekamp](https://discourse.itk.org/user_avatar/discourse.itk.org/blowekamp/32/79_2.png) [@blowekamp](https://discourse.itk.org/u/blowekamp)
#### Post date: [September 5, 2019, 2:36pm UTC](https://discourse.itk.org/t/fastmarchingsegmentation-graphical-interface/2225/2 "2019-09-05T14:36:21Z")

</div>

Hello,

If you have seen them before the [SimpleITK Jupyter Notebooks](https://github.com/InsightSoftwareConsortium/SimpleITK-Notebooks) contain some basic GUI elements with slicers and images, which is all that is needed here. The output of the Fast Marching represents the monotonic propagation of the front. You can just a threshold filter to see the segmentation a specific time. Then connect the threshold value or fast marching time to a slider and you have a basic GUI to select the desired fast marching time for a segmentation.

@zivy May be able to point you to a specific notebook to get started from, but I’d start with the thresholding and levelset notebooks.

---

<div class="post-metadata">

### Author: ![ral\_san](https://discourse.itk.org/user_avatar/discourse.itk.org/ral_san/32/236_2.png) [@ral\_san](https://discourse.itk.org/u/ral_san)
#### Post date: [September 5, 2019, 3:06pm UTC](https://discourse.itk.org/t/fastmarchingsegmentation-graphical-interface/2225/3 "2019-09-05T15:06:58Z")

</div>

I think I have found the SimpleITK Jupyter Notebook.

[http://insightsoftwareconsortium.github.io/SimpleITK-Notebooks/Python\_html/300\_Segmentation\_Overview.html](http://insightsoftwareconsortium.github.io/SimpleITK-Notebooks/Python_html/300_Segmentation_Overview.html)

However I cannot find any module called `myshow`. I get an unresolved reference.

---

<div class="post-metadata">

### Author: ![ral\_san](https://discourse.itk.org/user_avatar/discourse.itk.org/ral_san/32/236_2.png) [@ral\_san](https://discourse.itk.org/u/ral_san)
#### Post date: [September 5, 2019, 3:09pm UTC](https://discourse.itk.org/t/fastmarchingsegmentation-graphical-interface/2225/4 "2019-09-05T15:09:38Z")

</div>

Found it : [https://simpleitk-prototype.readthedocs.io/en/latest/user\_guide/myshow.html](https://simpleitk-prototype.readthedocs.io/en/latest/user_guide/myshow.html)

---

<div class="post-metadata">

### Author: ![zivy](https://discourse.itk.org/user_avatar/discourse.itk.org/zivy/32/1726_2.png) [@zivy](https://discourse.itk.org/u/zivy)
#### Post date: [September 5, 2019, 3:12pm UTC](https://discourse.itk.org/t/fastmarchingsegmentation-graphical-interface/2225/5 "2019-09-05T15:12:51Z")

</div>

Also possibly look at [gui.py](https://github.com/InsightSoftwareConsortium/SimpleITK-Notebooks/blob/master/Python/gui.py) which includes several UI’s for various display purposes.

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.itk.org/user_avatar/discourse.itk.org/lassoan/32/27_2.png) [@lassoan](https://discourse.itk.org/u/lassoan)
#### Post date: [September 5, 2019, 5:19pm UTC](https://discourse.itk.org/t/fastmarchingsegmentation-graphical-interface/2225/6 "2019-09-05T17:19:23Z")

</div>

3D Slicer has a GUI for fast marching segmentation with live preview in 2D/3D views:

It uses vtkPichonFastMarching class internally and not sitk.FastMarchingImageFilter, but it should be easy to modify the [Python script of the segment editor effect](https://github.com/lassoan/SlicerSegmentEditorExtraEffects/blob/master/SegmentEditorFastMarching/SegmentEditorFastMarchingLib/SegmentEditorEffect.py) to use ITK’s filter if you need that. You can use [source code of Watershed effect](https://github.com/lassoan/SlicerSegmentEditorExtraEffects/blob/master/SegmentEditorWatershed/SegmentEditorWatershedLib/SegmentEditorEffect.py) as an example of using SimpleITK filter for segmentation.
