Re: Plug-in recorder

Posted by Rob van 't Hof-2 on
URL: http://imagej.273.s1.nabble.com/Plug-in-recorder-tp5003030p5003031.html

Hi,
you need to built up the string for passing arguments to the plugin.
SizeE is a number not a string.
code should be like:

int sizeE = 2; //sizeE is asked before since I don't want to call the plug-in I'm re-using itself
IJ.run(imp2, "Gray Morphology", "radius=" + sizeE + "type=circle operator=erode");

hope this helps,
Rob


On 16/05/2013 19:13, João Silva wrote:

> Hi everyone!
>
> I was using the plug-in recorder to save the following code:
>
> IJ.run(imp2, "Gray Morphology", "radius=2 type=circle operator=erode");
>
> I wanted to know if it is possible to do something equivalent to this:
>
>
> int sizeE = 2; //sizeE is asked before since I don't want to call the plug-in I'm re-using itself
> IJ.run(imp2, "Gray Morphology", "radius=sizeE type=circle operator=erode");
>
> I have already tried this and ImageJ pops a dialog window saying:
>
> Macro Error
>
> Numeric Vvalue expected in run() function
> Dialog box title: "Parameters"
> Key: "radius of the structure element(pixels):"
> Value or variable name: "sizeE"
>
>
> I really don't know what to do.
>
>
>
> Best Regards,
>
> João
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
_____________________________
Dr. Rob van 't Hof
Reader

Centre for Molecular Medicine
MRC IGMM
University of Edinburgh
Western General Hospital
Crewe Road, Edinburgh EH4 2XU
United Kingdom

Phone: (+44)-131-6511031
email: [hidden email]
_____________________________

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