Unexpected behavior of color when using LUT with color count < 255

Hello:
The issue is first noted when I tried to reproduce a specific LUT in a commercial workstation by creating a custom LUT with 10 colors, and use it in a subtracted CT volume with standardized window and level ( basically with min 0 HU and max at a certain HU ). Then I noted that the displayed color is not compatible with the window and level settings in Volumes module, most region in the volume shows the color of maximum value. I then toggle color bar in Dataprobe module, and found that while as the data probe in left lower corner shows correct value, the viewport shows the color of 20-25 times of the actual value.
This also applies to builtin color tables with less then 255 colors (e.g. DarkBrightChartColors / 64Color-Nonsemantic) and I then noted that the it shows the color of with [ 255 / color count ] times the actual value.

CT Volume in “Gery” color table:
image
CT Volume in custom 10-color color table (see below for color txt):
image
Expected color is shown when adjust color window/level to roughly 25.5X (255/10)
image

This issue is also reproducible with sample dataset.
I’m not sure if I’ve missed something. :thinking:

the custom color table:

# step 10
0 Navy_blue 0 0 128 255
1 Blue 0 0 255 255
2 Green 0 128 0 255
3 Harlequin 0 255 0 255
4 Maroon 128 0 0 255
5 Red 255 0 0 255
6 Raw_Umber 128 96 0 255
7 Amber 255 192 0 255
8 Gray 128 128 128 255
9 White 255 255 255 255
#EOF

Platform: Windows 10 20H2, 3D slicer 4.11.20210226, intel i5-9400 + nVidia 1060.

Thanks for reporting. The current behavior is indeed not intuitive. We already have an issue for improving this, but for now you need to specify 0-255 range in the color table and then map it to the volume by setting the appropriate window/level in the display node. See more information here:

Hello:
Thanks for the quick and precise reply!
The workaround you provided works fine.
(upper panel: original 10 step color LUT, lower panel: 255 step workaround)

1 Like