Skip to content

Import Marker coordinates from IMOD

FriedrichFoerster edited this page May 26, 2020 · 2 revisions

Import Marker coordinates from IMOD

overview

IMOD is a common program for reconstruction of electron tomograms. In particular, it has handy functionality for tracking fiducial markers and features. The coordinates of these features can be used for alignment in pytom, as described in the following. From the files automatically generated during alignment with etomo the marker coordinates for later use in PyTom can be obtained. You will need one file from IMOD for reconstruction containing the coordinates of the markers in the un-transformed tiltseries: the WIMP file. IMOD itself by default makes use of a pre-transformed tiltseries according to a crude pre-alignment of the tiltseries (see also: tiltalign documentation). Thus, in order to get the raw marker coordimates you need to transform them back, either in PyTom or the built-in IMOD functions. IMOD will internally store the marker coordinates in a .fid file and the pre-transformation in a .prexg file. Moreover, the marker coordinates are stored in a coordinate system that is pre-shifted compared to the original files. The pre-shift binning value is somewhat hidden in the advanced options of the preprocessing tab in IMOD.

If you transform the marker coordinates in PyTom everything is straightforward. You obtain the WIMP files using 3dmod:

  1. Start 3dmod by typing 3dmod in the command line.
  2. Select the model file (myTiltSeries.fid), which is generated by the etomo workflow.
  3. Press 'OK'.
  4. A viewer for the tilt series and the small 3dmod window opens.
  5. Save WIMP file in the 3dmod window using menu: File -> Write Model As -> Wimp.

Alternatively you can convert the coordinates using imod tools, which is mentioned for the sake of completeness here: To convert the pre-transformed marker coordinates back to their original values the following IMOD programs can be used from the command line (see also: xfmodel):

xfmodel -back -prealign myTiltSeries.prexg -input myTiltSeries.fid -o myTiltSeries_raw.fid

For tiltseries myTiltSeries, this command will generate a .fid file with back-transformed marker coordinates (=myTiltSeries_raw.fid). In case you worked with binned images in the IMOD alignment you will also need to revert the binning. For example, the command would be the following for selection scale=1/8 (1/binimod):

xfmodel -back -scale 0.1250 -prealign myTiltSeries.prexg -input myTiltSeries.fid -o myTiltSeries_raw.fid

The _raw.fid file can now be converted into an WIMP file in 3dmod from the IMOD package:

  1. Start 3dmod by typing 3dmod in the command line.
  2. Select the raw model file (the myTiltSeries_raw.fid, which was just generated). If you need to revert binning make sure you select model and also tilt series- otherwise the magnification is somehow not taken into account - weird ...
  3. Press 'OK'.
  4. A viewer for the tilt series and the small 3dmod window opens.
  5. Save WIMP file in the 3dmod window using menu: File -> Write Model As -> Wimp.

Tomogram Alignment from WIMP file

The reconstruction script now supports alignment from WIMP files. Just specify the WIMP file as the markerfile instead of an EM markerfile and there you go. Additionally, you may often need to specify the tilt angles in the form of a tlt file because they are typically not stored anywhere in the header.