[Shift - using bilinear/trilinear interpolation ||]
USAGE
.OPERATION: CG PH [x],[y],[xr],[yr]
or:
CG PH [x],[y],[z],[xr],[yr],[zr]
.INPUT FILE: FIL001
[Enter name of image/volume.]
NOTES
Register variables [x],[y], (and [z] in 3-D case) receive
integer approximations of the center of gravity coordinates.
Registers [xr],[yr], (and [zr] in 3-D case) receive real
number coordinates of the center of gravity.
Coordinates are given in the X, Y, Z order.
To place the center of gravity at the origin one has to
use the 'SH' operation and reverse the signs of the
shifts.
Implemented by P. Penczek.
This operation sometimes reports incorrect center (at the
upper left corner) for dumbbell shaped objects. The
error is sporadic even given the same input file. The
implementor states: 'The code is correct. The operation is
not foolproof; it sometimes fails'. To overcome this
problem we now recommend (2012) you use
'CG SYM instead.
The estimation of center of gravity in this algorithm is based
on phase approximation as following:
i) The projections of image densities onto X and Y axes
are computed.
ii) First order 1D Fourier Transforms of each projection
are computed.
iii) The maxima of first order harmonics on X and Y axes are
taken as the coordinates of center.
Beware - negative images can generate systematic
artifactual shift equal to half-size of image.
Dumbbell-shaped figures also produce the same artifact.