Re: interact with iimage from the command line? [message #60465 is a reply to message #60461] |
Wed, 21 May 2008 05:22   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Keflavich writes:
> tvimage? Is that equivalent to tv, tvscl?
TVIMAGE is equivalent to TV in the way a Porche
is equivalent to a Buick. :-)
> Anyway, what I really want to do is display fully sampled data with an
> aspect ratio that allows it all to be viewed at once, but also display
> it in an interactive window so that a user can zoom in on parts of the
> data and possibly even change the transfer function interactively. I
> think the 'tv' is wrong for this sort of task - am I mistaken?
Yes, you are mistaken. TV allows you to display images. Period.
All the other stuff you are interested in has to do with how the
user interacts with data. That, generally speaking, involves
widget programming. Since you are just starting in IDL, let
me give you some advice. You could learn widget programming
fifty times over before you make any progress on programming
an iTool.
> atv
> comes somewhat close, but I don't think it can display weird aspect
> ratios either.
Aspect ratios are determined simply by how you resize the image.
In the simplest case, just make an IDL graphics window in the
aspect ratio you want, and use TVIMAGE to display the data.
There you go, done.
Have a look at a program like ZIMAGE or XSTRETCH. (You can
find them both on my web page.) These do the kinds of things
you are looking for, if not exactly the way you want to do
them. I guarantee you, they will be a LOT easier to understand
than any iTool you pick up.
> Honestly, though, I haven't figured out a good way to display even
> downsampled data on the tv. I'm fairly inexperienced with IDL, but I
> have a lot of experience with other data languages. Is there any way
> to take, e.g., every 10th element along a given axis?
This, my friend, is what IDL lives to do!
IDL> s = Size(image, /Dimensions) & Print, s
100 10000
IDL> each10 = Indgen(1000) * 10
IDL> resampledImage = image[*,each10]
But, this is *much* more easily accomplished by simply resizing
your array:
IDL> resampledImage = Rebin(image, 100, 1000)
Or, if you want it some "weird" size:
IDL> weirdImage = Congrid(image, 500, 700)
Any of those images can be displayed with a TV command. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|