Project

General

Profile

Make DE movie stack » History » Revision 3

Revision 2 (Anchi Cheng, 06/18/2012 09:41 PM) → Revision 3/4 (Anchi Cheng, 06/23/2015 12:41 AM)

h1. Make DE DE-12 movie stack 

 We've made appion function to correct raw frames from DE12 or DE20 DE-12 collected through Leginon.    This is not functional in standard Leginon/Appion installation with CentOS 5.x because the module we found (tifffile.py) that reads tiff files efficiently is written in python 2.6 while CetOS 5.x comes with python 2.4 still. 

 If you would like to use this, you will need to install python 2.6 and its matching supporting packages on some computer and run it there with database and data disk connection.    Leginon does work with python 2.6. 

 Two simple examples that uses the module are attached here. 

 *correctframes.py* let you correct a range of raw frames in an image and output as mrc file. 
 *correctstack.py* let you correct each frame in the specified summed image and output at 2D image stack in mrc format. 

 type: 
 <pre> 
 python correctframes.py 
 </pre> 
 for the options 

 In Appion, you should get a processing menu for Direct Detector Tools if you configure myamiweb/config.php with  
 <pre> 
 define('HIDE_FEATURE',false); 
 </pre> 
 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. 

 h2. How to do it yourself 

 h3. Find the reference images 

 Use leginon/getReferences.py to find the reference images for the leginon sum image. 

 h3. You can convert the tiff frame file to single mrc file with pyami/tifffile.py 

 This is written by The Regents of the University of California and Produced by the Laboratory for Fluorescence Dynamic. 

 To convert to numpy array, you can use these lines 
 <pre> 
     from pyami import tifffile 
     tif = tifffile.TIFFfile(frameimage_path) 
     a = tif.asarray() 
 </pre> 

 To write a numpy array to mrc file 
 <pre> 
     from pyami import mrc 
     mrc.write(a,framemrc_path) 
 </pre> 

 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. 

 Therefore the corrected frame at 25 frames per second need to be corrected in the following way: 

 <pre> 
 corrected_frame = (raw_frame - dark/25) * norm 
 </pre> 

 h3. Beware of image flip/rotation.