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
r

Here is a description of the wand tool:

http://imagej.net/docs/guide/146-19.html

“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.

@ctrueden

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(Path2D.java:1039)
    at ij.gui.ShapeRoi.parsePath(ShapeRoi.java:896)
    at ij.gui.ShapeRoi.getRois(ShapeRoi.java:464)
    at ij.gui.Roi.modifyRoi(Roi.java:1336)
    at ij.gui.Roi.update(Roi.java:1383)
    at ij.IJ.doWand(IJ.java:1473)
    at ij.IJ.doWand(IJ.java:1444)
    at ij.gui.ImageCanvas.mousePressed(ImageCanvas.java:1158)
    at java.awt.Component.processMouseEvent(Component.java:6532)
    at java.awt.Component.processEvent(Component.java:6300)
    at java.awt.Component.dispatchEventImpl(Component.java:4891)
    at java.awt.Component.dispatchEvent(Component.java:4713)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.awt.EventQueue$4.run(EventQueue.java:731)
    at java.awt.EventQueue$4.run(EventQueue.java:729)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

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

Here is another Wand tool plugin you can install:

http://imagejdocu.tudor.lu/doku.php?id=plugin:segmentation:versatile_wand:start

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.
Best
r

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