Project

General

Profile

Leginon Developer Guide » History » Revision 7

Revision 6 (Jim Pulokas, 08/27/2013 02:33 PM) → Revision 7/23 (Jim Pulokas, 08/27/2013 03:11 PM)

h1. Leginon Developer Guide 

 h2. Overview of the code repository 

 Over the years, Leginon has grown and divided.    With the addition of the Appion processing pipeline, several components that were once subsystems of Leginon were broken out to be used as a common tool set for both Leginon and Appion.    The top level master package that now contains the entire software suite developed at AMI is called _myami_.    Inside of myami you will find leginon, appion and all of these common packages.    Here is a brief description of the contents of the AMI software repository: 

 * *myami* - the complete suite of software 
 ** *appion* - the processing pipeline 
 ** *comarray* - Python extension to retrieve COM SafeArrays into NumPy arrays (deprecated, see [[Installing comtypes]] instead) 
 ** *dbschema* - If you are running your myami system out of a sandbox and frequently pulling changes from the repository, then your database schema is generally kept up to date automaticall.    But most production installations update only between major revisions.    The dbschema directory summarizes all of the database schema updates between revisions, which can be applied in sequence when doing a major jump in revisions. 
 ** *imageviewer* - this is a newer image viewer widget for wx meant to replace the old ImageViewer widget in the Leginon GUI.    So far only the tomography node uses it. 
 ** *install* - adds automation to the installation process 
 ** *leginon* - microscope control and automation 
 ** *modules* - python extensions that must be compiled 
 *** *libcv* - key point detection and matching 
 *** *numextension* - misc image functions 
 *** *radermacher* - functions for tilt picker, see http://emg.nysbc.org/projects/tiltpicker/wiki/TiltPicker_Installation 
 ** *myamiweb* - all of the php web server stuff for the the web viewer, appion pipeline, etc. 
 ** *programs* -  
 
 ** *pyami* - miscellaneous pure python modules that are usefull for both leginon and appion 
 ** *pyscope* - Python interface to several TEMs and cameras 
 ** *redux* - a Python replacement for php_mrc, but also generally useful on its own for image conversions, FFTs, resizing, etc. 
 ** *sinedon* - object relational mapping module, so you can use python objects to populate your MySQL database 

 


 h2. Brief description of some of the design core code components 

 * *leginondata.py* and *event.py* contain the definitions of Leginon 

 Leginon is a flexible framework for automating your TEM all classes of data collection. The flexibility comes from the fact that key tasks are coded into _nodes_, which can then be dynamically assembled into an event driven _application_.    Each node performs a task, and generates events to trigger other nodes to perform their tasks.    In addition to passing events passed around between each other, nodes may also share the data they produce.    For example, an Acquisition node may acquire an image from the instrument, then generate and event to notify another node to process that image.    Another area of flexibility is and/or stored in how applications may distribute the nodes among several hosts on database. 
 * *node.py* defines *Node*, the network. base class for all nodes.    Processing could be optimized depending on which nodes are on the instrument host versus which ones are on a more powerful host elsewhere. 

 h2. Adding new features and functionality to Leginon 

 The two most common ways you You will be adding find a new idea to Leginon: 

 * a small addition to an existing node.    For example, a new parameter or check box that alters the behavior lot of the main task. 
 * a completely new basic node that adds a major feature.    For example, a new target finding technique. functionality here, like passing events, storing user preferences, etc. 

 h2. Simulation: when you do not have access to a real TEM and/or camera. Brief description of some of the nodes 

 * You still need *targetwatcher.py* defines the overall infrastructure in place:    myami installed, database created, etc., but at least this can still be an option class *TargetWatcher* which includes basic functionality for a stand-alone laptop processing targets that were produced by another node.    The input is not even connected to target list, which is handled by the network. 
 * configure your instruments.cfg file with SimTEM and SimCCDCamera instruments. 
 * Start Leginon and do not connect to any external clients during *processTargetListData* method.    This method loops over the session setup wizard targets, calling *processTargetData* on each one.    The *processTargetData* method must be defined in a subclass. 
 * Most functionality can be tested, however your images will be simulated and *acquisition.py* defines the more advanced target finders may not work so well. *Acquisition* class, which is a subclass of *TargetWatcher*.    It defines the *processTargetData* function such that an acquisition sequence happens at each target.    More info, see: [[acquisition.py]] 

 h2. Useful diagonosis scripts 

 * [[testing pyscope instrument]] functions.