Nearest different pixel

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Nearest different pixel

Michael Doube-2
Hi all,

I'd like to find the set of distances from each thresholded pixel in an
ROI to the nearest un-thresholded pixel in the ROI.

The output would be a frequency table; that is, distance vs. count.

Any help appreciated,

Mike

--
Michael Doube  BPhil BVSc MRCVS
PhD Student
Dental Institute
Queen Mary, University of London
New Rd
London  E1 1BB
United Kingdom

Phone +44 (0)20 7377 7000 ext 2681
Reply | Threaded
Open this post in threaded view
|

Re: Nearest different pixel

dscho
Hi,

On Sun, 17 Sep 2006, Michael Doube wrote:

> I'd like to find the set of distances from each thresholded pixel in an ROI to
> the nearest un-thresholded pixel in the ROI.
>
> The output would be a frequency table; that is, distance vs. count.

You'd make a binary image (Process/Binary/Make Binary) after selecting the
threshold (Image/Adjust/Threshold), calculate the distance map
(Process/Binary/Distance Map) and show the histogram (Analyze/Histogram):

//run("Threshold...");
run("Make Binary", "thresholded remaining black");
run("Distance Map");
//run("Invert");
run("Histogram");

In my test, the Distance Map results were inverted, i.e. 255 where they
should have been 0 and vice versa. If that is the case for you, too, you
have to uncomment the Invert step.

Hth,
Dscho