ImageJ macro to measure distance between two lines/edges

Here is an ImageJ macro to measure distance between two user-drawn segmented lines (polylines) on an image. Shortest distances from points along the shorter line to the longer line are used to calculate the average distance between the two lines (their spline interpolations).

The macro works in ImageJ 2.1.0/1.53c, and may be useful to someone.

The macro prompts user to draw the two segmented lines (example below).

The macro then makes the measurements and displays statistics on the image, and prompts the user to save the values in a user-selected file.

InteredgeDistance_v1.0.1_ImageJMacro.txt (12.1 KB)
Instructions for InteredgeDistance macro.pdf (789.1 KB)

1 Like

Awesome! Wondering if I could measure tight junction lengths within my samples? :thinking:

See also this posts using the Exact Signed Distance Euclidean plug-in or similar:

Quantifying color distribution in birds (@oburri: still a nice example and in my list of links!)

1 Like

The newer version of the macro (1.1) should work when the lines are convoluted, as in your example.

1 Like

Updated to version 1.1:
InteredgeDistance_v1.1_ImageJMacro.txt (16.3 KB)
Instructions for InteredgeDistance macro 1.1.pdf (786.9 KB)

1 Like

@alpha2zee
Nice sharing.
Thank you

Hi,
Thanks for sharing the macro. I started using it for scratch assay analysis. Is there a reference for the macro somewhere, in case we get to publish the analysis?
Thanks,
Cath

As of now, there is no publication to cite as a reference for the macro. The macro logic is too simple to write about. Feel free to provide the macro code as supplementary material to accompany your publication.

Let me know if you find any issue with the macro.