Login  Register

running a plugin from a macro WITH options selected

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

running a plugin from a macro WITH options selected

rrmarino
21 posts
Hello,

I need to run the plugin differentials  (http://bigwww.epfl.ch/thevenaz/differentials/) with the option "Gradient Magnitude" from a macro

When I choose Macro Record in ImageJ menu, it just records:" run("Differentials "); "  , which opens the plugin window if I run it from a macro.

What I actually need is to run the plugin WITH the option "Gradient Magnitude" with no option window at all. I tried already " run("Differentials ", "Gradient Magnitude"); " with no success.

Is there anyway to do it?

Thanks

RMarino
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: running a plugin from a macro WITH options selected

Rasband, Wayne (NIH/NIMH) [E]
1064 posts
On Aug 26, 2012, at 8:35 PM, rrmarino wrote:

> Hello,
>
> I need to run the plugin differentials
> (http://bigwww.epfl.ch/thevenaz/differentials/) with the option "Gradient
> Magnitude" from a macro
>
> When I choose Macro Record in ImageJ menu, it just records:"
> run("Differentials "); "  , which opens the plugin window if I run it from a
> macro.
>
> What I actually need is to run the plugin WITH the option "Gradient
> Magnitude" with no option window at all. I tried already "
> run("Differentials ", "Gradient Magnitude"); " with no success.
>
> Is there anyway to do it?

This plugin is not compatible with the ImageJ macro language because it does not use the GenericDialog class. Fortunately, the source code is available so you can easily work around this problem. Copy the file "Differentials_.java" into the ImageJ plugins folder, open it by dragging and dropping it onto the "ImageJ" window, change the line

    private static int operation = LAPLACIAN;

to

    private static int operation = GRADIENT_MAGNITUDE;

remove, or comment out, these 10 lines

    differentialsDialog dialog = new differentialsDialog(IJ.getInstance(),
        "Differentials", true, operation);
    GUI.center(dialog);
    dialog.setVisible(true);
    cancel = dialog.getCancel();
    operation = dialog.getOperation();
    dialog.dispose();
    if (cancel) {
        return;
    }

then compile and run the plugin using Plugins>Compile and Run command.

-wayne

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: running a plugin from a macro WITH options selected

rrmarino
21 posts
You are the best Wayne! Thank you!

That's why ImageJ is the best image processing software in the market!

Rodrigo

On Mon, Aug 27, 2012 at 11:43 PM, Rasband, Wayne (NIH/NIMH) [E] [via ImageJ] <[hidden email]> wrote:
On Aug 26, 2012, at 8:35 PM, rrmarino wrote:

> Hello,
>
> I need to run the plugin differentials
> (http://bigwww.epfl.ch/thevenaz/differentials/) with the option "Gradient
> Magnitude" from a macro
>
> When I choose Macro Record in ImageJ menu, it just records:"
> run("Differentials "); "  , which opens the plugin window if I run it from a
> macro.
>
> What I actually need is to run the plugin WITH the option "Gradient
> Magnitude" with no option window at all. I tried already "
> run("Differentials ", "Gradient Magnitude"); " with no success.
>
> Is there anyway to do it?
This plugin is not compatible with the ImageJ macro language because it does not use the GenericDialog class. Fortunately, the source code is available so you can easily work around this problem. Copy the file "Differentials_.java" into the ImageJ plugins folder, open it by dragging and dropping it onto the "ImageJ" window, change the line

    private static int operation = LAPLACIAN;

to

    private static int operation = GRADIENT_MAGNITUDE;

remove, or comment out, these 10 lines

    differentialsDialog dialog = new differentialsDialog(IJ.getInstance(),
        "Differentials", true, operation);
    GUI.center(dialog);
    dialog.setVisible(true);
    cancel = dialog.getCancel();
    operation = dialog.getOperation();
    dialog.dispose();
    if (cancel) {
        return;
    }

then compile and run the plugin using Plugins>Compile and Run command.

-wayne

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html



If you reply to this email, your message will be added to the discussion below:
http://imagej.1557.n6.nabble.com/running-a-plugin-from-a-macro-WITH-options-selected-tp4999850p4999870.html
To unsubscribe from running a plugin from a macro WITH options selected, click here.
NAML