Measuring DNA Contour Lengths with ImageJ

Contributed by Martin Fitzpatrick, University of Birmingham, United Kingdom

This is an example of how to measure the lengths of DNA contours on images acquired using an atomic force microscope (AFM).


Requires ImageJ 1.30 or later.

In this example, we measure the length of the DNA contour in the lower right corner. The field width of the image is 500nm. The image is from M. Lysetska, et al., “UV light-damaged DNA and its interaction with human replication protein A: an atomic force microscopy study”, Nucleic Acids Research, 2002, Vol. 30, No. 12 2686-2691 (, used with permission.


  • Use the Analyze/Set Scale dialog to define the spatial scale. Enter the image width in the “Distance in Pixels” field, enter the field width in the “Known Distance” field, enter “nm” as the “Unit of Length”, then click “OK”.
  • Use the magnifying glass tool to zoom in on the DNA contour to be measured, in this case, the one in the lower right corner of the image. To zoom out, right-click or alt-click with the magnifying glass tool.
  • On the ImageJ toolbar select the segmented line tool (sixth tool from the left) to outline the DNA contour. The three tools on the right end of the toolbar are tool macros.
  • Use the segmented line tool to create a line selection that outlines the DNA contour. To finish outlining, right-click, double-click or click in the box at the starting point. The line selection can be adjusted by clicking and dragging the the tiny black and white “handles” along the outline.
  • Finally, use the Analyze/Measure command to measure the length of the DNA contour, in this case 181nm. Measurements can be transferred to a spreadsheet by right-clicking in the “Results” window, selecting “Copy All” from the popup menu, switching to the spreadsheet program, and then pasting.


Lysetska M, Knoll A, Boehringer D, Hey T, Krauss G, Krausch G UV light-damaged DNA and its interaction with human replication protein A: an atomic force microscopy study. Nucleic Acids Res (2002) pmid:12060686

This method is based, with permission, on an original protocol available here.