# Alignment

This logic determines the best alignment for all the input images against a set of given 2D references in an exhaustive manner and writes them in an AliInfoIO. Alignment is typically the prerequisite for all averaging procedures.

The user has to prepare a set of images for the alignment typically by filtering and normalizing the images and a set of 2D references coming either from a projection logic or a previous classification. The logic will transform all images in polar coordinates and than exhaustively compare all images with all references in all possible rotation and shift combination using the Cross correlation coefficient as means of comparision. The best fitting parameters for every combination of images and references are written in the output. They can be applied using the AlignmentApply logic.

Parameters Description
Accuracy angular accuracy of Aliinfo parameter saved. ONE: only the best correlating reference in the best fitting orientation is saved. Low: Shift, rotation and correlation values are saved for every reference on a 12° grid. Medium: Shift, rotation and correlation values are saved for every reference on a 6° grid. HIGH: Shift, rotation and correlation values are saved for every reference on a 3° grid.
Correlation Function Correlation Function used for comparing two images. CCF: Cross correlation Function. MCF:Mutual correlation function.
Coarse factor Coarses images by the given factor prior to alignment to speed up calculations
Extra options Determines the search space for the alignment. None: all possible combinations are searched Maximum: searches around the maximum of the last alignment cycle in a given angular distance. CORRIMS: Searches around all high peaks of the last alignment round.
Fraction determines the maximum applicable shift between image and reference as fraction of the image size
Interpolation methode pixels have to be interpolated during shifting and rotation of the images. This determines the mode of action. *Neighbour*: Gives the value of the nearest full pixel to the interpolated pixel. Linear: Interpolates linearly to the neighbouring pixels. Cubic: Interpolates cubicly to the neighbouring pixels.
Lower Angle bound determines the maximum applicable rotation between image and reference
Radius in Pixel Radius of the Particle in pixel or as fraction of the image size. Everything within this radius is transformed to polar coordinates
With reflection Adds mirror images of all references to the search space. This is useful when using class averages as references,
Sampling This determines how exact the polar transformation will be. A value around 4 shows good results. A value greater as 6.28 is senseless.
Step size Step size of shift search in pixel
Upper Angle bound determines the maximum applicable rotation between image and reference
Input Description
Images stack of 2D images to be aligned
References stack of 2D references, need to have the same size as the images
Output Description
Aliinfo parameter file containing the shift and rotation coordinates for different combinations of reference and image encoded as pixel values. These parameters can be applied to the original infos using AlignmentApply

This logic performs an exhaustive alignment in polar coordinates as described in: http://www.sciencedirect.com/science/article/pii/S1047847703001436?via%3Dihub