Login  Register

Re: Change selection brush size in macro

Posted by Wayne Rasband on Nov 21, 2008; 8:56pm
URL: http://imagej.273.s1.nabble.com/Change-selection-brush-size-in-macro-tp3694419p3694420.html

On Nov 21, 2008, at 3:41 PM, Josh D wrote:

> Hello,
> I'm trying to change the size of the selection brush tool in a macro. I
> haven't had any luck figuring out how to do it. The size seems to be
> set in
> ij.gui.Toolbar. There is a public static int getBrushSize, but I see no
> matching setBrushSize. Is there some other way that I could change the
> brush
> size from a macro?

You can set the size of the selection brush tool in a macro using

     call("ij.gui.Toolbar.setBrushSize", size);

The Toolbar.setBrushSize() method was added in ImageJ 1.41o.

You can get the current size using

     size = call("ij.gui.Toolbar.getBrushSize");

-wayne