# Correlation Maps

The module CorrelationFunctions.Map contains functions which calculate correlation maps, i.e. correlation functions over all possible directions with all possible correlation lengths.

## Functions

The following correlation functions are supported:

• Two point $S_2$ function.
• Cluster $C_2$ function.
• Surface-surface $F_{ss}$ function.
• Surface-void $F_{sv}$ function.
CorrelationFunctions.Map.c2Function
c2(image, phase; periodic = false)

Calculate $C_2$ (cluster) correlation function for the phase phase in an N-dimensional image.

Examples

julia> c2([1 0; 0 1], 1; periodic=true)
2×2 Matrix{Float64}:
0.5  0.0
0.0  0.0
CorrelationFunctions.Map.s2Function
s2(image; periodic = false)

Calculate $S_2$ (two point) correlation function for the binary image image.

s2(image, phase; periodic = false)

Calculate $S_2$ (two point) correlation function for the phase phase in an N-dimensional image.

Examples

julia> s2([1 0; 0 1], 1; periodic=true)
2×2 Matrix{Float64}:
0.5  0.0
0.0  0.5
CorrelationFunctions.Map.cross_correlationFunction
cross_correlation(image1, image2; periodic = false)

Calculate cross-correlation function between binary images image1 and image2.

cross_correlation(image, p1, p2; periodic = false)

Calculate cross-correlation function between phases p1 and p2 in an N-dimensional image.

Examples

julia> cross_correlation([1 0; 0 1], 1, 0; periodic=true)
2×2 Matrix{Float64}:
0.0  0.5
0.5  0.0
CorrelationFunctions.Map.surf2Function
surf2(image, phase; periodic = false, filter)

Calculate $F_{ss}$ (surface-surface) correlation function for phase phase on N-dimensional image.

Examples

julia> surf2([1 0; 0 1], 1; periodic=true)
2×2 Matrix{Float64}:
0.125  0.125
0.125  0.125

See also: Utilities.AbstractKernel

CorrelationFunctions.Map.surfvoidFunction
surfvoid(image, phase; periodic = false, filter)

Calculate $F_{sv}$ (surface-void) correlation function for phase phase on N-dimensional image. Phase 0 is considered to be void.

Examples

julia> surfvoid([1 0; 0 1], 1; periodic=true)
2×2 Matrix{Float64}:
0.5  0.5
0.5  0.5

See also: Utilities.AbstractKernel

CorrelationFunctions.Map.average_directionsFunction
average_directions(cfmap; len = (cfmap |> size |> minimum) ÷ 2)

Average correlation map cfmap over all directions. The result is a vector of length len with indices being equal to correlation length + 1.

You can use usual arrays (of type Array) or CUDA arrays for these functions.