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.c2
— Functionc2(image, phase; mode = NonPeriodic())
Calculate $C_2$ (cluster) correlation function for the phase phase
in an N-dimensional image.
Examples
julia> c2([1 0; 0 1], 1; mode = Periodic())
2×2 Matrix{Float64}:
0.5 0.0
0.0 0.0
CorrelationFunctions.Map.s2
— Functions2(image; mode = NonPeriodic())
Calculate $S_2$ (two point) correlation function for the binary image image
.
s2(image, phase; mode = NonPeriodic())
Calculate $S_2$ (two point) correlation function for the phase phase
in an N-dimensional image.
Examples
julia> s2([1 0; 0 1], 1; mode = Periodic())
2×2 Matrix{Float64}:
0.5 0.0
0.0 0.5
CorrelationFunctions.Map.cross_correlation
— Functioncross_correlation(image1, image2; mode = NonPeriodic())
Calculate cross-correlation function between binary images image1
and image2
.
cross_correlation(image, p1, p2; mode = NonPeriodic)
Calculate cross-correlation function between phases p1
and p2
in an N-dimensional image.
Examples
julia> cross_correlation([1 0; 0 1], 1, 0; mode = Periodic())
2×2 Matrix{Float64}:
0.0 0.5
0.5 0.0
CorrelationFunctions.Map.surf2
— Functionsurf2(image, phase; mode = NonPeriodic(), filter)
Calculate $F_{ss}$ (surface-surface) correlation function for phase phase
on N-dimensional image.
Examples
julia> surf2([1 0; 0 1], 1; mode = Periodic())
2×2 Matrix{Float64}:
0.125 0.125
0.125 0.125
See also: Utilities.AbstractKernel
CorrelationFunctions.Map.surfvoid
— Functionsurfvoid(image, phase; mode = NonPeriodic(), 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; mode = Periodic())
2×2 Matrix{Float64}:
0.5 0.5
0.5 0.5
See also: Utilities.AbstractKernel
CorrelationFunctions.Map.average_directions
— Functionaverage_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.
CorrelationFunctions.Map.dir_from_map
— Functiondir_from_map(m, dir)
Extract a direction from a correlation map. direction
must be of type AbstractDirection
.
See also: Utilities.AbstractDirection
.
You can use usual arrays (of type Array
) or CUDA arrays for these functions.