[vtkusers] Re: displaying a 3-channel dataset as an image

Goodwin Lawlor goodwin.lawlor at ucd.ie
Wed Feb 28 11:38:14 EST 2007


wind wrote:
> Hello, 
> 
> I have a file that has three sets of scalars in it that I would like to 
> display as an image with each set mapped to red, green and blue color 
> respectively. The data file contains different channels from a satellite. 
> 
> I've read the data into memory and now have three arrays of 8-bit 
> numbers. I can combine the data into a single array if I have to. Is 
> there a way to tell VTK to display that array as an RGB image?
> 
> Thanks, 
> 
> -- Gala

Hi Gala,

You can use vtkImageAppendComponents. See how it's used here:

http://www.bioengineering-research.com/vtk/VHPREADER.TCL

to read planar rgb images from the Visible Human Project.

Note you have to add the blue channel first, then green, the red.


hth

Goodwin




More information about the vtkusers mailing list