Posted by
jchanson on
May 10, 2007; 4:12pm
URL: http://imagej.273.s1.nabble.com/distance-between-adjacent-particles-tp3699485p3699488.html
Ok. If you're not really looking for "closest neighbor" distance
but the "average distance among the closest neighbors"...
You'll need to decide how many of the closest neighbors you want
to include in the average. Depending on what you expect the distribution
might be like, you could use from 3-6 neighbors. Then, you could do the
"brute force" calculation suggested below, except instead of keeping the
shortest distance in an array, you would keep the "n" shortest distances
in an array. When you were done scanning all of the points, you would
find the average of those "n" points. I like using "6" points, because
that's how many neighbors an object would have if it was in a tightly
packed hexagonal pattern.
In other applications, I've been interested finding areas of
different "densities" of objects and I've used the following steps:
- threshold the objects
- reduce the objects to their ultimate center points
- run a large scale blur (scale dependent on how far away you want to
include neighbors)
- this image will have it's highest intensities in the areas where you
have the closest packing of objects
This represents more of a "texture" measure. The advantage of
this technique is that it doesn't require any extra java programming, just
image processing steps. The problem with this technique is that it's a
lot harder to try to describe what the results mean.
good luck,
Jeff
Gabriel Landini <
[hidden email]>
Sent by: ImageJ Interest Group <
[hidden email]>
05/09/2007 05:36 PM
Please respond to
ImageJ Interest Group <
[hidden email]>
To
[hidden email]
cc
Subject
Re: distance between adjacent particles
On Wednesday 09 May 2007 21:30:10 Michael Schmid wrote:
> > I have an image with many particles, distributed randomly. I'm
> > trying to get the average distance between a particle with all its
> > closest neighbors but not all of the particles on the image.
> > Is there an easy way to do or an existing plugin that allows such
> > measurement?
To do this using brute-force would be quite easy with a macro:
get the coordinates of all the points or centroids in arrays x() and y(),
for each point calculate using pythagoras, the distance to all other
points
and keep the shortest one in another array.
Now look at the distribution of shortest distances.
Cheers,
G.