# 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:** 20\
**Page:** 3

<div class="post-metadata">

**Author:** ![Buyck](https://avatars.discourse-cdn.com/v4/letter/b/76d3ee/32.png) [@Buyck](https://discourse.slicer.org/u/Buyck)\
**Post date:** [January 9, 2021, 8:56am UTC](https://discourse.slicer.org/t/new-segment-editor-effect-local-threshold/9233/41 "2021-01-09T08:56:21Z")

</div>

Thank you, that’s very kind but there’s no need for it. I already tried insalling it on a different pc and managed to get the missing tools. However, they were unable to successfully segment the brainvessels of my scans. Thus I had to do it manually 😕

Thanks again for all of your effort to help fix my problem!

---

<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:** [January 10, 2021, 7:31pm UTC](https://discourse.slicer.org/t/new-segment-editor-effect-local-threshold/9233/42 "2021-01-10T19:31:34Z")

</div>

Slicer offers lots of others tools and techniques for brain vessel segmentation. If you are not happy with manual segmentation then let us know and we can help.

---

<div class="post-metadata">

**Author:** ![danpak94](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/danpak94/32/18310_2.png) [@danpak94](https://discourse.slicer.org/u/danpak94)\
**Post date:** [April 22, 2021, 4:37am UTC](https://discourse.slicer.org/t/new-segment-editor-effect-local-threshold/9233/43 "2021-04-22T04:37:12Z")

</div>

Thank you for this great new segment editor tool.

I think I might have found a small bug - the ctrl + click didn’t seem to work when using a transform-applied image. If this could be addressed in future versions, I think it would be really helpful (or if this actually isn’t supposed to happen, I would appreciate any pointer on how to fix this behavior). Thanks again!

---

<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 25, 2021, 1:43pm UTC](https://discourse.slicer.org/t/new-segment-editor-effect-local-threshold/9233/44 "2021-04-25T13:43:22Z")

</div>

SegmentEditorExtraEffects extension serves as an incubator of new effects. They are not fully developed, but they are made available so that users can try it. If they turn out to be useful then they get hardened and polished and moved to the Slicer core.

Local Threshold effect has been proven to be quote useful, so it will likely be moved to Slicer core. Please file a bug report to [GitHub - lassoan/SlicerSegmentEditorExtraEffects: Many additional segmentation tools for 3D Slicer's Segment Editor](https://github.com/lassoan/SlicerSegmentEditorExtraEffects) repository to make sure we fix this issue before finalizing this effect.

---

<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:** [January 17, 2023, 7:09pm UTC](https://discourse.slicer.org/t/new-segment-editor-effect-local-threshold/9233/45 "2023-01-17T19:09:18Z")

</div>

A post was split to a new topic: [Classify voxels via a predefined threshold](https://discourse.slicer.org/t/classify-voxels-via-a-predefined-threshold/27308)

---

<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 22, 2023, 7:45pm UTC](https://discourse.slicer.org/t/new-segment-editor-effect-local-threshold/9233/46 "2023-06-22T19:45:44Z")

</div>

For Local threshold, once the region has been established with the yellow demarcating line, how do we fill the segmentation? ‘ctrl click’ is not working no matter what combination of segmentation algorithm I choose

---

<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:24am UTC](https://discourse.slicer.org/t/new-segment-editor-effect-local-threshold/9233/47 "2023-06-23T05:24:15Z")

</div>

The whole area of the segmented should be filled with the color of the segment you want to create. Adjust the sliders.  
Make sure that you do not have “editable intensity range” checked by accident and that the “minimum diameter” is adequate. Try “Growcut”. Use the latest Slicer version.

---

<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, 2:17pm UTC](https://discourse.slicer.org/t/new-segment-editor-effect-local-threshold/9233/48 "2023-06-23T14:17:10Z")

</div>

Does the yellow line limit the segment to the interior of the circle? Or does the segment extend past it? Even with these changes I don’t seem to be able to make segments

---

<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 23, 2023, 2:25pm UTC](https://discourse.slicer.org/t/new-segment-editor-effect-local-threshold/9233/49 "2023-06-23T14:25:33Z")

</div>

The range of values in the voxels inside yellow line are used to set the upper and lower range of the threshold.

If you open the “Local histogram” section of the widget you can see a histogram of the voxels and the scalar range contained inside the yellow region.

---

<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, 2:36pm UTC](https://discourse.slicer.org/t/new-segment-editor-effect-local-threshold/9233/50 "2023-06-23T14:36:31Z")

</div>

so is there any way to just demarcate the region I want to segment? For example, if I want to segment just one organ, could I draw a circle around the organ ROI and fill it with a growing region seed?

---

<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 23, 2023, 2:40pm UTC](https://discourse.slicer.org/t/new-segment-editor-effect-local-threshold/9233/51 "2023-06-23T14:40:48Z")

</div>

You can add a Markups ROI around the organ you want to segment and select it in the ROI field, to force the local threshold to not add any areas outside the box.

Depending on the organ and the “minimum diameter” value, you may not need to specify a ROI.

---

<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, 2:54pm UTC](https://discourse.slicer.org/t/new-segment-editor-effect-local-threshold/9233/52 "2023-06-23T14:54:38Z")

</div>

Once I’ve made the ROI and selected it for the ROI of the local threshold, then how do I get the segment to grow?

---

<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 23, 2023, 3:00pm UTC](https://discourse.slicer.org/t/new-segment-editor-effect-local-threshold/9233/53 "2023-06-23T15:00:35Z")

</div>

You should be able to ctrl+click (cmd+click on Mac) on one of the regions with the pulsing color.  
See video here: [Segment Editor: New "Local threshold" effect - YouTube](https://www.youtube.com/watch?v=cevlMLyhfK8).

---

<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, 3:02pm UTC](https://discourse.slicer.org/t/new-segment-editor-effect-local-threshold/9233/54 "2023-06-23T15:02:50Z")

</div>

And once I ctrl click, should there be a change in color to suggest that a segment was made? I don’t see any appreciable change besides the yellow circle staying in place

---

<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 23, 2023, 3:05pm UTC](https://discourse.slicer.org/t/new-segment-editor-effect-local-threshold/9233/55 "2023-06-23T15:05:04Z")

</div>

It should be filled with the same color as the segment.

What kind of structure are you trying to segment?

---

<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, 3:11pm UTC](https://discourse.slicer.org/t/new-segment-editor-effect-local-threshold/9233/56 "2023-06-23T15:11:02Z")

</div>

I am using a scalar image and trying to segment anatomical regions. I first compressed the image using the Vector to scalar module, then drew an ROI, then began using the local threshold. I am able to create the ROI and draw the threshold, but I am unable to create a segment. Using the growing region module or segment draw modules both work so I believe I should be able to create segments using this file type

---

<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, 3:34pm UTC](https://discourse.slicer.org/t/new-segment-editor-effect-local-threshold/9233/57 "2023-06-23T15:34:32Z")

</div>

I dont see yellow lines 🙂  
Change the sliders until the structure you want to segment is solidly filled and the surrounding is not, then  
CTRL+ left-click

Maybe this helps:

[![](https://img.youtube.com/vi/NmG16cSwUHg/maxresdefault.jpg "Segmenting a lung nodule with 3D Slicer and "Local Threshold"") ](https://www.youtube.com/watch?v=NmG16cSwUHg)

---

<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, 3:53pm UTC](https://discourse.slicer.org/t/new-segment-editor-effect-local-threshold/9233/58 "2023-06-23T15:53:03Z")

</div>

For some reason I just can’t get the segment to be created, everything else on my screen looks like the video. I am using the latest Slicer version

---

<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:02pm UTC](https://discourse.slicer.org/t/new-segment-editor-effect-local-threshold/9233/59 "2023-06-23T16:02:43Z")

</div>

Try it like this:

Use the CT chest sample dataset

use this nodule  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/d/7/d7962ba02c071ba51f314db6d16ee23723b38331.jpeg)

Set the minimum diameter to 1 mm  
set the sliders to the positions:  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/3/b/3b43b36661a81f9b98a7aff4c4e60c6aba5741fc.png)

set everything else to

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/2/f/2f3e2d465da6c4d3931ea414f62b051019e405a7.png)

then CTRL+left click (both same time) into the filled nodule, it will turn green

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/8/d/8d0dc459934c212214f3a4cc0b5e14cd06f2871a.png)

---

<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:11pm UTC](https://discourse.slicer.org/t/new-segment-editor-effect-local-threshold/9233/60 "2023-06-23T16:11:41Z")

</div>

Thank you very much, that did work. Is there any surefire way to make this work for 2D images?

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

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