Image Processing of 2D Crystal Images

Electron crystallography of membrane proteins uses cryo-transmission electron microscopy to image frozen-hydrated/sugar embedded 2D crystals. The processing of recorded images exploits the periodic arrangement of the structures to extract the amplitudes and phases of diffraction spots in Fourier space. However, imperfections require a crystal unbending procedure to be applied to the image before evaluation in Fourier space. Here we describe the image processing of 2D crystal the Focus software system.

Theoretical Background

The processing of 2D crystal images involves several steps. These steps are the extraction of the lattice, the identification and correction of the crystalline deformation as well as image distortions introduced by the imaging system. This workflow is listed below and simplified in the block diagram.

  1. Defining basic processing parameters
  2. Calculating the Fourier transform of the image
  3. Measuring the defocus in different locations in the image
  4. Calculating potential specimen tilt from the defocus gradient
  5. Determining the 2D crystal lattice
  6. Calculating potential specimen tilt from distortions of the 2D crystal lattice
  7. Determining a spotlist of significant Fourier reflections
  8. Determine lattice distortion vectors and perform a first image unbending (Unbend I)
  9. Iteratively refine the lattice distortion vectors, do refined unbending (Unbend II)
  10. Movie mode unbending
  11. Extract amplitude and phase values for each Fourier reflection from the unbent image
  12. Correct the list of amplitudes and phases for the microscopes CTF
  13. Determine space group
  14. Calculate a final projection map from this image

These steps will now be discussed in detail, as implemented in the Focus software package.

Getting started

Starting in “Project Library” panel double-click the image that you want to process. Choose a non-tilted good quality image for the beginning. This will open a tab for the selected image in the “Edit Images” panel. Each image tab consists of different containers displaying data, processing parameters and image-processing routines also called as scripts. There are two major categories of these scripts which can be toggled by the button bar on the left side of the tab. These two categories include “Standard Scripts” and “Custom Scripts”. The image processing workflow of a 2D crystal is in the order of the scripts in the Standard Scripts. Custom Scripts contains other utility scripts.

When the tab is launched it automatically runs the Init Program script. The script checks the presence of all required external dependencies and the consistency of the image directory. Next, you have to launch the Init Files and Parameters script, which prepares the input files for the later processing steps. The image parameters that certainly have to be altered are: the Magnification the Pixel Size on Recording Medium CS and kV value of the used microscope.

Automated Processing

The image processing workflow of a 2D crystal is in the order of the scripts in the Standard Scripts. To evaluate the periodicity of the crystal, the image is transformed into Fourier space, where the lattice is then determined determined in reciprocal space. This lattice is then transformed into real space, and is used to identify the aberrations from the ideal lattice by cross correlating with an idealized reference map. The Contrast Transfer Function (CTF) is then used to correct distortions originated from the imaging. Since it is possible to process the image in an automated manner, select all the scripts in the Standard Scripts and press the Play button in the control panel. The scripts are executed consecutively. The progress bar depicts the progress of the current script and the Log panel displays the text output of the running script. You can change the verbosity level of the output in the Log panel with the buttons in the left corner of the panel. When all scripts are completed click on the last script of the workflow “Generate Map” to see its outcome. The result of the automatic unbending and CTF correction can be examined by double-clicking the Non-symmetrized Map in the Images panel. This will display 2 × 2 unit cells.

Manual Processing

Since the automatic processing is not perfect you may want to improve your result manually. You can do this at any time and will still profit from the prior executed steps. In this section we will walk you through each step.

Determine defocus

The first step is to determine the defocus and astigmatism for the later CTF correction. To do so run the Calculate FFT and the Get Defocus script and double click on FFT of Downsampled Image in the Images container. This will open up a down sampled Fourier transformation of the original image in the full screen viewer. You can zoom in with the period key and out with coma key. Press “C” in the full screen browser or select View CTF in the Navigator menu to see the Thon rings. You can adjust the defocus and astigmatism in the dialog window.

If you have trouble seeing the Thon rings you may want to change the Brightness and the contrast in the full screen viewer. You can do so by selecting Adjust Contrast/Brightness dialog from the Navigator menu. Press Accept if you are happy with the parameters, or use the shortcuts “B” and “N”.

If you still have problems seeing the Thon rings you can create a periodogram. To do this, enter the Advanced view in the Parameter panel of the Calculate FFT script by clicking the right button in the upper left corner of the panel. This will give you the full parameters list. Select Yes for Generate periodogram? and run the script again. The periodogram will show up in the Images panel and in this image you might see the Thon rings more clearly and can select them more easily. The selection is made in the same matter as before.

The defocus and astigmatism values will be used later in the Correct CTF script.

Determine lattice

The next step is to determine the crystal lattice. You can run the Get Lattice & Tilt script in order to find automatically your lattice. Open FFT of Downsampled Image in the full screen browser. You can display the lattice by pressing the “L” key. By pressing the D key or selecting Display Coordinate Info from the Navigator menu, you will get a dialog window that displays the amplitude, phase, the Miller index etc. of the pixel that the mouse pointer hovers over. To define the lattice de novo or to refine the lattice you have to enter the Lattice Refinement Mode through the Lattice Refinement in the Navigator menu.

Now you are able to add spots to your lattice. These would ideally be spots with a high resolution. With a double click the spot with the maximum intensity value in the surrounding area of your mouse pointer is selected. By pressing the Enter key or the Add Point in the Lattice Refinement dialog window the spot is added to the table. The Miller index is chosen according to the existing lattice. In case this is wrong you can alter it in the dialog window. You can activate the Display Parameters dialog window in the Navigator window. Here you can change the Maximum Value Search Range that is used when double clicking. Or you can change the method to use a Gauss Fit. To get a closer look at the area you can make a right click.

After having added spots press the Accept First Lattice button and you will see how the lattice is shifted to match the picked spots.

Ideally you will have only one lattice. But usually there is a second weaker lattice showing in Fourier space. This lattice can be defined and refined in the same manner as with the first lattice. You can view this lattice by pressing the S key. The second lattice could later be used to filter out spots that overlap in the process of unbending. You can calculate the unit cell dimensions which is defined by this lattice by running the Evaluate Lattice script from the Custom Scripts panel.

Determine tilt geometry

If you are processing a non-tilted image you should set Determine Tilt Geometry to No in the Tilt Geometry Section of the Processing Data panel. In case you are processing a tilted image there are two ways to determine the tilt geometry of your image. Firstly, you can determine the tilt geometry from the defocus gradient of your Fourier transform. This will be executed together with the Get Defocus & Tilt script. This way you determine the tilt geometry of the carbon film support, which is described by the variables TLTAXIS (tilt axis of the microscope) and TLTANG (angle between tilt axis and the grid). These two variables are valid for the sample support, and have nothing to do with the crystal. In fact, they could also be determined in absence of any crystal. Please note, that for smaller tilt angles, the defocus gradient is the safer method.

Secondly, you can determine tilt geometry based on the lattice distortion. For this purpose you have first to define the lattice, for example after running the Get Lattice & Tilt script. In addition to the TLTAXIS and the TLTANG it will also calculate TLTAXA, which describes the orientation of the crystal with respect to the tilt axis. This lattice based tilt geometry is only reliable for larger tilt angles, which should be greater than 25 degrees. In that case, the Get Lattice & Tilt script will use the now determined lattice orientation to translate the defocus-based tilt geometry into the sample tilt geometry.

Unbend

This chapter describes how you can correct for translational crystal distortion. Therefore you compare (= cross-correlating) a tightly masked and thus “perfect” transform (= reference) with a loosely masked transform that still contains all the information about irregularities in the lattice. However, to get the best results one first needs to determine the xy-coordinates that will serve to centre the reference area. The cross-correlation is done most conveniently in reciprocal space (twofile) because in this case it amounts to a multiplication of the loosely masked transform of the image with the complex conjugate of the transform of the reference area. Backtransformation of the crosscorrelation map is the first step to translate its information into real space disorder parameters. Consecutively, all unit cells can be searched for the exact position (= offset) of the object and the degree of similarity with the reference area (quadserchb ). In practical terms this is achieved by first correlating the object (or part of it) with itself. This so called autocorrelation map is calculated from a small part of the reference area and its centre appears as a more or less symmetrical peak whose shape depends on the actual distribution of Fourier terms in the image (autocorrl ). Finding the best fit of this central peak and the cross-correlation peaks for the individual unit cells provides the length and orientation of the distortion vectors and goodness (=height) of correlation. It should be mentioned that quadserchb only determines the translational offset for the cross-correlation peak but does not take into account any rotational disorder. Once the distortion vectors are known, the original image can be corrected by re-interpolating its optical densities to bring the unit cells onto a “perfect” lattice (ccunbend ). The resulting unbent image is Fourier transformed to give an FFT with sharper diffraction peaks. The unbent FFT is evaluated (mmbox ), yielding a list of amplitudes and phases for each lattice spot, together with an IQ value for each spot, which express the signal-to-noise ratio. The weighted sum of all IQ spots is depicted in the QVal, which can be used to judge the quality of the results of image processing.

The unbending is split into two rounds as depicted in the Standard Scripts panel by the Unbend I and Unbend II scripts. The needed reference for each unbending step is created from a spot list, which holds spots in Fourier space that lie on the lattice (scripts Get Spotlist for Unbend I and Get Spotlist complete. You can manually refine this spot list in the full screen view of the Fourier transformation. Enter Spot Selection Mode via Spot Selection in the Navigator Menu. With the P key you can identify the spots automatically selected. You may want to display the lattices when refining the spots. By clicking on a lattice spot you select it and by clicking it again you undo the selection. In this manner select now the spots that have a high signal to noise ratio. Save the spot list under Spot List in the Navigator menu.

From this outline it becomes clear that the quality of the reference area is the main factor to the success of the “unbending” procedure because any disorder present in the reference will remain uncorrected. Accordingly, improvements in the quality of the reference area by successive passes of processing make the determination of the lattice distortions and consequently, the correction of the image more accurate. In most cases the result will not get any better after 2-3 passes of image filtering and lattice unbending. However, a further improvement can be obtained once a 3D model is available, because in this case a “perfect” reference area can be created de novo by calculating a back projection of the model for the “precise” imaging conditions (maketran). Further parameters you can play around with are the radius of the loosely masked Fourier (mask) and the diameter of the reference (box).

Movie mode unbending

As the 2D crystals have to be imaged under sample tilt, the specimen drift during data recording is immense. The carbon film will move upwards in the microscope, which for a tilted sample means a lateral movement. If in addition the 2D crystal is not firmly attached to the carbon film, it will move erratically in varying directions in the image.

Movie data are recorded with a direct electron detector in dose-fractionation mode. A raw movie is first to be whole-frame drift-corrected. This can be done by a program such as MotionCorr, MotionCor2, Unblur, or with our in-house program ZORRO. ZORRO is being integrated into 2dx, which should allow to load a raw, non-drift-corrected movie into 2dx, and whole-frame drift-correct it with ZORRO directly from within 2dx.

Once, drift-corrected movies are available in 2dx, they still need to be unbent with the so-called Movie-Mode unbending. Here, the individual unit cells of a 2D crystal are each unbent independently, so that varying drift within a 2D crystal can be corrected.

2dx offers two different algorithms for movie-mode unbending, termed Movie-A and Movie-B.

A raw movie (top left, here with 40 frames) is first to be whole-frame drift-corrected (in this example using MotionCorr, leading to 38 remaining frames). This drift-corrected movie is then averaged (Image, Sum of Frames), which is then conventionally unbent, resulting in a final map called “Static”, top right.

The first movie-mode algorithm and script, termed Movie-A, then tries to unbend each of the 38 frames individually. This, however, usually fails, since the single frames don’t have enough signal-to-noise ratio (SNR) to allow the unbending. Help comes from using as unbending reference the reference from the Static unbending. Another help comes from the algorithm, unbending the frames consecutively: Starting with the unbending profile from the Static run and applying that to a middle frame, the algorithm “crawls” from one frame to the next frame, learning from the previous frame and only allowing smooth and small variations in the unbending profile from one frame to the next one. These constraints on the unbending profiles mean that a sudden jump during the movie recording cannot be accommodated. But this still allows to deal with the very low SNR of individual frames. 2dx will ask for several parameters in the Movie-A script, the most important being movie-smoothing (“Movie-Mode drift smoothing over how many neighboring lattice nodes”). This allows you to define, how many of the neighboring unit cell drift vectors should be averaged to replace a specific unit cell drift vector, if that unit cell’s drift vector deviates from that of the neighbors by more than a givenmovie_drift_threshold (“Movie-Mode drift smoothing threshold”).

Movie-mode also applies a dose-dependent B-factor filter to the movie series: Frames are resolution limited with a B-factor filter (i.e., with a Gaussian fall-off of amplitudes at higher resolution), whereby the B-factors are adjusted so that the first frames are used with their full high resolution, while later (burned) frames are used only with their low resolution. These B-factor filtered frames are then unbent. After unbending, the frames are summed up in Fourier space, and the resulting final Fourier sum is inversely B-factor filtered. This means that high-resolution terms are now up-weighted, so that in the end all resolution frequencies have the original intensity restored. The second movie-mode algorithm and script, termed Movie-B, groups a certain number of the original (whole-frame drift-corrected) frames together, forming so-called “super-frames”. In the above example, the 38 frames are grouped into 5 super-frames, each consisting of 8 original frames. So, frame 1-8 are averaged into super-frame 1, frame 9-16 into super-frame 2, frame 17-24 into 3, frame 25-32 into 4, and frame 33-38 into super-frame 5. These 5 super-frames then show enough SNR, so that they can be unbent independently, but still exploiting the high-contrast Reference from the Static unbending run. Also in Movie-B, dose-dependent B-factor filtering before and inverse B-factor adjustment after unbending is applied.

Crystal masking

In real world applications the crystal almost never fills the entire image. Therefore it does not make sense to use regions where the crystal is not regular or where we don’t have any crystalline structure. 2DX offers a tool with which you can manually mask an image. The following walkthrough explains how you can mask the crystal.

There are multiple ways how you can mask your image. You can mask the crystal automatically by selecting the option Do automatic masking of 2D crystal in the Parameter panel of Unbend II. Alternatively, you can mask your crystal manually. Open the original image from the result panel of the initialization script and mask the image there. For many applications this does not work, as the crystal is not visible by eye. Thus we advise to mask in the file XCF Map for Manual Merging which can be found in the result panel of Unbend II. This file shows you the cross-correlation profile generated during unbending the crystal. The height of the peak corresponds directly to the local quality of the crystal. In regions with no crystalline structures we will not find any peaks. As usual the file is opened in the fullscreen mode by a simple double click.

In order to be able to mask the image you have to activate the Polygon Selection Mode by right-clicking in the image and selecting “Polygon Selection > Polygon Selection Masking”.

Now you can mask your crystal by defining the borders with a bunch of left mouse clicks. A double-click will automatically close the selected polygon. Note that you can delete the current selection by selecting “Polygon Selection > Clear Selection” from the menu appearing when right-clicking on the image.

Once you are happy with your selection you can save the current selection by selecting “Polygon Selection > Save Selection” from the menu appearing after another right-click.

In order to apply your polygon selection you have to run the custom script Mask Crystal from Polygon. This script will replace all the pixels outside the polygon with the average grey value inside the polygon. In the future calculation this new image will be used as input image.

After masking the crystal from the saved polygon you have to save the current configuration by means of clicking on the save button in the header of the 2DX graphical user interface. Afterwards you have to rerun all the standard scripts, except Get Defocus & Tilt and Get Lattice & Tilt as neither the defocus nor the lattice are affected by the masking. This will generate a density map uniquely from the data points inside the selected polygon.

CTF Correction

The next step consists in an initial correction of the phase data for the effect of the contrast transfer function (ctfapply). The CTF is a modulation of the scattered waves by the objective lens, which results in periodical contrast reversals across the image. In Fourier space this corresponds to a phase shift by 180° where the CTF is negative. Because this modulation will be different for each image (due to their different amounts of defocus) the phases must be corrected to allow the combination of data from several images. The visual manifestation of the CTF is a characteristic pattern of alternating light and dark bands (= Thon rings) in the diffuse diffraction patterns of amorphous materials. The dark areas correspond to frequencies that are not or only poorly transferred and hence do not contribute to the formation of the image. Vice versa, good transfer is achieved in the bright areas. In order to correct for CTF in your images run Correct CFT script in the Standard Scripts panel. In addition, this scripts gives you an IQ-Plot.

Space Group Determination

CTF-corrected data can always be combined in “plane group p1”, i.e. assuming no symmetry at all. However, if the specimen does exhibit a certain symmetry, data handling and refinement becomes a lot easier because symmetry imposes constraints on the molecular transform. For instance, a simple twofold axis of symmetry means that the densities within the unit cell are related by a 180° rotation about this axis. Consequently, the density distribution will appear symmetrical in non-tilted image data (= projection density map). To encode this in reciprocal space requires all the projection terms to be symmetric about the origin, i.e. they are cosine waves that can only be shifted by 0 or 180° with respect to the phase origin. The introduction of redundancy is a further advantage of symmetry. For instance the terms (1 0 0), (0 -1 0) and (-1 1 0) are all different if no symmetry is present. However, if the specimen displays three- or six-fold symmetry these terms have identical phases and amplitudes, i.e. they are symmetry related, describing the same structural feature. In other words while the data of a single image only contribute a single measurement for each reflection in the first case, three independent measurements of the “unique” reflection (= 1 0 0) are obtained for three- or six-fold symmetry. In addition, the actual phase values allow discriminating further between three- (p3) and six-fold (p6) symmetry. Since the latter has intrinsic twofold symmetry all phases would be expected to adopt 0 or 180° values. However, this is not true in p3 where like in p1 no phase constraints are applicable. The agreement between symmetry related reflections is independent of the CTF as long as the image has no significant astigmatism because they have the same distance from the transform origin. In summary, the relationships between the phases obtained from images of non-tilted crystals allow an unambiguous determination of the specimen’s symmetry because each of the 17 plane groups has a unique set of constraints.

To determine the space group of your crystal run the Get Spacegroup & Phase Origin script in the Custom Scripts panel. It will calculate the internal phase residuals for all space groups and thereby choose the optimal space group and the corresponding phase origin. The space group and phase origin are then in 2DX as entries for Symmetry and Phase Origin. To find the right space group it is better to set the Resolution limitation for phase origin search to a lower resolution than with what you process your image. In case you know the space group of your crystal you can also use this script to just find the according phase origin for the image. Note that only projection images of non-tilted crystals show symmetry.

Optionally you can set your phase origin manually. This way you could process all your single images to a similar phase origin, making it later easier to find a common phase origin in 2D merging. For this purpose run the Set PhaseOrigin Manually script in the Custom Script panel. Open the Old p<X>-symmetrized Map in the Image panel. Position your mouse cursor on the wished phase origin and press shift “P”. The needed phase origin changes will be transferred to the Parameter panel. To apply the changes you have to rerun the script once again.

Map Generation

Final step of 2D image processing is the generation of the projection map. You can create an unsymmetrized map by running the Generate Map script in the Standard Scripts panel. Alternatively you can generate a symmetrized map by applying the selected space group. For this run Generate Map script in the Custom Scripts panel. The latter will calculate a table of phase residuals during the symmetrization, from which you can judge the overall quality and resolution of your image. Please note that you have to set the parameter Invert contrast to the final map again to No in case you are processing a negative stained image, and to Yes in case of a cryo image.

Setting config as Project Default

Once you are happy with processing one image you can set the parameters from this image to all the images. This can be done in following steps. To save this parameters as default for the project new imported images click the “Save as Project Default” button on the top of the tab located on the right of the script title. So all the new imported images would have this new config file as default. But this would change only the project master config file. To copy this config to others we can use “Reset Image Config” script from “Project Tools”. First select all the images which you want to reset and then run the script from “Project Tools”.

Parallel Image Processing

It is possible to run the automated processing of images in parallel. This can be done after selecting images in the “Project Library” and clicking the button Process selected.