# Island tool inside a segment removes the whole segment

**URL:** https://discourse.slicer.org/t/island-tool-inside-a-segment-removes-the-whole-segment/47649
**Category:** Support
**Created:** [July 16, 2026, 11:02pm UTC](https://discourse.slicer.org/t/island-tool-inside-a-segment-removes-the-whole-segment/47649 "2026-07-16T23:02:38Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)
#### Post date: [July 16, 2026, 11:02pm UTC](https://discourse.slicer.org/t/island-tool-inside-a-segment-removes-the-whole-segment/47649/1 "2026-07-16T23:02:38Z")

</div>

I want to remove these small specs left after a boolean. So I restricted the editable area to inside that specific segment, and then tried to use the island tools remove small islands with really small island size (like 10 voxel). It removed the whole segment.

Is this normal? What’s the combination of options for me to do that?

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/1/2/123c9f494042fa3e5759143c75b88036297f681a.jpeg)

---

<div class="post-metadata">

### Author: ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)
#### Post date: [July 17, 2026, 2:37am UTC](https://discourse.slicer.org/t/island-tool-inside-a-segment-removes-the-whole-segment/47649/2 "2026-07-17T02:37:05Z")

</div>

This feels like a bug to me. Because when I used the “Keep Selected Island” with the same masking options it completed successfully.

---

<div class="post-metadata">

### Author: ![hherhold](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/hherhold/32/12199_2.png) [@hherhold](https://discourse.slicer.org/u/hherhold)
#### Post date: [July 17, 2026, 12:34pm UTC](https://discourse.slicer.org/t/island-tool-inside-a-segment-removes-the-whole-segment/47649/3 "2026-07-17T12:34:45Z")

</div>

I have noticed this type of behavior too, but wasn’t really able to nail down exactly what was happening. I wound up just doing keep selected island as well, or making a new segment and adding large islands by clicking on them using “add island”. I’m glad you noticed it too, I kinda felt like it was a bug but figured it was my masking settings or something.

---

<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: [July 17, 2026, 3:26pm UTC](https://discourse.slicer.org/t/island-tool-inside-a-segment-removes-the-whole-segment/47649/4 "2026-07-17T15:26:35Z")

</div>

I could reproduce the problem (it is due to the input segment is deleted at the beginning of the splitting, which invalidates the editable area). I have a fix (reorder the operations to keep the original segment around until the end) and will submit a pull request soon.

Until the fix is ready, you can use “Remove small islands”, setting “Editable area” to the current segment is redundant, as only the current segment is modified by this operation anyway.

---

<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: [July 17, 2026, 3:41pm UTC](https://discourse.slicer.org/t/island-tool-inside-a-segment-removes-the-whole-segment/47649/5 "2026-07-17T15:41:26Z")

</div>

Here is the pull request with the fix:

> <https://github.com/Slicer/Slicer/pull/9292>
>
> Problem: Islands effect cleared the current segment when editable area was set t…o the current segment (https://discourse.slicer.org/t/island-tool-inside-a-segment-removes-the-whole-segment/47649).
> 
> Root cause: The Islands effect operations (Remove small islands, Keep largest island, Split islands to segments) erased the selected segment first and then added the surviving islands back. When the editable area was restricted to the current segment, the editable mask is regenerated from that segment on every modification, so once the segment was erased the editable area became empty and the islands could no longer be written back - clearing the entire segment.
> 
> Fix: Do not erase the segment up front. For the split operation, fill the new per-island segments first (while the selected segment still defines a full editable area), then replace the selected segment content last with a single Set operation. The empty result case (e.g. all islands smaller than the minimum size) is handled explicitly.

---

<div class="post-metadata">

### Author: ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)
#### Post date: [July 17, 2026, 3:57pm UTC](https://discourse.slicer.org/t/island-tool-inside-a-segment-removes-the-whole-segment/47649/6 "2026-07-17T15:57:11Z")

</div>

Thanks Andras. I use masking and editable area quite often, because even as a veteran user I get confused about which effects are global vs which ones are segment specific.
