Can we Identify the distance between two particle in IHC image using ImageJ

Tags: #<Tag:0x00007fd53fdd4de0> #<Tag:0x00007fd53fdd4c28>


I want to calculate the closest distance between multiple almost circular IHC particles.

Is this possible with macro to do in large scale?


If you know the coordinates of the centers of the particles, it’s pure geometry to do that.

A typical image and a list of the corresponding particle coordinates would be useful.




Can you please elaborate?


@Praveen_kumar_R honestly how do you think someone can elaborate more than @Herbie as done without see any of your pictures and with a short description like your first post?



sir, I am Praveen, Just doing my Post graduation in MD Anatomy, from India. I am totally new to ImageJ. I found this forum yesterday only.

Hope i will get some help from here.

Thank you for your responses


Please post a typical uncompressed image (TIF- or PNG-format), otherwise we are unable to help.

Please describe precisely what you are looking for and, if necessary, use image annotations, drawings and the like.



As Emanuele and I have written, there is little to no sense to make any statements without having seen a typical image.

Perhaps you can post an image from the literature that comes close to what you are going to achieve.

Better though is to make a pilot experiment (staining).




from that image, I came up to here.

Is the correct? after this?

Thank you in advance


Yes, that looks nice!

Check “Centroid” in “Set Measurements”.

Then “Analyze Particles” lists the center co-ordinates (X, Y) of all particles.

Now you need to access these co-ordinates and compute all distances according to Pythagoras and finally select the smallest one. This is extensive search and you may guess that there are ways to minimize the effort of the extensive search.

There may be an Imagej-plugin that does the distance analyses. Perhaps someone else can point you in this direction. Otherwise, you can write an Imagej-macro that does what you need.

Here is what you need for macro-coding:




Possibly these plugins could be worth looking into:

Or this one:

The plugin file can be downloaded from here



Really thank you @Herbie and @Danielle_Z
I will let you know my progress and if I found any trouble too…

Thanks a lot :blush:


your ND - ImageJ plugin was really good, but i dont know how to measure Xstart and Ystart?


Consider also using this plugin, which i haven’t tried yet, but i would choose for nearest neighbour analysis in imagej:

It uses the results table to calculate nearest neighbour distances based on centroid positions.




Thanks a lot. it an simplest way to identify nearest distance. :slight_smile: