pyCoAn: clem add-on tutorial
This tutorial shows how to deduce alignment parameters between fluorescence images and images from electron cryo-microscopy using the holes in the sample support film. See our recent bioRxiv preprint for more details on the background. It requires the pyCoAn base distribution and the pyCoAn clem add-on. In the example code boxes in this tutorial, lines with bold font will denote command input, lines with standard font are output lines. The first step is to start the pyCoAn shell by typing 'coan' at the prompt, then hitting return:
[user@machine ~]$ coan
Activating auto-logging. Current session state plus future input saved.
Filename : .coan
Mode : append
Output logging : False
Raw input log : False
Timestamping : False
State : active
Welcome to pyCoAn, the Correlative Analysis Environment for EM Image Processing
The current time is Tue Aug 15 18:29:04 PDT 2017
Generally, images are imported into pyCoAn using the 'Img' construct. For example, if one wanted to import an mrc file called 'em-image.mrc', one would use:
>>> em = Img('em-image.mrc')
eman reader
>>> print em
DeMan Img object (182,161,1)
The 'em' object is then available to be manipulated within pyCoAn. To get a general idea of what is possible, refer to the pyCoAn documentation. pyCoAn understands a large variety of input formats including 'mrc', 'tif', 'png', 'jpg' etc. The filetype is determined by the file extension and an appropriate file reader is determined automatically. For the tutorial, we will use two synthetic images that are distributed with the pyCoAn clem add-on for the tutorial. They can be imported in the following way.
>>> em = clem.tutorial('em')
eman reader
>>> fl = clem.tutorial('fl')
freeimage reader
The images can be locked at using the 'imshow' method:
>>> em.imshow()
>>> fl.imshow()
We will need an approximate angle that transforms the fluorescence image into the reference frame of the EM image. In this case, a counter-clockwise rotation of a little over 90 degrees is required. Let's see if a rotation of -100 degrees works.
Yes, this looks close enough. The rotation has no direct effect on the calculation. Its main purpose is to make it easier to pick the hole correspondences when the time comes. This ends the preparatory steps. Now we will run the interactive function to determine the transform from fluorescence to EM image space.