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

Goodwin Lawlor goodwin.lawlor at ucd.ie
Wed Feb 28 13:22:36 EST 2007


Hi Gala,

I'm not sure exactly what you're trying to do but you can calibrate your 
image using the methods SetOrigin and SetSpacing.

SetOrigin sets the lower left position of your image:
image->SetOrigin(long,lat,0);

SetSpacing sets the size of your pixels:
image->SetSpacing(d_long, d_lat, 0);

hth

Goodwin


wind wrote:
> Okay, that makes sense. Now I need to give each point of that image a 
> latitude / longitude coordinate.... Is there a way to specify point 
> coordinates for an image? I can do it with a dataset that has only one 
> component and display it with a lookup table, no problem. But now I need 
> to set an RGB color for each of those points to see the image. 
> 
> The reason I need to do this is that I'm mapping aircraft flight tracks 
> onto satellite imagery. I want the satellite image to appear on the XY 
> plane. That satellite image has to be in the coordinate system of the 
> flight track : latitude / longitude. Is there a way to do that or no? In 
> the worst case scenario, I guess I could go with a grayscale image, but 
> I really would like a color one. 
> 
> Here's the image read in after I converted the data into a TIFF image, 
> but it doesn't scale properly, because it has to be scaled using lat/lon 
> grid that comes with the data. The grid is already defined for every 
> point on the image. You can see what I'm trying to do. The colored line 
> is the flight track itself, the white line is the ground track and now I 
> want that satellite image underneath it. 
> 
> Thanks, 
> 
> -- Gala 
> 
> 
> On Feb 28, 2007, at 11:38 AM, Goodwin Lawlor wrote:
> 
>> 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
>>
>> _______________________________________________
>> This is the private VTK discussion list. Please keep messages 
>> on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
> 
> Gala Wind
> 
> (301) 614-6221
> 
> wind at climate.gsfc.nasa.gov <mailto:wind at climate.gsfc.nasa.gov>
> 
> Code 613.2, Climate and Radiation
> 
> SSAI, Inc.
> 
> NASA/GSFC
> 
> Greenbelt, MD 20771
> 
> 
> /*--------------------------------------------------------------------
> 
>   -- There's always a way, you just have to find it.
> 
>             ( B. Hambly "Children of the Jedi" )
> 
> ----------------------------------------------------------------------*/
> 
> 
> 




More information about the vtkusers mailing list