Problem: selecting dark background with Wand Tracing Tool

Given a white circle on a black background (in a 8 or 16 bit image), applying the Wand Tracing Tool to the black background does not exclude the circle from the resulting selection. This is independent of Wand Tool Tolerance or Mode.

When the circle is connected somehow via a white structure to the edge of the image it works fine, but not if the circle (or any other structure) is free within a black background.

This seems strange to me, can someone explain?

thanks a lot

Here is a description of the wand tool:

“To visualize what happens, imagine a turtle that starts moving to the
right from where you click looking for an edge. Once it finds the edge,
it follows it until it returns to the starting point.”

So if it traces your black background it will enclose the black area with the white circle within.


Apropos if I use the wand tracing tool, hold the “Alt” key (Alt-clicking removes the traced area from previously traced selections) and click again on the canvas the following exception is thrown, at least on Win 64-bit. Could someone reproduce this on Linux and MacOSX?:

Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 0
    at java.awt.geom.Path2D$Float$TxIterator.currentSegment(
    at ij.gui.ShapeRoi.parsePath(
    at ij.gui.ShapeRoi.getRois(
    at ij.gui.Roi.modifyRoi(
    at ij.gui.Roi.update(
    at ij.IJ.doWand(
    at ij.IJ.doWand(
    at ij.gui.ImageCanvas.mousePressed(
    at java.awt.Component.processMouseEvent(
    at java.awt.Component.processEvent(
    at java.awt.Component.dispatchEventImpl(
    at java.awt.Component.dispatchEvent(
    at java.awt.EventQueue.dispatchEventImpl(
    at java.awt.EventQueue.access$500(
    at java.awt.EventQueue$
    at java.awt.EventQueue$
    at Method)
    at java.awt.EventQueue$
    at java.awt.EventQueue$
    at Method)
    at java.awt.EventQueue.dispatchEvent(
    at java.awt.EventDispatchThread.pumpOneEventForFilters(
    at java.awt.EventDispatchThread.pumpEventsForFilter(
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(
    at java.awt.EventDispatchThread.pumpEvents(
    at java.awt.EventDispatchThread.pumpEvents(

Is someone aware of a plugin that works like the photoshop wand tool that would include the circle?

Here is another Wand tool plugin you can install:

However it would help us if you give us more information about what you want to archieve with the wand tool.

1 Like

Hi Bio7,
thanks a lot!
the Versatile Wand Tool does what I need.

I have fluorescently labelled single moving cells and need the circumference to follow their shape changes. Since the cells are on black background and are mainly stained at the cell periphery I thought something like the Photoshop magic wand could crop the background quite easily. I was quite puzzled that the Wand tracing tool worked a little bit different.

I could not reproduce this with ImageJ 2.0.0-rc-49/1.51a on OS X.