Re: PointInRoi function?
Posted by Gabriel Landini on Dec 13, 2007; 9:06am
URL: http://imagej.273.s1.nabble.com/PointInRoi-function-tp3697771p3697772.html
On Thursday 13 December 2007 01:58:06 Koala wrote:
> I would like to test if a specific pixel lies within a non-regular shaped
> ROI (area as defined by a freehand or wand tool).
Search in the source for a ROI method called contains(x, y) which returns
false or true depending if the pixel is in the ROI.
Alternatively, in a macro, you can use morphology which is slow for 1 pixel
but you can process an entire image in parallel if you want to process many
pixels:
Set an image with the test pixel(s) to 255 (background is black)
Set another image with your ROIs filled
Next, do an AND operation of the 2 images. The result is the pixels that are
contained in the ROI(s).
Cheers,
G.