MantisBT - VTK
View Issue Details
0001843VTK(No Category)public2005-05-11 15:412016-08-12 09:54
Mark Wyszomierski 
Will Schroeder 
normalmajoralways
closedmoved 
 
 
0001843: vtkImageMapToWindowLevelColors can do win/level on RGB data with no LUT
In vtkImageMapToWindowLevelColors, if there is no lookup table but the input image data is RGB/RGBA, all the color channel data is set to the same win/level, making it appear greyscale when drawn to screen (at least through vtkImageViewer2 anyways).

Instead, in this case where there is no LUT but the image data is in the RGB/RGBA format, can we just do the scaling per component so that the color data is retained:

*optr = result_val;
case VTK_RGB:
    *(optr+1) = result_val;
    *(optr+2) = result_val;

to:

unsigned char rgb_lvl[3];

case VTK_RGB:

    for (int i = 0; i < 3; i++) {
        if (*(iptr + i) <= lower) {
            rgb[i] = lower_val;
        }
        else if (*(iptr + i) >= upper) {
            rgb[i] = upper_val;
        }
        else {
            rgb[i] = (unsigned char) ((*(iptr + i) + shift)*scale);
        }
    }
    *(optr+0) = rgb_lvl[0];
    *(optr+1) = rgb_lvl[1];
    *(optr+2) = rgb_lvl[2];
    break;

and so forth for RGBA/LUMINANCE cases. I just put that in to see if it works and the output looks ok.
No tags attached.
Issue History
2011-06-16 13:11Zack GalbreathCategory => (No Category)
2016-08-12 09:54Kitware RobotNote Added: 0036785
2016-08-12 09:54Kitware RobotStatusexpired => closed
2016-08-12 09:54Kitware RobotResolutionopen => moved

Notes
(0036785)
Kitware Robot   
2016-08-12 09:54   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current VTK Issues page linked in the banner at the top of this page.