Using the Multilabel segmentation plugin view and the 3D Threshold tool, a label set image with multiple layers / labels is not correctly handled.
If using multiple labels on the same layer, the color of the first label is always used for a segmentation mask.
If using multiple layers, a Threshold segmentation on a layer != 0 leads to a workbench crash.
To reproduce:
- Load a 3D image, open the multilabel segmentation plugin view, create a new label set image
- create a new label on the first layer (automatic popup dialog)
- create another label on the first layer (distinct color)
- create a threshold segmentation mask on the first label
- create a threshold segmentation mask on the second label
- the second label will have the same color as the first label
- create a new layer and create a third label on that layer (automatic popup dialog)
- select a specific color for the third label
- use the threshold tool on the third label (second layer)
- MITK workbench crashes in mitk::BaseProperty *mitk::PropertyList::GetProperty(const std::string &propertyKey) const with this being a nullptr.
I did not look closer into it but I suspect that this is similar to other recently discovered bugs where the current layer is not considered and the current pixel value / label does not exist on the first layer.
I'm not exactly sure if this is related, but maybe these layer / label problems need to be kept in mind while working on T28118: Refactoring of SegTool2D.