LabCanvas
Image analysisPublished Last updated

How to measure an angle in ImageJ: the Angle tool and line angles

Measure an angle in ImageJ with the Angle tool (three clicks, then M), or from two straight lines and their Angle column. Worked example and reflex angles.

ImageJ 1.54f measuring a 58 degree angle with the Angle tool on a synthetic bent rod: the three-point angle selection on the image and a Results table with Angle 10, 68 and 58
ImageJ 1.54f measuring a 58 degree angle with the Angle tool on a synthetic bent rod: the three-point angle selection on the image and a Results table with Angle 10, 68 and 58.
Contents

To measure an angle in ImageJ or Fiji, pick the Angle tool in the toolbar (the sixth button, right of the line tools), click a point on the first arm, click the vertex, click a point on the second arm, and press M (Analyze › Measure): the Results table's Angle column gives the angle at the vertex, 0 to 180°. For the angle of a single line, draw it with the Straight Line tool and press M: its Angle is measured from the horizontal, counter-clockwise. The angle between two lines that do not meet is the difference of their two Angle values.

Below: both methods on a worked example with a known answer, the reflex-angle option, how the line angle's sign works, angles of whole objects from Set Measurements, and where to go for contact angles.

How do I measure an angle with the Angle tool?

The Angle tool is part of ImageJ 1.x, so these steps work the same in plain ImageJ and in Fiji.

  1. Zoom in on the angle (the + key, or the magnifier), so you can place the points on the middle of each line.
  2. Pick the Angle tool: the toolbar button with two lines meeting at an angle, between the straight-line tool and the point tool.
  3. Click a point on the first arm. Further from the vertex is better: a one-pixel error at the end of a long arm changes the angle less than at the end of a short one.
  4. Click the vertex, where the two arms meet. This is the corner whose angle is measured.
  5. Click a point on the second arm. The selection finishes on this third click. While you draw, the status bar at the bottom of the ImageJ window shows the angle.
  6. Press M (Analyze › Measure). The Angle column gets the angle at the vertex in degrees, from 0 to 180.

To adjust the selection afterwards, drag any of its three handles and press M again. To keep it, add it to the ROI Manager (T, or Analyze › Tools › ROI Manager › Add) or to the overlay (Image › Overlay › Add Selection, Ctrl B).

ImageJ Angle tool selection on two bright bars meeting at a vertex, with the Results table listing Angle 10, 68 and 58
ImageJ 1.54f on a synthetic bent rod whose arms point at 10° and 68°. Rows 1 and 2: a straight line along each arm from the vertex Angle 10.000 and 68.000, Length 300 and 230 px. Row 3: the Angle tool through a point on each arm and the vertex: 58.000°.

The worked example

The image is synthetic, so the true answer is known: two bright bars leave a vertex at 10° and 68° from the horizontal, so the angle between them is 58°.

MeasurementToolAngle in the Results table
Arm 1, drawn from the vertex outwardsStraight Line, then M10.000
Arm 2, drawn from the vertex outwardsStraight Line, then M68.000
Angle at the vertexAngle tool, then M58.000

Both routes give 58.000° here (68 − 10 = 58), because the points were placed on the centre lines of the bars. On a real image, the angle you get depends on where you click: repeat the measurement a few times, or have someone else repeat it, and report the spread.

Reflex angles: more than 180°

The Angle tool always reports the smaller angle at the vertex, 0 to 180°. For the other side (the reflex angle), double-click the Angle tool and tick Measure reflex angle in the "Angle Tool" dialog. ImageJ then reports 360° minus the angle, both in the status bar and in the Results table: our 58° reads 302°. The setting stays on until you untick it, so check it before a session of measurements.

How do I measure the angle of a line, or between two lines?

Draw a line with the Straight Line tool and press M. The Results table gets the Length and the Angle. A straight line's Angle is:

  • measured from the horizontal, pointing right;
  • positive counter-clockwise (up), negative clockwise (down), from −180° to 180°;
  • dependent on the direction you drew the line: a line drawn from left to right and upwards at 30° reads 30; the same line drawn from right to left reads −150.

The angle between two lines, a1 and a2, that need not meet:

θ=|a1−a2|,and if θ>180°, θ=360°−θ

For lines without a direction (fibre axes, crystal edges, cell axes), the acute angle between them is the smaller of θ and 180°−θ. In our example, |10−68|=58°.

The Angle column for lines comes whatever you tick in Analyze › Set Measurements; ticking Area, Mean gray value and others adds the statistics of the pixels under the line beside it. Set the scale first if you also want the Length in µm or mm: how to set the scale in ImageJ.

Angles of whole objects: Set Measurements

For the orientation of particles, cells or fibres, you do not draw lines at all. Tick these in Analyze › Set Measurements and measure the outlines (or run Analyze › Analyze Particles on a thresholded image):

TickColumnWhat the angle is
Fit ellipseAngle (with Major and Minor)The angle of the long axis of the ellipse with the same area and second moments, from the horizontal, 0–180°
Feret's diameterFeretAngle (with Feret, MinFeret, FeretX, FeretY)The angle of the longest calliper line across the outline, 0–180°

Ellipse and line angles share the column name Angle, so keep particle orientations and hand-drawn line angles in separate Results tables. Feret diameter, circularity and solidity explains both shape measures with drawings.

For the orientation of a texture rather than separate objects (collagen fibres, actin, aligned nanowires), Fiji has the Directionality plugin, and OrientationJ comes with the BIG-EPFL update site; both give a distribution of orientations instead of one angle per object.

Contact angle of a drop

A contact angle is an Angle-tool measurement with one rule: the vertex is the contact point, where drop, solid and air meet; one arm runs along the baseline and the other along the tangent to the drop edge at that point. The tangent is the hard part. Our contact angle guide shows it step by step on a drop with a known 72° angle, compares it with the spherical-cap formula θ=2arctan⁡(2h/d), and covers the DropSnake and LB-ADSA plugins.

Pitfalls

  • Short arms. Click points far from the vertex: the error of a click is a smaller angle on a long arm.
  • A vertex in the wrong place. On a rounded corner the "vertex" is a matter of choice; say how you chose it, or measure two straight lines along the straight parts instead.
  • Mixed line directions. Lines drawn in both directions give Angle values 180° apart. Draw them all the same way, or fold the values.
  • The reflex option left on. Measure reflex angle stays ticked between sessions; a column of 300-odd degrees is the sign.
  • A projection. An angle in a 2D image is the angle of the projection; a structure tilted out of the image plane shows a different angle than it has.
  • One measurement. Repeat it, ideally by someone who does not know the condition, and report mean ± SD.

Reporting it

A methods sentence to copy:

Angles were measured in [Fiji (ImageJ 1.54f)] with the Angle tool [at the vertex formed by …], [three] times per [structure] by an observer blinded to the condition, and are given as mean ± SD of [n] [structures] from [n] images.

In LabCanvas: line angles, orientation and contact angle

LabCanvas Image Analysis runs in the browser with nothing to install. It has no three-click Angle selection, but it covers the same jobs another way:

  1. Line angles: draw with the Line tool and click Measure in the Measure tab: each line gets Length and Angle with ImageJ's convention (from the horizontal, counter-clockwise), so the angle between two lines is the difference, as above.
  2. Contact angle: the Contact angle (sessile drop) assay finds the drop outline and the baseline and gives the left, right and mean angles from several fits, with no tangent to draw by hand.
  3. Orientation: the Orientation and directionality assay gives the orientation distribution, dominant direction and coherency of fibres and textures, as OrientationJ does.
  4. Fit ellipse and Feret's diameter in Set measurements give Angle and FeretAngle per region, as in ImageJ.

Results go to Send to Graphs or Copy; measuring is free with a LabCanvas account (downloading files is part of LabCanvas Pro), and the measurements are checked in more than 8,900 automated tests. For a true three-point angle, use the ImageJ Angle tool as above. ImageJ and Fiji are independent open-source projects; LabCanvas is not affiliated with them.

References

  • Schneider CA, Rasband WS, Eliceiri KW (2012). NIH Image to ImageJ: 25 years of image analysis. Nature Methods 9, 671–675. doi:10.1038/nmeth.2089
  • Schindelin J, Arganda-Carreras I, Frise E, et al. (2012). Fiji: an open-source platform for biological-image analysis. Nature Methods 9, 676–682. doi:10.1038/nmeth.2019

Frequently asked questions

How do I measure an angle in ImageJ?

Pick the Angle tool (the toolbar button with an angle drawn on it, to the right of the line tools). Click a point on the first arm, click the vertex, then click a point on the second arm; the selection finishes on the third click. Press M (Analyze › Measure) and the Results table shows the angle at the vertex in degrees, from 0 to 180.

Where is the Angle tool in Fiji?

In the same place as in ImageJ: the sixth button of the toolbar, right of the straight-line tool and left of the point tool. Its icon is two lines meeting at an angle. Fiji uses the ImageJ 1.x toolbar, so the tool works the same in both.

How do I measure the angle between two lines in ImageJ?

If the lines meet, use the Angle tool on them. If they do not, draw each with the Straight Line tool and press M after each: the Angle column gives each line’s angle from the horizontal, counter-clockwise. The angle between them is the difference; if it is more than 180°, take 360° minus it, and for two lines without a direction the acute angle is the smaller of that and 180° minus it.

How do I get the reflex angle (more than 180°) in ImageJ?

Double-click the Angle tool and tick Measure reflex angle. ImageJ then reports 360° minus the angle at the vertex, so our 58° example reads 302°. Untick it to go back.

Why does ImageJ give a negative angle for my line?

A straight line’s Angle is measured from the horizontal, counter-clockwise, with up as positive, and it depends on the direction you drew the line: from −180° to 180°. A line drawn down to the right reads negative; the same line drawn the other way reads 180° more. Draw all lines in the same direction, or fold the values into 0–180°.

How do I measure the orientation of many particles?

Threshold the image, tick Fit ellipse (and Feret’s diameter) in Analyze › Set Measurements, and run Analyze › Analyze Particles. Every particle gets an Angle (the angle of the fitted ellipse’s long axis from the horizontal, 0–180°) and a FeretAngle (the angle of its longest calliper line).

measure angle ImageJImageJ angle toolangle between two lines ImageJFiji anglereflex angleline angleSet Measurementsorientationcontact angle

Try it in LabCanvas

Every app is free to start in your browser. Create an account and begin.

Start Image Analysis free in your browser