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

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 @anon96376101 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


1 Like

Really thank you @anon96376101 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:

The link to ‘nearest neighbour distances calculation with ImageJ’ now seems to live at:

I am trying to calculate nearest neighbor distances for nanoparticle clusters from TEM image. I think the plugin you mentioned should be useful, but the link does not work. Can you please post the correct link or let me know where I can find this plugin?

Dear Praveen Kumar
I need to determine nearest neighbor distance from nanoparticle clusters in TEM image. I am guessing you have successfully used the ND plugin for your work. Can you please guide me on where I can download this from and how to use it?