## CC - Cross Correlation ||

(02/24/03)

PURPOSE

Computes the cross-correlation function of two images/volumes by using the Fourier transform relationship. The dimensions of the two pictures must be the same.   Example.

 CC N [Cross Correlation - Normalized ||] CN [Convolution ||] CN N [Convolution - Normalized ||] AC [Auto Correlation ||] AC N [Auto Correlation - Normalized ||] CC C [Cross Correlation Coefficient] FT [Fourier Transform ||]

USAGE

.OPERATION: CC

.INPUT FILE: PIC001
[Enter the name of the first picture. (Header positions from this file are transferred to output.)]

.REFER FILE: REF001
[Enter the name of the second picture, which is used as the reference.]

.OUTPUT FILE: CCF001
[Enter name of the file which will contain cross-correlation coefficients. It can be the same as the input file. In this case INPUT FILE will be replaced by the cross correlation.]

NOTES

1. The type of the input data can be real or Fourier in any mixed form.

2. The cross-correlation data are not scaled. (If values are very, very large then maybe you should reduce the FMAX of the input files first?)

3. The origin of the CCF is at (NX/2 + 1, NY/2 + 1, NZ/2 + 1).

4. The CCF contains artifacts from wraparound overlaps implicit in the Fourier computation. However, the CCF is artifact-free within
-L <= K <= +L
-M <= I <= +M
if the pictures are surrounded by frames containing the average, where the frame width is M/2 and the frame height is L/2. This can be achieved by use of the 'PD' operation.
The complete artifact-free CCF is obtained for the widths M=NY/2, L=NX/2. In this case, the padded pictures are just twice as large in each dimension as the original pictures.

5. The use of 'CC' with identical input and reference files is equivalent to the 'AC' (Auto-Correlation) operation. The input sequence:
CC
PIC001
PIC001
has the same effect as:
AC
PIC001

6. If the data cannot fit into the memory, use the 'FT' and 'MU' commands to calculate the CCF:
FT
INPUT1
FOUR1

FT
INPUT2
FOUR2

MU M
FOUR1
FOUR2

FT
FOUR2
CCF12
WARNING: The origin of CCF12 calculated in this way is in (1,1,1).

SUBROUTINES

FMRS_2, FMRS_1, FMRS_3, CCRS, CCRD_2, CCRD_3

CALLER

CORR1