# How Do I introduce the Segment Editor module into MY QT program?

**URL:** <https://discourse.slicer.org/t/how-do-i-introduce-the-segment-editor-module-into-my-qt-program/31531>\
**Category:** Development\
**Tags:** segmentation\
**Created:** [September 4, 2023, 1:08am UTC](https://discourse.slicer.org/t/how-do-i-introduce-the-segment-editor-module-into-my-qt-program/31531 "2023-09-04T01:08:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![iwangwangwang](https://avatars.discourse-cdn.com/v4/letter/i/f1d935/32.png) [@iwangwangwang](https://discourse.slicer.org/u/iwangwangwang)\
**Post date:** [September 4, 2023, 1:08am UTC](https://discourse.slicer.org/t/how-do-i-introduce-the-segment-editor-module-into-my-qt-program/31531/1 "2023-09-04T01:08:02Z")

</div>

I’m developing a program that needs image segmentation, so I want to bring in the Segment Editor module of 3d Slicer, or transform my program into a 3D slicer module, which approach is easier to implement and how? Do you have any examples? Ask for answers in good faith.

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [September 4, 2023, 2:06pm UTC](https://discourse.slicer.org/t/how-do-i-introduce-the-segment-editor-module-into-my-qt-program/31531/2 "2023-09-04T14:06:30Z")

</div>

It’s definitely easier to write a Slicer module than to write a new program. You can look at examples like MONAI Label, where the Segment Editor is embedded. Depending on your needs, it’s likely that you can implement everything you need in python and avoid the need to compile from source.

---

<div class="post-metadata">

**Author:** ![iwangwangwang](https://avatars.discourse-cdn.com/v4/letter/i/f1d935/32.png) [@iwangwangwang](https://discourse.slicer.org/u/iwangwangwang)\
**Post date:** [September 5, 2023, 2:29am UTC](https://discourse.slicer.org/t/how-do-i-introduce-the-segment-editor-module-into-my-qt-program/31531/3 "2023-09-05T02:29:15Z")

</div>

thanks, as mentioned in my question，image segmentation is just a small but very important part of the functionality in my program，I want to develop my program based on 3dslicer，bring the Segment Editor module of 3d Slicer into my program, or develop my program as a 3D slicer module，I don’t know which method is easier to implement，but python script may be difficult to implement complex functions in my program, include GUI、interactive、algorithm and uniform style etc…  
Do you have any good suggestions？  
sincerely for your answer.

---

<div class="post-metadata">

**Author:** ![iwangwangwang](https://avatars.discourse-cdn.com/v4/letter/i/f1d935/32.png) [@iwangwangwang](https://discourse.slicer.org/u/iwangwangwang)\
**Post date:** [September 5, 2023, 2:30am UTC](https://discourse.slicer.org/t/how-do-i-introduce-the-segment-editor-module-into-my-qt-program/31531/4 "2023-09-05T02:30:25Z")

</div>

thanks, as mentioned in my question，image segmentation is just a small but very important part of the functionality in my program，I want to develop my program based on 3dslicer，bring the Segment Editor module of 3d Slicer into my program, or develop my program as a 3D slicer module，I don’t know which method is easier to implement，but python script may be difficult to implement complex functions in my program, include GUI、interactive、algorithm and uniform style etc…  
Do you have any good suggestions？  
sincerely for your answer.

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [September 5, 2023, 12:06pm UTC](https://discourse.slicer.org/t/how-do-i-introduce-the-segment-editor-module-into-my-qt-program/31531/5 "2023-09-05T12:06:01Z")

</div>

It’s great that you want to write a program with more features and maybe you will find Slicer helpful for that, but it’s not always easy to factor out parts for reuse. It’s an ambitious undertaking to write a big program and you’ll need to study carefully to organize your efforts. Writing a big C++ program from scratch is a lot of work, but if you don’t need it to be cross-platform and you have only very specific use cases in mind it can be accomplished. Slicer with python provides a more efficient way solve many problems.
