# Name

scfp - calculate the self-correlation function of an image using padding with zeroes and multiplication in Fourier space.

# Usage

output = scfp(image, center=True)

## Input

- image
- input image (real)
- center
- if set to True (default), the origin of the result is at the center; if set to False, the origin is at (0,0), the option is much faster, but the result is difficult to use

## Output

- output
- self-correlation function of the input image. Real. The origin of the self-correlation function (term ccf(0,0,0)) is located at (int[n/2], int[n/2], int[n/2]) in 3D, (int[n/2], int[n/2]) in 2D, and at int[n/2] in 1D.

# Method

Calculation of the circulant self-correlation function of an image

*f*is performed first by padding with zeroes to twice the size in real space, next by calculating Fourier transform of the image, then the modulus in Fourier space as``|hat(f)|``, then the inverse Fourier transform, and finally the*scfp*is windowed out using the size of original images.

- This expression does not have any corresponding expression in real space - it can be considered to be adaptive filtration.
Note:

*scfp*is free from "wrap around" artifacts, although coefficients with large*lag n*have large error (statistical uncertainty).

# Reference

van Heel, M., Schatz, M., Orlova, E., 1992. Correlation functions revisited. Ultramicroscopy 46, 307-316.

# Author / Maintainer

Pawel A. Penczek

# Keywords

- category 1
- FUNDAMENTALS
- category 2
- FOURIER

# Files

fundamentals.py

# Maturity

- stable
- works for most people, has been tested; test cases/examples available.

# Bugs

None. It is perfect.