wand

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

wand

Bill Rothman
Could someone kindly give me the macro code for changing wand thickness. Am using it for particle analysis and need to vary it in code. Also want definitions of wand mode and tolerance. There's probably a ref to these somewhere.
Much appreciated and happy holidays to all,
Bill R.
Reply | Threaded
Open this post in threaded view
|

Re: wand

Michael Schmid
Hi Bill,

simply use Plugins>Macros>Record
It will give you, e.g.,

   run("Wand Tool...", "mode=4-connected tolerance=20");

If you want variables, you need something like this:

   myTolerance = 20;
   myWandMode = "4-connected";
   run("Wand Tool...", "mode="+myWandMode+" tolerance="+myTolerance);

In the latest ImageJ version you can also type

   run("Wand Tool...", "mode=&myWandMode tolerance=&myTolerance");

Michael
________________________________________________________________

On 21 Dec 2009, at 17:01, Rothman, William wrote:

> Could someone kindly give me the macro code for changing wand  
> thickness. Am using it for particle analysis and need to vary it in  
> code. Also want definitions of wand mode and tolerance. There's  
> probably a ref to these somewhere.
> Much appreciated and happy holidays to all,
> Bill R.
Reply | Threaded
Open this post in threaded view
|

Re: wand

Bill Rothman
Michael,
Thanks for you quick response.
But what is tolerance and does 4-connected mean 4 pixel wide wand??
Bill R.

________________________________

From: ImageJ Interest Group on behalf of Michael Schmid
Sent: Mon 12/21/2009 11:11 AM
To: [hidden email]
Subject: Re: wand



Hi Bill,

simply use Plugins>Macros>Record
It will give you, e.g.,

   run("Wand Tool...", "mode=4-connected tolerance=20");

If you want variables, you need something like this:

   myTolerance = 20;
   myWandMode = "4-connected";
   run("Wand Tool...", "mode="+myWandMode+" tolerance="+myTolerance);

In the latest ImageJ version you can also type

   run("Wand Tool...", "mode=&myWandMode tolerance=&myTolerance");

Michael
________________________________________________________________

On 21 Dec 2009, at 17:01, Rothman, William wrote:

> Could someone kindly give me the macro code for changing wand
> thickness. Am using it for particle analysis and need to vary it in
> code. Also want definitions of wand mode and tolerance. There's
> probably a ref to these somewhere.
> Much appreciated and happy holidays to all,
> Bill R.
Reply | Threaded
Open this post in threaded view
|

Re: wand

Michael Schmid
Hi Bill,

it seems that the description of the wand tool options is missing in  
the documentation.

Tolerance: The Wand takes the pixel value where you click as an  
initial value. It then selects a contiguous area under the condition  
that all pixel values in that area must be in the range initial_value  
- tolerance to initial value + tolerance.

4-connected: Only the four neighbors of a pixel are considered  
neighbors. E.g., the wand does not follow a one-pixel wide diagonal  
line because the pixels of that line are not four-connected.

8-connected: Each pixel is considered to have 8 neighbors. So the  
wand follows a diagonal line if you click onto it. On the other hand,  
if you have an area of constant value dissected by a one-pixel wide  
diagonal line, the 8-connected wand will "jump over the line" and  
include the other part of that area.

The wand has no fixed width; the selected area depends on the image  
data. If you want to select an area of 5 pixels width use the  
selection brush. You find it by right-clicking into the Oval tool;  
double click for setting the width.

The selection brush is not macro-recordable. If you want to save a  
selection created by the brush, use the ROI manager; restoring a  
selection from the ROI manager can be done in a macro.

Michael
________________________________________________________________

On 21 Dec 2009, at 17:19, Rothman, William wrote:

> Michael,
> Thanks for you quick response.
> But what is tolerance and does 4-connected mean 4 pixel wide wand??
> Bill R.
Reply | Threaded
Open this post in threaded view
|

Re: wand

Bill Rothman
Michael,
Thank  you, much clearer now.
ImageJ(fiji) needs an up-to-date glossary.
Bill

________________________________

From: ImageJ Interest Group on behalf of Michael Schmid
Sent: Mon 12/21/2009 2:00 PM
To: [hidden email]
Subject: Re: wand



Hi Bill,

it seems that the description of the wand tool options is missing in
the documentation.

Tolerance: The Wand takes the pixel value where you click as an
initial value. It then selects a contiguous area under the condition
that all pixel values in that area must be in the range initial_value
- tolerance to initial value + tolerance.

4-connected: Only the four neighbors of a pixel are considered
neighbors. E.g., the wand does not follow a one-pixel wide diagonal
line because the pixels of that line are not four-connected.

8-connected: Each pixel is considered to have 8 neighbors. So the
wand follows a diagonal line if you click onto it. On the other hand,
if you have an area of constant value dissected by a one-pixel wide
diagonal line, the 8-connected wand will "jump over the line" and
include the other part of that area.

The wand has no fixed width; the selected area depends on the image
data. If you want to select an area of 5 pixels width use the
selection brush. You find it by right-clicking into the Oval tool;
double click for setting the width.

The selection brush is not macro-recordable. If you want to save a
selection created by the brush, use the ROI manager; restoring a
selection from the ROI manager can be done in a macro.

Michael
________________________________________________________________

On 21 Dec 2009, at 17:19, Rothman, William wrote:

> Michael,
> Thanks for you quick response.
> But what is tolerance and does 4-connected mean 4 pixel wide wand??
> Bill R.