Image
image
image
image


EM Imaging Processing GUI - EMIP

EMIP is a Graphical User Interface written in wxPython that collects information from the user and runs existing programs from a variety of different software packages. Program output and error messages are printed on the console. If a particular program does not exist, is not in your path, is incorrectly configured, or is a version that takes different parameters, the program will fail and probably produce some kind of error message. EMIP requires python (tested on v.2.3, 2.4, 2.5) and wxPython (tested on 2.6 and 2.8), which in turn has its own dependencies (see http://www.wxpython.org ). Although EMIP runs on any system with python and wxpython installed (linux, windows, mac), the availability of necessary image processing programs is limited to linux and MacOS ? .


INSTALLATION of EMIP

  • The BEST way to install wxpython is to use yum , apt or some other package manager on your linux system
  • Alternatively, we have some instructions for manual installation of wxpython
  • for MacOS ? distributions of wxPython, you seem to need to run in 32 bit mode
    • set environment variable: export VERSIONER_PYTHON_PREFER_32_BIT=yes

  • EmIP is available through svn from cronus.nysbc.org
    • svn ls http://cronus.nysbc.org/repos/ --- to get listing of available repositories
    • svn co http://cronus.nysbc.org/repos/emip_distr --- to copy software to your computer
    • svn co http://cronus.nysbc.org/repos/helical_demo --- to copy helical reconstruction demo to your computer
      • please set your path to point to the appropriate binaries for the helical imaging programs and the scripts
      • ./helix/bin and /helix/script
      • 64-bit binaries are in bin directory in the trunk
      • 32-bit binaries are in the bin32 directory in the branches *svn update - to keep your distribution up to date
    • for Mac OSX
      • OSX binaries are in the bin_OSX directory in the trunk
      • for Mac OSX, use emip_OSX.py, which has been tested on OSX 10.6.6 using python 2.6.1 and the builtin version of wxPython wx-2.8-mac-unicode
      • image2010 software compiled under OSX 10.5 is available on svn server in branches
      • setenv PDFVIEWER open
      • make a symbolic link: ln -s /usr/bin/pstopdf /usr/local/bin/ps2pdf
      • get compiled a2ps from branches in repository, run 'make install'
        • if you don't have "make", then cp src/a2ps to /usr/local/bin
        • also need to create /usr/local/share/a2ps and cp several directories there: ps, ppm, afm . . .
      • can get gnupulot from http://octave.sourceforge.net/
        • Open the downloaded dmg file and browse to the Extras folder
        • Open gnuplot-4.2.5-i386.dmg and copy Gnuplot.app to your Applications folder (or anywhere else).
        • then need to make symbolic link from /usr/local/bin to the program in /Applications/Gnuplot/
        • alternatively, get a standalone version from http://www.miscdebris.net/upload/gnuplot-4.2.5-i386.dmg
      • can get Mac versions of EMAN1, EMAN2 and IMOD
        • for v2, need to make symbolic link to v2 in /usr/local/bin from /Applications/EMAN1/bin/v2
        • for e2display, need to make symbolic link to /usr/local/bin/e2display.py to /Applications/EMAN2/bin/e2display.py
        • or just put those bin directories in your path

EMIP makes use of the following image processing packages:

  • IMAGE2000 from the MRC: http://www2.mrc-lmb.cam.ac.uk/image2000.html (file manipulation and 2D crystallography)
  • EM2EM from the IMAGIC package (file conversion)
  • IMOD from University of Colorado: (file conversion and viewing)
  • EMAN1 and EMAN2 from Baylor College of Medicine: (v2 image viewer and e2display)
  • PROJALIGN from Florida State Univ.: (file conversion and tomographic reconstruction - Winkler and Taylor, Ultramicroscopy 2006 106:240-254)
  • Helical reconstruction programs from Beroukhim, Toyoshima and Unwin (Ultramicroscopy 1997 70:57-81).
  • CTFFIND3 (ctf determination program from FREALIGN)

EMIP also requires the following system software packages:

  • xpdf (or another PDF viewer specified by the environment variable PDFVIEWER)
  • a2ps
  • ps2pdf (called pstopdf on the Mac - make a symbolic link to ps2pdf)
  • gnuplot

EMIP Environment variables

  • PDFVIEWER specifies the PDF viewer to be used by EMIP
  • IMAGEBIN used by MRC software, should be set to director where MRC binaries are stored
  • VERSIONER_PYTHON_PREFER_32_BIT set to "yes" for MacOS ? (required for wxPython)
  • PATH should include:
    • EMIP directory (emip_distribution/trunk/emip)
    • MRC binaries (image2010/bin and image2010/com)
    • helical binaries and scripts (helix/bin and helix/script)
    • directories for gnuplot and a2ps (e.g., /usr/local/bin - make links if necessary)
    • directories for em2em and v2 and imod and projalign)

All of the above software must be installed and the relevant programs must be in your PATH . EMIP will generally give an error in the terminal window is a program is not found. The log file (or lack thereof) will also reflect that.


RUNNING EMIP

EMIP doesn't actually do any image processing. It just runs other programs. It creates control files and log files as well as output data files. It is wise to maintain awareness of these files so you know when something has gone wrong.

  • create an alias to the following command in your .cshrc file
    • alias lshead 'ls -lt | head'
  • run EMIP in the background by typing emip & (or emip_OSX.py for the Mac)
  • then type lshead regularly in the console to check for the files that have been created after each step in the process

EMIP consists of several individual panels. A new set of programs can be accessed by simply selecting a different panel.

  • Tranformations (FFT, viewing, boxing, rotations, file conversions)
  • Contrast Transfer Function (three methods for determining the defocus of an image)
  • 2D crystallography
  • Helical reconstruction
  • Electron Tomography (not yet implemented)

General Image Transformations

EMIP offers a variety of different operations to transform an image. These include

  • Viewing the image
  • Boxing a rectangular area
  • Rotation
  • Resampling
  • Fourier tranformation
  • Display of HEADER information
  • Histogram of image densities
  • File Format Conversion

transform.jpg

Enter the input filename (e.g. j01350.mrc). A default filename is chosen for the output file (j01350.fft), but this can be changed at any time. The output file will not be overwritten unless the overwrite outfile checkbox is selected. A variety of operations can be applied to create the output file from the input file:

  • Box Image : uses label to select a rectangular area. Enter the limits of area in the fields marked xmin/xmax and ymin/ymax .
  • Resample : uses label to downsample an image by the integer factor in the field marked reduce sampling .
  • FFTRANS : uses fftrans to calculate and FFT from the input image.
  • HEADER : displays information in the header of either the input file or the output file, depending on the choice of the dropdown box.
  • Histogram : uses histo and gnuplot to display an image histogram of either the input or output file.
  • View : uses the selected viewer to display either the input or the output image. Note that both mrcdisp and Ximdisp from the image2000 package require an 8-bit display.
    • Under redhat versions of linux, a second 8-bit X window session can be started as follows. <ctrl-alt-F2> - log in. type the command startx -- :1 -depth 8
    • you can use icewm or twm in this second session to conserve on memory.
    • use <ctrl-alt-F7>/<ctrl-alt-F8> to toggle between the X window sessions
    • alternatively, you can use vncserver -depth 8 to create a virtual X window session. Then use vncviewer to connect to that session and run EMIP
  • Rot Img : uses rotatevol from IMOD to rotate images (or volumes). Enter rotation angles about the Z, Y, and X axis. These are performed sequentially
    • for in-plane rotation of a 2-D image, simply enter the angle about the Z axis
  • File Conversions (not all combinations are implemented)
    • DM = digital micrograph dm3 format
    • DMtiff = digital micrograph tif format
    • Zeisstiff = tif format from Zeiss Photoscan film digitizer
    • TVIPS = dat format from Tietz CCD camera
    • Spider = dat format from SPIDER single particle package
    • MRC = mrc format from image2000 package
    • FSU = dat format from projalign tomography package
  • use the 3d map flag when processing a 3d map (SPIDER, MRC, FSU formats)
  • use the img series flag when processing a series of images with the same basename
  • a variety of different programs are used for these conversions:
    • tif2mrc (IMOD)
    • em2em (IMAGIC)
    • cutimage (FSU package)
  • After choosing input and output file formats (and necessary flags), hit Convert File

Contrast Transfer Function

The objective lens of the electron microscope imposes a contrast transfer function on the image information. This function depends on the defocus used to record the image and must be considered during image processing. See Erickson and Klug (Phil. Trans. Royal Soc. Lond. B. 1971. 261: 105-118) or Tani et al. Ultramicroscopy 1996. 65:31-44 or download ctfexplorer for a self tutorial ( http://www.maxsidorov.com/ctfexplorer/index.htm ).

EMIP offers three independent ways to estimate the defocus of a given image:

  • radial averaging of the FFT and plotting of the average using gnuplot
  • radial averaging of the FFT and a sophisticated analysis of the averages using pltctfx (see Tani et al. above)
  • analysis of the incoherent average of patches from the image using ctffind3 (from image2000 or freealign)

ctf.jpg

Enter the name of the image file and its fft (as calculated on the TRANSFORM page).

View CTF will divide the transform up into a number of equal pie slices (sectors). 5 is the default, which allow for evaluation of astigmatism (because of Friedel symmetry, 5 refers only to the non-redundant half of the transform, so each sector would consist of 36 deg. You may choose to plot 1 or more sectors, just enter the sector number(s) you would like to be plotted, separated by ',' if more than one (e.g. 1,2,3). If you would like to average groups of sectors together, enter a range of sectors, separated by a '-' (e.g. 1-3)

  • Hit View CTF , which will use sctravgft to create the radial averages, ctfavg to average sectors (if requested) and gnuplot to display the results.
    • click mouse in the gnuplot window to dismiss and return to EMIP

ctf-gnuplot.jpg

  • To estimate the defocus, move the mouse over the gnuplot window and note the x coordinate of the zeros. After dismissing the gnuplot window, enter these coordinates into the CTF Zero positions field in order (e.g. 76, 108, 141). Hit the calc df button will activate and defocus values will be printed to stdout. Each CTF zero will give an independent estimate of defocus. The program assumes that the first value corresponds to the first CTF zero, the second value corresponds to the second CTF zero, etc. Therefore, if you wish to omit one of the CTF zeros, then use a fictitious value as a placeholder.
    • the calculation of defocus depends on operating parameters of the microscope such as kV , Cs , Amp Contrast , Mag , as well as the sample size of the image. Therefore, enter these parameters down below (otherwise the default values will be used). Note that the Mag must apply to the plane of the device used to record the image (e.g. film or CCD camera).

PLTCTFX will use the program developed by Toyoshima and colleagues for estimating CTF. This program was designed for use with helical tubes suspended over ice and can be very effective in situations with low signal-to-noise ratio. The program works with rectangular images produced by the helical reconstruction software. This program starts by using sctravgft to divide the transform up into 5 sectors (as above) and then performs Fourier filtration and fitting on the resulting data. Enter appropriate operating values for the electron microscope and a range of defocus values that apply to your data (this controls the level of filtering). Users must then interact with a GUI to control the process. Refer to the paper by Tani et al. referenced above for use of this program.

  • enter the relevant information about kV, Cs, fraction of amplitude contrast (see Toyoshima papers on this topic: 1988 Ultramicroscopy 25:279 and 1993 Ultramicroscopy 48:165).
  • sample size corresponds to the pixel size and magnification should be calibrated for your microscope
  • min/max defocus helps constrain PLTCTFX to get the correct solution.
  • PLTCTFX requires a definition file containing the above EM parameters (pltctf.def). Uncheck the box if you wish EMIP to create this file.
  • You may be able to get a result by simply hitting NEXT for the several windows presented by PLTCTFX . However, better results may obtained by selecting data along each of the sectors. Do this by clicking the start position along the axis followed by Start R . Then click the ending position along the axis followed by End R . Do this sequentially for each sector. Subsequent windows will indicate the region of the layer line that has been selected.
  • The result is obtained after running CTFFIT . If you don't like the result, just try again.

CTFFIND uses a program developed by Niko Grigorieff, which is included both with the image2000 package, with freealign or as a standalone program: http://emlab.rose2.brandeis.edu/grigorieff/downloads.html . This program requires a minimum of user intervention and works by dividing the image up into "tiles" and performing an incoherent average of the resulting Fourier transforms. The program works with square or rectangular images. The result is analyzed to determine defocus and astigmatism.

  • Enter the tile size (pixels), a resolution range for the analysis, and a step size for fitting of CTF values.
  • Also enter names for the output file and the log file to view the results.
  • Res Min and Res Max correspond to high pass and low pass filters respectively
  • Evaluate the resulting fit graphically by selecting view output . This will use the program chosen on the TRANSFORM page to show the incoherent FFT average together with a simulated FFT for comparison. Defocus values will be printed to std out. Check log file for more details.

2D Crystallography

2D crystallography involves deriving amplitude and phase information from a series of discrete reflections in the Fourier transform from individual images. These data are then corrected for the contrast transfer function and combined together to create a 3D data set (Unwin & Henderson, 1975. J. Mol. Biol. 94:425-440; Amos et al. 1984. Prog. Biophys. Mol. Biol. 39:183-231).

In order to maximize the resolution of data obtained from 2D crystals, a process known as unbending is performed (described by Henderson et al. 1986. Ultramicroscopy 19:147-178). This process starts by determining the lattice parameters from the Fourier transform. These lattice parameters are then used to calculate a filtered image, which is then used to detect the position of the unit cells within the crystal by cross correlation. Deviations of the actual unit cell positions from an ideal lattice are determined and use to reinterpolate the image densities to produce more perfect crystalline order. This process is generally repeated 2 or more times to optimize the resolution. This page guides the user through all the necessary steps of unbending in order to produce a listing of amplitudes and phases from each individual image. click here for details ?

Helical Reconstruction

The Fourier transforms from helical assemblies consist of a series of layer lines. If the helical symmetry is known, then these data can be used to derive a 3D structure from a single image ( DeRosier and Moore, 1970. J. Mol. Biol. 52:355-369). More generally, layer lines from a number of images are averaged together to improve the signal-to-noise ratio and resolution, prior to 3D reconstruction. Furthermore, methods developed by Unwin and colleagues divide the helical assembly up into short segments in order to compensate for disorder and distortion along the length of the particle. EMIP provides an interface for guiding the user through the relevant programs. click here for details

-- DavidStokes - 31 Dec 2008

image