ALIGN2D

Overview

ALIGN2D aligns a tilt series without the need for explicit fiduciary markers (i.e. gold beads). Depending on the setting for the Method parameter, ALIGN2D use one or both of the following to determine the alignment parameters:

  1. Determine the translations using an FFT-based calculation of the cross-correlations.
  2. Refine translation, rotation, magnification, and tilt axis position using a simplex minimization algorithm on the cross-correlation values.

Alternatively, ALIGN2D can try to extract the alignment information from the extended header of the tilt series. If that information is not available, it will then use the methods listed above to calculate the alignment parameters. This alternative mechanism is used for rough alignment of the tilt series; see the "Use header" topic for more details.

Below is an example command line for ALIGN2D. It takes the tilt series test.stk and MASSNORM-generated parameters in test.bprmMn and updates the parameters in test.bprmMn with the calculated alignment values. It uses the combined method, FFT and simplex minimization, (-imod=0). The diagnostic image outputs, stretched/filtered tilt series and cross-correlation results, are not generated (-ofile=none -cor_out=none).

    align_2d_p test.stk -iprmfile=test.bprmMn -oprmfile=test.bprmMn \
        -imod=0 -ofile=none -cor_out=none

Parameters

Tilt series | NX:NY:NV | Input alignment | Output alignment | Use header | Axis orientation | Reverse tilt axis | Stretched series | Cross correlations | X-cor table | Section range | Wiener coefficient | Center peak distance | 2nd peak threshold | Tilt offset | Method | Stretch | Filter | Phase weighting | Simplex deviations | Resolution | Full size | Resolution scale

Related Priism Topics

Priism | Alignment and reconstruction | Mass normalization | Alignment with markers


Tilt Series

In the graphical user interface, the "Tilt series" field holds the name of the file containing the unaligned tilt series data. On the command line, pass the name of the unaligned tilt series file as the first argument.

Return to the list of parameters


NX:NY:NV

In the graphical user interface, the "NX:NY:NV" field displays the dimensions of unaligned tilt series. The first value in the field is the number of pixels in the x dimension, the second value in the field is the number of pixels in the y dimension, and the third value is the number of projections.

Return to the list of parameters


Input Alignment

In the graphical user interface, the "Input alignment" field holds the name of the input alignment parameter file. Normally you would use none or the name of a parameter file generated by MASSNORM. On the command line, specify the name of the input parameter file with the option

    -iprmfile=file_name

If you do not specify an input parameter file, ALIGN2D assumes that no input parameter file is available.

Return to the list of parameters


Output Alignment

In the graphical user interface, the "Output alignment" field is the name of the output alignment parameter file that ALIGN2D will generate. On the command-line, specify the name of the output parameter file with the option

    -oprmfile=file_name

If you do not supply the name of an output parameter file or specify the name as none, ALIGN2D will not write out a separate file with the alignment parameter results (those results are still written to ALIGN2D's log output). The name of the output parameter file may be the same as that for the input parameter file: ALIGN2D will update the geometric alignment parameters in the file and leave the mass normalization values intact.

Return to the list of parameters


Use Header

When invoked with the -header command-line option, ALIGN2D will first try to extract the alignment information from the extended header of the tilt series; if that fails, it will then calculate the alignment using the normal methods. The "Rough Alignment" stage in EMTAR will invoke ALIGN2D with the -header option when the "Use header" toggle button is on. It also passes ALIGN2D an -imod=1 option to force use of the FFT-based cross-correlation alignment.

Currently, the option to extract the alignment information from the extended header expects the header format as generated by the UCSF Tomography data collection software (32 floating-point entries per section with the x shift in pixels as the sixth entry, the y shift in pixels as the seventh entry, and the orientation of the tilt axis in degrees as the eleventh entry). ALIGN2D assumes that sections with an x and y shift of zero served as reference points. If there are more than two reference points or two reference points which are not adjacent, ALIGN2D will not attempt to use the information in the extended header. If there are two reference points, ALIGN2D will use the FFT-based cross correlation method to align them to each other. That process is affected by the center peak distance, second peak threshold, stretching, phase weighting, and Wiener coefficient parameters.

Return to the list of parameters


Axis

You can use the "Axis orientation" field to specify the angle, in degrees, that the tilt axis makes with the vertical axis of the images as displayed in Priism. If the angle is positive, the images have to be rotated clockwise to make the tilt axis vertical. If you supply an input parameter file or extract the alignment from the extended header of the tilt series, turn on the "overwrite input" toggle button adjacent to the "Axis orientation" field to force the axis orientation you entered to have precedence over those other sources.

On the command line, specify the orientation angle for the tilt axis with the option

    -axis=angle_value

The command-line option to override the tilt axis orientation in the input parameter file or the extended header of the tilt series is

    -overwrite_axis

When the axis orientation is not set from another source, ALIGN2D assumes the tilt axis is parallel to the vertical axis.

Return to the list of parameters


Stretched Series

When the alignment is not derived from the extended header of the tilt series, ALIGN2D can write out the images after filtering, stretching, and apodization. If you want to see those images, enter the desired file name in the "Stretched series" field of the graphical user interface (it is in the special parameters dialog) or by using

    -ofile=file_name

on the command line. If the name of the file is none or is not specified, ALIGN2D will not write the images after filtering, stretching, and apodization.

Return to the list of parameters


Cross Correlations

If you use the FFT-based cross-correlation calculation (either alone or in conjunction with the simplex minimization), ALIGN2D can write out the intermediate cross-correlation images for use in debugging or diagnosing problems. If the file name supplied in the graphical user interface's "Cross correlations" field or by the command-line's

    -cor_out=file_name

option is not none, then ALIGN2D will write the cross-correlation images to that file.

Return to the list of parameters


X-cor Table

If you enter a name other than "none" in the "X-cor Table" field, ALIGN2D will generate a text file with that name. The file will contain a table where each line has a section number, the corresponding tilt angle, and one minus the cross-correlation value between that section's image (corrected for the determined alignment parameters) and the adjacent section's image. To set the file name for the table on the command line, use

    -plotfile=name

Return to the list of parameters


Reverse Tilt Axis

ALIGN2D can add 180 degrees to the input rotation parameters (which set the tilt axis orientation) regardless of the source for those parameters (the extended header, input alignment parameter file, or the axis parameter). The usual reason for doing so would be to match your experimental conditions with the geometry conventions used to compute the defocus in CTF correction and generate reconstructions.

From the graphical user interface, turn on the toggle button labeled "Reverse tilt axis" to add 180 degrees to the rotation parameters. That toggle button is in the main dialog for the rough alignment and in the special parameters dialog for the full alignment. On the command line, include -revaxis in the options to add 180 degrees to the rotation parameters.

Return to the list of parameters


Section Range

Currently has no effect.

Return to the list of parameters


Wiener Coefficient

When you use phase weighting of the cross-correlations, there is a term like that in a Wiener filter to keep things well behaved when the amplitude of the cross-correlation value in the frequency domain approaches zero. The term is an estimate of the high-frequency power spectral density times the value in the user interface's "Wiener coefficient" field. A higher value for the "Wiener coefficient" increases the suppression of the low amplitude components. To set the coefficient on the command line, use

    -mult=value

Return to the list of parameters


Center Peak Distance

With the FFT-based cross correlations, the alignment application will try to cancel out the effect of a peak at the origin by subtracting out a radial average over the central 7 x 7 region from that region. The alignment application only performs that subtraction if the largest value in the central 7 x 7 region occurs at the center and the quadratic fit to that point and its four nearest neighbors gives a peak position, (xp, yp), where both the absolute value of xp and yp are less than a threshold value. The threshold value is, by default, 0.05 pixels. You can change the threshold by modifying the value in the user interface's "Center peak distance" field. On the command line, use

    -cpd=value

to set the threshold to be value.

You may want to use a slightly larger value of the threshold when you observe that the alignment application does not modify the origin for a section (in the log file, the alignment application will write "peak is in origin" for sections where the origin is modified) and consequently picks the peak at the origin which is higher than the peak corresponding to the better values for the shifts. You can use a negative value for the threshold to prevent the alignment application from modifying the center of the cross-correlation result; that may be useful if the cross-correlation peak corresponding to the best alignment shifts is frequently in the central 9x9 region.

Return to the list of parameters


2nd Peak Threshold

With the FFT-based cross correlations, the alignment application prefers peaks that are away from the origin and only takes the peak at the origin if the next highest peak (after masking out the origin) has a height less than f times the height of the peak at the origin. The default value of f is .001. In the graphical user interface, alter the value in the "2nd peak threshold" field to alter the value of f. To set the value of f on the command line, use

    -spth=f

Return to the list of parameters


Tilt Offset

ALIGN2D can apply an offset to all the tilt angles (if you use an input parameter file that is the source of the angles; otherwise, ALIGN2D gets them from the header of the unaligned data. By default, ALIGN2D does not apply an offset. If you wish to offset the angles (for instance to correct of a systematic problem in the reported tilt angles) then set the "Tilt offset" field to the desired offset in degrees. From the command line, you can set the tilt angle shift with

    -ang_shift=shift

where you would replace shift with the value of the offset in degrees.

If you use an input parameter file from massnorm, you will not normally set an angle shift because massnorm fits the observed intensities and applies a correction to the reported tilt angles as necessary.

Return to the list of parameters


Method

ALIGN2D uses one of three methods to determine the alignment parameters when the alignment parameters are not extracted from the extended header of the tilt series. The methods are:

Talign + Simplex
Computes an initial estimate of the translational parameters using a comparatively fast FFT-based cross-correlation algorithm and then applies a simplex minimization method to refine all the alignment parameters. On the command line, use the option -imod=0 to select this method.
Talign
Computes only the translational alignment parameters using a comparatively fast FFT-based cross-correlation algorithm. On the command line, use the option -imod=1 to select this method.
Simplex
Computes all the alignment parameters using a simplex minimization method. On the command line, use the option -imod=2 to select this method.

Return to the list of parameters


Stretch

In the calculation of the cross-correlation between a pair of projections, ALIGN2D has the option of assuming that the specimen is thin and then stretching one of the pair to account for difference in tilt angle. By default, ALIGN2D performs stretching. To turn stretching off from the graphical user interface, turn off the "Stretch" toggle button in the special parameters dialog. On the command line, use

    -nostretch

to turn off stretching.

Return to the list of parameters


Filter

Prior to using the simplex minimization algorithm, ALIGN2D will by default filter the images to reduce the contribution from the slowly varying intensity components (a "high pass" filter). From the user interface, you can turn off that filtering by turning off the "Filter" toggle button in the special parameters dialog. From the command line, use

    -nofilter

to turn off that filtering.

Return to the list of parameters


Phase Weighting

ALIGN2D can use phase weighting to sharpen the peaks in the cross-correlation images at the expense of less robustness in the face of noise. From the user interface, you can turn phase weighting on or off by turning on or off the "Phase weighting" toggle button in the special parameters dialog. If the median filter is used, phase weighting is, by default, off; otherwise, phase weighting is, by default on. On the command line, you can specify

    -phaseweight

to turn on phase weighting; if you do not specify that option, ALIGN2D will not use phase weighting.

Return to the list of parameters


Simplex Deviations

These six parameters set the characteristic length for each of the six alignment parameters that simplex can refine when aligning a pair of sections. A characteristic length scale of zero for a parameter causes the simplex method to not refine that parameter; in the graphical user interface, you turn on or off the refinement of a parameter with the toggle button adjacent to the field which displays the characteristic length. The six alignment parameters are the x shift (in pixels), y shift (in pixels), rotation (in degrees), isotropic magnification factor, the orientation angle for the anisotropic stretching axis (in degrees), and the anisotropic stretching factor. The first four parameters have a direct effect on the output alignment parameters. The last two (the orientation of the anisotropic stretching direction and the anisotropic stretching factor) do not.

On the command line, you can use

    -dev=xshift_l:yshift_l:rot_l:mag_l:axis_l:stretch_l

to set the characteristic lengths. The default characteristic lengths are one pixel for the x and y shifts, zero degrees for the rotation angle and orientation angle for the anisotropic stretching axis, and zero for the isotropic magnification factor and anisotropic stretching factor.

Return to the list of parameters


Resolution

The resolution parameter selects which resolution to process from the input tilt series. 0 is the highest (full) resolution. From the user interface, you would normally select the resolution from the main EMTAR dialog and allow the software to propagate the setting to the individual processing stages. You can also set the resolution to process specifically for the alignment calculations from the alignment special parameters dialog.

On the command line, use

    -res=i

to have the alignment process the ith resolution. When run from the command line and no resolution is selected, the alignment calculations will use the highest resolution present in the input tilt series.

Two other parameters, the full size and resolution scale, affect the handling of resolution.

Return to the list of parameters


Full Size

Use the full size parameter to specify the dimensions, in pixels, of the full resolution tilt series corresponding to the input tilt series. In the typical case where you select a resolution level to process from the main dialog of EMTAR, the graphical interface will automatically fill in these values correctly. In the case where you are running the alignment on a downsampled file but the input and output alignment parameters are to be for the full resolution data set, you should adjust the full size parameters to be the dimensions of the full resolution data set.

On the command line, use

    -fullsize=nx:ny

to specify the dimensions, in pixels, of the full resolution data set. When run from the command line without the -fullsize option, the alignment will use the dimensions of the highest resolution present in the input tilt series for the full size.

Two other parameters, the resolution and resolution scale, affect the handling of resolution.

Return to the list of parameters


Resolution Scale

The resolution scale parameter controls the scale factor applied to the alignment parameters and to the x and y shift characteristic lengths. In the typical case where you select a resolution level to process from the main dialog of EMTAR, the graphical interface will automatically fill in this value correctly. In the case where you are running the alignment on a downsampled file but the input and output alignment parameters are to be for the full resolution data set, you should set the resolution scale to be the same as the downsampling factor (if the data is scaled down by a factor of four set the resolution scale parameter to four).

On the command line, use

    -rscale=i

to set the resolution scale to be i. When run from the command line without the -rscale option, the alignment calculations will use a resolution scale factor equal to two raised to the power of the resolution level selected with -res.

Two other parameters, the resolution and full size, affect the handling of resolution.

Return to the list of parameters