[vtkusers] how to map a greyscale image to a color image?

imho imho at skynet.be
Thu Oct 17 11:52:06 EDT 2002


Hi,
I'd like to colorize a medical greyscale image.

I do this :

        vtkLookupTable table = new vtkLookupTable();
        table.SetTableRange(-1800,1800);                         ***
        table.SetValueRange( 0.0, 15);                           ***
        table.SetSaturationRange( 0.0, 1.0); // 0 a  1           ***
        table.SetHueRange(  0.0,1.0 ); // 0 a 1                  ***
        table.SetAlphaRange( 0.0, 1.0); // 0 a 1
        table.SetNumberOfColors(256);
        table.Build();

        vtkImageMapToColors alpha = new vtkImageMapToColors();
        alpha.SetInput(reader.GetOutput());
        alpha.SetLookupTable(table);
        alpha.SetOutputFormatToRGB();

but the colors are ugly :p
Wich values do I have to set for *** ?
Thanks a lot

PS : sorry if you receive this email twice, I had a problem





More information about the vtkusers mailing list