Name
flcc - calculate locally normalized cross-correlation function between a small template and a large image field
Usage
cc_map = flcc(template, mic)
Input
- template
- a template image, the image size is the size of window protein particles.
- mic
- a micrograph to be cross-correlated with the template
Output
- cc_map
- the locally normalized cross correlation function
Description
- The algorithm takes advantage of Fourier transformation to efficiently calculate locally normalized cross correlation function.
The fast local cross correlation function `C_L` is calculated as following:
`C_L(x)=1/Psum_(i=1)^Nfrac{(S_i-bar(S))M_i(T_(i+x)-bar(T))}{sigma_Ssigma_(MT)'
`bar(T) and `bar(S) are the means of the target image ( micrographs ), and search image(template), respectively. `sigma_S` and `sigma_(MT)(x)` are standard deviations of template under mask, and image, respectively. P is the non zero points in the mask image.
The template image ( search image) is easy to be normalized such that `bar(S)=0` and `sigma_S=1`. So, the cross correlation function can be simplied as:
`C_L(x)=1/(P sigma_(MT)(x)) sum_(i=1)^NS_iM_iT_(i+x)`
- Local average can be calcuated in real space as a convolution of a small mask image with the target image:
`Conv(x)=sum_(i=1)^NM_iT_(i-x)`
- In Fourier space, the convolution is equivalent to the multiplication of the two images:
`Conv(x)=F^(-1){F{M_i}F{T_i}}`
- Hence we can efficiently calculate local average and local variance of target image $T$.
`bar(T)(x)=1/P sum_(i=1)^NM_iT_(i-x)`
`sigma(x)_(MT)^2=1/P sum_{i=1}^NM_iT_(i-1)^2-bar(T)_M^2(x)`
Reference
A.M. Roseman, Particle finding in electron micrographs using a fast local correlation algorithm, Ultramicroscopy 94 (2003), pp. 225–236.
Author / Maintainer
Zhong Huang
Keywords
- category 1
- FUNDAMENTALS
- category 2
- FOURIER
Files
fundamentals.py
See also
Maturity
- stable
- works for most people, has been tested; test cases/examples available.
Bugs
None. It is perfect.