Login  Register

Re: minimum distance between objects

Posted by StefanoCC on Sep 04, 2013; 3:25pm
URL: http://imagej.273.s1.nabble.com/minimum-distance-between-objects-tp3688186p5004649.html

Hi,

I am trying to do exactly the same (calculate the minimum distance between objects from image A to objects in image B, so that for any ROI from image A I will get the minimum distance to one of the ROIs in image B), and I'm very happy to see that someone else already figured out how to do this!

Briefly, I have the a sample that is stained with two antibodies, and in the end I will get two images of the same field but with two different colours (and patterns). My idea is to apply a threshold to both images and convert them to 2-bit images, then create ROIs using the "Analyse particles" command, and then find out which is the minimum distance between any ROI from image A and its closest neighbour in image B.
I tried to use your BeanShell script (I'm not familiar with it), and I'm confused... It seems like that it picks up the XY coordinates of all ROIs listed in ROI Manager and calculates the minimum distance between all of them, not calculating the minimum distance between two different sets of objects. What am I doing wrong?

Best regards,

Stefano