Project-MONAI / MONAILabel

MONAI Label is an intelligent open source image labeling and learning tool.
https://docs.monai.io/projects/label
Apache License 2.0
567 stars 185 forks source link

Segmentation masks disappears from 2d views after histogram thresholding #1632

Open bkonkva opened 4 months ago

bkonkva commented 4 months ago

Not sure if this is a Slicer issue or a MONAI issue, but I've only hit the issue so far using the MONAILabel and MONAILabel Reviewer plugins. When I use threshold an image and see, for example Editable area = Inside segment_1), after "Apply" the segmentation mask for that label disappears from all 2d views. Any paint etc. drawing done after that point similarly does not appear in the 2d views. I do however see the label in the 3d view (including post-threshold values and any modifications I make with paint etc.).

bkonkva commented 4 months ago

I've done some additional testing and this issue does seem specific to MONAILabel and MONAILabel Reviewer (doesn't occur if I use segment editor). Also, the whichever mask is highlighted disappears from 2d views as soon as threshold is selected - before adjusting the threshold or selecting "Apply" - so if w/ segment_1 highlighted I select threshold and then jump back to paint, segment_1 disappears from all 2d views

lassoan commented 4 months ago

Probably the segment's 2D filling opacity is set to 0. Please test with latest Slicer Preview Release.

lassoan commented 4 months ago

You have probably run into this issue:

https://github.com/Slicer/Slicer/issues/6874

@pieper do you remember if you have fixed this?

bkonkva commented 4 months ago

I'm currently testing with the latest release. Opacity is set to 1.0 for all segments

lassoan commented 4 months ago

2D outline and fill opacity is set to 0, as described in the issue referenced above (same segment editor node is used by multiple widgets). @pieper has proposed a solution but it may not have been integrated yet.

bkonkva commented 4 months ago

@lassoan re opacity: so display opacity is unaffected but under advanced slice fill and slice outline drop to 0 after selecting the threshold tool. If I adjust these back to 1 my mask reappears in the 2d views. Hoping there's a fix as doing this after every threshold would be a big workflow slowdown

pieper commented 4 months ago

Once I knew what the issue was it was easy to work around for me so I didn't implement a fix. There just needs to be something to prevent both threshold effects from activating the preview at the same time, since their state management is not robust in that case. Probably need to something like designating the Segment Editor's instance to be the primary instance with some flag and then having the primary effect show the preview would work.

lassoan commented 4 months ago

Fixed by https://github.com/Slicer/Slicer/pull/7577. Slicer Preview Release that you download tomorrow or later will include this fix.