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

Home » Public Forums » archive » Re: How to dispaly one image with different color tables?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: How to dispaly one image with different color tables? [message #44155] Tue, 24 May 2005 09:23
envi35@yahoo.ca is currently offline  envi35@yahoo.ca
Messages: 48
Registered: March 2005
Member
It works perfect! Thanks! -Jenny
Re: How to dispaly one image with different color tables? [message #44162 is a reply to message #44155] Tue, 24 May 2005 06:15 Go to previous message
Ken Mankoff is currently offline  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/
Re: How to dispaly one image with different color tables? [message #44165 is a reply to message #44162] Tue, 24 May 2005 04:41 Go to previous message
Benjamin Hornberger is currently offline  Benjamin Hornberger
Messages: 258
Registered: March 2004
Senior Member
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.

http://www.dfanning.com/color_tips/twocolortables.html

> 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.

Note that you will have to byte-scale the image before display, so your
image values will change.

If you want to build your own color table:

http://www.dfanning.com/color_tips/create_colortable.html

Also skim through

http://www.dfanning.com/documents/tips.html

and you'll find many other useful stuff.

Good luck,
Benjamin
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Change the default dpi
Next Topic: help: window content erased after resize

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

Current Time: Wed Oct 08 15:17:52 PDT 2025

Total time taken to generate the page: 0.11629 seconds