# Name

phase_cog - Computes the shift of the coordinates of the center of gravity with respect to the image center (nx/2,ny/2,nz/2) using phase approximation. The operation works for all 1-2-3D image.

# Usage

*usage in command line*

s= image.phase_cog()

*usage in python programming*

s= center_of_gravity_phase(image)

## Input

- image
- 1-2-3D image for which the center of gravity needs to be calculated using phase approximation.

## Output

- s
- Returns a list containing the shift of the coordinates of the center of gravity from the image center.
- 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 the 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 the image is 3-D)
- s[3]-[the x-direction shift of the coordinates of the center of gravity, rounded to the nearest integer (i.e) round(s[0])]
- s[4]-[the y-direction shift of the coordinates of the center of gravity, rounded to the nearest integer (i.e) round(s[1])] (only for 2-D or 3-D images)
- s[5]-[the z-direction shift of the coordinates of the center of gravity, rounded to the nearest integer (i.e) round(s[2])] (only for 3-D images)

- List contains:

# Description

The operation works for all 1-2-3D images.

# Author / Maintainer

Bharath K Narayanan

# Keywords

- category 1
- FUNDAMENTALS
- category 2
- SPATIAL

# Files

statistics.py

# See also

# Maturity

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

# Bugs

None. It is perfect.