lineal_path_distribution(im, bins=25, voxel_size=1, log=False)[source]

Determines the probability that a point lies within a certain distance of the opposite phase along a specified direction

This relates directly the radial density function defined by Torquato [1], but instead of reporting the probability of lying within a stated distance to the nearest solid in any direciton, it considers only linear distances along orthogonal directions.The benefit of this is that anisotropy can be detected in materials by performing the analysis in multiple orthogonal directions.

  • im (ND-array) – An image with each voxel containing the distance to the nearest solid along a linear path, as produced by distance_transform_lin.

  • bins (int or array_like) – The number of bins or a list of specific bins to use

  • voxel_size (scalar) – The side length of a voxel. This is used to scale the chord lengths into real units. Note this is applied after the binning, so bins, if supplied, should be in terms of voxels, not length units.

  • log (boolean) – If True (default) the size data is converted to log (base-10) values before processing. This can help to plot wide size distributions or to better visualize the in the small size region. Note that you should not anti-log the radii values in the retunred tuple, since the binning is performed on the logged radii values.



L or LogL

Length, equivalent to bin_centers


Probability density function


Cumulative density function


Relative frequency chords in each bin. The sum of all bin heights is 1.0. For the cumulative relativce, use cdf which is already normalized to 1.


The center point of each bin


Locations of bin divisions, including 1 more value than the number of bins


Useful for passing to the width argument of

Return type



[1] Torquato, S. Random Heterogeneous Materials: Mircostructure and Macroscopic Properties. Springer, New York (2002)


Click here to view online example.