find_image_center_by_symmetry

This module’s scope is the method of finding the image center exploiting its symmetry. Therefore its applicability is limited to highly symmetric images.

Example:

>>> import tuna
>>> barycenter = tuna.io.read ( "tuna/test/unit/unit_io/G094_03_wrapped_phase_map.fits" )
>>> tuna.tools.phase_map.find_image_center_by_symmetry ( data = barycenter.array )
(219, 256)
tuna.tools.phase_map.find_image_center_by_symmetry.find_image_center_by_symmetry(data=<class 'numpy.ndarray'>)[source]

This function’s goal is to conveniently wrap the search for the center of the input image.

Parameters:

  • data : numpy.ndarray

    Should receive the data where a highly symmetric image can be found.

Returns:

  • iit_center : tuple of 2 integers

    Containing the column and row of the found center.

class tuna.tools.phase_map.find_image_center_by_symmetry.image_center_by_symmetry(array=<class 'numpy.ndarray'>)[source]

This class responsibility is to find the center of an image by finding the row and the column that split the image with the highest degree of symmetry.

If a cube is received, it will use the first plane as its input.

Its constructor signature is:

Parameters:

  • array : numpy.ndarray

    Containing the image whose center we intend to find.

find_center()[source]

This method’s goal is to find the center of the image, by splitting the image into same-sized chunks, where the relative distances to the center are the same. The center will have circular symmetry, and therefore these chunks will be very similar.

get_center()[source]

This method’s goal is to access the center coordinates. Will trigger a find if the center is yet unknown.

Returns:

  • unnamed variable : tuple of 2 integers

    Containing the column and row indexes for the center.