SegmentEditor Islands effect keeps the islands in the original segment

I am trying to do use the islands effect to separate individual bones. While, it finishes correctly, it still retains the new created islands/segments in the original segment. I thought the behavior was to move them to the newly created segments. See screen captures. This is with r28340 on windows 10.


After i turned off the segments that are right hindlimbs and forelimbs, they are still visible in segment_1 (green large chunk)

I don’t recall the functionality being like this. If this change was intentional, I find this behavior tedious. It requires me doing additional logical operations to remove them from the original segment.

I am not sure if it is relevant, but there is this error in the log file

[WARNING][Qt] 14.08.2019 13:29:35 [] (unknown:0) - ctkSliderWidget::setSingleStep() 0 is out of bounds. 0 100 1

[INFO][Python] 14.08.2019 13:35:34 [Python] (C:\Slicer 4.11.0-2019-08-09\lib\Slicer-4.11\qt-scripted-modules\SegmentEditorEffects\SegmentEditorIslandsEffect.py:187) - 18 islands created (78 ignored)

[INFO][Stream] 14.08.2019 13:35:34 [] (unknown:0) - 18 islands created (78 ignored)

[CRITICAL][Qt] 14.08.2019 13:35:58 [] (unknown:0) - void __cdecl qSlicerSegmentEditorAbstractEffect::modifySelectedSegmentByLabelmap(class vtkOrientedImageData *,enum qSlicerSegmentEditorAbstractEffect::ModificationMode,const int []) : Invalid segment selection

You can choose the behavior using Masking / Modify other segments option. “Overwrite all” replaces content in the original segments, “Allow overlap” preserves the original segments.

@lassoan
Unfortunately it happens with ‘overwrite all option’ (i.e., it doesn’t overwrite the initial segment)


There is this error in the log file:

Loaded volume from file: C:/Users/Murat/Downloads/IntensityWindowingImageFilter Output.nrrd. Dimensions: 869x998x1295. Number of components: 1. Pixel type: unsigned char.

“Volume” Reader has successfully read the file “C:/Users/Murat/Downloads/IntensityWindowingImageFilter Output.nrrd” “[1.00s]”

Switch to module: “SegmentEditor”

ctkSliderWidget::setSingleStep() 0 is out of bounds. 0 100 1

28 islands created (14632 ignored)

28 islands created (14632 ignored)

void __cdecl qSlicerSegmentEditorAbstractEffect::modifySelectedSegmentByLabelmap(class vtkOrientedImageData *,enum qSlicerSegmentEditorAbstractEffect::ModificationMode,const int []) : Invalid segment selection

I think the behavior haven’t changed in the last few years:

  • “Split islands to segments” option does not modify the original segment (you can delete the original segment if you no longer need it)
  • “Add selected island” does overwrite the original segment if “overwrite all” is chosen

Do you find these behaviors not optimal for your workflow? Do you find any difference compared to Slicer-4.10?

@lassoan
Thanks, I have to give it a more careful try with the preview version. Dataset is on my home computer.

The issue is, after the island effect segmentation is not fully done. I still have to operate on Segment_1 (e.g., isolate pelvis, the skull, left forelimb, vertebral column etc), yet Segment_1 is unmodified. It is ok for it to remain unmodified, but at the end of the operation I would like to have a segment that I can carry on the remaining segmentation tasks without having to do additional logical operations. If I delete the segment_1, I don’t have anything else to carry those operations.

For example, if I want to segment the thorax, I would like to use the fact that both forelimbs and scapula are already segmented.

I haven’t been using the segment editor as much as the old editor personally, so may be am missing something here. What I described was the behavior in the old island effect.

Island effect has many modes. Do you have problem with the behavior of “Split islands to segments”?

We are having the same problem with islands module, split island to segments option with the “overwrite all” selected. See screenshot. This is different than the behavior in stable version, which actually “splits” the segment into new segments. This behavior requires an additional operation to “subtract” the newly created island (or islands) from the original.
See screenshot.

2 Likes

@lassoan do you have a chance to replicate the issue with the split islands behavior?

I did not try it again since my first answer.

"Split islands to segments” option does not modify the original segment. Do you find that the behavior is different in latest stable vs latest preview version?

You can delete the original segment if you no longer need it by a single click. Is the problem that you need to do this extra click?

Hi Andras,

If you look at the image on the @hjhedgar post above, if you delete the segment_1 (green), which is the original, you will no longer have any segment that contains the hand on the left side as a single structure. This was not the behavior in the stable version.

Currently the solution we found is to subtract every other segment from the original, and that gets tedious as the number your islands increase.

I think keeping the original segment is a good idea, except the result of split islands to segment should output two additional segments, a left foot only, a right foot only, and then the original.

What we have instead is the original (untouched segment) and only the right hand. That’s our issue with the current behavior.

This sounds like a bug, will test again. What masking settings do you use?

Same as the screen capture, (editable everywhere, overwrite all segments)

I could reproduce and fixed the issue. The problem was that due to some recent changes, current node selection was lost when the new segments were added. Thanks @muratmaga and @hjhedgar for reporting the issue and providing all the details.

@Sunderlandkyl You’ve recently investigated and fixed a similar problem of losing current segment selection. Could you have a look at this, too - why current selected segment ID is cleared when running slicer.vtkSlicerSegmentationsModuleLogic.ImportLabelmapToSegmentationNode? Thank you!

2 Likes

This pull request should fix the segment selection issue for most cases.

1 Like

Hi Andras,
split island to segments is not working for my case.

I am doing it to split one labelmap. It ignores 113 islands 0 created.
0 islands created (113 ignored).

Also I noticed the one segment in the segment editor it diappears although the label is still there but its empty now.

Regards,
Saima Safdar

Split islands has a minimum island size option. If your individual islands are less than this value (which has a default of 1000 voxels), they will be removed. Try reducing this number and see if the islands are retained.

2 Likes

Yes I get it now. Thanks alot