interactive color changes within a procedure [message #24120] |
Wed, 07 March 2001 15:58  |
woodney
Messages: 2 Registered: March 2001
|
Junior Member |
|
|
I've been lurking on this group learning lots of useful things for
awhile now. Now I have a question that maybe somebody here knows
the answer to.
Once upon a time you could place a call to XLoadCT inside a
procedure so that when it ran, the color table widget would pop
up, you could play with the color table of an image being displayed,
then when you were done, you could close the widget and the program
would then continue on its merry way. Then RSI messed with XLoadCT
and this no longer worked: the color table widget would pop up, but
the program would continue on it's merry way and not give you a chance
to play with your color tables. Fortunately, the old version of
XLoadCT still worked and could be placed in my path in front of the
current RSI version.
Now here's the latest twist. My new display is 24-bit color, so I
want to start using David Fanning's XColor widget for playing with
my color tables. However, I can't figure out how to stop and
interactively play with the color stretch while inside a procedure.
Since I now live in a 24-bit world, the old solution of using XLoadCT
from vintage IDL doesn't work either.
Here's an example of what I'm trying to do (parts are cribbed from
David's great book):
PRO test,image
;scale and display the image
im = bytscl(image)
window,16,xsize=401,ysize=401
tv,im
;fiddle with the color table
xcolors, notifypro='display', image=im, wid= 16
;fit centroid to position clicked on image
center_par,im,x0,y0
print,'measured center:',x0,y0
end
PRO display, image=image,wid=wid
IF n_elements(wid) EQ 0 THEN wid = !d.window
wset,wid
tv,image
end
I'm not going to include center_par since it's too long, and isn't
really related to the problem.
This all works fine - except I can't change the color scale of the
image until after the procedure has ended, and I want to do it before
it gets to the center_par routine so I can see what it is I'm trying
to click on for that routine.
Figuring out what color stretch I want to use at each step before I
run a program is impractical. I have dozens of images I need to manipulate,
interactively measure and then manipulate some more.
Any ideas?
- Laura
+---------
|Dr. Laura M. Woodney
|Lowell Observatory
|Flagstaff, AZ 86001
|woodney@lowell.edu
--
+------
|Laura M. Woodney
|Lowell Observatory
1400 W. Mars Hill Rd. |
Flagstaff, AZ 86001 new e-mail: woodney@lowell.edu|
------+
|
|
|
|
Re: interactive color changes within a procedure [message #24169 is a reply to message #24120] |
Fri, 09 March 2001 15:41  |
John-David T. Smith
Messages: 384 Registered: January 2000
|
Senior Member |
|
|
Craig Markwardt wrote:
>
> JD Smith <jdsmith@astro.cornell.edu> writes:
>
>> Craig Markwardt wrote:
>>> I still use round parenthesis for all my new programs!
>>
>> For shame! Perpetuating a colossal syntax mistake.
>>
>> COMPILE_OPT STRICTARR
>
> I prefer to call it "classic" syntax.
>
> My putative reason was for compatibility with IDL 4, but this
> reasoning is slowly dissipating now.
How can one not use "break", "continue", and "switch"? When you're
still adding basic programming control functionality in your 25 year old
product, it's hardly a wonder many packages require the latest version.
I for one will always be adding a "Requires v5.4" disclaimer.
JD
P.S. IDL has turned 25! Did anyone throw a party? If not, next Friday
at David's. Bring your own device.
|
|
|