# New Segment Editor effect: Local threshold

**URL:** <https://discourse.slicer.org/t/new-segment-editor-effect-local-threshold/9233>\
**Category:** Support\
**Tags:** feature, segmentation\
**Created:** [November 20, 2019, 5:01pm UTC](https://discourse.slicer.org/t/new-segment-editor-effect-local-threshold/9233 "2019-11-20T17:01:15Z")\
**Posts on this page:** 13\
**Page:** 4

<div class="post-metadata">

**Author:** ![rbumm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbumm/32/9404_2.png) [@rbumm](https://discourse.slicer.org/u/rbumm)\
**Post date:** [June 23, 2023, 4:13pm UTC](https://discourse.slicer.org/t/new-segment-editor-effect-local-threshold/9233/61 "2023-06-23T16:13:17Z")

</div>

No idea, please try and it would be great if you report it here.

---

<div class="post-metadata">

**Author:** ![nysfour](https://avatars.discourse-cdn.com/v4/letter/n/c0e974/32.png) [@nysfour](https://discourse.slicer.org/u/nysfour)\
**Post date:** [June 23, 2023, 4:24pm UTC](https://discourse.slicer.org/t/new-segment-editor-effect-local-threshold/9233/62 "2023-06-23T16:24:02Z")

</div>

I am a little confused what Local Threshold vs the regular threshold module changes. I don’t seem to be able to threshold within a locality, so using this module seems to just threshold the image as it would have normally without using the ExtraEffects add on. Is there a way to delimit the area that I want to threshold? Even when I create an ROI it doesn’t seem to delimit the growing segment

---

<div class="post-metadata">

**Author:** ![rbumm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbumm/32/9404_2.png) [@rbumm](https://discourse.slicer.org/u/rbumm)\
**Post date:** [June 23, 2023, 5:02pm UTC](https://discourse.slicer.org/t/new-segment-editor-effect-local-threshold/9233/63 "2023-06-23T17:02:17Z")

</div>

By clicking into the locality you were able to threshold in the locality.  
Thresholding the whole image would be a different outcome.  
I have not used ROI yet with success.

---

<div class="post-metadata">

**Author:** ![nysfour](https://avatars.discourse-cdn.com/v4/letter/n/c0e974/32.png) [@nysfour](https://discourse.slicer.org/u/nysfour)\
**Post date:** [June 23, 2023, 6:07pm UTC](https://discourse.slicer.org/t/new-segment-editor-effect-local-threshold/9233/64 "2023-06-23T18:07:03Z")

</div>

What creates the locality? I don’t see a definitive demarcation in and outside of the local thresholder as it seems to threshold the whole image no matter where I click or draw

---

<div class="post-metadata">

**Author:** ![rbumm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbumm/32/9404_2.png) [@rbumm](https://discourse.slicer.org/u/rbumm)\
**Post date:** [June 24, 2023, 6:07am UTC](https://discourse.slicer.org/t/new-segment-editor-effect-local-threshold/9233/65 "2023-06-24T06:07:28Z")

</div>

As I understood it some functions from the Segment Editor Extra Effects package are not yet fully polished and require some more work until they can get included in the standard effects collection.

---

<div class="post-metadata">

**Author:** ![Sunderlandkyl](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sunderlandkyl/32/79987_2.png) [@Sunderlandkyl](https://discourse.slicer.org/u/Sunderlandkyl)\
**Post date:** [June 26, 2023, 3:07pm UTC](https://discourse.slicer.org/t/new-segment-editor-effect-local-threshold/9233/66 "2023-06-26T15:07:00Z")

</div>

@nysfour Could you try running local threshold and attaching the log? If you could also send me a scene with the image that you are trying to segment, it would be helpful. You can send it to me over private message if you can’t share it publicly.

---

<div class="post-metadata">

**Author:** ![nysfour](https://avatars.discourse-cdn.com/v4/letter/n/c0e974/32.png) [@nysfour](https://discourse.slicer.org/u/nysfour)\
**Post date:** [June 26, 2023, 3:09pm UTC](https://discourse.slicer.org/t/new-segment-editor-effect-local-threshold/9233/67 "2023-06-26T15:09:59Z")

</div>

How do I record the log?

---

<div class="post-metadata">

**Author:** ![Sunderlandkyl](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sunderlandkyl/32/79987_2.png) [@Sunderlandkyl](https://discourse.slicer.org/u/Sunderlandkyl)\
**Post date:** [June 26, 2023, 3:16pm UTC](https://discourse.slicer.org/t/new-segment-editor-effect-local-threshold/9233/68 "2023-06-26T15:16:27Z")

</div>

You can find log files in Help → Report a bug. The most recent log will be for the current session.

---

<div class="post-metadata">

**Author:** ![Sunderlandkyl](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sunderlandkyl/32/79987_2.png) [@Sunderlandkyl](https://discourse.slicer.org/u/Sunderlandkyl)\
**Post date:** [June 26, 2023, 3:44pm UTC](https://discourse.slicer.org/t/new-segment-editor-effect-local-threshold/9233/69 "2023-06-26T15:44:02Z")

</div>

Thanks for sending the log + data!

The issue is that the GrowCut filter does not work on 2D data.  
It should work if you change the segmentation algorithm to “Masking” in the Local threshold effect.

I’ll add a message to let the user know about this limitation if they have an algorithm that is incompatible with their data selected.

---

<div class="post-metadata">

**Author:** ![nysfour](https://avatars.discourse-cdn.com/v4/letter/n/c0e974/32.png) [@nysfour](https://discourse.slicer.org/u/nysfour)\
**Post date:** [June 26, 2023, 4:58pm UTC](https://discourse.slicer.org/t/new-segment-editor-effect-local-threshold/9233/70 "2023-06-26T16:58:46Z")

</div>

Thank you very much!

---

<div class="post-metadata">

**Author:** ![nysfour](https://avatars.discourse-cdn.com/v4/letter/n/c0e974/32.png) [@nysfour](https://discourse.slicer.org/u/nysfour)\
**Post date:** [June 26, 2023, 7:07pm UTC](https://discourse.slicer.org/t/new-segment-editor-effect-local-threshold/9233/71 "2023-06-26T19:07:58Z")

</div>

Is there any limitation on how many ROI’s can be added? When I add a first ROI, local thresholder works to segment. However, when a second ROI is added, the program doesn’t generate a new mask, even if the ROI is changed to the secondary box. Is there anything wrong with this group of settings? (R\_1 is the added ROI)  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/9/0/90e8486ad2f36c5e886bb5c4c05ddff692eee431.png)

---

<div class="post-metadata">

**Author:** ![Sunderlandkyl](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sunderlandkyl/32/79987_2.png) [@Sunderlandkyl](https://discourse.slicer.org/u/Sunderlandkyl)\
**Post date:** [June 27, 2023, 3:04pm UTC](https://discourse.slicer.org/t/new-segment-editor-effect-local-threshold/9233/72 "2023-06-27T15:04:10Z")

</div>

Multiple ROIs should work fine. I tested on 3D images and you can use multiple ROI nodes, or modify a single one between operations.

In 2D however it looks like the ROI doesn’t function correctly. I’m looking into it.

---

<div class="post-metadata">

**Author:** ![nysfour](https://avatars.discourse-cdn.com/v4/letter/n/c0e974/32.png) [@nysfour](https://discourse.slicer.org/u/nysfour)\
**Post date:** [June 27, 2023, 3:34pm UTC](https://discourse.slicer.org/t/new-segment-editor-effect-local-threshold/9233/73 "2023-06-27T15:34:26Z")

</div>

For the last 2D run I did, I was able to place 2 ROIs and segment within them, but the third ROI I placed prevented any segmentation. I can run more tests and send the logs if that would be helpful

[Previous page](https://discourse.slicer.org/t/new-segment-editor-effect-local-threshold/9233.md?page=3)
