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

Home » Public Forums » archive » Re: HELP - Changing color map in Mac IDl
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: HELP - Changing color map in Mac IDl [message #20179] Tue, 23 May 2000 00:00
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Liam E.Gumley (Liam.Gumley@ssec.wisc.edu) writes:

> However consider the following wrappers for TVSCL and XLOADCT in IDL
> 5.3:
>
> PRO TVSCL24, IMAGE, DATA=DATA
> if (n_elements(image) gt 0) then begin
> tvscl, image
> return
> endif
> if (n_elements(data) gt 0) then begin
> tvscl, data
> return
> endif
> message, �No image argument was specified�
> END
>
> PRO XLOADCT24, IMAGE
> xloadct, updatecallback=�tvscl24�, updatecbdata=image
> END
>
> These wrappers will update the image whenever the color table is
> changed, e.g.
>
> image = dist(256)
> tvscl24, image
> xloadct24, image

As long as Liam brings it up, here is another plug for
my XCOLORS program, a program I like better than XLOADCT
for a number of reasons. Don't try this at home with XLOADCT
because it won't work. Ten bonus points to the person who
has been reading this newsgroup for less than a year who
can tell me why. :-)

Be sure you do this on a 16-bit or 24-bit display. Create
a small image display program. Something like this:

PRO DisplayIt, Image=image, Wid=wid
IF N_Elements(wid) NE 0 THEN WSet, wid
IF N_Elements(image) NE 0 THEN TVImage, image
END

Next, type these commands:

image = Dist(256)

Window, 0
LoadCT, 5
TVImage, image
XColors, Title='Window 0 Colors', Wid=0, Image=image, $
NotifyPro='DisplayIt', XOffset=50
Window, 1
LoadCT, 3
TVImage, image
XColors, Title='Window 1 Colors', Wid=1, Image=image, $
NotifyPro='DisplayIt', XOffset=250

Now you have two windows on the display and you can change
the colors independently in each one and the colors are
updated automatically. There is no limit to how many windows
and how many color table tools you can have open at once.
(Well, no *practical* limit.)

In addition to XColors, you will need my TVImage program
because, well..., because I always use TVImage instead of
TV. Doesn't make sense not to. :-)

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

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
Re: HELP - Changing color map in Mac IDl [message #20181 is a reply to message #20179] Tue, 23 May 2000 00:00 Go to previous message
Liam E. Gumley is currently offline  Liam E. Gumley
Messages: 378
Registered: January 2000
Senior Member
Mark Elliott wrote:
> I am running IDL 5.3 on a G4 Mac. I'm using 8-bit pseudo-color.
> When I change the LUT (like with loadct) the images in the graphics
> windows do not change their appearance unless I redraw them. This
> makes routines like xloadct practically useless for optimizing the
> color map levels.

Assuming you are actually running in 8-bit mode (is your desktop set to
256 colors?), then you are seeing a 'feature' of the IDL direct graphics
system. There is no IDL preference which affects this behavior.

However consider the following wrappers for TVSCL and XLOADCT in IDL
5.3:

PRO TVSCL24, IMAGE, DATA=DATA
if (n_elements(image) gt 0) then begin
tvscl, image
return
endif
if (n_elements(data) gt 0) then begin
tvscl, data
return
endif
message, �No image argument was specified�
END

PRO XLOADCT24, IMAGE
xloadct, updatecallback=�tvscl24�, updatecbdata=image
END

These wrappers will update the image whenever the color table is
changed, e.g.

image = dist(256)
tvscl24, image
xloadct24, image

Cheers,
Liam.
http://cimss.ssec.wisc.edu/~gumley
Re: HELP - Changing color map in Mac IDl [message #20182 is a reply to message #20179] Tue, 23 May 2000 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Mark Elliott (mark@mail.mmrrcc.upenn.edu) writes:

> I am running IDL 5.3 on a G4 Mac. I'm using 8-bit pseudo-color.
> When I change the LUT (like with loadct) the images in the graphics
> windows do not change their appearance unless I redraw them. This
> makes routines like xloadct practically useless for optimizing the
> color map levels.
>
> Is there a preference of some sort that will fix this?

What makes you think you are using 8-bit pseudo-color?
I would be willing to bet quite a lot of money your
graphics card doesn't think you are using 8-bit pseudo-color.
In fact, I'm convinced your graphics card thinks you are
using "thousands" or "millions" of colors. :-) Use your
Monitor Control Panel to select 256 color mode (or whatever
it's called there). Then re-start IDL.

Or, you could use a program like XWindow on my web page
to display your image and use the color changing tool from
that program. Those colors will update your image even on
a 16-bit or 24-bit display:

XWindow, 'TV', image, /XColors

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: SPAWNing IDL from IDL under UNIX
Next Topic: More Keyboard events

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

Current Time: Wed Oct 08 18:53:01 PDT 2025

Total time taken to generate the page: 0.00477 seconds