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

Home » Public Forums » archive » Re: Color changing dialog
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: Color changing dialog [message #15590] Fri, 28 May 1999 00:00
David Foster is currently offline  David Foster
Messages: 341
Registered: January 1996
Senior Member
Tri VU KHAC wrote:
>
> Hi all,
>
> I write a little application which needs a color table in which two (or
> more) IDL's color tables are as the following description:
>
> Saying my color table has 256 color
> myCT[0 : n-1] = CompressCT(IDLCT1, n) ; linear
> compression of IDL's N-element color table into n-element color table (n
> <= 255)
> myCT[n : 255] = CompressCT(IDLCT2, 256-n) ; linear compression of
> IDL's N-element color table into (256-n)-element color table
>
> Does anyone implement this procedure or know where I can get it. If you
> have sth like XLoadCT of IDL, this' excellent !
> Thanks for help.
> Tri.

Tri -

Are you asking for something like the CompressCT() routine? You could
just use the INTERPOLATE() function to do this.

It looks like you are creating a split color-table, so you might want
to check out my GRAYSCALE.PRO routine that can do this. At present
it will make half the scale a linear gray-scale, like you are using,
and the other half will be a single-color scale (eg. gradations of
yellow or some other color). You could easily modify this to make both
halves gray-scales. This routine can also split the color table
into thirds. It is a modal widget, and allows you to adjust both
halves interactively (and simultaneously, this could be expanded
to allow independent adjustments) using sliders.

You can get this from:

ftp://bial8.ucsd.edu/pub/software/idl/share

Dave Foster


--

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
David S. Foster Univ. of California, San Diego
Programmer/Analyst Brain Image Analysis Laboratory
foster@bial1.ucsd.edu Department of Psychiatry
(619) 622-5892 8950 Via La Jolla Drive, Suite 2240
La Jolla, CA 92037
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
Re: Color changing dialog [message #15596 is a reply to message #15590] Fri, 28 May 1999 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Whoops! I wrote:

> Window, Title='Image One Window'
> LoadCT, 1, NColors=100, Bottom=100
> TVScale, image1, Top=199, Bottom=100
> XColors, Title='Image One Colors', NColors=100, Bottom=100
>
> Window, Title='Image Two Window'
> LoadCT, 3, NColors=100
> TVScale, image2, Top=99
> XColors, Title='Image Two Colors', NColors=100

Forgot that /FREE keyword on those Window commands! :-)

David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: Color changing dialog [message #15597 is a reply to message #15590] Fri, 28 May 1999 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Tri VU KHAC (tvk@info.fundp.ac.be) writes:

> I write a little application which needs a color table in which two (or
> more) IDL's color tables are as the following description:
>
> Saying my color table has 256 color
> myCT[0 : n-1] = CompressCT(IDLCT1, n) ; linear
> compression of IDL's N-element color table into n-element color table (n
> <= 255)
> myCT[n : 255] = CompressCT(IDLCT2, 256-n) ; linear compression of
> IDL's N-element color table into (256-n)-element color table
>
> Does anyone implement this procedure or know where I can get it. If you
> have sth like XLoadCT of IDL, this' excellent !

You can download my XCOLORS program, an XLOADCT knock-off:

http://www.dfanning.com/programs/xcolors.pro

This program has several advantages that XLOADCT lacks.
One of the most important to me is that you can have
multiple programs on the display at the same time.
(No COMMON blocks. :-) This makes it possible for me
to have a color changing tool associated with individual
windows:

Window, Title='Image One Window'
LoadCT, 1, NColors=100, Bottom=100
TVScale, image1, Top=199, Bottom=100
XColors, Title='Image One Colors', NColors=100, Bottom=100

Window, Title='Image Two Window'
LoadCT, 3, NColors=100
TVScale, image2, Top=99
XColors, Title='Image Two Colors', NColors=100

The most important XCOLORS advantage is that it can notify
a widget program (via a widget event) when the color
tables change. This makes it possible to write programs
that update their colors automatically on 24-bit displays.

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: SV: IDL 5.2 GUI Builder Tutorial ?
Next Topic: Re: accessing large arrays quickly

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

Current Time: Wed Oct 08 09:22:02 PDT 2025

Total time taken to generate the page: 0.00731 seconds