Re: interact with iimage from the command line? [message #60446 is a reply to message #60445] |
Wed, 21 May 2008 11:13   |
pgrigis
Messages: 436 Registered: September 2007
|
Senior Member |
|
|
David Fanning wrote:
> pgrigis@gmail.com writes:
>
>> Well, it is true that 8 bit color tables are the only ones
>> that are easily accessible from IDL, but there is nothing
>> to stop users to display false color images with color
>> tables with more than 256 elements, apart having to write
>> a few lines of code. As a matter of fact, sometimes I wonder
>> whether we should have some nice color table with, say,
>> 1024 elements...
>
> Well, what few lines of code would you write? I'd like
> to see how something like this would work.
Here's a quick working code. The trick of course
is to transform the intensity array into a true color
image:
;create 512 element color table
;by combining 2 different color tables
rl=bytarr(512)
gl=bytarr(512)
bl=bytarr(512)
loadct,3
tvlct,r,g,b,/get
rl[0:255]=r
gl[0:255]=g
bl[0:255]=b
loadct,5
tvlct,r,g,b,/get
rl[256:511]=r
gl[256:511]=g
bl[256:511]=b
;create some data
im=dist(512,512)
;scale data
im=(im-min(im))/(max(im)-min(im))*511
;create true color image
im2=bytarr(512,512,3)
im2[*,*,0]=rl[im]
im2[*,*,1]=gl[im]
im2[*,*,2]=bl[im]
;display image
tv,im2,true=3
Ciao,
Paolo
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|