Re: draw contour for given pixel value

Posted by Michael Schmid on
URL: http://imagej.273.s1.nabble.com/draw-contour-for-given-pixel-value-tp5003651p5003676.html

Hi Neil,

the standard ImageJ Wand works as a Wand only if you click outside the current selection (press shift-A to deselect if required). When clicking inside the current selection, you can drag the selection to some other position.

If you don't like this behavior, you can use the Versatile_Wand plugin (you have to specify 'include holes' in its options):

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

--

For getting the coordinates:
Apart from Tiago's suggestion, Edit>Selection>Properties, you can use the macro command getSelectionCoordinates:
  http://rsb.info.nih.gov/ij/developer/macro/functions.html#getSelectionCoordinates

Look at the getCursorLocDemo macro to see how to write a macro that takes mouse coordinates upon a click; then you deselect all, run doWand(x, y, tolerance, mode) and finally get the selection coordinates and save them, process them, or whatever you like, in your macro - which would be nice if you have to do this on many images.

http://rsb.info.nih.gov/ij/macros//GetCursorLocDemo.txt

In a macro, if you have a grayscale image, you could also read the pixel value at that coordinate, threshold the image between this value and maximum, and create a selection. This would eliminate the need for the Wand, which does not work well if you have steep slopes or the image data are noisy.

Michael
________________________________________________________________
On Jun 26, 2013, at 23:31, Neil Fazel wrote:

> Thanks Michael; the Wand Tool also works. (I find that it's a little finicky; sometimes the contour may be enlarged by clicking outside it, but not made smaller but clicking inside it.)
>
> Do you know of a way to list the XYZ values for a selection created by the Wand Tool?
>
> Neil
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html