## CG SYM - Find center of Object - Quasi-symmetry Approximation ||

(3/30/12)

PURPOSE

Compute center of object in an image (not volume) using cross-correlation between original image and the image after a 180-degree rotation. Coordinates are listed with respect to the SPIDER image center: (NX/2 + 1, NY/2 + 1).   Example.

 CG [Center of Gravity] CG PH [Center of Gravity - Phase approximation ||] SH [Shift - using bilinear/trilinear interpolation ||] SH F [Shift - using Fourier interpolation ||] CENT PH [Center image/volume using phase approximation]

USAGE

.OPERATION: CG SYM [xi],[yi],[xr],[yr]
[This operation can return up to four optional register variables:

 Variable Example Receives First [xi] Integer approximation of X center of gravity Second [yi] Integer approximation of Y center of gravity Third [xr] Sub-pixel X center of gravity Fourth [yr] Sub-pixel Y center of gravity

.INPUT FILE: IMG001
[Enter name of image.]

NOTES

1. Register variables [xi],[yi] receive integer approximations of the offset from the quasi-symmetry center. Registers [xr],[yr] receive sub-pixel coordinates of the offset from the quasi-symmetry center. To place the center of quasi-symmetry at the image center one has to use the 'SH' operation and reverse the signs of the shifts.

2. Implemented by G.Kishchenko.

3. The operation is noise- and fool-proof. It's based on two-fold quasi-symmetry of objects. This operation usually produces results similar to operation 'CG PH', but it is preferred, since it does not report incorrect center for dumbbell-shaped objects.

4. The estimation of center of quasi-symmetry in this algorithm is based on cross-correlation between original image and the image after a 180-degree rotation, implemented as follows:
i) The 2D Fourier transform of original image is computed.
ii) The square of a complex number in each point of 2D Fourier transform is computed. (Notes: it's an equivalent of multiplication of Fourier transform of original image and complex conjugate of image after a 180-degree rotation, because conjugate of image after a 180-degree rotation is equal to Fourier transform of original image.)
iii) The reversed 2D Fourier transform is computed to obtain 2D cross-correlation function. This is based on cross-correlation theorem that states that the Fourier transform of the cross-correlation of two functions is equal to the product of multiplication of the individual Fourier transforms, where one of them has been complex conjugated.
iv) The X,Y-coordinates corresponding to maximum of correlation function are divided by 2 to obtain the center of object.

SUBROUTINES

FINDCENT, CENT_SYM

CALLER

UTIL1