Page MenuHomePhabricator

Use whole image grey value must always be executed when switching colormap to 'Multilabel'
Closed, ResolvedPublic

Description

When viewing segmentation maps it is essential to display each unique label in a different (unique) color. The usual workflow to achieve that is to select the 'multilabel' color map for the segmentation.
I don't know what MITK does exactly under the hood to set the level window (which seems to be what controls the color assignments). It appears to not use the whole image. This can cause some labels to not be captures and consequently not to be displayed in a unique color.

Reproduce
(use data from here: e132-projekte/Share/FabianAnMITKTeam/T28421) :
load the image (Patient_01_0000.nii.gz) and its segmentation (Patient_01.nii.gz). Make the segmentation the top entry in the data manager so that it is displayed on top of the image. Then change colormap of segmentation to multilabel. Navigate up to the jaw of the patient. The jaw should be segmented in two parts: the left and the right (pixel values 21 and 22). Unfortunately these are not displayed in different colors. Both are yellow:

image.png (360×452 px, 56 KB)

This can be fixed manually by selecting the 'use whole image value' option when right clicking the level window slider:

image.png (398×470 px, 62 KB)

We should not expect users to do this every time. This should be done automatically whenever the multicolor label map is selected (I think it even used to be like that)

Fix
Automatically run 'use whole image value' whenever multilabel color map is selected

(MITK Version: 2021.02 on Ubuntu 18.04)

Revisions and Commits

rMITK MITK
Restricted Differential Revision
Restricted Differential Revision

Event Timeline

isensee renamed this task from Use whole image grey value must always be executed when switching colormap to to Use whole image grey value must always be executed when switching colormap to 'Multilabel'.Mar 29 2021, 1:07 PM
isensee updated the task description. (Show Details)
kislinsk added a subscriber: kalali.
kislinsk added a subscriber: kislinsk.

This issue was already resolved by @kalali in T23589: Multilabel Segmentations not loaded with multilabel colormap, resp. {D172} for MITK v2018.04.2 but I can confirm that the issue exists for the example image.

  1. Load Patient_01 -> center: 14, span: 13
  2. Set "Multilabel" color map -> center and span do not change
  3. "Use whole image grey values" -> center: 11, span: 22

Surprisingly, the issue seems to be related to the Colormap context menu which does not completely apply the correct colormap. A workaround is to apply the Multilabel colormap twice. The second time, the multilabel colormap is actually applied and the "use whole image grey values" is executed as intended.

Found the issue. After setting the colormap to "Multilabel" in QmitkDataNodeColorMapAction::OnActionTriggered, the previous LUT is checked if it is a "Multilabel" LUT, instead of the new LUT. Hence the observation above that it works when applying it twice.

kislinsk added a revision: Restricted Differential Revision.Apr 8 2021, 5:27 AM

Hm, while D480 resolves the issue, I think that the original approach for handling the Multilabel colormap in T23589 is already a workaround. Changing the level window to the maximum possible range is just an emulation of "do not use the level window". We actually have that mode in MITK already. The Image Rendering.Mode property is usually set to LOOKUPTABLE_LEVELWINDOW_COLOR but there is also LOOKUPTABLE_COLOR which is exactly what we need here. The thing is, that LOOKUPTABLE_COLOR is not implemented correctly in the 2-d image mapper, as the level window filter is not reset and instead is using the previously set range. So I will extent D480 to actually use the correct mode and fix the 2-d image mapper.

edit: It actually is already implemented correctly. So we only need to set the correct image rendering mode. This will also fix T28422.