Login  Register

Re: returning results of plugins within macros

Posted by Ben Tupper on Aug 05, 2008; 12:49pm
URL: http://imagej.273.s1.nabble.com/returning-results-of-plugins-within-macros-tp3695452p3695453.html

On Aug 5, 2008, at 8:21 AM, Frederic V. Hessman wrote:

> I looked at the documentation, but I can't find a way of using the  
> non-image result of a plugin in a macro.
>

Hello,

I think you want the macro command call("class.method", arg1,  
arg2, ...) See http://rsb.info.nih.gov/ij/developer/macro/ 
functions.html#C for more info.  The run("command", ...) command is  
used to call ImageJ menu commands which is a little different. Your  
FITS reader plugin will have to have a static method to return the  
contents of the FITS header as a string (or strings that have been  
concetenated into one string) to the macro.

Cheers,
Ben


> I want to be able to pull an entry out of a FITS image header and  
> use it in a macro, something like
>
> exposuretime=run("Read FITS Header","image=[] key=[EXPTIME]");
>
> Any ideas?  An alternative would be to be able to use Prefs within  
> a macro, e.g.
>
> run("Read FITS Header", "key=EXPTIME");
> exposuretime=Prefs.get("fits.result");
>
> This functionality would come in handy for other reasons.
>
> Rick
>
> ----------------------------------------------------------------------
> --------------------------
> Dr. Frederic V. Hessman     [hidden email]
> Institut für Astrophysik          Tel.  +49-551-39-5052
> Friedrich-Hund-Platz 1         Fax +49-551-39-5043
> 37077 Goettingen                 Room F04-133
> http://www.Astro.physik.Uni-Goettingen.de/~hessman
> ----------------------------------------------------------------------
> ---------------------------
> MONET: a MOnitoring NEtwork of Telescopes
> http://monet.Uni-Goettingen.de
> ----------------------------------------------------------------------
> ---------------------------

Ben Tupper
[hidden email]

I GoodSearch for Ashwood Waldorf School.

Raise money for your favorite charity or school just by searching the  
Internet with GoodSearch - www.goodsearch.com - powered by Yahoo!