# Is it possible to implement segment editor in c++

**URL:** <https://discourse.slicer.org/t/is-it-possible-to-implement-segment-editor-in-c/39808>\
**Category:** Development\
**Created:** [October 23, 2024, 1:41am UTC](https://discourse.slicer.org/t/is-it-possible-to-implement-segment-editor-in-c/39808 "2024-10-23T01:41:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bryanChau](https://avatars.discourse-cdn.com/v4/letter/b/c2a13f/32.png) [@bryanChau](https://discourse.slicer.org/u/bryanChau)\
**Post date:** [October 23, 2024, 1:41am UTC](https://discourse.slicer.org/t/is-it-possible-to-implement-segment-editor-in-c/39808/1 "2024-10-23T01:41:36Z")

</div>

I noticed that the segment editor module is under the python. I was wondering if I could integrated segment editor module into my c++ qt app. Cuz running AI inference under python is much slower when it compared c++

---

<div class="post-metadata">

**Author:** ![bryanChau](https://avatars.discourse-cdn.com/v4/letter/b/c2a13f/32.png) [@bryanChau](https://discourse.slicer.org/u/bryanChau)\
**Post date:** [October 23, 2024, 3:10am UTC](https://discourse.slicer.org/t/is-it-possible-to-implement-segment-editor-in-c/39808/2 "2024-10-23T03:10:45Z")

</div>

@lassoan it seems some effect is implemented in Python version --ref [Slicer/Modules/Loadable/Segmentations/EditorEffects/Python/SegmentEditorEffects at main · Slicer/Slicer · GitHub](https://github.com/Slicer/Slicer/tree/main/Modules/Loadable/Segmentations/EditorEffects/Python/SegmentEditorEffects), so I guess migrating all the effects are not viable to do so. Does that make sense?

---

<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:** [October 23, 2024, 5:33am UTC](https://discourse.slicer.org/t/is-it-possible-to-implement-segment-editor-in-c/39808/3 "2024-10-23T05:33:01Z")

</div>

> [@bryanChau](#):
>
> Cuz running AI inference under python is much slower when it compared c++

There is no difference in speed of running AI inference in Python and C++, because Python just adds a very thin wrapper over underlying highly optimized compiled code with negligible overhead.

> [@bryanChau](#):
>
> I guess migrating all the effects are not viable to do so. Does that make sense?

C++/Python language choice is a minor detail. It is usually very easy to translate the code between these languages.

The important decision for you to make is if you want to develop a C++/Qt application from scratch or build it on a well-proven application framework, such as Slicer. I would of course recommend to build on Slicer, as you can save many years of development efforts.
