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

Home » Public Forums » archive » Colormaps (a favorite subject!)
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Colormaps (a favorite subject!) [message #19621 is a reply to message #19448] Tue, 28 March 2000 00:00 Go to previous messageGo to previous message
Alex Schuster is currently offline  Alex Schuster
Messages: 124
Registered: February 1997
Senior Member
Craig Hamilton wrote:

> Thanks for the code, but my problem is not with grey-levels vs.
> number of colormap entries. My problem is as originally stated
> it: I want the user to be able to select the number of colors
> in the colormap, but I can't popup a window to get that information
> without having the number of colormap entries already set
> in the act of popping up the window. I must not be explaining
> myself very well. I've done loads of image processing programming
> in other languages on Unix and Windoze, so I'm familiar
> with colormaps and scaling of image data for display.
> I'm working with 16-bit data on 8-bit displays right now and I want to
> avoid color-flashing, so I want to use from 32 to 128 colormap
> entries for this display program. I want the user to be
> able to select how many entries are used.

Why don't you just let IDL allocate as much colors as it can get (window
& wdelete & ncolors=!d.n_colors)?

> Maybe a little more simply:
> I have been initializing the size of the colormap used with:
> window,0,colors=numcolors,/pixmap,xsize=10,ysize=10
> wdelete,0
> But now I just want to get the number 'numcolors' from the user first.
> I think I am realizing that I cannot get that number with a widget.
> Right?

I have had a similar problem: A tool displays brain images, but there
are often too few colors. So I check for the number of available colors,
and if it is at least 64, I use 64 color cells. If there are less, I
install a private colormap. This results in a flickering display, but at
least the user gets enought colors.

What I did to check the number of available colors is to open a
temporary IDL session which checks the number, and writes it to a file
in /tmp. The session then exists, and another IDL session starts. It
reads the file in /tmp, and allocates as much color cells as stated in
the file.

Alex
--
Alex Schuster Wonko@weird.cologne.de PGP Key available
alex@pet.mpin-koeln.mpg.de
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: FFT secrets revealed!! Update 6/5/2000
Next Topic: Advanced Programming Course in Europe

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

Current Time: Sat Oct 11 07:32:42 PDT 2025

Total time taken to generate the page: 0.39998 seconds