Name

cog = Computes integer shift of the coordinates of center of gravity with respect to the image center at (nx/2,ny/2,nz/2), and the radius of gyration of an image with respect to the image center at (nx/2,ny/2,nz/2).

Usage

usage in command line

s= image.cog()

usage in python programming

s= center_of_gravity(image)

Input

EMData
1-2-3D image for which the center of gravity and radius of gyration needs to be calculated.

Output

s
Returns a list containing both the actual and the integer shift of the coordinates of the center of gravity from the image center and the radius of gyration.
  • List contains
    • s[0]-[actual shift of the coordinates of the center of gravity in x-direction from the image center]
    • s[1]-[actual shift of the coordinates of the center of gravity in y-direction from the image center] (only if an image is 2-D or 3-D)
    • s[2]-[actual shift of the coordinates of the center of gravity in z-direction from the image center] (only if an image is 3-D)
    • s[3]-[radius of gyration]
    • s[4]-[the x-direction shift of the coordinates of the center of gravity,rounded to the nearest integer (i.e) round(s[0])]
    • s[5]-[the y-direction shift of the coordinates of the center of gravity,rounded to the nearest integer (i.e) round(s[0])] (only for 2-3-D images)
    • s[6]-[the z-direction shift of the coordinates of the center of gravity,rounded to the nearest integer (i.e) round(s[0])] (only for 3-D images)

Description

cog() calculates the center of gravity and radius of gyration of 1-2-3D image and returns them to a list.

Author / Maintainer

Bharath K Narayanan

Keywords

category 1
FUNDAMENTALS
category 2
SPATIAL

Files

statistics.py

See also

phase_cog

Maturity

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

Bugs

None. It is perfect.

cog (last edited 2013-07-01 13:12:53 by localhost)