Neuron Selection Problem with doWand

Hi all,

I want in a large image select neurons using their nuclei’s coordinates.
Using doWand(x,y) cause some problem as in the enclosed image using : doWand(40,125);

Is their any alternative ???

I don’t want to use Conditional dilatation (from Gabriel Landini’s plugin) as it can be long.

Thanks for you ideas…

Hi Eric,

If you could clarify, what is the problem with the doWand(x,y) function? The image you shared is not binary, so when I apply doWand directly I get this:

If that is the problem you can binarize the image using:

setOption("BlackBackground", true);
run("Make Binary");

However, when I run the doWand on the binarized image, I get the following selection, which I suspect is the issue you are facing?

I don’t know why the wand jumps to this selection… The source-code states:

The wand selects pixels of equal or similar value or thresholded pixels forming a contiguous area.

Any idea @imagejan @Wayne?


@EricDenarier after actually checking the documentation I see that you can tweak the doWand :sweat_smile:. Try:

doWand(40,125, 4.0, "Legacy");

Following up on this, I see that this is specifically mentioned in the source code as well (Legacy is default):

  * ('LEGACY_MODE' is also supported and may result in selection of
  * interior holes instead of the thresholded area if one clicks left
  * of an interior hole.)
1 Like

Hi Sverre,
It was the problem (selection of the hole instead of the neuron). Your trick seems to work. I will try it on the thousand neurons to see if another problem is encountered.
Thanks a lot !!!

1 Like