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 . 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  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.
 S. Torquato, 1993, J. Chem. Phys. 98, 6472.
 MacIver, M.R., Pawlik, M. 2017 Chem. Eng. Technol. 1–10, DOI:10.1002/ceat.201600523.
M. Ryan MacIver (2021). Chord Length Distribution from Binary 2D Images (https://www.mathworks.com/matlabcentral/fileexchange/64909-chord-length-distribution-from-binary-2d-images), MATLAB Central File Exchange. Retrieved .
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!