Make DE movie stack » History » Version 4
Anchi Cheng, 06/23/2015 12:42 AM
1 | 3 | Anchi Cheng | h1. Make DE movie stack |
---|---|---|---|
2 | 1 | Anchi Cheng | |
3 | 3 | Anchi Cheng | We've made appion function to correct raw frames from DE12 or DE20 collected through Leginon. |
4 | 1 | Anchi Cheng | |
5 | Two simple examples that uses the module are attached here. |
||
6 | |||
7 | 2 | Anchi Cheng | *correctframes.py* let you correct a range of raw frames in an image and output as mrc file. |
8 | *correctstack.py* let you correct each frame in the specified summed image and output at 2D image stack in mrc format. |
||
9 | |||
10 | type: |
||
11 | <pre> |
||
12 | 1 | Anchi Cheng | python correctframes.py |
13 | </pre> |
||
14 | for the options |
||
15 | |||
16 | 3 | Anchi Cheng | In Appion, you should get a processing menu for Direct Detector Tools |
17 | That will allow you to choose what images to correct in the usual Appion way and make the mrc stacks for the whole session on given preset. |
||
18 | |||
19 | h2. How to do it yourself |
||
20 | |||
21 | h3. Find the reference images |
||
22 | |||
23 | Use leginon/getReferences.py to find the reference images for the leginon sum image. |
||
24 | |||
25 | 4 | Anchi Cheng | h3. You can convert the tiff frame file to single mrc file with pyami/tifffile.py and pyami/mrc.py |
26 | 3 | Anchi Cheng | |
27 | This is written by The Regents of the University of California and Produced by the Laboratory for Fluorescence Dynamic. |
||
28 | |||
29 | To convert to numpy array, you can use these lines |
||
30 | 1 | Anchi Cheng | <pre> |
31 | 3 | Anchi Cheng | from pyami import tifffile |
32 | tif = tifffile.TIFFfile(frameimage_path) |
||
33 | a = tif.asarray() |
||
34 | 1 | Anchi Cheng | </pre> |
35 | 3 | Anchi Cheng | |
36 | To write a numpy array to mrc file |
||
37 | <pre> |
||
38 | from pyami import mrc |
||
39 | mrc.write(a,framemrc_path) |
||
40 | </pre> |
||
41 | |||
42 | h3. DE dark reference intensity comes from dark current and is proportional to exposure time. To do dark correction, you need to know the frame rate (typically 25 frames per second) and scale the dark image which is made to be 1 second. |
||
43 | |||
44 | Therefore the corrected frame at 25 frames per second need to be corrected in the following way: |
||
45 | |||
46 | <pre> |
||
47 | corrected_frame = (raw_frame - dark/25) * norm |
||
48 | </pre> |
||
49 | |||
50 | h3. Beware of image flip/rotation. |