Login  Register

Antwort: Re: How to return a value from a plugin to a macro?

Posted by Joachim Wesner on Oct 16, 2009; 1:57pm
URL: http://imagej.273.s1.nabble.com/How-to-return-a-value-from-a-plugin-to-a-macro-tp3690723p3690726.html

Hi Gabe,

there is also another way I use/would suggest, you can either set an ImageJ
property from the plugin
and read it in the macro via (and vice/versa)

call("ij.Prefs.get", "<propname>",  <default>);

or sometimes IMHO it makes more sense that the plugin attaches some
specific properties to the images it processed or created,
this can be read similarly with a simple plugin I once made:

http://rsbweb.nih.gov/ij/plugins/imp-props.html

I use this in some reader plugins for special file formats that attach
extra properties to the images read so that other plugins or macros can
interpret those

Hope this helps!

Joachim




                                                                           
             Michael Schmid                                                
             <[hidden email]                                            
             N.AC.AT>                                                   An
             Gesendet von:              [hidden email]                
             ImageJ Interest                                         Kopie
             Group                                                        
             <[hidden email].                                       Thema
             GOV>                       Re: How to return a value from a  
                                        plugin to a macro?                
                                                                           
             16.10.2009 14:34                                              
                                                                           
                                                                           
              Bitte antworten                                              
                    an                                                    
              ImageJ Interest                                              
                   Group                                                  
             <[hidden email].                                            
                   GOV>                                                    
                                                                           
                                                                           




Hi Gabe,

there are several possibilities:

- have a static method of your plugin that returns a String. You can
access it by the call macro function
- via the Results Table
- by setting pixels in an image created for this putpose (if you want
to access an array)
- via a file

Michael
________________________________________________________________

On 16 Oct 2009, at 14:20, gabejackson wrote:

> I've been searching around for this a bit and can't find anything.
>
> How can i return a value from a plugin to a macro? I've got a lot of
> analysis plugins and would like to perform various things with the
> return
> values in a macro.
>
> thanks in advance
>
> Gabe



______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________