Gatan K2 Installation Notes » History » Version 13
Anchi Cheng, 04/23/2013 06:29 PM
1 | 1 | Jim Pulokas | h1. Gatan K2 Installation Notes |
---|---|---|---|
2 | |||
3 | This is a preliminary document. Use at your own risk. |
||
4 | |||
5 | h2. Install the latest SerialEM DigitalMicrograph plugin: SEMCCD-GMS2-64.dll |
||
6 | |||
7 | This is the latest one that includes a socket interface. Not sure if it is available from SerialEM download site yet, so you can download it from our redmine Files: http://emg.nysbc.org/projects/leginon/files |
||
8 | 5 | Jim Pulokas | Copy it to C:\Program Files\Gatan\Plugins\ (maybe ProgramData is okay too instead of ProgramFiles) |
9 | 1 | Jim Pulokas | |
10 | 6 | Jim Pulokas | Set the environment variable SERIALEMCCD_PORT to whatever port you want, preferably something between 50000 and 60000 to avoid conflict with other programs. |
11 | |||
12 | |||
13 | 1 | Jim Pulokas | h2. Install 64 bit versions of the usual Python stuff |
14 | |||
15 | The 64 bit Python installer failes to update the windows registry properly if installed for "all users". When installing other python packages, it will complain that it can't find python. To solve this, install Python only for the current user. Or search google for how to install for all users and then update the registry manually. |
||
16 | |||
17 | We have tested with: |
||
18 | |||
19 | * Python 2.7.3: http://python.org/ftp/python/2.7.3/python-2.7.3.amd64.msi |
||
20 | * PyWin32 extension: pywin32-218.win-amd64-py2.7.exe, available here: http://sourceforge.net/projects/pywin32/files/pywin32/Build%20218/ |
||
21 | * wxPython: http://downloads.sourceforge.net/wxpython/wxPython2.8-win64-unicode-2.8.12.1-py27.exe |
||
22 | |||
23 | Some of the other packages have no officially supported 64 bit versions, but they are easy to find with google. To save the trouble, I dumped some of them in our Files: http://emg.nysbc.org/projects/leginon/files including: |
||
24 | |||
25 | Tested: |
||
26 | |||
27 | * MySQL-python-1.2.3.win-amd64-py2.7.exe |
||
28 | * numextension-svn.win-amd64-py2.7.exe |
||
29 | * numpy-MKL-1.6.2.win-amd64-py2.7.exe |
||
30 | * PIL-fork-1.1.7.win-amd64-py2.7.exe |
||
31 | * scipy-0.11.0.win-amd64-py2.7.exe |
||
32 | (many of those originally came from http://www.lfd.uci.edu/~gohlke/pythonlibs/) |
||
33 | |||
34 | You do not need to install comarray or libcv. |
||
35 | |||
36 | h2. Install myami from svn trunk |
||
37 | |||
38 | Our usual routine lately is: |
||
39 | * install Tortoise SVN client |
||
40 | * check out myami trunk sandbox to wherever you want |
||
41 | * Set PYTHONPATH to you myami sandbox, rather than installing each package to site-packages. |
||
42 | |||
43 | h2. Configure myami |
||
44 | |||
45 | * create a folder: C:\Program Files\myami\ |
||
46 | * copy the templates for config files into the new folder and rename them without the ".template" |
||
47 | ** sinedon.cfg - edit with your DB settings |
||
48 | ** leginon.cfg - edit with your leginon settings |
||
49 | 7 | Anchi Cheng | ** instruments.cfg - The camera modes are configured as separate cameras as follows. Note that Super Resolution should be double the size of Linear and Counting. Also note that zplane will be relative to any other cameras in your system. Anything below K2 should have a lower zplane. |
50 | 9 | Anchi Cheng | *In addition, to make the images acquired from the camera to have the [[Leginon Image Orientation|standard Leginon orientation]], the camera configuration in Digital Micrograph will need a rotation and flip (270 degree rotation and a horizontal flip on our camera). Therefore, the height becomes longer than width*. |
51 | 7 | Anchi Cheng | <pre>[Gatan K2 Linear] |
52 | 13 | Anchi Cheng | class: dmsem.GatanK2Linear |
53 | 2 | Jim Pulokas | zplane: 50 |
54 | 12 | Anchi Cheng | width: 3710 |
55 | height: 3838 |
||
56 | 2 | Jim Pulokas | |
57 | [Gatan K2 Counting] |
||
58 | 13 | Anchi Cheng | class: dmsem.GatanK2Counting |
59 | 2 | Jim Pulokas | zplane: 50 |
60 | 12 | Anchi Cheng | width: 3710 |
61 | height: 3838 |
||
62 | 2 | Jim Pulokas | |
63 | [Gatan K2 Super] |
||
64 | 13 | Anchi Cheng | class: dmsem.GatanK2Super |
65 | 2 | Jim Pulokas | zplane: 50 |
66 | 12 | Anchi Cheng | width: 7420 |
67 | height: 7676</pre> |
||
68 | 3 | Jim Pulokas | |
69 | h2. Try it out |
||
70 | |||
71 | Need to start DigitalMicrograph first |
||
72 | |||
73 | 4 | Jim Pulokas | Test pyscopy without leginon from python command line:<pre> |
74 | 13 | Anchi Cheng | import pyscope.dmsem |
75 | k = pyscope.dmsem.GatanK2Counting() |
||
76 | 3 | Jim Pulokas | k.setExposureTime(200) |
77 | 1 | Jim Pulokas | k.getImage()</pre> |
78 | 4 | Jim Pulokas | |
79 | Then try Leginon. |
||
80 | 1 | Jim Pulokas | |
81 | h2. Use it in Leginon |
||
82 | 10 | Anchi Cheng | |
83 | If you want to use DM's dose fractionation, activate the "save frames" check box in the particular preset camera configuration. You can also use DM's frame alignment algorithm by activating "align frames" check box. |
||
84 | |||
85 | We have also a script for transferring the frame images from the Gatan computer to Leginon's session image path using rsync. See [[DDD_raw_frame_file_transfer]]. This will remove also the transferred files on Gatan computer so that more images can be acquired automatically. If you choose to only "align frames" but not "save frames", this script delete the frames generated by DM without transferring them. |
||
86 | 12 | Anchi Cheng | |
87 | Another python script in leginon directory "cleanddraw.py" can help you clean up the transferred raw frames when you start to run out of disk space, too. See Feature #1784 for more details. |
||
88 | 10 | Anchi Cheng | |
89 | Here are some notes on odd things that we have to do: |
||
90 | |||
91 | 1 | Jim Pulokas | # Make sure your camera configuration is set to [[Leginon image orientation]] and instruments.cfg matches that resulting orientation and dimension. |
92 | 11 | Anchi Cheng | # We use DM's hardware Dark/Gain correction in counted and super-resolution mode. DM will only give usable dark reference when the camera is unflipped and unrotated. |
93 | 10 | Anchi Cheng | Therefore, it is necessary to switch between flip/rotate and unflip/unrotate to maintain [[Leginon image orientation]] convention and preparing dark/gain reference in DM, respectively. Many new users forget to switch at first and need reminder several times. |
94 | # You will still need to do gain/dark correction in Leginon to correct in DM so called software correction. WIthout it, the image of long exposure shows artifact even in counted and supre-resolution mode. |
||
95 | # K2's dose fractionation only works with full camera dimension without binning. |
||
96 | 13 | Anchi Cheng | # K2 interface in DM restricts the exposure time to multiple of some set number, depending on the mode. When you enter in DM an invalid number, it automatically change it to the valid one when you click the acquire button. pyscope/dmsem.py has hard-coded values for these precision. Compare them to the precision of the DM version you have since it may change. |
97 | # K2 frame save frame rate is currently hard-coded in pyscope/dmsem.py as the variable self.dosefrac_frame_time = 0.200. You may change this number to get different frame time. |