3D array imaging with different colors [message #83367] |
Thu, 28 February 2013 08:14  |
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.
|
|
|