Login  Register

Re: IJ.run

Posted by Wayne Rasband on Sep 06, 2006; 5:47pm
URL: http://imagej.273.s1.nabble.com/IJ-run-tp3701652p3701653.html

> 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