[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
interactive color changes within a procedure
- Subject: interactive color changes within a procedure
- From: woodney(at)encke.astro.umd.edu (Laura Woodney)
- Date: 07 Mar 2001 18:58:27 -0500
- Newsgroups: comp.lang.idl-pvwave
- Organization: U. of Maryland @ College Park, Astronomy
- Xref: news.doit.wisc.edu comp.lang.idl-pvwave:23880
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|
------+