**PURPOSE**- Computes the phase cross-correlation function of two images/volumes using the Fourier transform relationship. The dimensions of the two images/volumes must be the same. WARNING: This operation is expected to fail if there are Fourier coefficients of zero! Example.

**SEE ALSO****CC**[Cross Correlation ||] **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 H

- .INPUT FILE: PIC001

[Enter the name of the first image/volume.].REFERENCE FILE: REF001

[Enter the name of the second image/volume, which is used as the reference.].OUTPUT FILE: CCF001

[Enter name for file which will contain phase 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**

- The input data can be real or Fourier in any
mixed form.
- 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?)
- The origin of the CCF is at (NX/2 + 1, NY/2 + 1 , NZ/2 + 1).
- 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 images 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. - The phase correlation is calculated as follows in FORTRAN:
CTEMP = X(I,J) * CONJG(Y(I,J)) * CMPLX(COS(ARG),SIN(ARG))

O(I,J) = CTEMP / (SQRT(REAL(CTEMP)**2 + AIMAG(CTEMP)**2))

- While using phase correlation beware of artifacts that may appear from harmonics with small amplitude - near zero harmonics have phase undefined. Noise can become a serious problem, even making the result completely useless.

**SUBROUTINES**- FMRS_2, FMRS_2R, FMRS_1, FMRS_3, FMRS_3R, CCRS_2, CCRD_2, CCRS_PH_3, CCRD_3

**CALLER**- CORR1

© Copyright Notice / Enquiries: spiderem.software@gmail.com