[Insight-users] ScalarToRGBColormapImageFilter custom range

Wei Liu weiliu620 at gmail.com
Tue Nov 12 01:26:12 EST 2013


Dear itk users,

I'm trying to use ScalarToRGBColormapImageFilter to map a scalar to rgb
color. According to the document, "The range of values present in the input
image is the range that is mapped to the entire range of colors". However,
I want to fix the range of the input image.  That is, no matter what
intensity range of the input image is, I want the range [0, 255] map to the
full color range. So far I have tried the following approach:

     typedef itk::Function::HotColormapFunction< ImageType2DF::PixelType,
RGBImageType::PixelType >  ColormapType;
     ColormapType::Pointer colormap = ColormapType::New();
    colormap->SetMinimumInputValue(0);
    colormap->SetMaximumInputValue(255);
    std::cout << "max input: " << colormap->GetMaximumInputValue() <<
std::endl;
    rgbfilter->SetColormap(colormap);

I can see the maximum input value is correctly set. But it seems the
ScalarToRGBColormapImageFilter still define the input range by reading the
input image's min/max value. Did I miss something?

I have a related question: it looks itk does not have a filter to overlay a
continuous value image onto a gray level intensity image. That is the
reason I mannually convert the scalar image to rgb image, and overlay it
onto the gray level intensity image. Is there better way of doing it?

I appreciate your input.

Wei
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20131111/b59efb96/attachment.htm>


More information about the Insight-users mailing list