|
Re: How to dispaly one image with different color tables? [message #44162 is a reply to message #44155] |
Tue, 24 May 2005 06:15  |
Ken Mankoff
Messages: 158 Registered: February 2000
|
Senior Member |
|
|
On Tue, 23 May 2005, envi35@yahoo.ca wrote:
> Hello,Could you give me some help on the following problem -- I
> want to use different color tables to display different parts of
> an image. My image (intarr(700*700) includes 3 parts: ocean
> (=999), land(=900), several ROIs on land (=0~100). I'd like my
> ocean to be white, land to be yellow, and ROIs to be displayed
> using the Blue-red color table. I've been trying for sometime with
> no luck. Could you give me some hints or at least tell me is it
> possible with IDL direct graphics?
You probably don't want 1 image with 3 colortables. What you want is
1 colortable with 3 different sections.
loadct, 33 ; Blue-Red CT
tvlct, r,g,b, /get ; get the individual RGB channels
r[0]=(g[0]=(b[0]=0)) ; set bottom to black (background)
r[255]=(g[255]=(b[255]=255)) ; set top to white (ocean, text)
r[254]=255&g[254]=192&b[254]=0 ; yellow
tvlct,r,g,b ; load your new custom CT
; now scale the data
ocean = where( data eq 999 )
land = where( data eq 900 )
image = bytscl( data, min=0, max=100, bot=1, top=253 )
; save 254 and 255 for the ocean
image[ ocean ] = 255
image[ land ] = 254
; then, display
imdisp, image
; or
map_set...
tv, map_image( ...
I didn't test the above, I just wrote it from memory, so there could
be grammatical or logical errors, but I think it might point you in
the right direction.
-k.
--
http://spacebit.dyndns.org/
|
|
|
|