Re: Passing information to a macro from a plugin
Posted by
Michael Schmid on
Jun 02, 2010; 10:23am
URL: http://imagej.273.s1.nabble.com/Passing-information-to-a-macro-from-a-plugin-tp3688079p3688080.html
Hi Simon,
one possibilty is a static method in your plugin that returns a value
or string (possibly in dependence of a parameter that serves as key
which value to return). You can use the call("myPlugin.staticmethod",
"key")) macro function to get it.
You can also write the values (if numeric) to the ResultsTable or (if
a String or converted to a String) to the properties (info) of the
image - the latter would have the advantage that it is multithreading-
safe.
Michael
________________________________________________________________
On 2 Jun 2010, at 11:39, simon andrews (BI) wrote:
> I've written a plugin which calculates a value from an image.
> Someone now wants to use this plugin from within a macro.
>
> I can configure the plugin from the macro by using Macro.getOptions
> () and parsing the string they pass in, but what I need now is a
> way to return a value (or preferably values) from the plugin and
> send it back to the calling macro so it can be used elsewhere in
> the macro.
>
> I'm sure there must be an easy way to do this, but I've not found
> it in the documentation.
>
> Can anyone enlighten me?
>
> Thanks
>
> Simon.