comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » 3D array imaging with different colors
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
3D array imaging with different colors [message #83367] Thu, 28 February 2013 08:14 Go to previous message
tackmeister is currently offline  tackmeister
Messages: 5
Registered: March 2013
Junior Member
Hi all,

The past few months I've been breaking my head on a particular problem. I try to create RGB images using the image function. My array to plot is three dimensional, an example image would be:

a=fltarr(500,500,3)
for i=0,499 do if i lt 300 and i gt 200 then a(i,*,0)=i
for i=0,499 do if i lt 300 and i gt 200 then a(*,i,0)=i
for i=0,499 do if i lt 100 and i gt 0 then a(i,*,1)=i
for i=0,499 do if i lt 100 and i gt 0 then a(*,i,1)=i
for i=0,499 do if i lt 500 and i gt 400 then a(i,*,2)=i
for i=0,499 do if i lt 500 and i gt 400 then a(*,i,2)=i

I plot this array using:
graph = image(a)

The problem now is that every pixel with value (0,0,0) as (R,G,B) will be plotted black. Personally, I'd prefer it if the scaling would occur from white to black instead of the other way around (by default).

I tried to change the color table used, yet this doesn't work. The only thing that does help is by inverting the bytscled array, yet this inverts the entire color table and gives strange looking color. Using the tv procedure instead of the image function also doesn't help.

In any case, does anyone of you have an idea how I can image my 3D array as an RGB image, scaled from white (lowest intensity) to black (highest intensity)?

Thanks in advance.
[Message index]
 
Read Message
Read Message
Previous Topic: Re: 3D array imaging with different colors
Next Topic: Plot continuous line when have missing data points

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 09 21:58:34 PDT 2025

Total time taken to generate the page: 0.63772 seconds