Page MenuHomePhabricator

PixelValue 0 is not drawn in black background color or displayed transparently
Closed, WontfixPublic

Description

While working on a bug that @kompan had with her perfusion data, we came across a problem where a node that contained a ROI (cropped part of an image) showed everything else outside of the ROI as light-green (Colormap mode "Jet", background pixel value = 0).

I did some experiments and here is what I did and what happened (to reproduce):

  • open MITK Workbench, load an image (I used Pic3D.nrrd)
  • open the segmentation plugin and create a simple segmentation mask
  • open the segmentation utilities plugin and perform "image masking" with "zero background value"
  • see how a new image node is created that shows the pixel values of the original image under the ROI and gray pixel values as background
  • click on the background and verify that the pixel value is actually 0
  • right-click on the new image node and select "Jet" and then "Jet Transparent" as colormap
  • see no difference in the visualization of both colormaps
  • right-click on the new image node and select "Multilabel" as colormap
  • see how the background is rendered transparently
  • set the colormap mode back to "Grayscale"
  • open the properties plugin view and select the new image node
  • check the "binary" property checkbox
  • see how the background is rendered transparently
  • click on the background and verify that the pixel value is still 0

So our question here: Obviously 0 pixel values are not transparently drawn in general but depending on the image type / rendering mode

  • in colormap mode "Multilabel" 0 pixel values are rendered transparently
  • for binary images 0 pixel values are rendered transparently
  • for LabelSetImages 0 pixel values are rendered transparently

However, all three variants are not acceptable for our current scenario since they change the visualization of the pixel values inside the ROI ("Multilabel" colormap does not make any sense, binary images draws everything in the ROI as white).
What is the suggested solution for such a scenario, where an image node shows a ROI but wants to show the underlying image for regions outside of the ROI?

Event Timeline

kalali triaged this task as Normal priority.Sep 29 2021, 4:49 PM
kalali created this task.

"Jet Transparent" only sets the lowest possible intensity to transparent. You can facilitate the new "Minimum" option in the Image Masking segmentation utility for that.

You can set a custom lookup table for your node and specify which value should be transparent. For example, the following code creates a standard grayscale lookup table but sets the minimum intensity value to be transparent:

auto lut = mitk::LookupTable::New();
lut->SetType(mitk::LookupTable::GRAYSCALE);
lut->ChangeOpacity(0, 0.0f);

auto lutProperty = mitk::LookupTableProperty::New();
lutProperty->SetLookupTable(lut);

node->SetProperty("LookupTable", lutProperty);
kislinsk added a project: Auto-closed.

Hi there! ๐Ÿ™‚

This task was auto-closed according to our Task Lifecycle Management.
Please follow this link for more information and don't forget that you are encouraged to reasonable re-open tasks to revive them. ๐Ÿš‘

Best wishes,
The MITK devs