Automatically measure distances between two irregular edges

Hello ImageJ community,

I’m a dentist and very new to the image analysis programs. It just happened that I have to find out the shortest distance of the root canal of a tooth from the pictures.

For the easier understanding, the root canal looks similar to a donut, and I have to find out the shortest distance between the outer edge and the inner edge of that donut.

My idea is to use the free-hand line to sketch the curve according to the outer and inner edges of the donut and use the image analysis program helping to automatic measure the distances. I’ve found this video which should be able to solve my problem but the Image Pro is too expensive.

Could anyone help me how can I accomplish this function with the ImageJ?

Thank you very much for every reply!


Good day!

Please post a typical image and a duplicated one in which you indicate what exactly should be measured. Use PNG-format for the images.



1 Like

Hi Herbie,

Many thanks for your attention and also sorry for my late reply.

Regarding your reply, please kindly find the typical image and the duplicated image with the indication of what should be measured as attached below. I’m trying to do the automatically measure the distances between two irregular edges of the root canal.


whole freehand canal

Could you please help giving some suggestion how can I do?

Best regards,


Good day Virachai,

thanks for posting the images that help except that I don’t know the distances that you are interested in. I see the contour line drawn by you but what are the distances in question?



Hi @Virachai_TH,

it’s not entirely clear to me which distances you are interested in, but the Local Thickness plugin might be helpful in your case:

For your image, I got the following result:


Here’s how I got it:

  • Open your image
  • Image > Adjust > Threshold with Dark background checked
  • Analyze > Analyze Particles… with Show: Masks and Include holes
  • Analyze > Local Thickness > Local Thickness (complete process)
  • Analyze > Tools > Calibration bar