- two_point_correlation(im, voxel_size=1, bins=100)#
Calculate the two-point correlation function using Fourier transforms
im (ndarray) – The image of the void space on which the 2-point correlation is desired, in which the phase of interest is labelled as True
voxel_size (scalar) – The size of a voxel side in preferred units. The default is 1, so the user can apply the scaling to the returned results after the fact.
bins (scalar or array_like) – Either an array of bin sizes to use, or the number of bins that should be automatically generated that span the data range. The maximum value of the bins, if passed as an array, cannot exceed the distance from the center of the image to the corner.
result – The two-point correlation function object, with named attributes:
The distance between two points, equivalent to bin_centers
The center point of each bin. See distance
Locations of bin divisions, including 1 more value than the number of bins
Useful for passing to the
The probability that two points of the stated separation distance are within the same phase normalized to 1 at r = 0
- probability or pdf
The probability that two points of the stated separation distance are within the same phase scaled to the phase fraction at r = 0
- Return type:
The fourier transform approach utilizes the fact that the autocorrelation function is the inverse FT of the power spectrum density. For background read the Scipy fftpack docs and for a good explanation see this thesis.
Click here to view online example.