Page MenuHomePhabricator

[Segmentation] Multiple Segmentations under one parent node aren't displayed
Closed, ResolvedPublic


When you create multiple segmentations under one parent node, only the segmentation with the highest layer is displayed.

Steps to reproduce:

  • Load an image
  • Create two segmentations for the image with the 2D Add tool

If the two segmentations are set to the same layer in the properties, both are shown but overlayed areas are not shown in different opacities.
If you turn off the image node, the segmentations are shown correctly.

Revisions and Commits

Restricted Differential Revision
Restricted Differential Revision
Restricted Differential Revision

Event Timeline

kahl triaged this task as High priority.Jan 9 2020, 1:27 PM
kahl created this task.

I just found out the following:

  • perform both steps as written in the description
  • change the layer of one of the two segmentations such that one segmentation is on the same layer as the parent node (the other segmentation should still have a layer above the parent node),

e.g. from

ParentNode: Layer 4
 Segmentation1: Layer 5
 Segmentation2: Layer 7


ParentNode: Layer 4
 Segmentation1: Layer 5
 Segmentation2: Layer 4
  • see how both segmentations are visible with overlapping area

I guess that will be something that has to be fixed in the mapper. When looking into it, may be you also see the reason for T25445: MultiLabel segmentation mapper is very slow would be great.

During (and only during) drawing on any segmentation (after first mouse move), both segmentations are also visible.

Works in v2018.04.2. Parent image has layer 4, first segmentation 5, second 6, just as one would expect it to be. Drag & dropping the lower segmentation above the upper one, interchanges the layer.

When loading the same scene in the latest workbench, the layers fine as well but the segmentation with the higher layer hides the lower one.

I will check for other data types or if it is only an issue for segmentations. In the latter case I will check the segmentation mapper for wrong early-outs.

Only segmentations are affected. There is no relevant change in the mapper code between the last release and now, though. I found out, that it has something to do with opacity. In particular when setting the opacity of the top segmentation to 1, it works, but masks the segmentation below with its own extent. When setting both opacities to 1, everything looks like it should.

Oof, was able to boil it down to a VTK bug when depth peeling is enabled. Evaluating different options, like if it has something to do with @maleike's VTK patch, or if it is already fixed in a newer version...

The basic issue is that only the top translucent segmentation is rendered, when there is a texture below/behind from a reference image for example. As soon as there is no texture below/behind, both translucent textures are rendered correctly.

As it is not @maleike's patch, it must have been the upgrade from VTK 8.0 to 8.1 or the depth peeling reactivation in general. Checking with the latest version of VTK...

It's depth peeling and it is not solved with VTK 9. I tried to narrow down the issue in a minimum VTK application but I wasn't able to reproduce it. As quite a significant amount of time already was spent here, I will probably reintroduce preferences to disable/enable depth peeling and declare this issue as a known issue.

I think I found a nice solution. Depth peeling is set per renderer, not for the whole application. So it makes sense to activate it only for 3d renders. Side effect: probably speeds up rendering a little bit.

kislinsk added a revision: Restricted Differential Revision.Jun 17 2020, 4:33 PM