Calling a PlugInFilter with a custom arg string from a macro

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Calling a PlugInFilter with a custom arg string from a macro

Daniel Hornung
Hi all,
the subject nearly says it all.

Is there a way to start a PlugInFilter from a macro script, but with a
non-default String argument to its setup(String, ImagePlus) method?  I know
about the run("command"[, "options"]) function, but that is only for
non-interactively filling out a dialog window, afaics.

Any help would be appreciated,
thanks,
Daniel


--
Daniel Hornung

Biomedical Physics Group
Max-Planck-Institute for Dynamics and Self-Organization
Bunsenstr. 10
D-37073 Goettingen

(+49) 551 5176 368
Reply | Threaded
Open this post in threaded view
|

Re: Calling a PlugInFilter with a custom arg string from a macro

dscho
Hi,

On Mon, 2 Nov 2009, Daniel Hornung wrote:

> the subject nearly says it all.

I haven't tried this, but this could work:

        call("ij.IJ.runPlugIn", "class.name", arg);

(it might fail due to returning an Object rather than a String, in which
case you will have to resort to using Javascript or any other scripting
language.)

Ciao,
Johannes
Reply | Threaded
Open this post in threaded view
|

[solved] Re: Calling a PlugInFilter with a custom arg string from a macro

Daniel Hornung
In reply to this post by Daniel Hornung
Oh, I more or less accidentally found a solution.  Although not elegant, it works:

call("ij.IJ.runPlugIn",
     "${MY_PLUGIN}",
     "${MY_ARGUMENT_STRING}");

I just didn't consider call() before because it requires a static method,
runPlugIn() is exactly this.

Nevermind,
Daniel

--
Daniel Hornung

Biomedical Physics Group
Max-Planck-Institute for Dynamics and Self-Organization
Bunsenstr. 10
D-37073 Goettingen

(+49) 551 5176 368