[vtkusers] Convert grayscale image to rgb

David Cole dlrdave at aol.com
Wed Jun 4 07:34:18 EDT 2014

> Hi David. Thank you very much for the example, it did push me a bit
> further. Another thing, I have a number of
> 16bit grayscale images that also need converting. In what way should
> I modify the lookup table to accommodate these files?

See the updated example which I've put on the wiki now:


You can use any of the classes that derive from vtkScalarsToColors as
the lookup table.


If you just use vtkLookupTable as in the example, you can just modify
the arguments to the SetRange call to cover whatever range of grayscale
values you want to map to color. Anything lower than the lower arg will
map to the lowest color, and anything higher than the higher arg will
map to the highest color... in between values get interpolated.


Please keep replies on the list so others may also benefit from the

David C.

More information about the vtkusers mailing list