APPL_PRM

Overview

With alignment parameters and the conversion factors for electron counts to mass density (both are loaded from the file pointed to by the input alignment parameter file), APPL_PRM creates a mass normalized and aligned data stack for reconstruction.

Here's an example command file for APPL_PRM:

    (time appl_prm \
     /mama/weiping/test/centSr.stk \
     /mama/weiping/test/centSr.MnAln \
     -iprmfile=/mama/weiping/test/centSr.bprmMn \
     -dimxy=480:480 -iv=0:22:1 -shxyz=0:0:0 -iref=-1 \
     -imform=0 -pcbase=.05 ) \
     > /mama/weiping/emrecon.log

Parameters

Tilt series | Aligned series | NX:NY:NV | Input alignment | Output XY | Section range | Output shift | Reference projection | Image formation | pcBase | Tilt offset | Statistics | Apply alignment | Resolution | Full size | Resolution scale | Add multires

Related Priism Topics

Priism | Alignment and reconstruction | MASSNORM | EWBP | TAPIR | Alignment with markers


Tilt Series

This is the name of the file containing the raw projection data stack from the CCD (i.e. measured in terms of electron counts; data stacks with the contrast inverted can not be handled). On the command line, the tilt series file name is the first argument.

Return to the list of parameters


Aligned Series

This parameter names the file that will contain the aligned and mass normalized data stack. On the command line, the file name for the aligned result is the second argument.

Return to the list of parameters


NX:NY:NV

The first two values are, respectively, the x and y dimension of the projections. The third value is the number of projections in the data stack.

Return to the list of parameters


Input Alignment

This parameter supplies the name of the file with the alignment information and, optionally, conversion factors for mass normalization. Usually you would generate the file with MASSNORM. You could also directly use the files generated by cross-correlation alignment or alignment with markers.

On the command line, use -iprmfile=filename to supply the name of the parameter file. If the option is not set or the filename is not supplied or is none, the program will terminate with an error.

Return to the list of parameters


OutputXY

These two values are, respectively, the x and y dimensions of the aligned projections. Usually the full dimensions of the input data are used, but when doing a quick reconstruction to determine an appropriate value for the z shift, it is convenient to generate an aligned projection with a y dimension of one.

On the command line, set the dimensions of the output data stack with -dimxy=nx:ny. If not set, the output x and y dimensions are the same as the x and y dimensions of the input data stack.

Return to the list of parameters


Section Range

These three values set which of the input projections are aligned and mass normalized. The first value is the index of the first projection to use, the second value is the index of the last projection to use, and the third is the index step. Allowable values for the indices are between zero and the number of input projections minus one, inclusive.

From the command line, use -iv=first:last:step to set the range of projections to process. When not set, the default is to process the entire input stack: first is zero, last is the number of input projections minus one, and step is one.

Return to the list of parameters


Output Shift

These three values (they are in units of pixels) shift the imaginary 3D tilt axis of the projection data from its default location; they are used to center the reconstruction volume on an object of interest. The default orientation of the 3D tilt axis has it pass through the point whose x and y coordinates are the center of the reference projection and whose z coordinate is the z coordinate of the center of mass of the reference markers used for alignment.

A good way to determine appropriate values for the shifts is to use the XY and XZ buttons for region selection in the main alignment and reconstruction dialog.

Use -shxyz=x_shift:y_shift:z_shift to set the shifts on the command line. If the shifts are not specified, a value of zero pixels for each shift is assumed.

Return to the list of parameters


Reference Projection

For calculating the effect of the x and y shifts (see the output shift parameter), APPL_PRM uses the center of the reference projection. Specify the reference projection by its zero-based index in the file (i.e. a value between zero and the number of projections minus one) or use a value of negative one to select the projection whose tilt angle is closest to zero.

The reference projection can be set on the command line with -iref=index. If it is not specified or index is less than zero or greater than or equal to the number of projections in the input file, the projection whose tilt angle is closest to zero is used.

Return to the list of parameters


Image Formation

This parameter sets which model should be assumed for the process of image formation - how electron counts are related to the mass density of the specimen. The three options are:

logarithmic
The mass density is linearly related to the logarithm of the electron counts.
scaled linear
The mass density is linearly related to the electron counts.
linear
The mass density is linearly related to the electron counts. The images APPL_PRM generates with this model are simply the input images interpolated to account for the alignment parameters. APPL_PRM always assumes this model when the input parameter file does not contain mass normalization information.

For the logarithmic and scaled linear models, the relationship between the ith input image, P(i,j,k) after interpolation for the alignment parameters and the ith output image (i.e. the mass-normalized values), P'''(i,j,k), is P'''(i,j,k) = minimum(h(i), P''(i,j,k) - a - (b-a)/cos(tilt(i))). For the logarithmic model, P''(i,j,k) is 10000 * log(s(i) / (P'(i,j,k) - s(i) * c0)). P'(i,j,k) is f(i) / r(i) * P(i,j,k) - b(i). For the scaled linear model, P''(i,j,k) is f(i) * s(i0) / (r(i) * s(i)) * P(i,j,k) - b(i). The other terms are:

tilt(i)
Is the tilt angle for the ith image.
i0
Is the index of the image whose tilt angle is closest to zero.
f(i)
Is the value fit by massnorm (i.e. column 7 in the parameter file).
r(i)
Is the measured reference value (the quantity fit by massnorm; i.e. column 6 in the parameter file).
b(i)
Is the offset determined by massnorm (i.e. column 9 in the parameter file).
s(i)
Is the scale factor determined by massnorm (i.e. column 8 in the parameter file).
h(i)
Is the intensity such that .001 of the pixels in P''(i,j,k) have intensities greater than h(i).
l(i)
Is the intensity such that .05 of the pixels in P''(i,j,k) have intensities less than l(i).
a
Is the y intercept for the best fit line to the graph of l(i) versus 1/cos(tilt(i)).
b
b is the intensity such that the fraction, pcBase, of the pixels in P''(i0,j,k) have intensities less than b.
c0
c0 is the minimum of zero and P'(im,jm,km) / s(km) where im, jm, and km are the indices that give the smallest value of P'(i,j,k).

On the command line, use -imform=0 to use the logarithmic model, -imform=1 to use the scaled linear model, or -imform=2 to use the linear model. If the input alignment file does not contain mass normalization data, APPL_PRM ignores the -imform options and always assumes the linear model. If you do not supply a -imform option and the input alignment file has mass normalization data, APPL_PRM uses the logarithmic model.

Return to the list of parameters


pcBase

With the scaled linear or logarithmic image formation models, the pcBase parameter affects the contribution of an additive term corresponding to a sheet of uniform mass density.

On the command line, set pcBase with -pcbase=cutoff. When it is not set, appl_prm uses a a value of 0.05.

Return to the list of parameters


Tilt Offset

The value of this parameter, assumed to be in degrees, is added to the tilt angles stored in the header of the output data stack and used in the mass normalization calculation. On the command line you can supply the tilt offset by specifying -tilt_offset=angle. When no offset is set, a value of zero is assumed.

Return to the list of parameters


Statistics

If the image formation model is not linear, APPL_PRM can write out a text file with some intermediate results for each projection: the 1/cos(tilt_angle) factor and the intensity corresponding to the cutoff for the lower 5% of the histogram. To cause these results to be written, enter a name different than "none" in the "Statistics" field. As a shortcut, you can turn on the toggle button adjacent to the "Statistics" field to insert the base name for the input tilt series plus a .applprm_stat extension. From the command line, use

    -statfile=name

to specify the file name for the intermediate results; if you do not use a -statfile option, APPL_PRM will assume name was "none" and will not write out the intermediate results.

Return to the list of parameters


Apply Alignment

When the "Apply alignment" toggle button is on, APPL_PRM generates an aligned data stack; when it is off, APPL_PRM only applies the conversion from electron counts to mass density when generating the output data stack (if you specify a change to the image size or shift the region of interest, however, those will be applied as if there was no other alignment information available). When run from the command line, generating an aligned data stack is the default and to disable the alignment you must specify the option -noalign.

If you want to disable the conversion from counts to mass density, use the linear image formation model.

The relationship between a coordinate, (x,y), in the unaligned projection k, to a coordinate, (x',y'), in the corresponding aligned projection is given by the linear transformation:

    [ x ]          [  cos(r(k))  -sin(r(k)) ] [ x'-0.5*(nx'-1) ]   [ tx(k)+0.5*(nx-1) ]
    [   ] = m(k) * [                        ] [                ] + [                  ]
    [ y ]          [  sin(r(k))   cos(r(k)) ] [ y'-0.5*(nx'-1) ]   [ ty(k)+0.5*(ny-1) ]

m(k) is the magnification for the kth projection; the value is read from the third column of the parameter file. r(k) is the rotation angle for the kth projection; the value, in degrees, is read from the second column of the parameter file. tx(k) and ty(k) are the two components of the translation for the kth projection; the values for those are read from the fourth and fifth columns, respectively, of the parameter file. nx' and ny' are the dimensions, in pixels, for the aligned frame. nx and ny are the dimensions, in pixels, for the unaligned frame. The coordinates for the samples in the aligned image are integers drawn from the range, [0, nx'-1], for the first coordinate and the range, [0, ny'-1], for the second coordinate. The coordinates for the samples in the unaligned image are integers drawn from the range, [0, nx-1], for the first coordinate and the range, [0, ny-1], for the second coordinate.

When the alignment parameters are used to align a lower resolution version of the input data, appl_prm uses the linear transformation given above with values for the image dimensions and translations that have been corrected for the resolution change. If nxh, nyh, nxh', and nyh' are the dimensions of the unaligned and aligned images in the higher resolution, the dimensions of the images in the lower resolution are:

    nx = truncate(nxh/s)
    ny = truncate(nyh/s)
    nx' = truncate(nxh'/s)
    ny' = truncate(nyh'/s)

where s is the scaling factor between the two resolutions. The translations in the lower resolution are calculated from those, txh(k) and tyh(k), in the higher resolution as follows:

   tx(k) = (txh(k) + 0.5*(nxh-1) - s*0.5*(nx-1)) / s
   ty(k) = (tyh(k) + 0.5*(nyh-1) - s*0.5*(ny-1)) / s

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 application of the alignment and mass-normalization parameters from the special parameters dialog for "Apply Parameters".

On the command line, use

    -res=i

to apply of the alignment and mass-normalization parameters to the ith resolution. When run from the command line and no resolution is selected, the calculations will use the 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 applying the alignment and mass-normalization parameters to a downsampled file but the input parameters are 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, apply parameters 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 output size and shift. 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 the resolution scale correctly. In the case where you are applying the alignment and mass-normalization parameters to a downsampled file but the input alignment parameters are 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, apply parameters 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


Add Multires

Turn on the "Add multires" toggle button to cause apply parameters to add lower resolutions to the aligned and mass-normalized tilt series if the x and y dimensions of the tilt series are large enough. Turn off the "Add multires" toggle button to cause apply parameters to always generate a tilt series with a single resolution.

On the command line, include

    -multires

in the command-line options for apply parameters to cause apply parameters to add lower resolutions to the tilt series if the x and y dimensions of the tilt series are large enough.

Return to the list of parameters