Chord Length Distribution from Binary 2D Images

version (511 KB) by M. Ryan MacIver
Measure the chord length distribution of two phases in binary images


Updated 2 Nov 2017

View License

A chord is a line segment with every point in one of the two phases, and with its end points on the interface between the two phases [1]. Randomly oriented lines can be laid across each image, and the segments with uninterrupted intersections with either of two phases, p1 or p2, are tabulated. If you use this file in your research or for publication, please cite reference [2] below.
There are two considerations for this implementation:
1. Some directional anisotropy may be introduced by the method (randi) used to generate random lines.
2. Technically, chords touching the edge of the images should be removed; but I left them in to permit display of both phases from the sample images.

[1] S. Torquato, 1993, J. Chem. Phys. 98, 6472.
[2] MacIver, M.R., Pawlik, M. 2017 Chem. Eng. Technol. 1–10, DOI:10.1002/ceat.201600523.

Cite As

M. Ryan MacIver (2022). Chord Length Distribution from Binary 2D Images (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2016a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired by: geom2d, Bresenham optimized for Matlab

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!