# Using Segment Editor effects programmatically

**URL:** <https://discourse.slicer.org/t/using-segment-editor-effects-programmatically/11561>\
**Category:** Development\
**Tags:** segmentation, python\
**Created:** [May 15, 2020, 5:02pm UTC](https://discourse.slicer.org/t/using-segment-editor-effects-programmatically/11561 "2020-05-15T17:02:41Z")\
**Posts on this page:** 1\
**Showing post:** 5

<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:** [August 3, 2020, 7:25pm UTC](https://discourse.slicer.org/t/using-segment-editor-effects-programmatically/11561/5 "2020-08-03T19:25:25Z")

</div>

See this topic for details about how to run Python code from C++:

> [@Calling Python from C++](https://discourse.slicer.org/t/calling-python-from-c/7841/10):
>
> There are several options for calling Python from C++ (one of them is shown in my comment above, using evalScript) and it is done at many places in Slicer. However, C++ modules provide low-level infrastructure, so it would not make sense for a C++ module to depend on Python. If you want to implement some performance-critical processing in C++ but other features are in Python then I would recommend to: create a hidden C++ loadable module that just implements performance-critical processing in …

For more complex Python calls, search for “pythonmanager” in Slicer source code.

---

_[View the full topic](https://discourse.slicer.org/t/using-segment-editor-effects-programmatically/11561)._
