IJ.run

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

IJ.run

John T. Sharp
I want to call a command from within a plugin

I have no problem creating a MACRO  that runs but when I enter the macro code into the plugin I get the error message that it doesn't recognize the command.

I have tried varying the code but haven't discovered where the e rror is.

MACRO

run("Convolve...", "open=[C:\\ImageJ\\plugins\\Filters\\k3x3 pos-neg.txt] text1=[1 3 1 1 1 1 -1 -3 -1] normalize");

Plugin line
        IJ.run("Convolve...","open=[C:\\ImageJ\\plugins\\Filters\\k3x3-pos-neg] text1=[1 3 1 1 1 1 -1 -3 -1]normalize");
Reply | Threaded
Open this post in threaded view
|

Re: IJ.run

Wayne Rasband
> I want to call a command from within a plugin
>
> I have no problem creating a MACRO  that runs but when I enter the  
> macro code into the plugin I get the error message that it doesn't  
> recognize the command.
>
> I have tried varying the code but haven't discovered where the e rror  
> is.
>
> MACRO
>
> run("Convolve...", "open=[C:\\ImageJ\\plugins\\Filters\\k3x3  
> pos-neg.txt] text1=[1 3 1 1 1 1 -1 -3 -1] normalize");
>
> Plugin line
> IJ.run("Convolve...","open=[C:\\ImageJ\\plugins\\Filters\\k3x3-pos-
> neg] text1=[1 3 1 1 1 1 -1 -3 -1]normalize");

Remove "open=[path]" from the options string and make sure there is a  
space before "normalize" and the code should work in both macros and  
plugins.

Macro:
     run("Convolve...", " text1=[1 3 1 1 1 1 -1 -3 -1] normalize");

Plugin:
     IJ.run("Convolve...","text1=[1 3 1 1 1 1 -1 -3 -1] normalize");

-wayne