Re: ENVI Question: Can you programmatically access the Available Spectra List? [message #53267 is a reply to message #53190] |
Fri, 30 March 2007 13:34   |
Mort Canty
Messages: 134 Registered: March 2003
|
Senior Member |
|
|
Jeff N. schrieb:
>
> Hi Mort,
>
> Thanks for the reply. I knew about getting data out of spectral
> libraries already - I think I probably didn't explain my original
> problem well enough. Lets say you had a z-profile (or any kind of
> profile, really) opened in an ENVI spectral profile window. If you
> then go to spectral math and enter an expression like "s1 + 50" in the
> expression dialog, then the next thing you're going to see is another
> dialog where you tell ENVI which spectrum you're going to use as s1.
> That spectrum that you had in the ENVI spectral profile window is
> going to be listed in that dialog box so that you can tell ENVI to use
> it as s1. In fact, if you didn't have a spectral profile window up
> with any spectra displayed before you called the spectral math dialog,
> the spectral math dialog will give you an error as I recall. It does
> all this by somehow having a list in memory of all the spectra that
> are being displayed in a profile box. What I want to do is get to
> that list and use it in a routine of my own. That way I can process on
> any kind of spectrum, whether it be from a library, a remote sensing
> scene, test data, etc.
>
> I'm sure you know that there are custom "plot functions" that you can
> write that show up under the "Plot Function" menu of a spectral
> profile display if you modify the useradd.txt file. But, like with
> custom band and spectral math functions, the code that you write has
> some limitations. This is sort of what I want to do in that it's a
> routine that takes in a spectrum that's been displayed in a profile
> window and does some things with it. But I need to do more than just
> display that input spectrum. I need to do things that require more
> input from the user, so I need dialog boxes, etc. Now, of course, I
> can write a routine of my own that gets the spectrum from the user
> some other way, but that just seems to be reinventing the wheel, and
> from the user's point of view it seems more intuitive to display a
> routine, and then click a button or something that says "Do Jeff's
> nifty routine on this spectrum."
>
> I've pretty much given up hope that what I want to do is possible, but
> I thought it was worth a try anyway.
>
> Thanks for your help,
> Jeff
>
Thanks for the explanation. Now I see what you want ( I hope :-) ). I
don't have a clue either, but it seems to me like writing, for instance,
your own ENVI "user defined motion routine" to pick up mouse clicks from
an opened image display, extracting the Z-profiles (or whatever) and
then doing your nifty routine is re-inventing the wheel. You could even
call it from the TOOLS/PROFILES menu. But I guess it's a matter of how
versatile and "envi-like" you want it to be. If you manage to figure it
out after all, let me know.
Cheers
Mort
|
|
|