corr_scoring#

corr_scoring(template, template_filter, ft_target, inv_denominator, numerator, fast_shape, fast_ft_shape, rotations, callback, interpolation_order, template_mask=None)[source]#

Calculates a normalized cross-correlation between a target f and a template g.

\[(CC(f,g) - \text{numerator}) \cdot \text{inv_denominator},\]

where

\[CC(f,g) = \mathcal{F}^{-1}(\mathcal{F}(f) \cdot \mathcal{F}(g)^*).\]
Parameters:
templateUnion[Tuple[type, tuple of ints, type], BackendArray]

Template data buffer, its shape and datatype.

template_filterUnion[Tuple[type, tuple of ints, type], BackendArray]

Template filter data buffer, its shape and datatype.

ft_targetUnion[Tuple[type, tuple of ints, type], BackendArray]

Fourier transformed target data buffer, its shape and datatype.

inv_denominatorUnion[Tuple[type, tuple of ints, type], BackendArray]

Inverse denominator data buffer, its shape and datatype.

numeratorUnion[Tuple[type, tuple of ints, type], BackendArray]

Numerator data buffer, its shape, and its datatype.

fast_shape: tuple of ints

Data shape for the forward Fourier transform.

fast_ft_shape: tuple of ints

Data shape for the inverse Fourier transform.

rotationsBackendArray

Rotation matrices to be sampled (n, d, d).

callbackCallbackClass

A callable for processing the result of each rotation.

interpolation_orderint

Spline order for template rotations.

template_maskUnion[Tuple[type, tuple of ints, type], BackendArray], optional

Template mask data buffer, its shape and datatype, None by default.

Returns:
Optional[CallbackClass]

callback if provided otherwise None.