I want to measure the distribution of all nearest neighbors of ROIs drawn over a micrograph. The micrograph is of a neural network and the ROIs are from Ca imaging. My goal is to get the distribution of the distances between active cells. Some are immediate neighbors, but others are far apart.
I can get from a map of the ImageJ ROIs (I create an overlay with the ROIs filled in black) to an x,y map (in Excel) of points using Analyze->Measure->Center of Mass>copy XM, YM to Excel:
Now that I have a map of all the points in an x,y plot, how can I get the distances of the nearest neighbor for each point in this x,y plot?
@sroper your post title is a bit misleading. You don’t want do get all the distances between all ROIs (with the shortest distance being the shortest line between point on the periphery of each object), do you? If the centroid distances is all that you want, @tibuch’s workflow is just right.
@tibuch the way you’re calculating the nearest distance is quite complex. I’ve used the Similarity Search node (with a neighbor count of 2 and followed by a Row Filter for nearest neighbor index=1) in the past for similar tasks.