# Segment Editor source code

**URL:** <https://discourse.slicer.org/t/segment-editor-source-code/5845>\
**Category:** Development\
**Created:** [February 20, 2019, 2:07pm UTC](https://discourse.slicer.org/t/segment-editor-source-code/5845 "2019-02-20T14:07:02Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![dp1991](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/dp1991/32/3142_2.png) [@dp1991](https://discourse.slicer.org/u/dp1991)\
**Post date:** [February 20, 2019, 2:07pm UTC](https://discourse.slicer.org/t/segment-editor-source-code/5845/1 "2019-02-20T14:07:02Z")

</div>

Hello friends,  
I have a question  
How can I use " Segment Editor " ( 3d slicer module), in VS2015 C++ ??  
I need the source code of this module  
Can anyone help me ??

---

<div class="post-metadata">

**Author:** ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)\
**Post date:** [February 20, 2019, 3:08pm UTC](https://discourse.slicer.org/t/segment-editor-source-code/5845/2 "2019-02-20T15:08:25Z")

</div>

Segment Editor is a Slicer scripted module written in python (see code [here](https://github.com/Slicer/Slicer/blob/2e5dcf178d0d26d359a10437aa16223e3a594e2f/Modules/Scripted/SegmentEditor/SegmentEditor.py)). Some editor effects are written in C++ (see code [here](https://github.com/Slicer/Slicer/tree/4c0b0b15276aedc0e12d77e2227536426979d773/Modules/Loadable/Segmentations/EditorEffects)) and some are written in python (see code [here](https://github.com/Slicer/Slicer/tree/e72ef376ddb0bf1e8d52d080c2355620ac3b4abf/Modules/Loadable/Segmentations/EditorEffects/Python)).

What is the end goal that you are trying to accomplish? There are people on the forum that will be able to better support you with some extra information.

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [February 20, 2019, 3:12pm UTC](https://discourse.slicer.org/t/segment-editor-source-code/5845/3 "2019-02-20T15:12:23Z")

</div>

And for usage, please check out these tutorials: [https://www.slicer.org/wiki/Documentation/Nightly/Training#Slicer4\_Image\_Segmentation](https://www.slicer.org/wiki/Documentation/Nightly/Training#Slicer4_Image_Segmentation)

---

<div class="post-metadata">

**Author:** ![dp1991](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/dp1991/32/3142_2.png) [@dp1991](https://discourse.slicer.org/u/dp1991)\
**Post date:** [February 23, 2019, 5:03am UTC](https://discourse.slicer.org/t/segment-editor-source-code/5845/4 "2019-02-23T05:03:34Z")

</div>

Hi  
thank u for your answers.  
i need to edit segmentation in all 3d view ( axial , sagittal , coronal )  
exactly like this [https://youtu.be/BJoIexIvtGo](https://youtu.be/BJoIexIvtGo)  
i need source code for this in C++ and VS215 and ITK and VTK  
(I apologize , my English language is not well ) 🙂

---

<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:** [February 23, 2019, 5:21am UTC](https://discourse.slicer.org/t/segment-editor-source-code/5845/5 "2019-02-23T05:21:59Z")

</div>

See links to the source code above.

---

<div class="post-metadata">

**Author:** ![dp1991](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/dp1991/32/3142_2.png) [@dp1991](https://discourse.slicer.org/u/dp1991)\
**Post date:** [February 24, 2019, 6:19am UTC](https://discourse.slicer.org/t/segment-editor-source-code/5845/6 "2019-02-24T06:19:49Z")

</div>

I need source code of "paint " in segment editor  
at c++ and vs2015  
steps of my program  
1 - load dicom image ( ITK or VTK )  
2 - manual segmentation 3d view " axial sagittal coronal "  
exactly like 3d slicer…

---

<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:** [February 24, 2019, 1:49pm UTC](https://discourse.slicer.org/t/segment-editor-source-code/5845/7 "2019-02-24T13:49:12Z")

</div>

> [@dp1991](#):
>
> exactly like 3d slicer

If you need a software that works exactly like 3D Slicer then it seems reasonable to use 3D Slicer. We put a lot of work into making Slicer appearance and behavior completely customizable for any particular workflow, so you don’t need to start a new project from scratch.

We allow usage of Slicer source code for any purpose in any project, so if you want to create a new software application the you are free to do so. However, we don’t have the capacity to actively help you in those efforts.

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [February 24, 2019, 5:16pm UTC](https://discourse.slicer.org/t/segment-editor-source-code/5845/8 "2019-02-24T17:16:06Z")

</div>

> [@lassoan](#):
>
> If you need a software that works exactly like 3D Slicer then it seems reasonable to use 3D Slicer.

Indeed, doesn’t seem like a crazy idea at all 🙂

@dp1991 If you want to create an application that uses 3D Slicer features but is less complex and more fitted to your workflow, then you can develop a slicelet. Here’s the documentation:  
[https://www.slicer.org/wiki/Documentation/Nightly/Developers/Slicelets](https://www.slicer.org/wiki/Documentation/Nightly/Developers/Slicelets)  
And here’s an example that works well, and is freely available:

> **[GitHub - SlicerRt/GelDosimetryAnalysis: 3D Slicer extension containing a...](https://github.com/SlicerRt/GelDosimetryAnalysis)**
>
> 3D Slicer extension containing a slicelet that covers the gel dosimetry analysis workflow used in commissioning new radiation techniques and to validate the accuracy of radiation treatment by enabl...

Or if you want to use Slicer in an application that “doesn’t look like Slicer”, then you can create a SlicerCustomApp:

> **[GitHub - KitwareMedical/SlicerCustomAppTemplate: Template to be used as a...](https://github.com/KitwareMedical/SlicerCustomAppTemplate)**
>
> Template to be used as a starting point for creating a custom 3D Slicer application - GitHub - KitwareMedical/SlicerCustomAppTemplate: Template to be used as a starting point for creating a custom ...

---

<div class="post-metadata">

**Author:** ![dp1991](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/dp1991/32/3142_2.png) [@dp1991](https://discourse.slicer.org/u/dp1991)\
**Post date:** [February 25, 2019, 5:11am UTC](https://discourse.slicer.org/t/segment-editor-source-code/5845/9 "2019-02-25T05:11:18Z")

</div>

I will writing new software that manual segmentation is one part of this software  
i need to edit or draw segmentation in 3 view (axial coronal sagittal) and display result in 3d space  
i saw " edit segmentation " is useful for this purpose  
i write my program in VisualStudion2015 and C++ language programming  
so I need source code of " edit segmentation " in c++ and visual studio  
( I again apologize for my English language and very thank u for your guidance and helps )

---

<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:** [February 25, 2019, 12:20pm UTC](https://discourse.slicer.org/t/segment-editor-source-code/5845/10 "2019-02-25T12:20:45Z")

</div>

Hi @dp1991 - thanks for providing more details. I think you’ll find a lot of helpful resources at the slicer, vtk, itk, and related web sites that could help with a project to write a program in C++ for viewing and segmenting 3D data. As Andras and Csaba have pointed out, 3D Slicer already provides a fully open source implementation of a wide range of features and is fully customizable. We hope you find it useful either as-is or as inspiration for whatever you choose to write.

Since it sounds like you are new to this field, I would also suggest you base your work on 3D Slicer as an existing platform rather than reinventing something very similar from the ground up.

---

<div class="post-metadata">

**Author:** ![dp1991](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/dp1991/32/3142_2.png) [@dp1991](https://discourse.slicer.org/u/dp1991)\
**Post date:** [February 26, 2019, 5:23am UTC](https://discourse.slicer.org/t/segment-editor-source-code/5845/11 "2019-02-26T05:23:59Z")

</div>

thanks for all answers …🌹🌹
