# About paintApply method in qSlicerSegmentEditorScissorsEffect.cxx

**URL:** <https://discourse.slicer.org/t/about-paintapply-method-in-qslicersegmenteditorscissorseffect-cxx/28835>\
**Category:** Development\
**Tags:** segmentation\
**Created:** [April 11, 2023, 4:42am UTC](https://discourse.slicer.org/t/about-paintapply-method-in-qslicersegmenteditorscissorseffect-cxx/28835 "2023-04-11T04:42:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dbtruong](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/dbtruong/32/65581_2.png) [@dbtruong](https://discourse.slicer.org/u/dbtruong)\
**Post date:** [April 11, 2023, 4:42am UTC](https://discourse.slicer.org/t/about-paintapply-method-in-qslicersegmenteditorscissorseffect-cxx/28835/1 "2023-04-11T04:42:22Z")

</div>

Hello  
What does qSlicerSegmentEditorScissorsEffectPrivate::paintApply method does in qSlicerSegmentEditorScissorsEffect.cxx ?  
Thanks.

---

<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:** [April 11, 2023, 4:44am UTC](https://discourse.slicer.org/t/about-paintapply-method-in-qslicersegmenteditorscissorseffect-cxx/28835/2 "2023-04-11T04:44:03Z")

</div>

The method adds the painted region to the current segment and removes it from all other segments (taking into account masking settings).

---

<div class="post-metadata">

**Author:** ![dbtruong](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/dbtruong/32/65581_2.png) [@dbtruong](https://discourse.slicer.org/u/dbtruong)\
**Post date:** [April 12, 2023, 1:48am UTC](https://discourse.slicer.org/t/about-paintapply-method-in-qslicersegmenteditorscissorseffect-cxx/28835/3 "2023-04-12T01:48:49Z")

</div>

How to remove it from all other segments?

---

<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:** [April 12, 2023, 4:29pm UTC](https://discourse.slicer.org/t/about-paintapply-method-in-qslicersegmenteditorscissorseffect-cxx/28835/4 "2023-04-12T16:29:31Z")

</div>

You can attach a debugger and step through the code to see how it is done exactly. It is a very complex process because segments are stored in multiple layers in a 4D array and there are several masking options.

---

<div class="post-metadata">

**Author:** ![dbtruong](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/dbtruong/32/65581_2.png) [@dbtruong](https://discourse.slicer.org/u/dbtruong)\
**Post date:** [April 13, 2023, 9:28am UTC](https://discourse.slicer.org/t/about-paintapply-method-in-qslicersegmenteditorscissorseffect-cxx/28835/5 "2023-04-13T09:28:44Z")

</div>

Can you for me some ideas when I crop by operation: fill inside, shape: free-form and slice cut: unlimited?
