FLC#
- class FLC(target, template, template_mask=None, target_mask=None, pad_target_edges=False, pad_fourier=False, rotate_mask=True, interpolation_order=1, negate_score=True, **kwargs)[source]#
Bases:
_MatchDensityToDensity
Computes a normalized cross-correlation score of a target f a template g and a mask m:
\[\frac{CC(f, \frac{g*m - \overline{g*m}}{\sigma_{g*m}})} {N_m * \sqrt{ \frac{CC(f^2, m)}{N_m} - (\frac{CC(f, m)}{N_m})^2} }\]Where:
\[CC(f,g) = \mathcal{F}^{-1}(\mathcal{F}(f) \cdot \mathcal{F}(g)^*)\]and Nm is the number of voxels within the template mask m.
- Parameters:
- targetarray_like
The target density array.
- templatearray_like
The template density array.
- template_maskarray_like, optional
Mask array for the template density.
- target_maskarray_like, optional
Mask array for the target density.
- pad_target_edgesbool, optional
Whether to pad the edges of the target density array. Default is False.
- pad_fourierbool, optional
Whether to pad the Fourier transform of the target and template densities.
- rotate_maskbool, optional
Whether to rotate the mask arrays along with the densities. Default is True.
- interpolation_orderint, optional
The interpolation order for rigid transforms. Default is 1.
- negate_scorebool, optional
Whether the final score should be multiplied by negative one. Default is True.
- **kwargsDict, optional
Keyword arguments propagated to downstream functions.
Methods
FLC.rotate_array
(arr, rotation_matrix, ...)FLC.score
(x)Compute the matching score for the given transformation parameters.
Computes the score after a given rotation.
Computes the score after a given translation.