Index by title

"Calibrations" Application

Since the applications can be imported easily, we will not go through how it is created. Here, we will just list the node class for each node and the event bindings of the application.

Click Apply and Save.

Table 18.3. Calibrations Nodes:

Node Class: Node alias: Launcher:
DoseCalibrator Dose main
Navigator Navigation main
BeamTiltCalibrator Beam Tilt main
PresetsManager Presets Manager main
PixelSizeCalibrator Pixel Size main
MatrixCalibrator Matrix main
Corrector Correction main
Focuser Focus main
GonModeler GonioModeling main
EM em scope


< Create Leginon "Simple Application" | "MSI-Edge" Application >



"Manual" Application

The application "Manual" allows the microscope user to operate the FEI Low Dose kit and acquire CCD images by hand that are saved into the Leginon database. There is no required bindings.

Table 18.7. Manual Nodes:

Node Class: Node alias: Launcher:
EM Instrument instrument
Corrector Correction main
ManualAcquisition Manual main

< "MSI-Tomography" Application



"MSI-Edge" Application

This section describes the node classes and event bindings of the application.

Table 18.4. MSI-Edge Nodes:

Node Class: Node alias: Launcher:
EM Instrument scope
PresetsManager Presets Manager main
DriftManager Drift Manager main
MosaicClickTargetFinder Square Targeting main
Acquisition Grid main
MosaicTargetMaker Grid Targeting main
Navigator Navigation main
Corrector Correction main
Acquisition Square main
Acquisition Hole main
HoleFinder Exposure Targeting main
HoleFinder Hole Targeting main
FFTMaker Focus FFT main
Focuser Z Focus main
Focuser Focus main
FFTMaker Exposure FFT main
Acquisition Exposure main


< "Calibrations" Application | "MSI-T" Application >



"MSI-raster" Application

The basic flow of "MSI-raster" is the same as other MSI applications. HoleFinder class nodes are replaced with RasterFinder in the application. Node aliases that refer to Hole are replaced with Sub-square. The bindings of the corresponding nodes are the same as those in MSI-Edge and MSI-T.

Table 18.5. MSI-raster Nodes:

Node Class: Node alias: Launcher:
EM Instrument scope
PresetsManager Presets Manager main
DriftManager Drift Manager main
MosaicClickTargetFinder Square Targeting main
Acquisition Grid main
MosaicTargetMaker Grid Targeting main
Navigator Navigation main
Corrector Correction main
Acquisition Square main
Acquisition Sub-square main
RasterFinder Exposure Targeting main
RasterFinder Sub-square Targeting main
FFTMaker Focus FFT main
Focuser Z Focus main
Focuser Focus main
FFTMaker Exposure FFT main
Acquisition Exposure main

< "MSI-T" Application | "MSI-Tomography" Application >



"MSI-T" Application

"MSI T" is identical to "MSI" with one exception. All HoleFinder class nodes are replaced with JAHCHoleFinder in the application.


< "MSI-Edge" Application | "MSI-raster" Application >



"MSI-Tomography" Application

The main difference from MSI are the replacement of Exposure node with Tomography, and the addition of Tomography Preview, "Align ZLP", and "Measure Dose" nodes

Table 18.6. MSI-Tomography Nodes:

Node Class: Node alias: Launcher:
EM Instrument scope
PresetsManager Presets Manager main
DriftManager Drift Manager main
MosaicClickTargetFinder Square Targeting main
Acquisition Grid main
MosaicTargetMaker Grid Targeting main
Navigator Navigation main
Corrector Correction main
Acquisition Square Q main
Acquisition Hole Q main
ClickTargetFinder Tomography Targeting main
ClickTargetFinder Hole Targeting main
FFTMaker Focus FFT main
Focuser Z Focus main
Focuser Tomo Focus main
Acquisition Tomography Preview main
Tomography Tomography main
MeasureDose Dose Measurement main
AlignZeroLossPeak Align ZLP main

< "MSI-raster" Application | "Manual" Application >



1st Pass application

This application is mainly a shortened MSI application without any focusing and limit the imaging to intermediate mag.

Images taken are:
  1. a small atlas of gr images.
  2. one sq image with intact support film and reasonable stain located closest to the center of each gr images.
  3. raster of hl images sample different area on the grid square.

Square Target Filtering:

Square Target Filtering node belongs to CenterTargetFilter Class and is unique to "Robot-MSI-Screen 1st Pass" application. It filters the centerred most target per parent image so that the screening samples are spread out through the grid. If you want more targets to pass through, simply increase the value in its settings. This is unique for this application.

Node Classes, function, and corresponding node in other MSI's:

Refers to MSI-Raster or MSI in General for the functions of the following nodes


< Robot node | Evaluation application >



2nd Pass application

This application transforms the targets selected from Evaluation according to the rotation and shift of the second grid insertion and acquires high mag images with focusing.

Images taken are:
  1. center-most gr image to find rough grid transformation caused by re-insertion.
  2. gr image on which the target is selected acquired after the re-insertion transformation.
  3. sq image based on the target.
  4. autofocusing images
  5. raster of en images based on the target.

2nd Pass Targeting Node:

"2nd Pass Targeting" node is unique to "Robot-MSI-Screen 2nd Pass" application. It displays the grid atlas from the first pass and the targets selected on them. It also allows editing of the targets. Once submitted, it alsow perform the acquisition of an initial gr image for target transformation and the calculation and application of the transformation. The refresh tool is used to refresh target status and the submit tool for starting target processing.

Node Classes, function, and corresponding node in other MSI's:

Refers to MSI-Raster or MSI in General for the functions of the following nodes


< Evaluation application



2 Way Viewer

The 2 Way Viewer allows you to view the selected image in two image view panes side by side. The following example shows the original mrc image next to its Fourier transform. For more details see Image Viewer Overview.

2 Way Viewer Screen:


< Image Viewer | 3 Way Viewer >



3 Way Viewer

The 3 Way Viewer allows you to view the selected image in 3 adjacent Image View panes. The following example shows the original mrc image along with a heat map view and Fourier transform. For more details see Image Viewer Overview.

3 Way Viewer Screen
3 Way Viewer


< 2 Way Viewer | Dual Viewer >



Acquisition

The Acquisition node is the base node to acquire images with in a Leginon application. This node receives a Published Target List and navigates to each target using the specified Move Type. Then, an image is acquired and published to the database. Acquisition and Click Target Finders go together. The Click Target Finder nodes generate the list of targets and the Acquisition acquires images at each target. More than one preset can be assigned as a sequence to a single acquisition node; therefore, multiple images can be taken at each target. The ability to acquire many images at one target is how a defocal high magnification pair of images can be taken in the MSI application.

Required bindings:

AcquisitionNodeAlias- (ChangePresetEvent) -> PresetsManagerNode
PresetsManagerNode - (PresetChangedEvent) -> AcquisitionNodeAlias

Bindings with the previous target makers or click target finder and the next click target finder:

TargetMakerNodeAlias - (ImageTargetListPublishEvent) -> AcquisitionNodeAlias
AcquisitionNodeAlias - (TargetListDoneEvent) -> TargetMakerNodeAlias
AcquisitionNodeAlias - (AcquisitionImagePublishEvent) -> ClickTargetFinderNodeAlias
ClickTargetFinderNodeAlias - (ImageProcesstDoneEvent) -> AcquisitionNodeAlias

Optional Bindings with DriftManager to allow target correction after drift:

AcquisitionNodeAlias - (NeedTargetShiftEvent) -> DriftManagerNodeAlias
DriftManagerNodeAlias - (AcquisitionImageDriftPublishEvent) -> AcquisitionNodeAlias

Optional Bindings with Navigator to allow (iterative) target move correction:

AcquisitionNodeAlias - (MoveToTargetEvent) -> NavigatorNodeAlias

Acquisition Toolbar ( Leginon/Acquisition/Toolbar> )

Acquisition Settings ( Leginon/Acquisition/Settings> )


BeamFixer >



acquisition.py

Defines a subclass of TargetWatcher, defining a specialized processTargetData method which acquires images at each target using a detailed set of user preferences.

processTargetData


Adding a new focus sequence to a focus node

You may have a grid that requires additional focusing step at either Z_Focus or Focus node that is not available to be activate in Leginon by default. In this case, a new step can be added using this instruction:

  1. open the Focus Sequence dialog.
  2. type the name of the new step in the box below the heading "Focus sequence"
  3. click on the "+" tool to add to the sequence. This is most likely show up not as the first step.
  4. click on the arrows to move the new step to where you want while it is highlighted.
  5. select the preset and method to measure the defocus.
  6. enter the angle you want to use to induce image shift for focus measurement. Note that the unit changes according to the focus method. For example, the default 0.01 is not going to be very useful if you are tilting the stage since it is in degrees.
  7. you might want to change fit limit if the focus limit is "Beam Tilt".
  8. Give a upper limit you will allow a correction to be made. This prevents images that has no feature to initiate an unreasonable correction.
  9. Correction type depends on the purpose. It is not recommended to use "Defocus" correction type in Z_Focus node since it is meant to do rough focusing that move the specimen to eucentric height.
  10. There should only be one activated Wait for drift per node and is usually only used for fine adjustment in Focus node.
  11. click O.K. and save the sequence.

< Optimizing Autofocus | Queuing option >



Additional Setup After Webserver initialization

If your webserver installation is successful, a number of tables will be propagated in the databases. There were several options for setting up databse user privileges recommended in Database Server Installation. The following additional steps should be taken, depending on which option you previously used.


< Web Server Installation | Installation on the microscope computer>



Upgrade at the computer controlling the microscope and camera (Window)

By switching to svn package check out, you now need to install svn on Windows to get the
updated packages. Because numextension and libCV requires extra compiler, we have created
window installer for them for python 2.5 and made them available through http://www.leginon.org/

See Installation Troubleshooting and the Leginon Forum searching
for "install" if you run into problems.

Packages required from NRAMM

Here are the packages you need to install with python installer

SVN Package Name Installed Python Package Name Reason for update:
leginon Leginon new features
pyami pyami clean up
sinedon sinedon new stuff
pyScope pyScope new instrument configuration
ImageViewer ImageViewer updated and required for tomography
comarray comarray new for Gatan and Eagle camera

Because numextension and libCV requires extra compiler, we have created window installer
for them for python 2.5 and made them available through http://www.leginon.org/

Downloadfile Name Installed Python Package File Reason for update:
NumExtension-1.2.0.win32-py2.5.exe numextension.pyd clean up
libCV-0.2.win32-py2.5.exe libCV.pyd bug fixes

Uninstall your existing packages:

Although new installation overwrite the old in most cases, problem has been observed in
the past. Therefore, it is best to remove the old files before new installation.

Use "Add or Remove Programs" application in "Control Panel" to do this. Leginon related
packages are shown with prefix "Python 2.5"

If you didn't use Installer to install previously, the packages may not show up in the
Programs list. Simply remove the folder containing the old packages in this case.

Download and install SVN client program:

By switching to svn package check out, you now need to install svn client on Windows to
get the updated packages. We recommand TortoiseSVN http://tortoisesvn.tigris.org/ .

Check out SVN Source Files from the depository

Use your mouse to do the following

Install the packages you downloaded from NRAMM svn depository

Download the two Window Installer Files from Leginon website

http://www.leginon.org/

Install individual packages

Excute the installer files and follow the instruction.

Additional Package required from NRAMM for Gatan camera or camera that uses TIA

comarray package need to be install with python

Modify instruments.cfg:

Modify the file instruments.cfg in the installed pyScope directory.

[tem]
class: tecnai.Tecnai
[camera]
class: gatan.Gatan
The file contains other examples of microscope and camera drivers that we distribute from NRAMM.

Run updatecom.py

From a command line window:

cd C:\python25\Lib\Site-Packages\pyScope
C:\python25\python.exe updatecom.py

This should generate a few files, including tecnaicom.py, gatancom.py and tietzcom.py, in the same directory.


Add a new project

In the View Projects page


< Go to project tools page | Edit an existing project >



Add a new project for testing

In the View Projects page


< Setup steps needed in database Administration Tools | Test Leginon with Simulator >



In the View Projects page


Administration Tools

  1. Recommendation for setup at a new institute
  2. Steps involved in the installation
  3. Set up for a new regular user
  4. More about Groups
  5. Revert Settings
  6. Applications
  7. Goniometer

After a new installation, you will have to input Groups,Users to the database you have just created. You may want to import new Applications later or revert Leginon node settings. These tasks can be performed through the web-based Administration Tools.


< Complete Installation | Using Project Management Tools >



Administration Tool problems

Incomplete xml-imported application

Why:

How do you know it is imcomplete? View the application saved in the database in the web admin tool

Solution: Try it again.


< Installation/Update problems | Test run operation problems >



Advanced Features


< Running "Manual" Application | Using the Web viewer >



An example of working port-forwarding configuration

(by Brian J. Gibbens)

For those interested, this is how I set up Leginon on the TF20 in the
Kornberg lab at Stanford with the following configuration:

  1. TECNAI_COMPUTER (Windows XP) not connected to network, but connected
    directly to Tecnai F20 and to
    TF20SUPPORT_COMPUTER (Windows XP) through two separate routers. Static
    IP addresses on all routers.
  2. TF20SUPPORT_COMPUTER connected to network, and set up as a gateway
    for the TECNAI_COMPUTER through a directly connected separate router.
    Gateway setting (IP address of the TF20SUPPORT_COMPUTER) was added to
    the TCP/IP settings on the router on the TECNAI_COMPUTER that connects
    to the TF20SUPPORT_COMPUTER.
  3. WEBSERVER_DATABASE_COMPUTER (Suse 11.1 Linux) with MySQL, PHP, and
    Samba share for drive mapping on PC's. Connects to TF20SUPPORT_COMPUTER
    through network.

--Norton firewall settings on TF20SUPPORT_COMPUTER configured to allow
communication to both '1' and '3'.

--Appropriate IP addresses and hostnames added to the hosts files
(C:/WINDOWS/System32/drivers/etc/hosts.txt on Windows PC's and
/etc/hosts on Linux). '2' and '3' listed in hosts file on '1'; '1' and
'3' listed in hosts file on '2'; and '2' only listed in hosts file on
'3' since all communication from '1' to '3' through '2' will appear to
come from '2'.

--Program for port forwarding (AUTAPF) installed on TF20SUPPORT_COMPUTER
and set up to forward all appropriate ports to IP address of the router
on TECNAI_COMPUTER that connects to TF20SUPPORT_COMPUTER.


Go up



An introduction to Leginon

  1. What is the Leginon System?
  2. Terminology
  3. Graphical User Interface
  4. Minimum Requirements and current NRAMM setup
  5. Getting Started

Version Change Log >



Applications

Applications define how nodes are linked together in order to form a specialized Leginon application or program. Because Leginon uses a nodal or modular archetecture, multiple applications can be created by linking together nodes in different fashions suitable for the current experiment. Several default Leginon applications are distributed with the release. This section enables the Leginon user to import and export applications.

Import Applications online

Export Applications online

to another Host

to a Leginon application XML file

to the screen in XML format

to the screen in "easy-to-read" format

It should contain tables of Application Data, NodeSpec Data, and likely BindingSpec Data.


< Revert Settings | Goniometer >



Authors

The Leginon Team (B. Carragher, A. Cheng, D. Fellmann, F. Guerra, C. Irving, G. Lander, P. Mecurio, C. Potter, J. Pulokas, J. Quispe, B. Sheehan, S. Stagg, C. Suloway, N. Voss, and C. Yoshioka)


Autofocus Calibration with Beam Tilt Node

Three functions have to be performed in Beam Tilt node to perform defocus, stigmation and
z-height corrections used in autofocus procedures. Defocus and stigmator calibration are
required for defocus/stigmation correction. These plus a record of eucentric focus value are
required for the z-height correction to eucentric height.

Beam Tilt Defocus/Stigmator Calibration and Eucentric Focus Recording Need for the Example MSI:

Preset magnification
hl 5000
fa 50000

Defocus Calibration

  1. Leginon/Presets Manager> send the preset you want to make the calibration "To Scope"
     
  2. Leginon/Beam Tilt/Toolbar/Setting> check and make sure that it does NOT overwrite presets
     
  3. Leginon/Beam Tilt/Toolbar> select Defocus as calibration type
     
  4. Leginon/Beam Tilt/Toolbar> open "Parameter Settings" window to set parameters as follows:
     
    at 50,000x: defocus1 = -2e-06, defocus2 = -4e-06 and beam tilt angle=0.01
     
    at 5,000x: defocus1 = -2e-05, defocus2 = -4e-05 and beam tilt angle=0.01
     
  5. Leginon/Beam Tilt/Toolbar> click Calibrate.
     
  6. Occasionally the beam may be partially blocked by the objective aperture and
    produce a dark field image upon beam tilts. Reducing the beam tilt angle, using a
    larger objective aperture, and/or centering the objective aperture accurately are the
    possible solutions.

Beam Tilt Stigmator calibration

The Beam Tilt Stigmator calibration is used by Leginon to correct astigmatism. This
calibration functions well if the microscope has been well aligned first. Stigmation
correction at low mag such as 5000x is not necessary practically but the calibration is
still required for the equation used in autofocusing.

  1. Leginon/Presets Managaer> if hasn't done so, send the preset you want to make
    the calibration "To Scope"
     
  2. Leginon/Beam Tilt/Toolbar> select Stigmators for calibration.
     
  3. Leginon/Beam Tilt/Toolbar> open "Parameter Settings" window to set parameters
    as follows:
    at 50,000x: beam tilt angle= 0.01 and delta stig.= 0.2
    at 5,000x: beam tilt angle= 0.01 and delta stig.= 0.2
     
  4. Leginon/Beam Tilt/Toolbar> click Calibrate.
     
  5. Occasionally the beam may be partially blocked by the objective aperture and
    produce a dark field image upon beam tilts. Reducing the beam tilt angle, using a
    larger objective aperture, and/or centering the objective aperture accurately are the
    possible solutions.

Checking the Calibrations

Once both Defocus and Stigmation are calibrated against beam-tilt induced image shift,
the two can be measured using the Measure Function in the Toolbar.

  1. Leginon/Beam Tilt/Toolbar> click Measure to open measurement submenu.
     
  2. Leginon/Beam Tilt/Measure> click Measure (to test the beam tilt defocus and stigmation calibration).
     
  3. Leginon/Beam Tilt/Measure> click Correct Defocus to make the correction according to the measurement.
     
  4. Leginon/Beam Tilt/Measure> click Reset Defocus and exit the sub-window.
     
  5. Leginon/Presets Managaer> send the fc preset "To Scope"
     
  6. Leginon/Focus/Settings> select fc as the preset used for the acquisition.
     
  7. Leginon/Focus/Toolbar> start Manual Focusing.
     
    Power Spectrum of the image at defocus specified by "fc" preset should appear on
    the screen.
     
  8. Leginon/Focus/Manual Focus> set 0 defocus to scope by selecting the movetype
    to "defocus" and the number entry in meter to "0" and then click "Set
    Instrument".
     
    The Thone ring should disappear as the defocus is changed to zero measured by Beam
    Tilt node. If not, recalibration of defocus may be needed.
     
  9. Leginon/Focus/ToolbarManual Focus> stop Manual Focusing by clicking the "stop" button.
     
  10. Leginon/Beam Tilt/Toolbar> click Measure to open measurement sub-menu.
     
  11. Leginon/Beam Tilt/Measure> click Correct Stigmator to make the correction
    according to the measurement.
     
  12. Leginon/Focus/Toolbar> start Manual Focusing and check to see if the
    correction makes bad stigmation better.
    If not, redo stigmation correction.

Trouble Shooting:

Eucentric Focus Storage and Retrieval

Encentric Focus From/To Scope (From/To Scope icons) do what they indicate. The "from
Scope" function simply records the current absolute focus value at the scope.
Therefore,

  1. Scope> eucenter the grid and reset defocus at U-centric height at the required high tension and at a high mag where focusing is easier.
     
  2. Leginon/Presets Manager> select the preset that will perform z-focusing (i.e., hl). temporarily change its defocus to 0.0
     
  3. Leginon/Presets Manager> sent the preset "To Scope"
     
  4. Leginon/Beam Tilt> left-click the Encentric Focus From Scope icon to save the focus value.
     
  5. Leginon/Presets Manager> return the defocus value back to its original.

Rotation Center Storage and Retrieval

Rotation Center From/To Scope (From/To Scope icons) do what they indicate. The "from Scope" function simply records the current beam tilt value at the scope. Therefore,

  1. Scope> Align the rotation center at a magnification and high tension where the value will be used.
     
  2. Leginon/Beam Tilt> left-click the Rotation Center From Scope icon to save the beam tilt value to Leginon database.

< Checking Matrix and Modeled Stage Position Calibration | Dose (Camera Sensitivity) Calibration >



Backup Practices

Ideal setup:

Regular computer backup

To protect your program installation.

Full backup of the databases every night

The database are the metadata generated by Leginon and Project management system, leginondb and projectdb, respectively in the installation
example.

Full/Incremental/differential backup of the images

The image files located in [your storage disk] should be backup in full at least once
a month, and nightly in differential or incremental mode.

Current NRAMM setup:

Because our tape backup system is not on-site and the data have to transfer over slow
network to perform the task, we have not been able to backup in the ideal setting. Here is
what we currently do:

Regular computer backup

TSRI Research Computing provides regular back up service that does full backup of the
computers every four weeks and incremental backup every night. The full backup expires in
4 months and the incremental backup one month. We do this for the computers running
Leginon main program, the database server, as well as the web server.

Regular backup & tar of the databases every night

On top of the TSRI backup, we also tar the database everynight and store it on the
institutional tape library.

rsync to a tape library of the image storage disk

As our image storage disks total 15T byte, we currently use rsync function to update a
copy on our institutional tape library. It creates new files, updates old files, but does
not remove old files on the tape if it is removed on the storage disk. We do not think
this is the best solution since it is not possible to retrieve old files that have been
modified on a later time.


< Next Steps



BeamFixer

The BeamFixer acquires 3x3 images at the requested beam shift step size centered around
the current value to find the best beam shift and then update the value to Presets Manager. A
list of presets that the update is to be applied is entered in the settings and the first
preset in the list is used for the best beam shift determination. The beam shift step size is
relative to that of the imaging area of the first preset, too.

Required bindings:

AcquisitionNodeAlias - (FixBeamEvent) -> BeamFixerNode
BeamFixerNodeAlias - (PresetChangeEvent) -> PresetsManagerNode
BeamFixerNodeAlias - (UpdatePresetEvent) -> PresetsManagerNode
PresetsManagerNode - (PresetChangedEvent) -> BeamFixerNodeAlias

Target Required:

Reference Target (best of an empty area)

BeamFixer Toolbar ( Leginon/BeamFixer/Toolbar> )

BeamFixer Settings ( Leginon/BeamFixer/Settings> )


< Acquisition | Beam Tilt Calibrator >



Beam Shift matrix calibration (Optional)

Beam shift matrix calibrations are used at each magnification that Leginon uses. These
calibrations are not absolutely necessary, but can be very helpful to center the beam in the
navigator node. In this case, the image of a small beam within the CCD is treated as an object
in the image.
When the beam is shifted by the electromagnetic lenses of the microscope, the
imprint of the beam moves relative to the CCD. The 2x2 transformation matrix created then
relates the values sent to the microscope and the amount of "beam shift" movement seen on the
CCD imaging area. Only one set of measurement is sufficient for beam shift matrix
calibration.

How does matrix calibration work?

  1. Leginon/Presets Manager> Select a preset for the calibration and send its
    parameter to the microscope. Matrix calibration depends only on magnification and
    microscope high tension. Therefore, only one preset per combination needs to be
    calibrated.
     
  2. Scope> contract the beam sufficiently so that it remains in the area of CCD
    acquisition during the calibration. It is also preferable that the CCD is imaging an
    area with no distinct feature such as an empty grid square to minimize false peak from
    unmoved object during a beam shift. At low magnifications, stage can be pulled out and
    parked with a spacer to create the empty field.
     
  3. Leginon/NodeSelector> select "Matrix" node.
     
  4. Leginon/Matrix> the preset CCD configuration is almost certainly bad for imaging
    contracted beam. Therefore, DO NOT use "test acquire" at this point.
     
  5. Leginon/Matrix/Toolbar> open "settings" window by clicking the icon to select
    camera configuration and correlation method. The former will take into effect only if
    "Overwrite Preset" is checked. Click "OK" to save the settings and close the window when
    done.
     
    *Tip: 1024x1024 binned by 4 and a VERY short exposure time can save time but still
    keep the contracted beam from burning the CCD.
     
  6. Leginon/Matrix/Toolbar> left-click "Acquire Image" to obtain a test image with
    current parameters.
     
  7. Leginon/Matrix/Toolbar> select "beam shift" as the Parameter and open the
    "Parameter Setting" window by clicking on the icon to the right of the selector.
     
  8. Leginon/Matrix/Matrix Settings> "Average # position"=1 is sufficient. The rest
    can be left in default values. "Interval" is not a relavent parameter since " average #
    position"=1.
     
  9. Leginon/Matrix/Toolbar> left-click (Execute icon) to calibrate.
     
  10. The image of the beam should be shifting 10-30% of the imaging area. If this is not
    the case, then adjust shift fraction so that this occurs. The images can be monitored in
    Image Display Panel with display selection in image control panel set to "image". The
    cross correlation and its peak can also be displayed. The beam need to be contained in
    the imaging area at all time.
     
  11. Use Navigation node to check the result of the calibration.

Beam Shift Calibration Need for the Example MSI:

<filename>Preset</filename> <filename>magnification</filename>
gr 120 (rarely used)
sq 550 (rarely used)
hl 5000 (seldom used)
11000 (useful in beam shift alignment tool in Presets Manager to align the beam at
50000x)
fc,fa,en,ef 50000 (useful)

*The Presets Manager beam shift alignment tool works best using ~5x lower magnification than the
preset meant to be aligned in order to see the whole beam in view. This means that for
fc,fa,en,ef that are at 50000x, a calibration at 11000x is required at the similar defocus
range.


< Image Shift matrix calibration | Stage Position matrix calibration >



Beam Tilt Calibrator

The Beam Tilt Calibrator is in fact the calibrator for autofocus. This calibration functions well if the microscope has been well aligned first. The three main functions are defocus calibration, stigmator calibration and storage/retrieval of eucentric focus

Required bindings to use preset instrument configuration set by presets manager:

PresetsManagerNode - (PresetChangedEvent) -> BeamTiltCalibratorNode

Toolbar ( Leginon/Beam Tilt Calibrator/Toolbar> )

Settings ( Leginon/Beam Tilt Calibrator/Settings> )

Defocus or Stigmators

Parameter Settings

Measure

Eucentric Focus Retrieve from /Send to scope

Rotation center Retrieve from /Send to scope

Align Rotation Center


< BeamFixer | Beam Tilt Imager >



Beam Tilt Imager

To achieve high resolution, the electron beam is best to be parallel and aligned with the optical axis of the lenses at the specimen. This is particularly important if better than 5 Angstrum resolution is required.


< Beam Tilt Calibrator | Click Target Finder >



Bright and Dark reference images

Bright and Dark reference images need to be acquired for every camera setting that will
be used. The camera settings include image dimension, bin size, and offset. Over time,
references may need to be repeatedly acquired.

Correction Channels

When two flat-field-corrected images are correlated, there is often an origin peak
derived from the common normalization image even if both image acquisition contains only
noise. In order to avoid this problem, two or more sets of bright/dark references, and hence
normalization images can be obtained per CCD camera configuration. When a correlation
between two images will be done, Leginon will check the channel of the correction the first
acquired image has used and then force the new image to be corrected by a different
channel.

To use this function, simple set the number of channels to 2 or larger in
Correction/Settings/Image Correction/Reference Creation> while creating the reference
images.

Acquire reference images

  1. scope> make sure that the CCD will be acquiring images in an area with uniform
    beam intensity such as an empty area with no specimen nor support. You may skip a trip
    to the scope room by sending one of the high mag preset to the scope from
    Leginon.
     
  2. Leginon/Node Selector> Select "Correction" node.
     
  3. Leginon/Correction/Toolbar> Open "Settings" window.
     
  4. Leginon/Correction/Toolbar/Settings> Select one of the Common Camera
    Configuration or select Custom mode and enter your own values based on the presets you
    created.
     
  5. Leginon/Correction/Settings/Camera Configuration> Enter the Exposure time. It
    should be chosen so that the image is not saturated and ideally close to the condition
    that will be used in the experiments. If unsure about the experimental condition, use an
    exposure time that gives high but not saturated counts.
     
  6. Leginon/Correction/Settings>By default, the corrector node is set to average 3
    images together to create one reference image and to despike the hot pixels with
    averaged neighbor hood values. These can be changed if desired.
     
  7. Leginon/Correction/Settings> It is recommended to use 2 correction channels for the camera configuration used
    for correlation peak search.
     
  8. Leginon/Correction/Settings> Click OK to exit settings.
     
  9. Leginon/Correction/Toolbar> Select "Raw image " from the pull down list of
    acquisition modes and then click on "Acquire" button next to the selector to view an
    image that is not corrected.
     
  10. Leginon/Correction/Toolbar> Select "Dark reference" in the acquisition mode
    selector and then click "Acquire" to acquire the Dark reference image for this
    particular camera configuration.
     
  11. Leginon/Correction/Toolbar> Select "Bright reference" and repeat the acquisition
    to obtain the Bright reference.
     
  12. Leginon/Correction/Toolbar> Select "Corrected image" and then "Acquire" to view
    the corrected image. A corrected image should be free of artifacts and have smaller
    standard deviation than the raw image, in general.
     
  13. Repeat steps 3-11 for all the images and bin sizes that will be used:
     
  14. If a pixel, a column/row or a region gives bad values in the bright or dark image
    after a few trials, it may be excluded in all corrected images.
     
  15. Only one channel is required for image shift alignment purpose. If the same camera configuration is used for presets that involves in correlation, two channels are strongly recommended.

Bright/Dark Reference Image Need for the Example MSI:

Dimension after binning Bin number of correction channels
4096 1 1 or 2 if used for tomo preset
1024 4 2^*^
1024(centered) 1 1^**^
512 8 2^***^
512 (centered) 1 1^***^

-This camera configuration is used in preset beam shift alignment even if you don't use it for a preset.
-This camera configuration is used in Manual Application Manual Focusing even if you don't use it for a preset.
-These camera configurations are used in preset image shift alignment even if you don't use it for a preset.

Image Despike

The Despike feature removes random bright or hot pixels from the acquired images. This
hot pixel is assigned the average intensity of the surrounding area, a circle of the radius
which is entered in Neighborhood Size. The Despike Threshold is the number of standard
deviations away from the mean that qualifies a pixel for despike correction. The despike
affects the flat-field corrected image saved on the disk and can not be recovered.
Therefore, use a minimal neighborhood size to avoid artifact and set the threshold high to
avoid over-despiking.

Activation of this feature and its parameter settings are defined when in the pop-up dialog for "Edit Correction Plan". See below.

Correction Plan

Bad Pixel, Rows and Bad Cols are used to crop portions of the image that do not read
well off of the CCD. The values entered into here are determined empirically for each
instrument that Leginon operates on. If one column or row of the images is incorrect,
measure the location of the row and column that need to be removed from this image. These
values should then be entered as a sequence of values separated by commas by editing the
Plan. Click Save after adjusting.

Individual bad pixel can also be corrected by its surrounding pixels. Choose these
pixels with the selection tool on the image and then click on "Grab From Image".

Find A Single Bad Pixel

When a single pixel is defected, it may not be easy to find it on a large image, even if
it changes the stats dramatically. A tool is available to help finding these pixels:

  1. Leginon/Correction> Acquire either a corrected image that shows the bad
    stats.
     
  2. Leginon/Correction/Toolbar> Left-click on the
    button to "Add extreme points to bad pixel list". There
     
  3. Leginon/Correction/Tools> Left-click on the "Add Region" tool that looks like
    "+". This adds the selected bad region to the bad pixel plan.
     
  4. Leginon/Corrections> Acquire a corrected image in the same configuration to
    check if the apearance improves.

Bad Region Correction

When a large region is covered by a fallen chip, image correction through bright/dark
reference may not be sufficient to produce a spike-free image since the bright and dark
values in the region are almost identical. To add such a large region into bad pixel plan,
do the following:

  1. Leginon/Correction> Acquire either a bright or corrected image that shows the
    bad region clearly.
     
  2. Leginon/Correction> Use "Regions" target tool next to the image to enclose the
    bad region. The corners that the target tool identifies can be larger than the bad
    region but should be close to its size so that not too much is corrected.
     
  3. Leginon/Correction/Tools> Left-click on the "Add Region" tool that looks like
    "+". This adds the selected bad region to the bad pixel plan.
     
  4. Leginon/Corrections> Acquire a corrected image in the same configuration to
    check if the appearance improves.

< Pixel Size Calibration | Image Shift matrix calibration >



Bug Fixes

GUI

.


Bug Fixes 2.0

This list is updated with each release of 2.0.x


< New Web Tool Features | Known Bugs >



Bug Fixes 2.1

This list is updated at each release of 2.1.x


< New Web Tool Features | Known Bugs >



Calibrations

Good calibrations are absolutely essential to running Leginon. They can also be very time consuming. As a way of rudimentarily starting up without calibrating the current instrument specifically or perhaps to revert to a previously saved calibration, this import/export calibration tool can be quite useful.

Import Calibrations

Export Calibrations

to another Host

to a Leginon application XML file

to the screen in XML format

to the screen in "easy-to-read" format


Calibrations required on FEI microscopes

Two calibrations are needed for proper operation of Leginon MSI applications

HM Beam Shift Image Shift Calibration

TEM Scripting Beam Tilt Calibration


Gatan camera setup >
Tietz camera setup >



Calibration without presets

Calibrations can be made without presets although not as conveniently. For each of the
calibration node, the following need to be done before the calibration or even before
acquiring a test image.

Select the TEM and Camera Configuration


< Creating Presets for the first time | Pixel Size Calibration >



Checking Matrix and Modeled Stage Position Calibration

The Navigation node is quite useful because it allows the user to test many of the
calibrations that have been completed, such as image shift, beam shift, stage position,
modeled stage position, and dose measurements (indirectly). Additionally, Navigator could be
used to simply navigate across the grid in the microscope using Leginon calibrations.

Navigate using a calibration

A particular calibration, "stage position, image shift, modeled stage position, or beam
shift," can be chosen to navigate bases on the current image in Navigator. For example,
clicking on the center of a beam offset to the side in the acquired CCD image with The "beam
shift" move type will center the beam around the point where the mouse was clicked.

  1. Leginon/Navigation/Toolbar/Settings> select the TEM Parameter for navigation (the calibration to test)
     
    Available calibrations (these calibrations are only available if they have been completed):
     
  2. Leginon/Navigation/Toolbar> Click Acquire .
     
  3. Leginon/Navigation> Activate the click tool just above the image panel .
     
  4. Leginon/Navigation> Target a feature on the image with a single left click
     
    - The feature that is clicked will be centered in the image. If the feature is
    not centered in the new image, then the calibration needs to be repeated or the
    microscope has been altered in some way.

Iterative Move Navigation

Navigation, especially navigation by stage position movement, has error that is larger
at larger moving distance. Therefore, the accuracy of the navigation by stage movement can
be improved by multiple moves. By specifying the tolerance of the navigation error, Leginon
can achieve more accurate navigation. This feature is activated by giving a non-zero value
for "Move to within xx m of clicked position" within Navigator for direct click-and-move or
from an Acquisition node class that uses Navigator as the mover.

When Acquisition node class uses Navigator as the mover, you may want to check the
"Preset cycle after each move" option reduce hysteresis. The downside of this is that it can
take a lot of time.

Calibration Assessment

Calibration Error Checking is on by default in settings. It calculates and displays how
much error there is between the targets that were selected and how accurate the selected
calibration moved to that target. When calibrated properly, the image shift error should
always be better than 1 % of the image dimension, beam shift 5 %, modeled stage position
< 1.5 um, and stage position < 5 um On our FEI Tecnai microscopes.

Stage Locations

Save (x, y) stage positions in the Stage Locations section to revisit the same positions later.
Keep the From Scope gets X and Y Only check box enabled is a general practice.

Save a new location:
  1. Leginon/nav/Navigator> enter a New Name (for the postion that will be saved).
     
  2. Leginon/nav/Navigator> enter a New Comment.
     
  3. Leginon/nav/Navigator> click New Location From Scope (to save the current stage position).
     
    - The new saved location will appear in the Location Selector.
Go to a saved location:
  1. Leginon/nav/Navigator> select a location (from the Location Selector).
     
  2. Leginon/nav/Navigator> click To Scope
Update / Remove a saved location:
  1. Leginon/nav/Navigator> select a location (from the Location Selector).
     
  2. Leginon/nav/Navigator> click From Scope (to update) or Remove (to delete the location).

Other features


< Modeled Stage Position calibration | Autofocus Calibration with Beam Tilt Node >



Check php information

Create the following info.php in your web server document root directory (/var/www/html on CentOS. /srv/www/htdocs on SuSE. You can find its location in httpd.conf mentioned above under the line starting DocumentRoot).

sudo nano /var/www/html/info.php

Copy and paste the following code into info.php:

<?php
phpinfo();
?>

Restrict access to your info.php file.

sudo chmod 444 /var/www/html/info.php

Visit this page at http://HOST.INSTITUTE.EDU/info.php or http://localhost/info.php

You will see comprehensive tables of php and apache information, including the location of the additional .ini files, extension, include path, and what extension is enabled.

Here is an example screen shot of the part of the info.php page that tells you where php.ini and other configuration files are. This information will be used while installing components of the Web Server.


< Install Apache Web Server | Download Appion and Leginon Files >



Click Target Finder

Click Target Finder is a basic node that takes input images and allows the user to manually select targets on the input image. The image target list is the output of this node. Because most of its subnodes such as Holde Finder and RasterFinder have the option of skipping automatic finding, they can perform the job of this base class. Therefore, the node is seldom used.

Required bindings for recieving images and publishing targets:

previous Acquisition or Focuser- (AcquisitionImagePublishEvent) -> ClickTarget Finder
ClickTargetFinder - (ImageTargetListPublishEvent) -> next Acquisition or Focuser
ClickTargetFinder - (QueuePublishEvent) -> next Acquisition or Focuser
ClickTargetFinder - (ReferenceTargetListPublishEvent) -> AlignZeroLossPeak or MeasureDose

Required bindings for proper waiting among nodes:

ClickTargetFinder- (ImageProcessDoneEvent) - > previous Acquisition or Focuser
next Acquisition or Focuser- (TargetListDoneEvent) - > ClickTargetFinder

This node only has the ability to display target types and submit (send) new image targets to another node via the Submit Targets button.

Settings


< Beam Tilt Imager | Corrector >



Image Viewer Overview

Image Viewers allow you to view the images that are associated with a particular session (or experiment). You may select a project from a drop down list, then select a session in that project. The images belonging to that session appear in an Image List and the selected image is displayed in the Image View.

1 Anatomy of an Image Viewer

Primary Features:
Name Description
Project Drop Down List Projects that you own or have been shared will appear in the list. Select one to view.
Session Drop Down List Sessions that belong to the currently selected Project will appear in the list. Select one to view.
Image List The images belonging to the currently selected Session will appear in the Image List. The selected image will appear in the Image View. The total number of images is displayed at the top of the list.
Image View The selected image will be displayed in the Image View. The Image View may be configured using the Image Tools controls located directly above the Image View.
Image Tools Includes many basic image manipulation features such as filtering and Fourier Transform.

Image Viewer Screen:
Image Viewer Screen Marked

 

2 Features available with all viewers

2.1 From the header buttons

  1. View an aggregate summary of all the images in a session
  2. Launch the Appion Image processing application
  3. Launch a tool to create jpegs of all or many of the images in a session
     
    Image Viewer Header Buttons:

2.2 From the Image Tools panel

  1. View the mrc images associated with Projects and Sessions
  2. Adjust image properties
  3. Mark images as hidden or exemplar
  4. View a sideshow of the images in a session
  5. Download individual images in mrc, tiff or jpeg format
  6. View a detailed image report including mrc header information and calibrations
  7. View the Fourier Transform of the image
  8. View ACE graphs
  9. View Particle Picks
  10. View Leginon MSI focus and acquisition targets
  11. Overlay a scale ruler
     
    Features of the Image Tools Panel:

2.3 Dequeue Tool:

Used to remove queued targets on the image shown in the viewer and queued targets chosen on its direct descendant images. Clicking on it gives the number of active queued targets and the user can choose to remove them from the active list.

 

3 Chose the right viewer for the job

Image Viewer applications available in Appion and Leginon web tools:
Viewer Name Viewer Features
Image Viewer provides a single image pane
2 Way Viewer provides 2 image panes for viewing the same mrc file in different ways side by side
3 Way Viewer provides 3 image panes for viewing the same mrc file in different ways
Dual Viewer provides 2 image panes for viewing separate mrc images side by side
RCT provides 2 images panes for viewing Tomography tilt images

^ Image Viewers | Image Viewer >



Install Ace2

Test Ace 2 binary

The 64bit Ace2 binary is already available in the myami/appion/bin directory.
Test it by changing directories to myami/appion/bin and type the following commands:

./ace2.exe -h
./ace2correct.exe -h

If it is working the help commands will display.

Compile Ace 2 from source

It is highly recommended to use the Ace2 binary, if it works.

see Compile Ace 2 from source


< Compile FindEM | Install Imod >



Compile FindEM

Install supporting packages:

Name: Download site: yum package name SuSE rpm name
compat-gcc-34-g77 compat-gcc-34-g77
gcc-gfortran gcc-gfortran

Test FindEM binary

Both 32 and 64 bit findem binaries are already available in the myami/appion/bin directory.
Test it by changing directories to myami/appion/bin and type the following commands:

./findem64.exe         (64 bit version)

or

./findem32.exe         (32 bit version)

If it does not crash you are good.

Install FindEM from source

If the binary included with Appion does not work, or you wish to compile it yourself follow the instructions to install FindEM from source.


< Install Grigorieff lab software | Install Ace2 >



Compile Radermacher

Pre-install

sudo yum install libgomp

Build and install

cd myami/modules/radermacher
$ python ./setup.py build
$ sudo python ./setup.py install

Quick test to see if installed properly

$ python
>>> import radermacher
>>> <Ctrl-D>

< Compile Ace2 | Install Xmipp >



Complete Installation

Instructions for installing CentOS on your computer

  1. Four Parts of the Leginon System
  2. What is in this Chapter
  3. Possible Computer Set-up Configurations
  4. Select Linux distribution to use
  5. Network Configuration
  6. Where to register and download Leginon
  7. Database Server Installation
  8. File Server Setup Considerations
  9. Processing Server Installation
  10. Web Server Installation
  11. Additional Database Server Setup after Web Server Installation
  12. Installation on the microscope computer
  13. Steps needed for Installation Using Database Administration Tools
  14. Create a test project for testing
  15. Perform Microscope Setup and Test run
  16. Backup Practices

< Upgrade Instructions | Leginon Administration Tools >



Configure leginon.cfg

For older versions of Appion and Leginon (pre-2.2), please use the following instructions:
Instructions for Appion and Leginon versions prior to 2.2

The order in which Leginon/Appion looks for leginon.cfg

  1. individual user home directory
  2. $PYTHONSITEPKG/leginon
     
    Note: You can discover the $PYTHONSITEPKG path by starting python:
    python
    import sys
    sys.path
    

    The first path to site-packages should hold the config file.
     
  3. /etc/myami

Configuration file template

A skeleton (default) configuration file is available:

/path/to/myami/leginon/leginin.cfg.template

Create a global leginon.cfg

Copy leginon.cfg.template to leginon.cfg.

sudo cp -v /path/to/myami/leginon/leginin.cfg.template /etc/myami/leginon.cfg

Edit the newly created file and add a directory for images. Make sure you have permission to save files at this location. See File Server Setup Considerations for more details

You may put in a fake path on the microscope PC installation and ignore the error message at the start of Leginon if you follow our general rule of not saving any image directly from the microscope pc,

[Images]
path: your_storage_disk_path/leginon

This serves as the global leginon configuration.

Individual User leginon.cfg

For individual Leginon users, the above file can be copied to their home directory and the following added once they have registered as a Leginon user. This extra configuration will allow individual user to skip the step of selecting his/her name from the user list.

[User]
fullname: your_firstname your_lastname

< Install Appion/Leginon Packages | Configure sinedon.cfg >



Configure php.ini

Edit the following items in php.ini (found as /etc/php.ini on CentOS and /etc/php5/apache2/php.ini on SuSE)

sudo nano /etc/php.ini

so that they look like the following:

error_reporting = E_ALL & ~E_NOTICE & ~E_WARNING
 
display_errors = On
 
register_argc_argv = On
 
short_open_tag = On
 
max_execution_time = 300 ; Maximum execution time of each script, in seconds
max_input_time = 300 ; Maximum amount of time each script may spend parsing request data
memory_limit = 256M ; Maximum amount of memory a script may consume (8MB)

You may want to increase max_input_time and memory_limit if the server is heavily used. At NRAMM, max_input_time=600 and memory_limit=4000M.

You should also set timezone using one of the valid string found at http://www.php.net/manual/en/timezones.php like this:

date.timezone = 'America/Los_Angeles'

< Install Web Server Prerequisites | Install Apache Web Server >



Configure sinedon.cfg

For older versions of Appion and Leginon (pre-2.2), please use the following instructions:
Instructions for Appion and Leginon versions prior to 2.2

The order in which Leginon/Appion looks for sinedon.cfg

  1. individual user home directory
  2. $PYTHONSITEPKG/sinedon
     
    Note: You can discover the $PYTHONSITEPKG path by starting python:
    python
    import sys
    sys.path
    

    The first path to site-packages should hold the config file.
     
  3. /etc/myami

Create a sinedon.cfg for all users

Sinedon is an object relational mapping library designed to interact with the Leginon and Appion databases.

Note: If you are a developer, and you need to use sinedon.cfg settings that are different from the global settings, you may create your own sinedon.cfg file and place it in your home directory. This version will override the global version located in the site packages directory.


< Configure leginon.cfg



Corrector

Corrector handles image corrections before it is displayed and saved. It has three functions:

Required bindings: None

Normalization Image

Flat field correction removes the contribution of dark current to the intensity and artifacts on the CCD camera that are reproducible, for example, the patterns of the fiber optic plate and debris fall and remain stationary on the CCD.

Dark images record the residual intensity recorded by the CCD for the same length of acquisition time as the chosen camera configuration but with no electron beam present. Bright images record the raw image under the same condition except that the camera is flooded with uniform electron beam.

Let the mean of an image be avg(Image)

Normalization_Image_Pixel_Value = [avg(Bright_Image-Dark_Image)]/(Bright_Pixel -Dark_Pixel)

Flat-Field_Corrected Image_Pixel_Value = (Raw_Image_Pixel_Value) * (Normalization_Image_Pixel_Value)

Some Leginon functions requires more than one image, for example the cross/phase correlation done in drift monitoring of Drift Manager node. When the node acquires a new image that will be used to correlated to an old image, it checks the correction channel that the old image used, and force the new image to use a different correction channel. This process eliminates the origin correlation peak produced by identical noise in the two images when the same correction channel is used.

Settings for Creating the Normalization Image

Both methods are applied per pixel. Average is used normally. Medium is used when x-ray spikes are a common problem and requires a larger number of combining images.

Settings for Image Flat-Field Correction from Another Node

Correction by the correction plan

Correction plan is a list of bad columns, rows, and pixels that tend to give non-repeating error readings. A good example is often found at the last columns of the CCD. Because their non-repeating nature, flat-field correction can not remove their contribution.

The correction plan is associated to individual instrument, camera, and camera configuration.

Intensity Clipping and Image Despike

Intensity clipping and image despike are done after flat-field correction. Intensity clipping simply replace pixel values that is outside the min/max range with the limits. Despike defines a hot pixel as a pixel that has intensity higher than the threshold multiples of standard deviation above the mean of a neighborhood box. The intensity of the hot pixel is replaced by the mean of the neighborhood box.

The settings related to these two corrections apply to all camera configuration and images passed through Corrector.

Find A Single Bad Pixel

When a single pixel is defected, it may not be easy to find it on a large image, even if it changes the stats dramatically. A tool is available to help finding these pixels:

Bad Region Correction

When a large region is covered by a fallen chip, image correction through bright/dark reference may not be sufficient to produce a spike-free image since the bright and dark values in the region are almost identical. To add such a large region into bad pixel plan, do the following:


< Click Target Finder | Dose Calibrator >



Create and Edit Applications

  1. Use the Application Editor to create Leginon applications
  2. Reload and Edit an existing application
  3. Edit an existing application as an xml file
  4. Create Leginon "Simple Application"
  5. "Calibrations" Application
  6. "MSI-Edge" Application
  7. "MSI-T" Application
  8. "MSI-raster" Application
  9. "MSI-Tomography" Application
  10. "Manual" Application

< Node Descriptions



Create Leginon "Simple Application"

This application is meant to demonstrate how to create applications with event bindings in Leginon. This application has little functionality other than being able to take one image at a time at a given preset.

Table 18.1. Simple Application Nodes:

Node Class: Node alias: Launcher:
Corrector cor main
SimpleAcquisition simple_acq main
PresetsManager pm main
EM em scope

Table 18.2. Simple Application Event Bindings:

Node to alias: Event Binding: Node from alias:
pm ChangePresetEvent simple_acq
simple_acq PresetChangedEvent em

< Edit an existing application as an xml file | "Calibrations" Application >



Creating Presets for the first time

Configuring the Presets are critical to many different applications. Presets describe
camera configurations such as image size and exposure time as well as many other microscope
parameters such as magnification and defocus. Setting presets in calibration application is
optional but recommended for determining what calibrations are needed for future runs.

Design Presets

MSI presets can be customized to your need of data collection. By matching
nodes/subnodes in MSI with presets and move types, the behavior of the node is
defined.

See the section on Designing Presets in the chapter
for MSI application for more explanations on the presets standardized at NRAMM which we will
reference in this chapter, we use here the nomenclatures at NRAMM that is used to collect
defocus paired images with four scales of targeting ant two sequences of focusing using an
MSI application. You will need to adjust the preset parameters for your own camera, scope,
as well as the grid mesh you use.

Presets Created for Convenience in Calibration

The table shows an example of the presets for an MSI application. For calibration
purpose, undefined image shift can be left as what received from the scope. Beam intensity,
spot size, and should be adjusted to give reasonable signal to noise ratio for usable
exposure time and for the beam to cover the whole CCD. The exact setting of exposure time
can be set later after bright and dark images are collected.

Example MSI preset initial parameters:

Magnification: Preset name: Image Shift (x,y): Binning: Dimension: Beam Coverage: Exposure Time (ms): Spot Size: Defocus (m):
120 gr as is* 8 512 max 20 4 0.0
550 sq as is* 4 1024 1x CCD size 100 4 -2e-3
5000 hl as is* 8 512 1x CCD 20 4 -1.5e-4
50000 fc 0,0 1 512 <~ 1x CCD 300 4 -2e-6
50000 fa 0,0 4 1024 >2x CCD 50 4 -2e-6
50000 en 0,0 1 4096 2x CCD 170 (10e/A^2) 4 -1e-6
50000 ef 0,0 1 4096 2x CCD 170 (10e/A^2) 4 -2e-6

*Use whatever image shift from the microscope when the preset is newly created. These will be aligned later.

Create Presets from microscope setting

  1. (Optional) Microscope/Reset defocus at eucentric height.
     
  2. Adjust the microscope settings at the microscope. This includes magnification,
    beam intensity, beam shift, and defocus. Beam intensity and beam shift is adjusted to
    get the good beam coverage shown in the table. Defocus only need to be
    approximate.
     
  3. Leginon/Node Selector>Select "Presets Manager" node.
     
  4. Leginon/Presets Manager> Click New From Scope icon to open "Create New Preset" setting window.
     
  5. Leginon/Presets Manager/Create New Preset> Type a descriptive name for a
    Preset, "hl" for example, left-click "Create" to save and close the window.
     
  6. Leginon/Presets Manager/Preset Parameters/Camera Configuration> Change the
    image shift, defocus, camera configuration and exposure time if necessary. It will be
    saved automatically when changed.

Presets Selector and Cycle Order List

If Presets are not ordered as in the table above, we recommend that they are rearranged
for efficient cycling. Cycling is important for minimizing hysteresis effect on em optics
and targeting and are defaulted to be on in Presets Manager Settings. To reduce cycling
time, it is best to group the presets that often occur consecutively in order. For example,
the typical MSI preset order as in the table above.

  1. Leginon/Presets Manager> select a preset from the Preset Selector.
     
  2. Up/Down: Move the presets up or down in the Cycle Order.

Adjusting Presets at the microscope

With cycling activated as default, the preset beam shift may behave differently from
that was first created. The following procedure check, adjust, and save the presets
parameters with cycling accounted for.

  1. Leginon/Presets Manager> select a preset from the Preset Selector.
     
  2. Leginon/Presets Manager> click To Scope icon to send the current preset to the microscope.
     
  3. Adjust the microscope settings either at the microscope or in a node that
    controls the microscope (Instrument) and/or the camera (Navigation,etc.).
     
  4. Leginon/Presets Manager> click From Scope icon to save the current settings to this preset.

Using Presets in Calibrations

With presets created, calibrations at different magnifications can be changed by sending
the corresponding preset to the scope.

  1. Leginon/Presets Manager> select a preset from the Preset Selector.
     
  2. Leginon/Presets Manager> click To Scope icon to send the current preset to the
    microscope.

Calibration Status

Calibration status of a preset is displayed in PresetsManager right below the message
log panel. This section is very useful for troubleshooting calibration problems. Over time,
certain calibrations may need to be repeated. This section will display the latest
calibration date related to the current preset.

Check this section to see which calibrations the new preset will need to be
completed.

  1. Pixel Size: This value is entered through the Pixel Size Calibrator node. (required)
     
  2. Image Shift: This is calculated through the Image Shift matrix calibration. (required)
     
  3. Stage: This is calculated through the Stage Shift matrix calibration. (Optional
    if Modeled Stage Mag Only calibration exists at the same mag).
     
  4. Beam Shift: This is calculated through the Beam Shift matrix calibration
    (Optional; Necessary to move the beam in Navigator).
     
  5. Modeled Stage: This is calculated through the Modeled Stage Position calibration
    (necessary to accurately center holes/targets for high magnification images).
     
  6. Modeled Stage Mag Only: Same function as in 5. This may be created from full or
    mag only model fit in GonioModeling.

< Startup | Pixel Size Calibration >



Creating Template

Any image can be used as a template for the hole finder. If you create your own, you just need to point the node preference to the right mrc file. Our philosophy for the template distributed with the Leginon package (your leginon python source path/holetemplate.mrc) was to make a hole template that had the average features of a 2 micron hole covered in vitreous ice. To accomplish this, we took fifty images of holes acquired by Leginon at 5000X magnification. Holes were then boxed out of these images using the boxer utility in the EMAN package making sure that the holes were in the center of the box.

Figure 1-Boxing a hole

The hole images were then assembled into a single Imagic stack. Since the hole images were well centered, they were then averaged to produce an image of an average hole (fig. 2). Finally, the average hole image was rotationally averaged to produce a symmetrical generalized hole image (fig. 3).

Figure 2-Average of 50 holes

Figure 3-Rotationally averaged final template.

The following is the EMAN program and parameters associated with each step.

1. For 10-50 hole images, run boxer to box out holes and save them as a pair of IMAGIC file (hole.hed and hold.img).

boxer <hole_image.mrc>

2. Average hole images and save the output as an MRC image file.

proc2d hole.hed average.mrc average

3. Rotationally average the average hole image and save as an MRC image file.

proc2d average.mrc rotav.mrc rotav

4. The result is the new hole template.


< Summary of this application | Hole Targeting Set-up for MSI-T >



Database Server Installation

Install MySQL

The following is for the computer that hosts the databases. This involves installing MySQL server and creation/configuration of the leginondb and projectdb databases.

1 Install MySQL-Server and MySQL-Client

Note: You may already have MySQL Server and Client installed. Check by typing mysql at the command line.
If you see a MySQL prompt (mysql>), you may skip this step.

To install Mysql on Linux you have two options (the first option is better):

  1. Use your package installer (yum, zypper, YaST, apt-get). For example:
    sudo yum install mysql mysql-server

    For Suse
    yast2 -i mysql mysql-client
  2. Download the latest MySQL-server package for Linux from http://www.mysql.com

2 Locate Example MySQL configuration files

They are usually located in /usr/share/mysql.

ls /usr/share/mysql/my*
    /usr/share/mysql/my-huge.cnf
    /usr/share/mysql/my-innodb-heavy-4G.cnf
    /usr/share/mysql/my-large.cnf
    /usr/share/mysql/my-medium.cnf
    /usr/share/mysql/my-small.cnf

If that does not work try the locate function
locate my | egrep "\.cnf$" 
    /etc/my.cnf
    /usr/share/mysql/my-huge.cnf
    /usr/share/mysql/my-innodb-heavy-4G.cnf
    /usr/share/mysql/my-large.cnf
    /usr/share/mysql/my-medium.cnf
    /usr/share/mysql/my-small.cnf

3 Configure my.cnf in /etc using my-huge.cnf as the template

  1. Copy my-huge.cnf to my.cnf
    sudo cp -v /usr/share/mysql/my-huge.cnf /etc/my.cnf
  2. Edit /etc/my.cnf to add or change query cache variables like these (be sure to place them under the [mysqld] section):
    query_cache_type = 1
    query_cache_size = 100M
    query_cache_limit= 100M
    
  3. Search for the text default-storage-engine in /etc/my.cnf. If it exists and is set to other than MyISAM, you should change it to:
    default-storage-engine=MyISAM

4 Start the MySQL Server

For CentOS/Fedora/RHEL system use the service command:

sudo /sbin/service mysqld start

For other Unix systems:

sudo /etc/init.d/mysqld start

or on some installations (Suse),

sudo /etc/init.d/mysql start

For future reference: start | stop | restart MySQL Server with similar commands:

For Centos, Fedora

sudo /etc/init.d/mysqld start
sudo /etc/init.d/mysqld stop
sudo /etc/init.d/mysqld restart

or
sudo /sbin/service mysqld start
sudo /sbin/service mysqld stop
sudo /sbin/service mysqld restart

or for Suse
sudo /etc/init.d/mysql start
sudo /etc/init.d/mysql stop
sudo /etc/init.d/mysql restart

5 Configure MySQL to start automatically at boot

sudo /sbin/chkconfig mysqld on

or for SuSe:
sudo /sbin/chkconfig --add mysql

6 For future reference, the database location will be:

ls /var/lib/mysql
    ibdata1  ib_logfile0  ib_logfile1  mysql  mysql.sock  test

7 Create the Leginon database, call it leginondb

sudo mysqladmin create leginondb

8 Create the Project database, call it projectdb

sudo mysqladmin create projectdb

9 Connect to mysql db

If starting from scratch, the mysql root user will have no password. This is assumed to be the case and we will set it later.

mysql -u root mysql

You should see a mysql prompt: mysql>

You can view the current mysql users with the following command.

select user, password, host from user;
      +------+----------+-----------+
      | user | password | host      |
      +------+----------+-----------+
      | root |          | localhost |
      | root |          | host1     |
      |      |          | host1     |
      |      |          | localhost |
      +------+----------+-----------+
      4 rows in set (0.00 sec)

10 Create user

Create and grant privileges to a user called usr_object for the databases on both the localhost and other hosts involved. For example, use wild card '%' for all hosts. You can set specific (ALTER, CREATE, DROP, DELETE, INSERT, RENAME, SELECT, UPDATE) privileges or ALL privileges to the user. See MySQL Reference Manual for details. The following examples demonstrate some of the options available.

11 Give create and access privileges for the processing databases which begin with "ap".

# if your web host is local
GRANT ALTER, CREATE, INSERT, SELECT, UPDATE ON `ap%`.* to usr_object@localhost; 
# for all other hosts if you are accessing the databases from another computer
GRANT ALTER, CREATE, INSERT, SELECT, UPDATE ON `ap%`.* to usr_object@'%.mydomain.edu';       

12 Change Root password

To set the root password use the command:

sudo mysqladmin -u root password NEWPASSWORD

Or you can do it from within mysql

update user set password=password('your_own_root_password') where user="root";
Query OK, 2 rows affected (0.01 sec)
Rows matched: 2  Changed: 2  Warnings: 0

# run the flush privileges command to avoid problems
flush privileges;
^D or exit;

From now on, you will need to specify the password to connect to the database as root user like this:

mysql -u root -p mysql

13 Check MySQL variables

# at the command prompt, log into the leginon database

mysql -u usr_object -p leginondb

# At the mysql prompt show variables that begin with 'query'.
# Check that the changes you made to my.cfg are in place.

SHOW VARIABLES LIKE 'query%';
      +------------------------------+-----------+
      | Variable_name                | Value     |
      +------------------------------+-----------+
      | ft_query_expansion_limit     | 20        |
      | have_query_cache             | YES       |
      | long_query_time              | 10        |
      | query_alloc_block_size       | 8192      |
      | query_cache_limit            | 104857600 | ---This should correspond to your change
      | query_cache_min_res_unit     | 4096      |
      | query_cache_size             | 104857600 | ---This should correspond to your change
      | query_cache_type             | ON        | ---This should correspond to your change
      | query_cache_wlock_invalidate | OFF       |
      | query_prealloc_size          | 8192      |
      +------------------------------+-----------+
      10 rows in set (0.00 sec)

exit;
If you do not see your changes, try restarting mysql.
On centOS:
sudo /etc/init.d/mysqld restart

14 Make sure MySQL is running

mysqlshow -u root -p
      +--------------+
      | Databases    |
      +--------------+
      | mysql        |
      | leginondb    |
      | projectdb    |
      +--------------+

Run the following command from the command line:

Be sure to edit PASSWORD to the one you previously set for usr_object.

php -r "mysql_connect('localhost', 'usr_object', 'PASSWORD', 'leginondb'); echo mysql_stat();"; echo "" 

Expected output:

Uptime: 1452562 Threads: 1 Questions: 618 Slow queries: 0 Opens: 117 Flush tables: 1 Open tables: 106 Queries per second avg: 0.000

If there are any error messages, mysql may be configured incorrectly.

Note: If you do not have php and php-mysql packages installed you need to install them to run the above command. The yum installation is:

sudo yum -y install php php-mysql


< Where to register and download Leginon | File Server Setup Considerations >



Revert Settings

Revert Settings is a tool for use with the Leginon image acquisition software.

Leginon settings for the applications are saved in the database during the installation. When a user use Leginon the first time, the settings or the Appion/Leginon administrator user will be loaded. The user can change them and Leginon will remember the new values from then on.

In the case that a user incorrectly modifies Leginon application settings, the user or an administrator may revert all the settings of a specific user to the default values.

  1. Click on the Revert Settings icon
  2. Choose the user in the list, and click on the Revert button.
Expected result:


< More about Groups | Applications >


Differences between Linux flavors

Different Linux flavors often put web server and mysql-related files in different locations. This can be confusing. From experience, we found the equivalent on CentOS vs SuSE. Here we list them for reference. If your system uses different naming and you are willing to share your experience, please send us the list. We will add it here:

Table Different File locations and Commands on CentOS vs SUSE

File or Command Head CentOS SuSE
php.ini /etc/ /etc/php5/apache2/
httpd.conf /etc/httpd/conf/ /etc/php5/apache2/
default document_root /var/www/html/ /srv/www/htdocs/
apache start/stop/restart command head /sbin/service httpd /etc/init.d/apache2
mysql start/stop/restart command head /sbin/service mysqld /etc/init.d/mysql

For a more detailed comparison of Apache file layout on different Linux distributions, see http://wiki.apache.org/httpd/DistrosDefaultLayout


Install Web Server Prerequisites >



Dose (Camera Sensitivity) Calibration

Faraday Cup Measurment Notes

Dose Calibration is a calibration of CCD sensitivity. This calibration is required only once at each high tension per instrument. It can be used for three purposes:

  1. To obtain a scaling factor between the scope screen current and the beam current measured by a standardized equipment such as a Faraday cup.
     
  2. To calibrate the camera sensitivity to electron.
     
  3. If camera sensitivity is already calibrated, the value can be entered directly.

Determine the screen current/beam current scale factor

The following uses a Faraday cup

  1. Scope> Move the stage to an empty area or a broken hole.
     
  2. Scope> Adjust the beam so that it passes through the measuring area of the Faraday cup.
     
  3. Scope> Choose a magnification so that the same beam will pass within the main screen, too.
     
  4. Leginon/Dose/Dose Calibrator> Beam Diameter = 0.16 m for Tecnai main screen.
     
  5. Leginon/Dose/Dose Calibrator> Enter Screen Current to Beam Current Scale Factor as 1 as a starting point.
     
  6. scope> Optionally lower the screen. Dose Calibrator will automatically do this if the user forgets.
     
  7. Leginon/Dose/Dose Calibrator> Click Measure Dose Rate. The Dose Rate, Beam Current, and Screen Magnification will appear in the corresponding fields after they have been calculated.
     
  8. Leginon/Dose/Dose Calibrator> Adjust the Screen Current to Beam Current Scale Factor so that the displayed beam current is equal to that of the Faraday cup measurement. NRAMM Tecnai's value is 0.88.

Calibrate the camera sensitivity

  1. Scope> Move the stage to an empty area or a broken hole.
     
  2. Scope> Expand the beam so that it covers the main screen and illuminate it uniformly.
     
  3. Leginon/Dose/Settings> Configure camera with override preset activated.
     
  4. Leginon/Dose/Dose Calibrator>
     
  5. scope> Optionally lower the screen. Dose Calibrator will automatically do this if the user forgets.
     
  6. Leginon/Dose/Dose Calibrator> Click Measure Dose Rate. The Dose Rate, Beam Current, and Screen Magnification will appear in the corresponding fields after they have been calculated.
     
  7. Leginon/Dose/Dose Calibrator> Without changing the beam intensity, click on "Calibrate". An image is acquired by Leginon.
     
    *Leginon will automatically lift the main viewing screen on the microscope. Some users report that the function does not work on their microscopes. Do it manually if the automatic function does not work.
     
  8. The calculated CCD sensitivity (counts / electron) will display once the calculation is completed.

Enter pre-determined camera sensitivity value

  1. Leginon/Dose/Calibrate/Camera Sensitivity> Enter Sensitivity values in counts per electron.
     
  2. Leginon/Dose/Calibrate/Camera Sensitivity> Click on Save.

Dose Calibration Need for the Example MSI:

Preset magnification
* any

< Autofocus Calibration with Beam Tilt Node



Dose Calibrator

The Dose Calibrator calculates the electron dose at the current scope and camera state using the beam current of the Tecnai microscope. The information in term is used to calibrate the sensitivity of the CCD using the recorded dose measurement in counts/electron. Alternatively, a sensitivity value is directly inputted.

Optional bindings for using preset instrument configuration:

PresetsManagerNode - (PresetChangedEvent) -> DoseCalibrationNode

Other than standard Calibrator settings and tools, the calibrator node contains tools to move main microscope view screen to required position, and entries required for dose conversion. Dose calibration is only as accurate as the screen-current scale factor.


< Corrector | Drift Manager >



Download Appion and Leginon Files

If you have not already downloaded the Appion and Leginon files,

Download Myami 2.1 (contains Appion and Leginon) using one of the following options:

Option 1: Release Version

 
This is a stable supported release available as a tar file.
 
myami-2.1.3.tar.gz
Unzip with

 tar -zxvf myami-2.1.3.tar.gz

 

Option 2: SVN Release Branch

 
This is a stable supported branch from our code repository.
Change directories to the location that you would like to checkout the files to (such as /usr/local) and then execute the following command:

svn co http://ami.scripps.edu/svn/myami/branches/myami-2.1 myami/

Note: If you are installing this file on a microscope Windows PC, you may use Tortoise SVN to checkout the files.
 

Option 3: SVN Development version

 
This contains features that may still be under development. It is not supported and may not be stable. Use at your own risk.

svn co http://ami.scripps.edu/svn/myami/trunk myami/

Note: If you are installing this file on a microscope Windows PC, you may use Tortoise SVN to checkout the files.


< Check php information | Install the MRC PHP Extension >



Download Leginon Files

Download Myami 2.1 (contains Appion and Leginon) using one of the following options:

Option 1: Release Version

 
This is a stable supported release available as a tar file.
 
myami-2.1.3.tar.gz
Unzip with

 tar -zxvf myami-2.1.3.tar.gz

 

Option 2: SVN Release Branch

 
This is a stable supported branch from our code repository.
Change directories to the location that you would like to checkout the files to (such as /usr/local) and then execute the following command:

svn co http://ami.scripps.edu/svn/myami/branches/myami-2.1 myami/

Note: If you are installing this file on a microscope Windows PC, you may use Tortoise SVN to checkout the files.
 

Option 3: SVN Development version

 
This contains features that may still be under development. It is not supported and may not be stable. Use at your own risk.

svn co http://ami.scripps.edu/svn/myami/trunk myami/

Note: If you are installing this file on a microscope Windows PC, you may use Tortoise SVN to checkout the files.


< Install supporting packages | Perform system check >



Do and Do Not in leginon


< Getting Help | Pausing and Aborting during data collection >



Drift Manager

The Drift Manager monitor has two functions. It works with Transform Manager to keep the accuracy of targeting through long experiment and certain operation such as the change of stage z position.

The first way of determining that drift is occurring is by measuring it directly. A drift measurement is initiated in one of two ways:

Drifting can also be assumed to have occurred without doing a measurement. This is done as a result of certain operations of Leginon:

In the above cases, whether drift is measured or assumed, a drift time stamp is entered into the database to mark when the drift occured. Acquisition nodes have an option "Adjust targets for drift" which causes them to look for these drift time stamps before processing a target and acquiring an image. If a drift occured after the target was created, the target is declared invalid. To adjust the target, the Acquisition node must send a request to the DriftManager to measure the total drift that has occurred since the target was created. The
DriftManager will load the target's parent image from the database and reacquire it under its original imaging conditions as a different version. The correlation shift is then stored in the database so that any target that came from this image can be adjusted in the same way.

Initiating drift monitoring by a focuser node requires two bindings to do such task:

FocuserNode - (DriftMonitorRequestEvent) -> DriftManagerNode
DriftManagerNode - (DriftMonitorResultEvent) -> FocusNode

For DriftManager to change presets, two bindings are needed:

DriftManagerNode - (ChangePresetEvent) -> PresetsManagerNode
PresetsManagerNode -(PresetChangedEvent) -> DriftManagerNode

Settings

Toolbar


< Dose Calibrator | The EM node >



Dual Viewer

The Dual Viewer splits the browser window to allow two instances of the Image Viewer to appear side by side. The following example shows images from two different Projects being displayed side by side. For more details see Image Viewer Overview.

Dual Viewer Screen:
Dual Viewer


< 3 Way Viewer | RCT >



Edge Hole Finder Set-up

Most steps in this original hole finder are identical to that of JAHC holefinder used in MSI-T application. Only the edge and template steps are different since edge finding is performed before using an artificial ring template to create the correlation image used in the later steps.

Edge>

A good combination of parameters show the edges of holes well with minimal thresholded "edge" from random features.

Template>

A good template gives a sharp correlation at the center of the holes.


< Summary of this applicaiont



Edit an existing application as an xml file

Application editor behaves well enough that it is not necessary to edit xml files. However, if you want to, here is how.

  1. go to "http://your_myamiweb/addapp.php" with your web browser
  2. Choose your existing application from Export section and export and save as an xml file.
     
  3. Edit the xml file in any text editor.
     
    Search for the name of the node class that you want to replace and make the changes.
     
    The following section of the file controls the name of the application and version number
    <!-- ApplicationData -->
    
    <sqltable name="ApplicationData">
    
    <field name="DEF_id" >264</field>
    
    <field name="version" >6</field>
    
    <field name="DEF_timestamp" >20041209145648</field>
    
    <field name="name" >MSI-raster (1.0)</field> </sqltable>
    

    Change the application name in the "name" field as a new application
     
  4. Use the same webpage to import: Load the changed application xml file in the Import section and click import button.

< Reload and Edit an existing application | Create Leginon "Simple Application" >



Edit an existing project


< Add a new project | Grid management >



Eucentric focus

Eucentric Focus is the microscope image focusing that makes an object at eucentric height at Gaussian focus.

In operation, you go through these steps to reach that focus value.
  1. Use alpha wobbler to move the object on the specimen holder to eucentric height where the movement of the object at the center of the screen is minimal during the wobbling.
  2. Looking at the object in the microscope and adjust defocus until the object is in-focus.

The eucentric height is defined by the goniometer alpha tilt axis, and therefore grid independent. Therefore, focus value (in term of current applied to the lens ) is also an invariant. Therefore, it is a very good reference point. Microscope manufacture aligned and calibrated magnification at eucentric height and encentric focus. We'd like to do the same in Leginon.

Please note that there is a "eucentric focus" button on FEI scopes. The button is not calibrated to the operational definition above unless you've done so or request engineers to recalibrate it regularly. Do not assume that pressing that button will bring the focus to the Eucentric Focus with 100 um if not calibrated.


Evaluation application

This application is for user-interactive target selection of "sq" and/or "hl" images aquired the Square and Mid Mag Survey. The results are transformed onto "gr" images since the 2nd pass targeting is done on the grid atlas. It only has one node: "2nd Pass Targeting"

robot MSI screen evaluation

Settings:

Choose from "sq" and "hl" presets as the child images where the targets are selected and transformed from.

"gr" preset should always be selected as the preset of the ancestor images where the targets are transformed to.

You may enter an image to start the selection process.

Tools:

The images are chronological ordered.


< 1st Pass application | 2nd Pass application >



Explanation of Sample Names

MySQL database usernames, Leginon/Appion username, and your linux login username are all different. Each serves its own purpose.

Database names, user, and password need to be entered during web server and sinedon.cfg setup.
In our example, we have:

purpose example name
database name for leginon parameters and metadata leginondb
database name for project management projectdb
database name prefix for appion processing ap
database user name usr_object
database user password (not set)

username for Leginon image viewing and appion processing/reporting from the web = username registered for Leginon running
Firstname used in the registration + Lastname used in the registration = fullname entered in leginon.cfg


Relevant Topics:
Database Server Installation
Configure sinedon.cfg
Web Server Installation



Exposure Targeting Set-up for MSI-Edge

The same hole finder class from Hole Targeting is used in Exposure Targeting for finding exposure and focus targets at higher magnifications by loosely defining some parameters. This set-up should be much easier and more stable than Hole Targeting. The parameters not mentioned here can be left at their default values. To proceed from one step of the exposure targeting process to another, simply proceed from top to bottom through the display selection buttons in the image control panel. The display settings associated with each display selection are the locations where the Hole Targeting parameters can be adjusted. To see the final acquisition and focus targets, enable only the Original, acquisition, and focus display selections.

1. Leginon/Exposure Targeting/Edge>

(This step does not apply if you are using MSI-T)

A good combination of parameters show edges of the hole(s) well with minimal thresholded "edge" from random features.

2. Leginon/Exposure Targeting/Template>

(This step does not apply if you are using MSI-T)

A good template gives a sharp correlation at the center of the holes.

3. Leginon/Exposure Targeting/Threshold>

A good correlation threshold leaves only small blobs of the correlation peaks from the hole(s). This parameter also tends to change during an experiment. In addition, the value is in the unit of number of standard deviation above the mean.

4. Leginon/Exposure Targeting/Blobs>

The Border is used here to prevent the selection of non-targeted holes that show up at the edge of the image.

5. Leginon/Exposure Targeting/Lattice>

This step is used here only to remove multiple blobs found close to the center of the targeted hole.

6. Leginon/Exposure Targeting/acquisition>

No discrimination of holes is needed here. This step will set-up the template for exposure and focus targets.

7. Leginon/Exposure Targeting/Settings> Activate automatic hole finding for future images received.

Skip automatic hole finding = no


< Hole Targeting Set-up for MSI-Edge



Exposure Targeting Set-up for MSI-T

The same hole finder class from Hole Targeting is used in Exposure Targeting for finding exposure and focus targets at higher magnifications by loosely defining some parameters. This set-up should be much easier and more stable than Hole Targeting. The parameters not mentioned here can be left at their default values. To proceed from one step of the exposure targeting process to another, simply proceed from top to bottom through the display selection buttons in the image control panel. The display settings associated with each display selection are the locations where the Hole Targeting parameters can be adjusted. To see the final acquisition and focus targets, enable only the Original, acquisition, and focus display selections.

1. Leginon/Exposure Targeting/Original>

Use this setting to load a test image if needed.

2. Leginon/Exposure Targeting/Template>

A good template gives a sharp correlation at the center of the holes.

3. Leginon/Exposure Targeting/Threshold>

A good correlation threshold leaves only small blobs of the correlation peaks from the hole(s). This parameter also tends to change during an experiment. In addition, the value is in the unit of number of standard deviation above the mean.

4. Leginon/Exposure Targeting/Blobs>

The Border is used here to prevent the selection of non-targeted holes that show up at the edge of the image.

5. Leginon/Exposure Targeting/Lattice>

This step is used here only to remove multiple blobs found close to the center of the targeted hole.

6. Leginon/Exposure Targeting/acquisition>

No discrimination of holes is needed here. This step will set-up the template for exposure and focus targets.

7. Leginon/Exposure Targeting/Settings> Activate automatic hole finding for future images received.

Skip automatic hole finding = no


< Hole Targeting Set-up for MSI-T



Faraday Cup Measurment Notes

Picoammeter setup:

Exposure Time to Screen Current measurment

Leginon screen scale factor measurement

Camera sensitivity

2011-02-02 calibration on Tecnai 2:


FFT Maker

The FFT Maker calculates power spectrums of input images.

Required bindings:

Acquisition - (AcquisitionImagePublishEvent) -> FFT Maker

There are two FFT Maker nodes in MSI, Exposure FFT and Focus FFT. Both of these FFT Maker nodes need to be bound with events from different acquisition nodes. Exposure FFT (with a hint from its name) is bound to the Exposure (Acquisition) node. Likewise, Focus FFT is bound to the Focus node (that has Acquisition node behavior embedded within it).

Settings


< The EM node | Focuser >



File Server Setup Considerations

A specific file tree structure has been assumed as default in Appion/Leginon. Until v2.2 release, this can not be altered. Here is a description of it:

  1. Leginon default image path is defined in leginon.cfg. The acceptable form is /your_file_server_mount_point/whatever/leginon. The images are saved by sessionname under subdirectory of this directory in a form such as
    /your_file_server_mount_point/whatever/leginon/sessionname/rawdata/.
  2. Appion processing is default under appion directory parrallel to leginon directory, i.e., /your_file_server_mount_point/whatever/appion. This relationship is hard-coded until v2.2 release. The processing are divided by sessionname and then processingtype and then runname of the process. Therefore, your processing results are saved in the following default appion path: /your_file_server_mount_point/whatever/appion/sessionname/processing_type/runname/

The following permission rule is required for multi-unix-user usage of Leginon/Appion:

For Leginon:

  1. The web server apache user need to have read permission to all images in the rawdata directories in order to display them in the viewer.
  2. all users need to have permission to create directory in /your_file_server_mount_point/whatever/leginon
  3. all users need to have read permission in a leginon rawdata directory that contains reference images.
  4. Users need to have write permission to the session they created, of course.

For Appion:

  1. Images uploaded to Appion is considered as a Leginon session. See above for its file tree structure.
  2. The web server apache user need to have read permission to processing directories to display the results.
  3. All users need to have permission to create directory in /your_file_server_mount_point/whatever/appion
  4. If more than one user will be processing data in the same session, they all need write permission to the session directory /your_file_server_mount_point/whatever/appion/sessionname/


< Database Server Installation | Processing Server Installation >



Fitting the tilt axis model

Find the Rough Tilt-Axis Location Manually

The easiest way to find the tilt axis uses the fact that the projected feature moves according to a cosine function when it is off from CCD or optical axis but not off from eucentric height.

Do this at the microscope:

  1. Use stage alpha wobbler (symmetrical tilts) to put the specimen to eucentric height.
  2. Send to scope alternatively between 0 and 30 degree. Track the position of an object near the center of the viewing screen at the magnification you want use the model. If the tilt axis does not pass the center of the screen, the object will move upon this asymmetric movement.
  3. Move image shift x,y until the asymmetric tilt movement is minimized.
  4. Use a larger tilt to do the same if desired.
  5. Check the asymmetric movement between 0 and -30 degree to make sure it works reasonably in both way.
  6. Save the image shift as tomo preset's image shift.
  7. Estimate the combined image shift sqrt(x^2+y^2) and enter that as the custom, tilt axis-offset.
  8. From what is observed during the tilts, estimate the direction of the tilt axis and entered as the custom phi value.
  9. Perform the quick test run with this custom *Fixed Tilt Axis Model"

Quick fixed model test run

Instead of a full range tilt series, much can be learned at low tilts. Again, this uses the fact that defocus changes in a sine curve when the tilt axis is off.

Use Leginon Tomography to do a small range tilt since sine curve has the highest slope around zero.
  1. Set the tilt series to cover max 8, min 8 and step at 2 deg.
  2. Take tilt series at these low tilts and at an area where defocus change can be observed easily. Increase dose if needed.
  3. Compare the defocus of the resulting images. Optimize the tilt axis offset so that defocus differences among the tilts in the same tilt direction is minimized.

Full Length Tilt-Axis Model Testing and Fitting

Test runs should be done at the magnification, defocus, and tilts up to the highest values planned for the real ones with a specimen with isotropic features in view and
adjusted to eucentric height. Tilt steps should be made to allow at least 15 images taken per tilt direction. Note that this can refine the above rough results but may give
worse results at times.

First Test Run: Fixed Model

The first time the tomography application is used on a microscope, all model
parameters are default to zero. A test run should be done with the specimen at eucentric
height and all default settings including "keep the tilt axis parameters fixed" activated.
If the feature tracking is good, and the defocii of the images in the tilt series do not
significantly changed, the goniometer behavior and camera alignment are close to ideal,
and no improvement of the model is required.

If the xy tracking deteriorates quickly in the first few tilts, the magnification
should be dropped so that tracking is possible through out the tilt series. Once a rough
model is established, refinement can then be done at higher magnifications.

Runs to Improve the Model-Fitting

A complete tilt model fitting is difficult with small number of data points or at only
low tilts. Therefore, two tilt series need to be taken in order to get a good averaged
model that is later fixed.

  1. tomography/settings/model>deactivate "keep the tilt axis parameters
    fixed".
  2. tomography/settings/model>initialize the model with "this preset only" unless
    this is a refinement of <link linkend="Tomo_low_mag_fitting">a rough model obtained at
    a lower magnification</link>, in which case, initialize the model with "this preset
    and lower mags".
  3. tomography/toolbar>click on "reset learning" to have
    a fresh start of tilt series data included in the fitting.
  4. Presets Manager>send the "tomo" preset to scope.
  5. tomography>Start the tilt series image collection by clicking on "Simulated
    Target" tool.
  6. repeat 4 and 5 to dynamically fit the model the second time if the first one goes
    to completion.
    If the target shifts away during the run, reduce the magnification, repeat 1
    through 9 in this procedure and then return to the higher, intended mag and refined
    the model using the same procedure and proper setting for refinement as mentioned in
    2.
  7. Check on web image viewer to see if the result of the second run in step 6
    produces images of constant defocus through out each half of the tilt seriese.
  8. If the model is good, activate "keep the tilt axis parameters fixed" in the
    tomography settings.
  9. Repeat step 2. Other than reset the learning, the tool produces an output of image
    shift you should copy down and apply to the "tomo" preset in the future runs.

Understand the results of the model fitting

If the above procedure does not yield a good model, it is necessary to study the graphs
output by the run to determine possible causes and derive the best fixed model that at least
work for most angles.

See Fitting the tilt axis model for definition of the displayed values

First fitting tilt series

Figure 1 shows a typical result from the first dynamically fitted tilt series run. x and

Figure 1

According to the Zheng et. al. model, the tilt-axis can be characterized by three
parameters: phi, the angle between the tilt axis and the detector x axis (column), offset,
the distance between the center of the detector and the tilt axis on the xy plane, and z0,
the distance between the specimen from the xy plane that contains the tilt axis.

As a first tilt series used in the model fitting, the data is not fitted until it
accumulate enough data points and spread over more tilts. We arbitrarily select 30 degrees as
the starting angle where the fit is started.

As can be seen in Figure 1, the model is significantly different from the initial as z-axis "Prediction" jumps once the fitting is started. In particular, the model z0 which corresponds to the offset of the specimen from the tilt axis in z direction dominates deviation. Such problem is evident by the near-straight line feature shift in x-axis over more than 1 um. There is also some offset in
x direction since the "Prediction" and "Position" flattens somewhat as it approaches zero tilt. The tilt axis has minimal tilt from x-axis since in the y-direction, despite the bump at about 40 degrees, the range of variation in the whole tilt series is about 0.06 um.

By activate "show model parameters" check box in the viewer, more plots are shown
(Figure 2). phi and "optical axis" offset remain fixed below 30 deg while z0 is recalculated at each tilt. As you can see, the fitting of the former two parameters are not very stable in this first trial. Therefore, we need to do the second run.

Figure 2

Second fitting tilt series

Figure 3 shows the z-axis plot of the second run since the x and y does not change
significantly. Figure 4 shows its corresponding model parameters. The zero and first tilt
uses the initial model and the rest are fitted dynamically. In this run, because more than
one tilt series is found in the memory since last "reset learning", the model fitting starts
after the first tilt image is acquired. model parameters are rather stable over the whole
tilt series and suggests that the tilt axis is tilted from x-axis by about -1.3 degree, and
offset from the center of the detector by -0.6 um, and the specimen is off from eucentric
height by about -0.7 um

Figure 3

Figure 4

Although it is not possible to maintain perfect defocus prediction in the full range of
the tilt by using a fixed model, we found that the overall performance is better if an
average tilt axis model that works well in the mid-range tilt is used as a fixed model. For
example, for the behavior in the above figure, we choose:

Fixed axis tilt series

Use these custom values as initial model and turn on "Keep the tilt axis parameters
fixed". If the result is good, judging by consistent defocus and target tracking through out
the tilt series, this model will be saved in the database as best model automatically, and
you can revert back to initialize with the model of "only this preset".

Low Magnification Model Fitting

The fitting of optical axis offset does not always works if the offset is so large that
the feature moves out of view with even a small tilt. In such a case, it is worth first
collect a tomography series at a lower magnification to define roughly the model.

At beginning of each session, or forced by the user, the model is initialized. By
default, at the initialization, Tomography node uses past fitting results that show good
agreement with the experimental data at the magnification of the preset used. If a good
model is not found, that from lower magnifications will be used. It is possible to force the
node to use a model fitted at a particular magnification by selecting it in
Tomography/Settings/Model.

Therefore, we recommend that, in case of fitting failure on good contrast images, the
followings should be done:

  1. Tomography/Settings/Image Acquisition> change the preset to "hl".
  2. Tomography/Settings> adjust Tilt and Exposure parameters to match.
  3. Acquire the tiltseries images.
  4. If the tracking is good, change the preset back.
  5. Tomography/Settings/Model> Initialize with the model of (the mag of "hl"
    preset).
  6. Acquire the tomo-series.
  7. If tracking is good, change back to Initialize with the model of "this preset and
    lower" mag.

See Troubles with Tomography section for various modeling problem solving examples


< Reading the tomography graphs | Full Protocol on a F30 with an energy filter >


Flavors of MSI applications

Seven MSI applications are distributed with Leginon.

MSI-Edge, MSI-T, and MSI-Raster each uses a different automated target finders in
Hole(Subsquare) Targeting and Exposure Targeting.


< Ways of Moving to Targets in Nodes that acquire images inside MSI | Summary of MSI applications >



Focuser

The Focuser node is responsible for focusing. Focus sequence determines the sequence of focus steps that can be applied to the focus target the node received. For each item in the sequence, a preset is chosen for imaging and the method of focus (Autofocus or Manual focus) is selected. For autofocus method, defocus and astigmation are measured by beam tilt induced image shift. Alternatively distance from the eucentric height is measured by two opposite stage alpha tilts. The correction type then determines which and how the correction is made. Manual
focus, either through a z height or defocus change, is possible. Eucentric focus can be send to/received form the scope, and the user can also reset current zero defocus. Note that when stage z is used for focus correction, drift is declared automatically so that the drift manager can handle the position change properly.

When the stage is tilted significantly, distortion of the image occurs when beam is tilted. Cosine stretching (Ziese et al. 2003 J. Microscopy 211,179-185) boosts the correlation peak during autofocusing. In addition, a defocus offset is made according to the tilt geometry so that equivalent level of defocus is achieved with image shift at any targeted location. This correction is made automatically.

Required bindings to Presets Manager:

FocuserNode - (ChangePresetEvent) -> PresetsManagerNode
PresetManagerNode - (PresetChangedEvent) -> FocuserNode

Focuser normally receives rejected target list from acquisition node rather than from a TargetFinderNode Class although it is possible, too.

AcquisitionNodeAlias - (ImageTargetListPublishEvent) -> FocuserNode
FocuserNode - (TargetListDoneEvent) -> AcquisitionNodeAlias

For the focuser that initiates drift monitoring, two bindings are needed:

FocuserNode - (DriftMonitorRequestEvent) -> DriftManagerNode
DriftManagerNode - (DriftMonitorResultEvent) -> FocusNode

Required Bindings to use drift check image for auto focusing:

DriftManagerNode - (AcquisitionImagePublishEvent) -> RCTNode

Bindings needed if to be Fourier transformed:

FocuserNode- (AcquisitionImagePublishEvent) ->FFTMakerNode

Focuser node may need target shift correction upon drift:

FocuserNode - (NeedTargetShiftEvent) - > DriftManagerNode
DriftManagerNode-(AcquisitionImageDriftPublishEvent) -> FocuserNode

Optional Bindings with Navigator to allow (iterative) target move correction:

AcquisitionNodeAlias - (MoveToTargetEvent) -> NavigatorNodeAlias

Toolbar

Settings

Focus Sequence Settings

Manual Focus

- Mask radius: "1" % of image = center percentage of FFT that is masked out in order to see the FFT easier on the screen

- Icrement: 5e-7 m = the incremental amount of defocus or stage z change

Align Rotation Center


< FFT Maker | Gon Modeler >



Forum conversion

Notes on porting the Leginon BB to Redmine

  1. Add Forums
    1. create new colum for bb forum id
    2. insert the bb forums
  2. Add column to redmine message db for bb post id
  3. Import all posts to current forums (map forum id's), saving bb post id to new column
  4. enter messages parent ids
  5. edit posts to put into new forum
  6. delete unwanted forums

Redmine DB Tables

Messages

id board_id parent_id subject content author_id replies_count last_reply_id created_on updated_on locked sticky

Boards

id project_id name description position topics_count messages_count last_message_id

Users

id login hashed_password firstname lastname mail mail_notification admin status last_login_on language auth_source_id created_on updated_on type identity_url

BB DB Tables

Notre_forums

forum_id parent_id left_id right_id forum_parents forum_name forum_desc forum_desc_bitfield forum_desc_options forum_desc_uid forum_link forum_password forum_style forum_image forum_rules forum_rules_link forum_rules_bitfield forum_rules_options forum_rules_uid forum_topics_per_page forum_type forum_status forum_posts forum_topics forum_topics_real forum_last_post_id forum_last_poster_id forum_last_post_subject forum_last_post_time forum_last_poster_name forum_last_poster_colour forum_flags display_subforum_list display_on_index enable_indexing enable_icons enable_prune prune_next prune_days prune_viewed prune_freq

Notre_posts

post_id topic_id forum_id poster_id icon_id poster_ip post_time post_approved post_reported enable_bbcode enable_smilies enable_magic_url enable_sig post_username post_subject post_text post_checksum post_attachment bbcode_bitfield bbcode_uid post_postcount post_edit_time post_edit_reason post_edit_user post_edit_count post_edit_locked

Notre_topics

topic_id forum_id icon_id topic_attachment topic_approved topic_reported topic_title topic_poster topic_time topic_time_limit topic_views topic_replies topic_replies_real topic_status topic_type topic_first_post_id topic_first_poster_name topic_first_poster_colour topic_last_post_id topic_last_poster_id topic_last_poster_name topic_last_poster_colour topic_last_post_subject topic_last_post_time topic_last_view_time topic_moved_id topic_bumped topic_bumper poll_title poll_start poll_length poll_max_options poll_last_vote poll_vote_change

Notre_users

user_id user_type group_id user_permissions user_perm_from user_ip user_regdate username username_clean user_password user_passchg user_pass_convert user_email user_email_hash user_birthday user_lastvisit user_lastmark user_lastpost_time user_lastpage user_last_confirm_key user_last_search user_warnings user_last_warning user_login_attempts user_inactive_reason user_inactive_time user_posts user_lang user_timezone user_dst user_dateformat user_style user_rank user_colour user_new_privmsg user_unread_privmsg user_last_privmsg user_message_rules user_full_folder user_emailtime user_topic_show_days user_topic_sortby_type user_topic_sortby_dir user_post_show_days user_post_sortby_type user_post_sortby_dir user_notify user_notify_pm user_notify_type user_allow_pm user_allow_viewonline user_allow_viewemail user_allow_massemail user_options user_avatar user_avatar_type user_avatar_width user_avatar_height user_sig user_sig_bbcode_uid user_sig_bbcode_bitfield user_from user_icq user_aim user_yim user_msnm user_jabber user_website user_occ user_interests user_actkey user_newpasswd user_form_salt

Conversion tables

Redmine Users

Search for the user to have an existing entry, if not their posts will be assigned to anonymous.

Redmine Entry BB Entry
id
login notre_users->username
hashed_password
firstname
lastname
mail notre_users->user_email
mail_notification
admin
status
last_login_on
language notre_users->user_lang
auth_source_id
created_on
updated_on
type
identity_url

Redmine Boards

We will create these from scratch - Development, Using Leginon, Using Appion, Tomography, Installation, Administration Tools

Redmine Entry BB Entry
id
project_id (the leginon id)
name notre_forums->forum_name
description notre_forums->forum_desc
position
topics_count notre_forums->forum_topics
messages_count notre_forums->forum_posts
last_message_id After all messages are ported add: notre_forums->forum_last_post_id->Redmine Messages->bb_post_id->id
bb_forum_id notre_forums->forum_id

Redmine Messages

Redmine Entry BB Entry
id
board_id notre_posts->forum_id->Redmine Boards->bb_forum_id->id
parent_id Add these as second step after all posts moved over, notre_posts->topic_id->notre_topics->topic_first_post_id->Redmine Messages->bb_post_id->id
subject notre_posts->post_subject
content notre_posts->post_text (need to get BLOB)
author_id notre_posts->poster_id->notre_users->user_email->Users->mail->Users->id, if does not exist assign to anonymous
replies_count Set all to 0 then check Notre_topics->topic_first_post_id and update that message with notre_topics->topic_replies
last_reply_id Set all to NULL then check notre_topics->topic_first_post_id->Redmine Messages->bb_post_id->id and update that message with notre_topics->topic_last_post_id->Redmine Messages->bb_post_id->id
created_on notre_posts->post_time (may need a conversion)
updated_on notre_posts->post_edit_time (may need a conversion)
locked notre_posts->post_edit_locked
sticky 0
bb_post_id notre_posts->post_id

Commands

Make backups

First backup the tables that we will be modifying:

mysqldump -u amber -p --skip-lock-tables --extended-insert redmine boards > boards-preport.sql

mysqldump -u amber -p --skip-lock-tables --extended-insert redmine messages > messages-preport.sql

Add temporary columns to the boards and messages tables

ALTER TABLE boards
ADD bb_forum_id int(11);

ALTER TABLE messages
ADD bb_post_id int(11);

Add forums

INSERT INTO ami_redmine.boards (project_id, name, description, topics_count, messages_count, bb_forum_id)
SELECT ami_redmine.projects.id, bb2.notre_forums.forum_name, bb2.notre_forums.forum_desc, bb2.notre_forums.forum_topics, bb2.notre_forums.forum_posts, bb2.notre_forums.forum_id
FROM ami_redmine.projects, bb2.notre_forums
WHERE ami_redmine.projects.identifier="leginon" 

Inserts 9 rows.

Add Messages

INSERT INTO ami_redmine.messages (board_id, subject, content,  locked, sticky, bb_post_id)
SELECT ami_redmine.boards.id, bb2.notre_posts.post_subject, bb2.notre_posts.post_text, bb2.notre_posts.post_edit_locked, 0, bb2.notre_posts.post_id
FROM bb2.notre_posts, ami_redmine.boards
WHERE bb2.notre_posts.forum_id = ami_redmine.boards.bb_forum_id;   

inserted 603 rows.

Add parent_id to messages

UPDATE ami_redmine.messages AS redMess1, ami_redmine.messages AS redMess2, bb2.notre_topics, bb2.notre_posts
SET redMess1.parent_id=redMess2.id
WHERE redMess1.bb_post_id = bb2.notre_posts.post_id
AND bb2.notre_posts.topic_id = bb2.notre_topics.topic_id
AND bb2.notre_topics.topic_first_post_id = redMess2.bb_post_id
AND redMess1.id != redMess2.id;

Add author_id to messages

UPDATE ami_redmine.messages, ami_redmine.users, bb2.notre_users, bb2.notre_posts
SET ami_redmine.messages.author_id=redmine.users.id
WHERE ami_redmine.messages.bb_post_id = bb2.notre_posts.post_id
AND bb2.notre_posts.poster_id=bb2.notre_users.user_id
AND bb2.notre_users.user_email = ami_redmine.users.mail;

For the messages from people who are not registered in redmine, set the author_id to 2 which is the anonymous user.

UPDATE ami_redmine.messages
SET ami_redmine.messages.author_id=2
WHERE ami_redmine.messages.author_id IS NULL;

Updates 290 entries.

Add replies_count to messages

UPDATE ami_redmine.messages, bb2.notre_topics, bb2.notre_posts
SET ami_redmine.messages.replies_count = bb2.notre_topics.topic_replies
WHERE ami_redmine.messages.parent_id IS NULL
AND ami_redmine.messages.bb_post_id = bb2.notre_posts.post_id
AND bb2.notre_posts.topic_id = bb2.notre_topics.topic_id;

Add last_reply_id to messages

UPDATE ami_redmine.messages AS redMess1, ami_redmine.messages AS redMess2, bb2.notre_topics, bb2.notre_posts
SET redMess1.last_reply_id = redMess2.id
WHERE redMess1.parent_id IS NULL
AND redMess1.bb_post_id = bb2.notre_posts.post_id
AND bb2.notre_posts.topic_id = bb2.notre_topics.topic_id
AND bb2.notre_topics.topic_last_post_id = redMess2.bb_post_id;

Convert Unix timestamps to ISO 8601 and add to messages

http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_from-unixtime
http://aruljohn.com/timestamp2date.html

UPDATE ami_redmine.messages,  bb2.notre_posts
SET ami_redmine.messages.created_on = FROM_UNIXTIME(bb2.notre_posts.post_time)
WHERE ami_redmine.messages.bb_post_id = bb2.notre_posts.post_id;
UPDATE ami_redmine.messages,  bb2.notre_posts
SET ami_redmine.messages.updated_on = FROM_UNIXTIME(bb2.notre_posts.post_edit_time)
WHERE ami_redmine.messages.bb_post_id = bb2.notre_posts.post_id
AND bb2.notre_posts.post_edit_time != 0;

Add last_reply_id to boards

UPDATE ami_redmine.boards, ami_redmine.messages, bb2.notre_forums
SET ami_redmine.boards.last_message_id = ami_redmine.messages.id
WHERE ami_redmine.boards.bb_forum_id = bb2.notre_forums.forum_id
AND bb2.notre_forums.forum_last_post_id = ami_redmine.messages.bb_post_id;

Create a backup of the tables

mysqldump -u amber -p --skip-lock-tables --extended-insert redmine boards > boards-postport.sql

mysqldump -u amber -p --skip-lock-tables --extended-insert redmine messages > messages-postport.sql

Remove the temporary columns

ALTER TABLE boards
DROP COLUMN bb_forum_id;

ALTER TABLE messages
DROP COLUMN bb_post_id;

For testing content conversion

Get the original content:

UPDATE ami_redmine.messages,  bb2.notre_posts
SET ami_redmine.messages.content = bb2.notre_posts.post_text
WHERE ami_redmine.messages.bb_post_id = bb2.notre_posts.post_id;


Four Parts of the Leginon System

Leginon as a system that we distribute can be divided into three parts:

Processing Server (Python-side)

Python (and some c) scripts that handle instrument control, data acquisition, and
processing.

Database Server (MySQL-side)

a MySQL server that handles the database

Web Server (PHP-side)

This includes php and Java scripts at a webserver that we will create to retrieve image
and metadata from the database and file-storage system.

File Server

This is up to you to set up to store lots of data coming out of Leginon system.


What is in this Chapter >



Frequent Asked Questions

  1. How does Leginon Name the Files?
  2. Why does the first Grid Image Not Numbered 00001?
  3. What is the definition of ice thickness in the hole finders?

< Leginon "Robot-MSI-Screen" Applications | Trouble shooting >



Full Protocol on a F30 with an energy filter

This is edited from a complete protocol written by Lu Gan (Jensen Lab, Caltech) for users
who have not used general MSI applications. It is modified to reflect the current Leginon
version and a current and graphic-rich protocol by Jian Shi (contact him at
jianshi@caltech.edu for a copy) of the same group.

Notes

Initial setup

  1. Tecnai/GIF> Tune GIF with scope column empty
  2. Tecnai/TUI/Stage> Set Z = 0.
  3. Tecnai/TUI> Turn on Intensity Zoom
  4. Tecnai> Remove objective aperture.
  5. Quit UCSF Tomo, TEM Auto-functions, Low-Dose kit.

Start Leginon

  1. Launch Leginon
  2. Choose either to start a new session or continue an old one, then launch Multiscale
    Tomography from Applications menu.

Presets setup with empty column

  1. Leginon/Presets Manager> Set up all the presets except align image shifts. If
    starting new session, import presets from previous session. If you want to preview
    images at high mag, make or copy a preview called "preview," which should be set to 3x3
    to 4x4 binning for greater contrast.

Flat fielding and dose calibration

  1. Tecnai/TUI/EFTEM> Make sure that "filter" is on.
  2. Leginon/Presets Manager> tomo preset to scope.
  3. Tecnai/TUI/GIF> Go back to hole and re-align ZLP (and tune GIF if it's been ~24
    hours since last
  4. Leginon/Correction/Settings> set camera configuration to match that of the
    preset. Choose to use 2 correction channels.
  5. Leginon/Correction> acquire dark current, then acquire bright image, then
    acquire corrected image to make sure "flat-fielding" worked.
  6. Leginon/Presets manager> redo dose measurement.
  7. Leginon/Tomography> recheck dose.
  8. Leginon/Correction> repeat 4 and 5 for preset fa and hl if they are of different
    camera binning.

Presets setup and grid atlas

  1. Insert Grid.
  2. Make sure you're near eucentric height (z = 0 is close enough for Leginon, unless
    your grid is seriously bent).
  3. You should know from experience whether the imported "gr" preset aligns reasonable
    well to higher mags so that you can reach your intended grid square, however inaccurate,
    without alignment. If this is true, you can follow 4 and 5 immediately. If not, you will
    need to manually move to a test sacrificial square at Tecnai and acquire the grid atlas
    after presets alignment.
  4. Leginon/Grid Targeting> Calculate and then publish a grid atlas using the "Grid
    Targeting" node. Do NOT pick targets in "Square" node during atlas assembly.
  5. Leginon/Square Targeting> Pick an broken square on the grid atlas and press the
    play icon, then save position on Tecnai/TUI/Stage> or in Leginon/Navigation/Stage
    Locations>. Repeat for a sacrificial square. The broken square is used to manually
    align the ZLP; the sacrificial square is used to align presets, objective lens, and to
    record test images.

Presets alignment

Note: steps 1 and 2 are only necessary for really bad grids (you'll know).

  1. Tecnai/TUI> stage: go to the sacrificial square. Turn on wobbler
  2. Tecnai/DM> do auto eucentric height and auto focus.
  3. Leginon/Presets Manager> hl preset to scope.
  4. Tecnai/TUI> move the stage to a feature recongnizable across the presets.
  5. Leginon/Presets Manager> tomo preset to scope.
  6. Tecnai/TUI> recenter the feature accurately.
  7. Leginon/Presets Manager> Follow image shift
    alignment procedure
    in general MSI set-up using tomo preset as the
    reference.

Objective aperture centering

  1. Leginon/Presets Manager> tomography presets to scope.
  2. Tecnai/TUI/motorized apertures> Put in objective aperture.
  3. Tecnai> Go into diffraction mode.
  4. Tecnai> Center image using diffraction shift-X&Y.
  5. Tecnai/TUI/motorized apertures> Click center in motorized apertures menu.
  6. Tecnai/TUI/motorized apertures> Center objective aperture, then remove objective
    aperture.

Target acquisition

1. Leginon/Grid Targeting> Remove objective aperture, Rename and calculate a new
grid atlas, then publish to make a new atlas, and then Reinsert objective
aperture.

*Note: You only need to take this (second) atlas if the presets - especially
square and hole - are poorly aligned, which you'll find out from the previous
alignments. If the presets were already aligned, then you can use the original grid
atlas. *

2. Leginon/Square Targeting> Click on the purple crosshair icon (reference point)
and click on a broken square, which will be used for ZLP alignment and dosage.

3. Leginon/Square Targeting> Pick squares that look good, then press Play button .

4. Leginon/Hole Targeting> While square targets are getting collected, you can
start picking targets in the hole targeting menu. Pick a bunch of holes (but not
adjacent ones), then pick a focus point for rough Z- focus. To advance to the next
square, press the play button but NOT Queue- play .

5. Leginon/Hole Targeting> After the hole targets are all selected, insert the
objective aperture and press Queue-play.

6. Leginon/Tomography Targeting> DON'T PRESS Queue-play until ready for final
tomography acquisition.

7. Leginon/Tomography Targeting>Remember to pick a FOCUS spot for each hole and
tomography target!

Tip: you can mouse over the target and get an estimate of the average intensity in
the popup menu, which lists X,Y,Cnts. This feature lets you rapidly screen for (1)
squares with the thinnest ice and (2) the thinnest targets.

8. Leginon/Tomography Targeting> To preview target, use preview crosshair to pick
the target:

9. Leginon/Tomography> check data collection parameters: dose, tilt range, tilt
interval. See notes on image intensity recorded through
tomography
. (If you want -60 to 60 tilts, you should ender -61 to 61 since the
limiting algorithm is "smaller than" not "smaller than or equal to".

10. Leginon/Presets> setup data collection parameters for focus & tomography:
mag, defocus, INT (INT for focus should be greater than for tomo).

Final checklist: Getting ready to collect


< Running the application | Using "MSI-SimuTomography" Application for debugging >



General operation problems

Leginon main window has frozen

Commonly Why: You have a setting window open somewhere. The main window can not do anything if there is a subwindow open.

Solution:

Solution:

  1. If the freeze is reproducable, record and report the circumstance when this happens to those in charge with Leginon redmine
     
  2. Kill frozen Leginon window by one of the following. Try the gentler ones listed at front first. Check to see if any Leginon related process is running by Unix command >ps. If there are left-over python processes, try the next more aggresive one.
     
  3. scope> kill and restart Leginon Client if desired.
     
  4. main> restart Leginon by 'start-leginon.py'
     
  5. Leginon Setup Wizard> Select user and returning sesson and "Start" the program.
     
  6. Leginon/Application> select the application used to run. Select the scope and the main launcher, and then launch the application.
     
  7. If a simple application such as "Manual" is used, just continue what you were doing.
     
  8. If "MSI" or "Multiscale Tomography" application is used and Leginon did not crash during queue processing, do the following to continue:
     
  9. If "MSI" or "Multiscale Tomography" application is used and Leginon crash during queue processing, do the following at the node where the targets from its queue you wish to continue process.
     
    Leginon/XXX Targeting/Toolbar> click on the "Submit the queued target".

Still not working: Check for hardware and network problems.

Leginon has crashed

Commonly Why: You have click too many places and make changes so fast that leginon can not follow it.

Solution:

Solution:

  1. If the crash is reproducable, record and report the circumstance when this happens to those in charge with Leginon redmine
     
  2. Check to see if any Leginon related process is running by Unix command >ps. If there are left-over python processes, try the next more aggresive one.
     
  3. scope> kill and restart Leginon Client if desired.
     
  4. main> restart Leginon by 'start-leginon.py'
     
  5. Leginon Setup Wizard> Select user and returning sesson and "Start" the program.
     
  6. Leginon/Application> select the application used to run. Select the scope and the main launcher, and then launch the application.
     
  7. If a simple application such as "Manual" is used, just continue what you were doing.
     
  8. If "MSI" or "Multiscale Tomography" application is used and Leginon did not crash during queue processing, do the following to continue:
     
  9. If "MSI" or "MSI-Tomography" application is used and Leginon crash during queue processing, do the following at the node where the targets from its queue you wish to continue process.
     
    Leginon/XXX Targeting/Toolbar> click on the "Submit the queued target".

Still not working: Check for hardware and network problems.

Python window does not close on Windows after Leginon GUI window is closed

Why: Python process controls Leginon GUI window. On Windows, Python process is considered broken without Leginon GUI.

Data collection does not resume after restarting Leginon

Commonly Why:

For applications that process targets on grid atlas such as MSI and "Multiscale Tomography", resuming data collection depends on whether "queuing" option is used and if there are still targets left in the queues.

Acquired image or program parameters do not behave in the same way as the input

Commonly Why: An invalid input is entered such as an invalid camera setting, text in place of an inumber.

Parameters in setting windows do not apply to the node image display

Why:

Fail to load a node in an new application with DataAccessError

Why:

You may want to get help from the most experienced user at your institute to do these:


< Pausing and Aborting during data collection | Hardware Troubles >



Getting Help


Installation/Update problems >



Getting Help


Do and Do Not in leginon >



Getting Started

Full (Super User) Manual - Getting Started

These steps are a general overview of the entire procedure involving
installation, microscope alignment, calibrations, and using Leginon applications (e.g.
Manual, Calibrations, MSI).

Getting Started as a Super User

Installation (System Administrator) - Getting Started

These steps are geared solely towards the system administator(s) that will installing
Leginon and setting it up initially for the rest of the Leginon users that need not be
concerned with these details.

Getting Started as a System Administrator

Short Manual (Basic Leginon User) - Getting Started

These steps are intended to help the basic Leginon user who will operate Leginon (and
not care about installation or the first-time calibrations).

To use the recommended new wiki version, start at Getting Started as a basic Leginon user

To use the old one, go here. We will phase out the old-style documentation in near future.

To print out the old-style manual, download part I and part II


< Minimum Requirements and current NRAMM setup



Getting Started as a basic Leginon user

These steps are intended to help the basic Leginon user who will operate Leginon (and
not care about installation or the first-time calibrations).

1. Align the microscope

Refer to Microscope Set-up.

2. Recording images with Low Dose Kit on the microscope

Refer to using the Leginon "Manual Application".

3. Set-up and run MSI

Refer to MSI Quick-start.

AND

Refer to MSI Operation.

4. Help yourself and others

Refer to Trouble shooting.


< Getting Started as a System Administrator



Getting Started as a basic Leginon user (docbook version)

These steps are intended to help the basic Leginon user who will operate Leginon (and
not care about installation or the first-time calibrations).

1. Align the microscope

Refer to Microscope Set-up

2. Recording images with Low Dose Kit on the microscope

Refer to using the Leginon Manual Application

3. Set-up and run MSI

Refer to MSI quick set-up checklist

AND

Refer to MSI Operation

4. Help yourself and others

Refer to User Trouble Shooting


Getting Started as a Super User

These steps are a general overview of the entire procedure involving
installation, microscope alignment, calibrations, and using Leginon applications (e.g.
Manual, Calibrations, MSI).

1. Install the Leginon System

Refer to the Complete Installation.

2. Add Users, Groups, Instruments, Calibrations, and Applications

Refer to Leginon Administration Tools.

For advanced Leginon users who would like to create an application, see the chapter entitled Create and Edit Applications.

3. Test run

Refer to the Start Leginon chapter for test run instructions on
the microscope and on a remote computer.

4. Align the microscope

Refer to Microscope Set-up.

5. Calibrate Leginon for the microscope

Refer to the Leginon "Calibrations" Application chapter.

6. Set-up and Run MSI

Refer to MSI Quick-start.

AND

Refer to MSI Operation

7. Help yourself and others

Refer to Installation Troubleshooting,
Trouble Shooting and the Leginon Forum.

8. Know the details

For advanced Leginon users who would like to create an application, see Create and Edit Applications.

Refer to Node Descriptions.


Getting Started as a System Administrator >



Getting Started as a System Administrator

These steps are geared soley towards the system administator(s) that will installing
Leginon and setting it up initially for the rest of the Leginon users that need not be
concerned with these details.

Refer to Installation Troubleshooting, and
Leginon Forum.

1. Download and Install the Leginon System

Refer to the Complete Installation for new installation.

Refer to the Upgrade Instructions for upgrading from previous Leginon versions.

2. Add Users, Groups, Instruments, and Applications

Refer to Leginon Administration Tools.

3. Test run for new installations.

Refer to Start Leginon for test run instructions on
the microscope and on a remote computer.


< Getting Started as a Super User | Getting Started as a basic Leginon user >



Goniometer

The goniometer movement must be modeled for finer movements. Leginon calibrates this movement through the Gon Modeler node. Through this feature, the models for these movements can be graphically seen.

View the Goniometer Model


< Applications | Leginon Administration Tools ^



Gon Modeler

The GonModeler node models the goniometer/stage movement to give a more accurate stage position/movement calibration. The stage position is modeled in both x and y directions. For a more accurate calibration, many points or images need to be acquired to give a more accurate mathematical fit to the function. This calibration works best on a grid that will always give good cross correlations. Slot grids give large areas that can cross correlate well, but this type of grid tends to drift. Negatively stained grids or grids with a carbon in the background will work well.

How does modeled stage position work?

There are two types of results from doing a modeled stage calibration: 1) a function (in the form of a harmonic series) that models the mechanical behavior of the stage 2) a magnification adjustment (scaling and rotation) that allows the model function to be used at different magnifications. Part 1 needs to be done at only one magnification, because the result will be normalized in the database so that it can be used at any other magnification. Part 2 needs to be done at any other magnifications that you wish to use this calibration. The user interface of GonModeler node gives you two methods: "Fit Model" and "Mag Only" These two methods are really identical except for the final result they store in the database. "Fit Model" will store both part 1 and 2 above. "Mag Only" will onlystore part 2 (and assumes that you already have part 1 done). Since "Fit Model" is responsible for part 1, you generally need to measure a lot of points to get a good fit. You will normally select between 2 and 5 terms for the harmonic series to get a good fit. The "Mag Only" method will also fit a function to your measured points using the number of terms you specify. But the resulting best fit function is not stored in the database. Only the constant term of the resulting function is stored, because this can be used to scale the existing normalized model function to the current magnification.

Right now it is not possible to use the modeled stage calibration for building a mosaic of images. The reason is that we have not yet implemented the inverse transform of this calibration. All of the matrix calibrations are easy to invert (for instance, you can convert from a pixel shift to a stage shift, or invert that and convert from a stage shift to a pixel shift). The modeled stage calibration is more complicated to invert, so right now we can only convert from a pixel shift to a stage shift. The MosaicClickTargetFinder node is responsible for assembling the images into a complete mosaic image. It does this by looking at the stage position of each of the component images, and doing the reverse transform from stage position to pixel shift. The result is the pixel offset of the component image in the overall mosaic.

Required bindings to use preset instrument configuration set by presets manager:

PresetsManagerNode - (PresetChangedEvent) -> GonioMedelerNode

Toolbar

Settings


< Focuser | Hole Finder >



Good Alignments Save Time

Leginon relies on a stable microscope. The most likely reason for leginon to fail performing is bad microscopy alignment. Various bad alignments often compound the difficulty in problem solving. The requirement of leginon for good alignment is higher than most users who set up low dose image acquisition directly at the scope are used to, especially regarding alignment in LM mode since most low dose user has limited usage for LM mode images.

Apart from alignments that every user does without Leginon, Here are some of alignment critical to Leginon MSI applications but not a common low-dose kit users.

HM beam-tilt pivot point and current rotation center set for eucentric focus

These are needed for beam-tilt based auto-focusing

Defocus reset to eucentric at BOTH HM and LM modes

These are important starting point to allow consistent performance of calibrations and saved presets.

What is eucentric focus?

Image/Beam Calibration at HM mode

Beam has to remain centered at CCD camera when Leginon move to targets with image shift. For FEI scopes, the calibration procedure is in Tecnai/TEM User Interface. For JEOL scopes, a calibration is performed in Leginon to achieve the same effect.


< Calibrations required on FEI microscopes | Microscope Set-up Checklist >



Go to project tools page

Open a web browser. Go to 'http://yourhost/myamiweb/project'


< Installation | Add a new project >



Graphical User Interface

How to use this manual

Many places in the manual, a specific section of a window for a node on a
launcher/computer/instrument is mentioned. The first time they are mentioned, the full path
is shown as

computer/program window/node/subsection of the node to open the setting window/setting
window/section in the window>

It is assumed that the user knows how to follow this path to the specific section of the
window by reading the following graphical user interface (GUI) manual and by a little of
practice. A abbreviated path rather than the full path will be shown in the latter steps for
the same node or application.

Leginon Window

The window is divided into sections.

Node Panel

Parameter Entry

Image Viewing

Tool Bar

Tool bar of the node contains tools for setting and execution of the node functions. In
addition, some tools are available as pop-up for convenience. The general rule for the flow
of setting up and execution is to go from left to right up to the execution tool (execution
icon).

Settings Window

Settings windows are opened by left clicking its button

in the toolbar. Note that only one setting swindow can be opened at a time and that all
functions in the main leginon window is inactivated when a settings window is open even if
the leginon window is the focus. The content of the settings window depends on the purpose
of the settings. The general controls are described here:

Execution tools

Found in the node toolbar. They may take on different meanings for different node
classes. The general ones are described here:


< Terminology | Minimum Requirements and current NRAMM setup >



Grids for Calibration

The grid used for calibration should have reasonable contrast and features at multiple
scale. A frozen grid is generally not convenient for the purpose since the contrast is low and
can drift easily. Large protein complex negatively stained on a 200-400 mesh em grid with
Quantifoil, C-falt, or home-made holey carbon support is ideal. You can even use one that is
abandoned after a cryo run, just negatively stain it to improve the contrast. From our
experience, small protein negatively stained on continuous carbon support often gives low
contrast at intermediate magnification and therefore not ideal. If your Quantifoil or C-flat
grid is too clean, there may be a problem of false peaks from the lattice. In this case, you
can add some gold clusters such as Nanogold from Nanoprobe.


< Importance of making calibrations | Startup >



Grid management

Grid management shared

You may register grid boxes and grids by projects. This is mainly used with grid handling
robot.


< Edit an existing project



1. Grid Boxes

The grids are located in a grid box.
  1. Click on <new> tab under the heading "Grid Box".
  2. Type an label unique to the database.
    There are three types of grid boxes defined: 4 slot cryo grid box, typical 50 slot grid box, and 96 well robot grid tray
  3. Select the type of grid box used.
  4. Click on "add" to register this grid box in the database.

2. Grids

  1. Click on <new> tab under the heading "Grid" to register a new grid

After the grid is added, it can be assigned to a location on an existing grid box by choosing the box and click on a location not yet occupied by a grid.

3. Upload Grids

This allows the user to register multiple grids on the same grid box. This is most useful for a robot grid tray. Above rules for the grid fields still applies to the uploaded grids. In addition, only grids from the same project can be uploaded at one uploading grid file.
  1. Click on upload grid/tray
  2. Create grid file on local computer. The fields should be separated by tabs.
  3. Select the project with which the grids in the file is associated to.
  4. Type the grid box label to which the grids are inserted into. If the grid box does not exist, a new robot tray is created.
  5. Browse to choose the grid file and upload

Hardware Troubles

Preset manager fails to send a preset to the microscope

Why: If Tecnai microscope is busy for reasons such as correcting a pole touch error, Leginon can not comunicate with the scope until the latter is free.

Solution: Make sure the scope is not busy any more and send the preset to scope manually to resume data collection.

Note: The immediate imaing condition may be wrong since manual preset sending does not include extra image shift from the target, but it should recover in later process.

Leginon can not activate GIF slit

Why: Unknown

Try these:

There is no fix for this bug.

Image acquired at the wrong stage position

Commonly why: dirty or worn compustage parts

Solution: Call for scope service

< General operation problems | Troubles with Imaging >



HM Beam Shift/Image Shift Calibration

Purpose

allow image shift without moving the beam and vice versa.

Procedure

  1. From TUI Workset look for Alignment tools and start Image/Beam calibration located inside Image HM-TEM. Follow its instruction for the calibration.


Hole Depth

The hole depth node, is a set of tools to measure parameters needed to correlate the intensity values of hole with (I) and without ice (I0) with the physical thickness of the ice. The two intensity values gives the image contrast , c=ln(I0/I), that is used in Hole Finder Node Class as the relative measurement of thickness. Since the actual calibration of contrast against physical thickness is not yet written, we do not advise using this node unless you plan to perform your own query and fit the values with the proper function outside Leginon.

Required bindings for recieving images:

This node at the moment stands alone and is used in post session processing.

Image Selection

Each selected image type are for different measurement required for the correlation.

Image Control Panel

NOTE: To see the effects of Testing the settings for a particular Hole Depth step in the Image Control Panel, the corresponding Hole Depth step Display must be enabled before using the Test feature in that step's Display Settings.

Original

Display

To view the original input image without any image processing done to it, enable this button. Enabling this button will disable/override the Edge, Template, and Threshold Displays.

Display Settings

Edge

The purpose of the Edge step is to convert the original image into an "edge" image where the edges of the holes in the image are enhanced against a black background.

Display

To view the Edge image, enable this button. Enabling this button will disable/override the Original, Template, and Threshold Displays.

Display Settings

Template

The purpose of the Template step is to cross correlate a template of the properly sized holes against the edge image where the edges of the holes have been enhanced in the previous step. Unlike in HoleFinder, this template is a tilt projection of the circularring.

Display

To view the Template image, enable this button. Enabling this button will disable/override the Original, Edge, and Threshold Displays.

Display Settings

Threshold

The purpose of the Threshold step is to apply a threshold to the previous Template image. It is in unit of correlation. The Threshold image should have dots that represent the center of all the found holes.

Display

To view the Threshold image, enable this button. Enabling this button will disable/override the Original, Edge, and Template Displays.

Display Settings

Blobs

The purpose of the Blobs step in Hold Depth is not only to mark the center of the thresholded image but also to calculate the depth of the hole from the two marked locations.

Display

To view Blobs, either the Original, Edge, Template, or Threshold Displays must be enabled. The Blobs that pass this step or manually picked will be shown with a turquoise crosshair.

Display Settings

Pick Holes

The purpose of the step is to locate the burned position in either the images before or after the burning and to calculate the mean intensity within given radius.

Display

To pick and calculate mean intensity of the Picked Holes, the Original Displays must be enabled. The acquisition targets that pass this step will be shown with a green crosshair.

Display Settings


< Hole Finder | JAHC Hole Finder (Template Hole Finder) >



Hole Finder

The hole finder node, in the general sense, is designed to pick imaging and focus targets on an input image. More specifically, the hole finder node will find potential holes (circular features of the proper size), determine whether these holes lie in the known lattice, and determine which holes have good ice thickness. The values in this node vary so much from grid to grid (and from square to square) that the best way to find these parameters is by going through a step-by-step trial and error process. To proceed from one step of the hole targeting process to another, simply proceed from top to bottom through the display selection buttons in the image control panel. The display settings associated with each display selection are the locations where the Hole Finder parameters can be adjusted. To see the final acquisition and focus targets, enable only the Original, acquisition, and focus display selections.

Required bindings for recieving images and publishing targets:

previous Acquisition - (AcquisitionImagePublishEvent) -> Hole Finder
Hole Finder - (ImageTargetListPublishEvent) -> next Acquisition
Hole Finder - (QueuePublishEvent) -> next Acquisition

Required bindings for proper waiting among nodes:

Hole Finder- (ImageProcessDoneEvent) -> previous Acquisition
next Acquisition - (TargetListDoneEvent) -> Hole Finder

Settings

Image Control Panel

NOTE: To see the effects of Testing the settings for a particular Hole Finder step in the Image Control Panel, the corresponding Hole Finder step Display must be enabled before using the Test feature in that step's Display Settings.

Original

Display

To view the original input image without any image processing done to it, enable this button. Enabling this button will disable/override the Edge, Template, and Threshold Displays.

Display Settings

Edge

The purpose of the Edge step is to convert the original image into an "edge" image where the edges of the holes in the image are enhanced against a black background.

Display

To view the Edge image, enable this button. Enabling this button will disable/override the Original, Template, and Threshold Displays.

Display Settings

Template

The purpose of the Template step is to cross correlate a template of the properly sized holes against the edge image where the edges of the holes have been enhanced in the previous step.

Display

To view the Template image, enable this button. Enabling this button will disable/override the Original, Edge, and Threshold Displays.

Display Settings

Threshold

The purpose of the Threshold step is to apply a threshold to the previous Template image. It is in unit of number of standard deviation above the mean. The Threshold image should have dots that represent the center of all the found holes.

Display

To view the Threshold image, enable this button. Enabling this button will disable/override the Original, Edge, and Template Displays.

Display Settings

Blobs

The purpose of the Blobs step is to begin to narrow down the "hole center dots" that have been found. This step serves as additional criteria for finding good holes.

Display

To view Blobs, either the Original, Edge, Template, or Threshold Displays must be enabled. The Blobs that pass this step will be shown with a turquoise crosshair.

Display Settings

Lattice

The purpose of the Lattice step is to determine whether the blobs or "hole center dots" fit in a lattice that describes how the hole layout.

Display

To view Lattice, either the Original, Edge, Template, or Threshold Displays must be enabled. The Lattice blobs that pass this step will be shown with a pink crosshair.

Display Settings

acquisition

The purpose of the acquisition step is to select holes of the proper ice thickness and arrange the desired acquisition target layout. The "focus" and "acquisition" Hole Finder steps Display Settings appear in the same window. For the purpose of this documentation to facilitate the separation of steps in the user interface, acquisition and
focus will be addressed separately. Therefore, only the parameters pertaining to acquisition targets will discussed in this section. The parameters not covered in this section are part of the focus section.

Display

To view acquisition, either the Original, Edge, Template, or Threshold Displays must be enabled. The acquisition targets that pass this step will be shown with a green crosshair.

Display Settings

Ice Thickness Threshold:

Target Template:

focus

The purpose of the focus step is to focus targets near selected holes. The "focus" and "acquisition" Hole Finder steps Display Settings appear in the same window. For the purpose of this documentation to facilitate the separation of steps in the user interface, acquisition and focus will be addressed separately. Therefore, only the parameters pertaining to focus targets will discussed in this section. The parameters not covered in this section are part of the acquisition section.

Display

To view focus, either the Original, Edge, Template, or Threshold Displays must be enabled. The focus targets that pass this step will be shown with a blue crosshair.

Display Settings

Ice Thickness Threshold:

Target Template:


< Gon Modeler | Hole Depth >



Hole Targeting Set-up for MSI-Edge

We can use any image that is already loaded into Hole Targeting to adjust these parameters. The values in this node vary so much from grid to grid that the best way to find these parameters is by going through a step-by-step trial and error process. The parameters not mentioned here can be left at their default values. To proceed from one step of the hole targeting process to another, simply proceed from top to bottom through the display selection buttons in the image control panel. The display settings associated with each display selection are the locations where the Hole Targeting parameters can be adjusted. To see the final acquisition and focus targets, enable only the Original, acquisition, and focus display selections.

1. Leginon/Hole Targeting/Original>

Use this setting to load a test image if needed.

2. Leginon/Hole Targeting/Edge>

A good combination of parameters show the edges of holes well with minimal thresholded "edge" from random features.

3. Leginon/Hole Targeting/Template>

A good template gives a sharp correlation at the center of the holes.

4. Leginon/Hole Targeting/Threshold>

A good correlation threshold leaves only small blobs of the correlation peaks from the holes. Since the peaks from holes with ice are usually weaker but more important to catch, it is o.k. to leave some but not too many noise peaks. This parameter also tends to change during an experiment. The value is in the unit of number of standard deviation above the mean.

5. Leginon/Hole Targeting/Blobs>

If the threshold level from the last step is too low, there will be a lot of big blobs, making the process slow. The parameters set in this node reasonably limit the total number of blobs.

6. Leginon/Hole Targeting/Lattice>

The lattice of the holes is not perfect; therefore, a decent tolerance is necessary for a good fit to this imperfect lattice. If only a few blobs were centered in the last step, then this step is not likely to work.

7. Leginon/Hole Targeting/acquisition>

The settings here depend on the required ice thickness and on the "Zero thickness" setting in the last step. At a minimum, these settings can be used to rule out holes that are empty and that have massive ice contaminant.

8. Leginon/Hole Targeting/focus>

The only relevant focus setting ("Focus hole selection") in Hole Targeting is in relation to Z Height correction. The Leginon/Hole Targeting/focus Display Settings window = Leginon/Hole Targeting/acquisition Display Settings window. This means that the focus settings were set in the previous section and do not need to be revisited here. To see the focus targets, enable the Original and focus (and optionally the acquisition) display selections in the image control panel.

9. Leginon/Hole Targeting/Settings> Activate automatic hole finding for future images received.

Skip automatic hole finding = no


< Summary of this application | Exposure Targeting Set-up for MSI-Edge >



Hole Targeting Set-up for MSI-T

If you change the value and test an earlier step, you must redo all subsequent steps without skipping.

1. Leginon/Hole Targeting/Original>

Use this setting to load a test image if needed.

2. Leginon/Hole Targeting/Template>

A good template gives a sharp correlation at the center of the holes.

3. Leginon/Hole Targeting/Threshold>

A good correlation threshold leaves only small blobs of the correlation peaks from the holes. Since the peaks from holes with ice are usually weaker but more important to catch, it is o.k. to leave some but not too many noise peaks. This parameter also tends to change during an experiment. The value is in the unit of number of standard deviation above the mean.

4. Leginon/Hole Targeting/Blobs>

If the threshold level from the last step is too low, there will be a lot of big blobs, making the process slow. The parameters set in this node reasonably limit the total number of blobs.

5. Leginon/Hole Targeting/Lattice>

The lattice of the holes is not perfect; therefore, a decent tolerance is necessary for a good fit to this imperfect lattice. If only a few blobs were centered in the last step, then this step is not likely to work.

6. Leginon/Hole Targeting/acquisition>

The settings here depend on the required ice thickness and on the "Zero thickness" setting in the last step. At a minimum, these settings can be used to rule out holes that are empty and that have massive ice contaminant.

7. Leginon/Hole Targeting/focus>

The only relevant focus setting ("Focus hole selection") in Hole Targeting is in relation to Z Height correction. The Leginon/Hole Targeting/focus Display Settings window = Leginon/Hole Targeting/acquisition Display Settings window. This means that the focus settings were set in the previous section and do not need to be revisited here. To see the focus targets, enable the Original and focus (and optionally the acquisition) display selections in the image control panel.

8. Leginon/Hole Targeting/Settings> To activate automatic hole finding for future images received.

Skip automatic hole finding = no


< Creating Template | Exposure Targeting Set-up for MSI-T >



How does Leginon Name the Files

Leginon image files are typically named 09mar16a_atlas1_00005gr_00003sq_00001hl_v1_00002en.mrc

This name includes

  1. sessionname: 09mar16a
     
  2. grid atlas label: atlas1
     
  3. target number in the target list: 00005; 00003; 00001; 00002
     
  4. presetname with which the image is aquired: gr; sq; hl; en
     
  5. target version: v1

Since Leginon always defines target on an image, and an image is acquired at the location of the target offsets from the parent image of the target, a family tree is estabilished. The filename therefore carries this family tree of the multi-scaled imaging.


Why is the first Grid Image Not Numbered 00001? >



How to Update from v15 (Linux)

The changes from v1.5 requires update of all in-house components of Leginon and dbemtools,
but not the database nor mrctools. instruments.cfg should be modified on each microscope host.
Don't forget that you need to also update the packages on the microscope-controlling computer
since the pyScope update need to be synchronized.

See <link linkend="InstT_install">Installation Troubleshooting</link> and the Leginon Forum searching
for "install" if you run into problems.

Packages required from NRAMM

Here are the packages you need to install with python installer

SVN Package Name Installed Python Package Name Reason for update:
numextension numextension none
libcv libCV bug fixes
leginon Leginon new features
pyami pyami clean up
sinedon sinedon new stuff
pyScope pyScope new instrument configuration
ImageViewer ImageViewer updated and required for tomography

Download and install SVN client program:

By switching to svn package check out, you now need to install svn client. The rpm
package probably has the word "svn" or "subversion" in its name.

Check out SVN Source Files from the depository

From a text
terminal:

mkdir Leginon-1.6-ALL
cd Leginon-1.6-ALL
svn co http://ami.scripps.edu/svn/leginon/branches/1.6 Leginon
svn co http://ami.scripps.edu/svn/pyami/branches/leg1.6 pyami
svn co http://ami.scripps.edu/svn/pyScope/branches/leg1.6 pyScope
svn co http://ami.scripps.edu/svn/sinedon/branches/leg1.6 sinedon
svn co http://ami.scripps.edu/svn/numextension/branches/leg1.6 numextension
svn co http://ami.scripps.edu/svn/libcv/branches/leg1.6 libcv
svn co http://ami.scripps.edu/svn/ImageViewer/branches/leg1.6 ImageViewer

Perform system check:

In addition to the downloads from our svn depository, there are several other
requirements that you will get either from your OS installation source, or from its
respective website. The system check in the Leginon package checks your system to see if you
already have these requirements

cd Leginon
python syscheck.py

You should have all the supporting packages installed for v1.5. If you see any lines
like "*** Failed...", then you have something missing. Otherwise, everything should result
in "OK". Note that numpy and scipy are now required by the new version even if you don't run
tomography. numarray is no longer used.

Uninstall your existing packages:

At the beginning of the syscheck.py output, the location of the exisiting Leginon folder
is shown. Although new installation overwrite the old in most cases, problem has been
observed in the past. Therefore, it is best to remove the old files before new
installation.

For example, your Leginon folder is at /usr/lib/python/site-packages/Leginon

cd /usr/lib/python/site-packages
rm -r Leginon

Be aware that in some cases the installed package name is different (capitalized) from
your svn package name and that numextension amd libCV are not in its own subdirectory in the
python library but just the compiled .so files

Install the packages you downloaded from NRAMM svn depository

Modify sinedon.cfg if you use grid-inserting robot

[robot2]
db: dbemdata

Transfer Drift adjustment preference to use Transform Manager

[robot2]
db: dbemdata

Install updated mrc module

php-mrc 1.5 uses fftw3. You may need to install that before installing the tool as a php
extension.

See <link linkend="install_mrc">php-mrc extenstion installation</link> section in
Complete Installation Chapter.

Install updated dbemtools

See <link linkend="install_dbemtool">dbemtools installation</link> section in Complete
Installation Chapter.

Reset installation status in projectdb

You can do this directly by mysql commands.

mysql
projectdata

> mysql projectdata -u usr_object
mysql> drop table install;
mysql> exit

Alternatively, you can use phpMyAdmin to achieve this by visiting the database, find the
table and click on drop.

Install updated tools for project management

See <link linkend="install_projecttools">projecttools installation</link> section in
Complete Installation Chapter.

Load default node settings for Leginon applications (optional)

Default settings are useful for new users of a new application. However, if you have
manually set these as administrator user in Leginon, loading these now will "overwrite" your
settings.

See <link linkend="admin_load_defaults">admintools default loading</link> section in
Complete Installation Chapter.


How to Update from v15 (Window)

By switching to svn package check out, you now need to install svn on Windows to get the
updated packages. Because numextension and libCV requires extra compiler, we have created
window installer for them for python 2.5 and made them available through http://www.leginon.org/

See <link linkend="InstT_install">Installation Troubleshooting</link> and the Leginon Forum searching
for "install" if you run into problems.

Packages required from NRAMM

Here are the packages you need to install with python installer

SVN Package Name Installed Python Package Name Reason for update:
leginon Leginon new features
pyami pyami clean up
sinedon sinedon new stuff
pyScope pyScope new instrument configuration
ImageViewer ImageViewer updated and required for tomography

Because numextension and libCV requires extra compiler, we have created window installer
for them for python 2.5 and made them available through http://www.leginon.org/

Downloadfile Name Installed Python Package File Reason for update:
NumExtension-1.2.0.win32-py2.5.exe numextension.pyd clean up
libCV-0.2.win32-py2.5.exe libCV.pyd bug fixes

Uninstall your existing packages:

Although new installation overwrite the old in most cases, problem has been observed in
the past. Therefore, it is best to remove the old files before new installation.

Use "Add or Remove Programs" application in "Control Panel" to do this. Leginon related
packages are shown with prefix "Python 2.5"

If you didn't use Installer to install previously, the packages may not show up in the
Programs list. Simply remove the folder containing the old packages in this case.

Download and install SVN client program:

By switching to svn package check out, you now need to install svn client on Windows to
get the updated packages. We recommand TortoiseSVN http://tortoisesvn.tigris.org/ .

Check out SVN Source Files from the depository

Use your mouse to do the following

Install the packages you downloaded from NRAMM svn depository

Download the two Window Installer Files from Leginon website

http://www.leginon.org/

Install individual packages

Excute the installer files and follow the instruction.


How to Update from v16 (Linux)

The changes from v1.6 requires update of all in-house components of Leginon, dbemtools (called myamiweb in the new version) and database
but not the php mrctools.

This processing package upgrade instruction includes that for installing Appion's processing scripts and executables. They have more supporting package requirement. Therefore, if you do not plan to use Appion on this computer, you may skip it.

Don't forget that you need to also update the packages on the microscope-controlling computer
since the pyScope update need to be synchronized.

See Installation Troubleshooting and Leginon Bulletin Board searching
for "install" if you run into problems.

Check and correct the following before you start, because we did not put in the checks for you, and your upgrade will fail if it is incorrect.

You must have an administrator user in your database
  1. Go to "http://your_host/dbem_1_5_1/adduser.php
  2. Check to see that you do have a user with "name" ( as in username) as "administrator" (all lower-case). If you don't have one, make one and save it.

All users should be assigned to a group
  1. Go to "http://your_host/dbem_1_5_1/addgroup.php
  2. Create at least a group and save
  3. Go to "http://your_host/dbem_1_5_1/adduser.php
  4. If you did not have group created before, select each user and choose a group and then click save. If there is only one group that you just created, you will need to click save even though you can not make the group selection.

Packages required from NRAMM

All Leginon (and Appion) packages distributed from NRAMM are now under one svn control called myami.

A few updates are needed for preparation of python 3.0 compatibility where the method for importing module is changed. They will still run under python 2.4 and up.
Here are the packages you need to install with python installer

SVN subPackage Name Reason for update:
numextension package import method change
libcv package import method change
leginon new features
pyami new features
sinedon required for updating database
pyscope new method for creating pythoncom modules
imageviewer debug

Download Leginon 2.0 source code (substitute that of newer releases by 2.0 ones)

Download Myami 2.1 (contains Appion and Leginon) using one of the following options:

Option 1: Release Version

 
This is a stable supported release available as a tar file.
 
myami-2.1.3.tar.gz
Unzip with

 tar -zxvf myami-2.1.3.tar.gz

 

Option 2: SVN Release Branch

 
This is a stable supported branch from our code repository.
Change directories to the location that you would like to checkout the files to (such as /usr/local) and then execute the following command:

svn co http://ami.scripps.edu/svn/myami/branches/myami-2.1 myami/

Note: If you are installing this file on a microscope Windows PC, you may use Tortoise SVN to checkout the files.
 

Option 3: SVN Development version

 
This contains features that may still be under development. It is not supported and may not be stable. Use at your own risk.

svn co http://ami.scripps.edu/svn/myami/trunk myami/

Note: If you are installing this file on a microscope Windows PC, you may use Tortoise SVN to checkout the files.

Perform system check if you can't remember where you have installed your Leginon before.

cd /your_download_area/myami/leginon
python syscheck.py

You should have all the supporting packages installed for v1.6. If you see any lines like "*** Failed...", then you have something missing. Otherwise, everything should result in "OK".

Move your existing python processing packages to a backup directory:

At the beginning of the syscheck.py output, the location of the exisiting Leginon folder is shown. Although new installation overwrite the old in most cases, problem has been observed in the past. Therefore, it is best to remove the old files from the path before new installation. Better yet, copy into a backup folder because we need some configuration files from them.

For example, your Leginon folder is at /usr/lib/python/site-packages/Leginon

cd /usr/lib/python/site-packages
mkdir Leginon1_6_backup
mv Leginon Leginon1_6_backup

Be aware that in some cases the installed package name is different (capitalized) from your svn package name and that numextension amd libCV are not in its own subdirectory in the python library but just the compiled .so files

cd /path/to/myami-VERSION/myami
sudo ./pysetup.sh install

That will install each package, and report any failures. To determine the cause of failure, see the generated log file "pysetup.log". If necessary, you can enter a specific package directory and run the python setup command manually. For example, if sinedon failed to install, you can try again like this:

cd sinedon
sudo python setup.py install

python-site-package-path: where the installed python packages went:

Python installer put the packages you installed into its site-packages directory. This enables all users on the same computer to access them. The easiest way to discover where your installed package is loaded from by python is to load a module from the package using interactive python command lines like this:

Start the python command line from shell:

python

Import a module from the package. Let's try sinedon here. All packages installed through the above setup.py script should go to the same place.
At the python prompt (python>) type:

import sinedon

If the module is loaded successfully, call the module attribute path (two underscrolls before "path" and two underscrolls after) will return the location of the module it is loaded from

sinedon.__path__
['/usr/lib/python2.4/site-packages/sinedon']

In this case, /usr/lib/python2.4/site-packages/ is your python-site-package-path. If you go to that directory, you will find all the packages you just installed.

Save this value as an environment variable for use later, for bash:

export PYTHONSITEPKG='/usr/lib/python2.4/site-packages'

or C shell
setenv PYTHONSITEPKG '/usr/lib/python2.4/site-packages'

Copy your Leginon1.6 sinedon.cfg to the new installation

Copy your Leginon1.6 leginon.cfg to the new installation similarly

Back up all your databases

Very Important: Fix the bad tables before backup with mysqldump or the backup would be corrrupted. Sorry, it was our fault a long time ago.

Check and Fix your database for bad tables

We've found this on two databases outside NRAMM that there are empty tables created that causes a bad database backup. Please check and correct your database first before your backup.

  1. start mysql command line on your leginondb
    mysql -u usr_object your_leginon_database
    
  2. display all tables
    mysql> show tables;
    
  3. if you find both BindngSpecData and bindingspecdata, you have a problem. The former has data in there and the later does not. If you have data in both tables, please contact us. We will need to create a customized solution. You can check like this:
    mysql> select * from BindingSpecData;
    mysql> select * from bindingspecdata;
    
  4. remove the empty lowercased table
    mysql> drop table bindingspecdata;
    
  5. repeat 3-4 on launchedapplicationdata and nodespecdata

Backup

We will be doing a database update that is not backward compatible, Make sure you back up all your current databases before performing the update

Install updated Web viewers and tools

You will not need to upgrade php mrc tools.

See Install the Web Interface section in Complete Installation Chapter to put the new web tools (Now under subpackage myamiweb) to document root for the web server.

Step through setup wizard in the myamiweb on your server

The Setup Wizard will take you through the steps to create config.php and to create and initialize values for the new tables. For example, project database will contain a table called privileges when you finish. Your old config.php is not formatted correctly for the new viewers but the parameters for databases stands. You can enter them in the wizard.

You will be asked about whether you want to enable myamiweb user login feature that restricts individual user's access to projects and administrator features. Read about it here

Check and modify your sinedon.cfg to be compatible to the new version

All module names are now all in lower cass.

Run Database Update Script

Running the following script will indicate if you need to run any database update scripts.

cd /your_download_area/myami/dbschema
python schema_update.py

This will print out a list of commands to paste into a shell which will run database update scripts.
You can re-run schema_update.py at any time to update the list of which scripts still need to be run.

There should be a least scripts to run.
The first one updates UserData and GroupData so that new data viewing and processing privileges can be enforced
The second is a wide-scale change on database schema many on appion processing databases if you had one, and some on projectdata and leginondata.
The third fills in some appion data that was obtained with slow query in previous versions.
The rest are debug update after the release of 2.0.0.


How to Update from v1.6 (Microscope Windows Computer) >



How to Update from v1.6 (Microscope Windows Computer)

The changes from v1.6 requires update of all in-house components of Leginon, dbemtools and database but not the php-mrctools.
Don't forget that you need to also update the packages on the microscope-controlling computer
since the pyScope update need to be synchronized.

See Installation Troubleshooting and Leginon Bulletin Board searching
for "install" if you run into problems.

Packages required from NRAMM

All Leginon (and Appion) packages distributed from NRAMM are now under one svn control.

A few updates are needed for preparation of python 3.0 compatibility where the method for importing module is changed. They will still run under python 2.5 and up.
Here are the packages you need to install with python installer

SVN subPackage Name Reason for update:
leginon new features
pyami new features
sinedon required for updating database
pyscope new method for creating pythoncom modules
imageviewer debug

Because numextension and libcv requires extra compiler, we have created
window installer for them for python 2.5 and made them available at http://ami.scripps.edu/redmine/projects/leginon/files.

Downloadfile Name Purpose:
numextension-2.0.0.win32-py2.5.exe c extension for numerical processing
comarray-2.0.0.win32-py2.5.exe com module output conversion to array
libCV-0.2.win32-py2.5.exe small c library of algorithm from computer vision field

Download Leginon 2.0 source code

Check out SVN Source Files from the repository

Assuming that you have installed some kind of svn client such as TortoiseSVN "http://tortoisesvn.tigris.org/", you can use your mouse to do the following

Perform system check if you can't remember where you have installed your Leginon before.

You should have all the supporting packages installed for v1.6. If you see any lines like "*** Failed...", then you have something missing. Otherwise, everything should result in "OK".

Uninstall your existing NRAMM packages:

Although new installation overwrite the old in most cases, problem has been observed in the past. Therefore, it is best to remove the old files before new installation.

Use "Add or Remove Programs" application in "Control Panel" to do this. Leginon related
packages are shown with prefix "Python 2.5"

Remove only packages from NRAMM but not the suppporting packages. The NRAMM packages that you may find in "Add or Remove Programs" are
pyScope
numextension
comarray
libCV

If you didn't use Installer to install previously, the packages may not show up in the
Programs list. Simply remove or rename the folder containing the old packages in this case as described next.

Move your existing packages to a backup directory:

At the beginning of the syscheck.py output, the location of the exisiting Leginon folder is shown. Although new installation overwrite the old in most cases, problem has been observed in the past. Therefore, it is best to remove the old files from the path before new installation. Better yet, copy into a backup folder because we need some configuration files from them.
You may find these folders here:
Leginon
pyScope
sinedon
pyami
ImageViewer

For example, your Leginon folder is at C:\\python25\Lib\site-packages\Leginon

Go to C\\python25\site-packages
Create Leginon1_6_backup folder
Move Leginon folder into Leginon1_6_backup folder

Be aware that in some cases the installed package name is different (capitalized) from your svn package name and that numextension amd libCV are not in its own subdirectory in the python library but just the compiled .so files

Install the Windows Installer Files from Leginon website http://ami.scripps.edu/redmine/projects/leginon/files

Execute the installer files and follow the instructions.

Install other subpackages you downloaded from NRAMM svn repository. You don't need to repeat ones you've already installed using the installer files.

cd Your_Download_Place\Leginon 2.0\install_folder
c:\\python25\python.exe setup.py install

Copy your Leginon1.6 sinedon.cfg to the new installation

Copy your Leginon1.6 Instruments.cfg to the new installation:

Run updatecom.py

From a command line window:

cd C:\python25\Lib\Site-Packages\pyScope
C:\python25\python.exe updatecom.py

The python window appears should say show the required type libraries it found:

Generating .py files from type libraries...
initializing TEM Scripting Error, cannot find typelib for "TEM Scripting" 
initializing Tecnai Scripting done.
initializing TOM Moniker done.
initializing Tecnai Low Dose Kit done.
initializing Tecnai Exposure Adaptor done.

initializing Tietz CCD Camera done.

The output depending on what is available on your microscope computer. You should have either "Tecnai Scripting" or the pairing of "TEM Scripting" and "TOM Moniker".

The script should generate a few files in C:\\python25\Lib\win32com\gen_py with seemly scrambled names such as BC0A2B03-19FF-11D3-AE00-00A024CBA50Cx0x1x9.py

modify Tietz PXL camera imaging size if you did so before for Leginon 1.6

You should not copy the old one in this case since the file has been changed
 def getCameraSize(self):
# {'type': dict, 'values': {'x': {'type': int}, 'y': {'type': int}}}}
x = self._getParameterValue('cpTotalDimensionX')
y = self._getParameterValue('cpTotalDimensionY')
return {'x': x, 'y': y}
    return {'x': 2048, 'y': 2048}

Perform TEM_Scripting_Beam_Tilt_Calibration if this is an FEI microscope.


< How to Update from v1.6 (Linux) | Preparation before Using v2.x Routinely >



How to Update from v20 (Linux)

Download myami 2.1.x source code

Download Myami 2.1 (contains Appion and Leginon) using one of the following options:

Option 1: Release Version

 
This is a stable supported release available as a tar file.
 
myami-2.1.3.tar.gz
Unzip with

 tar -zxvf myami-2.1.3.tar.gz

 

Option 2: SVN Release Branch

 
This is a stable supported branch from our code repository.
Change directories to the location that you would like to checkout the files to (such as /usr/local) and then execute the following command:

svn co http://ami.scripps.edu/svn/myami/branches/myami-2.1 myami/

Note: If you are installing this file on a microscope Windows PC, you may use Tortoise SVN to checkout the files.
 

Option 3: SVN Development version

 
This contains features that may still be under development. It is not supported and may not be stable. Use at your own risk.

svn co http://ami.scripps.edu/svn/myami/trunk myami/

Note: If you are installing this file on a microscope Windows PC, you may use Tortoise SVN to checkout the files.

Install Appion/Leginon Packages

Install all the myami python packages except appion using the following script:

cd /your_download_area
cd myami
sudo ./pysetup.sh install

That will install each package, and report any failures. To determine the cause of failure, see the generated log file "pysetup.log". If necessary, you can enter a specific package directory and run the python setup command manually. For example, if sinedon failed to install, you can try again like this:

cd sinedon
sudo python setup.py install

Rename your current myamiweb at the document root of the web server to something else as a backup.

Install updated Web viewers and tools

You will not need to upgrade php mrc tools.

See Install the Web Interface section in Complete Installation Chapter to put the new myamiweb tools to document root for the web server.

Copy config.php from your older myamiweb backup to the new myamiweb folder.

Step through setup wizard in the myamiweb on your server

The Setup Wizard will take you through the steps to update config.php If the wizard does not have the privilege to modify the file at the last step, copy the displayed result to an text editor and save as config.php to replace the olde one.

You will be asked about whether you want to enable myamiweb user login feature that restricts individual user's access to projects and administrator features. Read about it here

Run Database Update Script

Running the following script will indicate if you need to run any database update scripts.

cd /your_download_area/myami/dbschema
python schema_update.py

This will print out a list of commands to paste into a shell which will run database update scripts.
You can re-run schema_update.py at any time to update the list of which scripts still need to be run.


How to Update from v2.0 (Microscope Windows Computer) >



How to Update from v20 (Microscope Windows Computer)

The changes from v2.0 does not require upgrade at the microscope but is recommended.

See Installation Troubleshooting and Leginon Bulletin Board searching
for "install" if you run into problems.

Packages required from NRAMM

All Leginon (and Appion) packages distributed from NRAMM are under one svn control.

Recommended minimal subpackage upgrade:
pyscope setting of beam tilt value scale factor

Download myami-2.1 source code

Check out SVN Source Files from the repository

Assuming that you have installed some kind of svn client such as TortoiseSVN "http://tortoisesvn.tigris.org/", you can use your mouse to do the following

Otherwise, you can copy the files from your linux myami-2.1 source.

Perform system check if you can't remember where you have installed your Leginon before.

You should have all the supporting packages installed for v2.0. If you see any lines like "*** Failed...", then you have something missing. Otherwise, everything should result in "OK".

Move your existing packages to a backup directory (Optional):

At the beginning of the syscheck.py output, the location of the exisiting Leginon folder is shown. Although new installation overwrite the old in most cases, problem has been observed in the past. Therefore, it is best to remove the old files from the path before new installation. Better yet, copy into a backup folder because we need some configuration files from them.
You may find these folders here:
leginon
pyscope
sinedon
pyami
imageviewer

For example, your Leginon folder is at C:\\python25\Lib\site-packages\leginon

Go to C\\python25\site-packages
Create Leginon2_0_backup folder
Move Leginon folder into Leginon2_0_backup folder

Install subpackages you downloaded from NRAMM svn repository. You should not install numextension, libcv and comarray using this instruction

cd Your_Download_Place\myami2.1_folder
c:\\python25\python.exe setup.py install

Copy your Leginon2.0 sinedon.cfg to the new installation if you have moved the Leginon2.0 installation into its backup.

Copy your Leginon2.0 Instruments.cfg to the new installation if you have moved Leginon2.0 installation into its backup:

modify Tietz PXL camera imaging size if you did so before for Leginon 2.0

You should not copy the old one in this case since the file has been changed
 def getCameraSize(self):
# {'type': dict, 'values': {'x': {'type': int}, 'y': {'type': int}}}}
x = self._getParameterValue('cpTotalDimensionX')
y = self._getParameterValue('cpTotalDimensionY')
return {'x': x, 'y': y}
    return {'x': 2048, 'y': 2048}

Perform TEM Scripting Beam Tilt Calibration in case your TEM Scripting requires non-unity scale factor


< How to Update from v2.0 (Linux)



How to Update from v21 (Linux)

Process of downloading and updating to 2.2 is generally the same as the one for How_to_Update_from_v20_(Linux)

Please follow that instruction but substitute any mention of 2.1 with 2.2

Assigning Cs value for each TEM used by Leginon

schema-r15653.py that show up in the list of required update when schema-update.py is run at the end is used to assign individual spherical aberration constant (Cs) values to different microscope. Please find out what these values are in advance before running the script to save time.

Running the python script will prompt you at each TEM you have used so far so that you can enter the value in unit of millimeter

The Cs value also need to match what is set in pyscope/instrument.cfg before you will be able to acquire more images. See How to Update from v2.1 (Microscope Windows Computer)


How to Update from v2.1 (Microscope Windows Computer) >



How to Update from v21 (Microscope Windows Computer)

Instruction is similar to How to Update from v20 (Microscope Windows Computer)

Assign Cs value in meters for the TEM in pyscope/instruments.cfg

[tem]
class: tecnai.Tecnai
cs: 2.0e-3

< How to Update from v2.1 (Linux)



Image Beam Shift matrix calibration

FEI tecnai series scope has an internal calibration performed through Tecnai GUI to decouple image shift from beam shift, making it possible to request an image shift without movement of the beam, and vice versa. As the result, we refer to image shift as the movement of image only.

For non-FEI scopes the decoupling need to be done inside Leginon to achieve the decoupling. This is done by coupling image shift calibration and beam shift calibration. Therefore, to move by Image-Beam Shift matrix, both image shift and beam shift matrix need to be calibrated.


Image Shift matrix calibration

Image shift matrix calibrations are used at each magnification that Leginon uses. All 2x2
matrix calibrations covered by the "Matrix" node works in the same way. For a particular type
of movement, in this case an "image shift" using the electromagnetic lenses of the microscope,
a 2x2 transformation matrix needs to be created that relates the values sent to the microscope
and the amount of "image shift" movement seen on the CCD imaging area. Only one set of
measurement is sufficient for image shift matrix calibration.

How does matrix calibration work?

Matrix calibration is made by making N sets of measurements (specified by "N
Average"). Each measurement set acquires three images, first at a given origin, second
with an x-axis movement in the specified "Parameter" by the specified "Shift Fraction" of
the image, and third with an y-axis movement by the same shift fraction. The resulting
shifts in the acquired images are obtained by cross correlation. A transformation matrix
is then generated for the measurement set. The origin is shifted by the "Interval"
specified in the node, in meters before the next set of measurements is taken. At the end,
the N matrixes obtained are averaged and saved in the database at the specific
magnification and movement type and can be applied to any camera configuration.
"Tolerance", expressed in fraction of image, is used as an error check. The calibration is
considered failed when the measured movement is much different from that calculated from
pixel calibration

  1. Leginon/Presets Manager> Select a preset for the calibration and send its
    parameter to the microscope. Matrix calibration depends only on magnification and
    microscope high tension. Therefore, only one preset per combination needs to be
    calibrated.
     
  2. Scope> Make sure that the CCD is imaging an area with distinct feature.
    preferable isotropic, i.e., a single line is not appropriate but lines crossing each
    other is good.
     
  3. Leginon/NodeSelector> select "Matrix" node.
     
  4. Leginon/Matrix/Toolbar> left-click "acquire image" to obtain a test image with
    current parameters.
     
  5. If the camera settings are not ideal-
     
    Leginon/Presets Manager> If you have presets set up, you can change the camera
    setting of the preset and send it to scope.
     
    OR
     
    Leginon/Matrix/Toolbar> open "settings" window by clicking the icon to select
    camera configuration and correlation method. The former will take into effect only if
    "Overwrite Preset" is checked. Click "OK" to save the settings and close the window when
    done.
     
    *Tip: Use this step to set the camera configuration to 512x512 binned by 8 (and a
    short exposure time, of course) for presets with larger dimension and lower bin can save
    a lot of image acquisition time during the calibration.
     
  6. Leginon/Matrix/Settings> select correlation method. Phase correlation is
    especially efficient in cases where periodic pattern exist. The pattern often causes
    cross correlation peak search to misidentify the correct peak in the multiple peak
    correlation map.
     
  7. Leginon/Matrix/Toolbar> select "image shift" as the Parameter and open the
    "Parameter Setting" window by clicking on the icon to the right of the selector.
     
  8. Leginon/Matrix/Matrix Settings> "Average # position"=1 is sufficient. The rest
    can be left in default values. "Interval" is not a relavent parameter since " average #
    position"=1.
     
  9. Leginon/Matrix/Toolbar> left-click (Execute icon) to calibrate.
     
  10. The image should be shifting 10-30% of the imaging area. If this is not the case,
    then adjust the shift fraction so that this occurs. The images can be monitored in Image
    Display Panel with display selection in image control panel set to "image". The beam
    should also be covering the entire imaging area at all time. If significant beam shift
    is produced during the calibration, then the microscope alignments need to be adjusted,
    especially image/beam calibration through the FEI software).
     
  11. Use Navigation node to check the result of the calibration

Image Shift Matrix calibration need for the Example MSI:

<filename>Preset</filename> <filename>magnification</filename>
gr 120
sq 550
hl 5000
fc,fa,en,ef 50000

< Bright and Dark reference images | Beam Shift matrix calibration >



Error executing the include macro (Page not found)


Image Viewer

From the Appion and Leginon Tools start page, select Image Viewer to view images associated with your Project Sessions in a single viewing pane.
The following screen is displayed. For more details see Image Viewer Overview.

Image Viewer Screen:
Image Viewer Screen


< Image Viewer Overview | 2 Way Viewer >



Importance of making calibrations

Leginon will not function if calibrations have not been done. In essence, this (or a
similar combination of nodes) is the first application that should be used if calibrations do
not already exist. The term calibrations is an inclusive term that refers to different sets of
measurements such as image shift and stage position.

Unless you plan to perform calibration to all available magnification and camera
configuration, the first step in performing calibration will be to set up Presets.

The following lists all the calibrations that must be completed for Leginon MSI
application to function correctly. Some calibrations can not be performed without existing
calibration of the others. Therefore, it is necessary to follow the order listed below for the
very first calibration for an empty database:

In most cases, calibration only needs to be done once. Through experience, we have found the Stage Position and Calibrations involving Beam Tilt need to be refined often. The other calibrations (in our experience) do not fluctuate as frequently as these two do. Modeled stage position calibration does gradually go off over several months and a full calibration of the modeled stage position matrix is required to rectify the problem.

Image Shift, Stage Position, and Modeled Stage Position matrix calibration are being completed so that targets can be accuratly centered in the images at each different magnification. At the lowest magnifications, an image shift is too big without inducing significant beam shift so the stage has to be moved. As the magnification increases, a simple
calibration of stage movement (error typically of 1.5 um or more) is not adequate, so we have to model the stage movement (error typically of 1 um or less), but still move the stage. At
even higher magnifications (e.g. hl, en, ef, fc, and fa) image shifts (error of 0.3 um or less) can be used to go to targets.

The following are magnifications and types of positioning calibrations that typically have
been completed at a very minimum:

Move Type Calibration Need for Presets in Example MSI:

Magnification: Calibrations:
120 (i..e., mag for "gr" preset) modeled stage position(mag-only), image shift
550 (i.e., mag for "sq" preset) modeled stage position(full), image shift
5000 (i.e., mag for "hl" preset) image shift
50000 (i,e, mag for "fa","fc","en" and "ef" presets) image shift

The Presets Manager has a "Calibration Status" section that will show which calibrations
have been completed for the given mag the selected preset is set to. We usually calibrate for
a range of magnifications so that later we will not have to complete them.


Grids for Calibration >



Import the new (16) applications included with Leginon

Follow instruction in Import the applications
administration Chapter at http://yourhost/dbem_1_5/addapp.php.

All applications that you plan to use should be uploaded since the old ones
won't work with the 1.6 version.


Improving Autofocusing

Because MSI-raster is normally used for acquiring images on negatively stained particles on continuous carbon, the intermediate mag preset (hl) often lacks contrast. To reduce focusing failure, we recommend a different focusing sequence for the Z focus node.

For "Stage_Wobble" Step: For "Z_to_Eucentric" Step, change these:

< Queuing Option



Initial MSI application preferences

Many of the preferences are matched to the function of the nodes and therefore are more like configuration. Starting from v1.5, the default preferences are loaded during the installation ready for standard MSI operation assuming the use of example preset names and properties. A separate Chapter called "Initial MSI application preference setup" gives the details of these settings if you are interested. As a new user, you don't have to know what is in it if you don't deviate from standard operation.

If you change your settings to the point that the application no longer run, you may revert the settings back to your institute default.


< Pre-MSI Set-up | Special Operation Preference setup >



Initial MSI application preference setup

Many of the preferences are matched to the function of the nodes and therefore are more like configuration. Starting from v1.5, the "Leginon-Appion Administrator" default preferences are loaded during the installation ready for standard MSI operation assuming the use of example preset names and properties. This means that as a new user, you can use these straight away as long as the calibration required are made.

If you mess up your settings too badly that it does not run any more, you may revert back to your institution default easily.

The following is the comprehensive list of what is set as default during the initial loading for basic MSI-T, MSI-Edge, and MSI-Raster applications. In some cases, the reason behind the setting is also included. Each institution can alter these default values according to their particular need for all their new users by making the changes as "Leginon-Appion Administrator" user.

Table 16.1 Example MSI node setup

Node name: preset: move type (to reach the preset) : wait for a node to process the image: publish and wait for rejected targets: adjust target using ancestor:
Grid Targeting gr N/A N/A N/A N/A
Grid gr modeled stage position no no no
Square sq modeled stage position yes no no
Hole hl modeled stage postion yes yes one
Z Focus hl or fc* modeled stage position no no one
Exposure en & ef image shift no yes one
Focus fc image shift no no one

Table 16.2 Example MSI Focus Setup

Step: preset: focus method: correction type: Enabled:
Z_to_Eucentric fa Beam Tilt Stage Z No
Def_to_Eucentric fa Beam Tilt Defocus Yes
Manual_after fc Manual N/A Yes

Table 16.3 Example MSI Z Focus Steps.

Step: preset: focus method: Enabled:
Stage_Wobble sq Stage Tilt No
Z_to_Eucentric hl Beam Tilt Yes
Manual_after fc or hl* Manual Yes

MSI-Tomography Preferences >



Installation

If you have not created the project database, or have not install project_1_2 files to
your web server document area, please go back to Installation Chapter and perform the
installation and setup.

See Installation Troubleshooting and the Leginon Forum searching
for "project" if you run into problems.


< Recommendataion-Dividing projects by long-term goal | Go to project tools page >



InstallationUpdate problems

Failed pyScope numExtension Window installation through
python

Why:

Solution: Download and use python2.5 and use the window-installer in win-install
folder (start by double-clicking them) not "python setup.py install".

Incomplete Leginon update

This normally happens to files that you have modified in the previous version.

Why:

Solution: Remove the old installation first.

Linux> cd
Linux> start-leginon.py -v

Window> Go to \All Programs\Leginon\Leginon Folder from your Start Menu
Linux> rm -r Leginon
Window> drag the Leginon folder to Recycle Bin

Installation without a class of nodes

If you encounter a problem with node classes that you don't actually use, you may avoid
loading the codes with the following modification:

Linux> cd
Linux> start-leginon.py -v
Linux/home> cd leginon_directory/noderegistry
#[Tomography]
#module: tomography
#type: Pipeline
#package: tomography

SciPy Installation failed in SuSE

SciPy may not build properly on some versions of SuSE due to an incompatible LAPACK
package that comes with SuSE. You can get scipy as well as a compatible LAPACK etc. from
http://repos.opensuse.org/science (need to specify your SuSE version and machine etc.

Display errors on webviewer and web
administration tools

To display error and report them to get help for the php, including mysql-php and mrc
extension, do the following:

display_errors = On
error_reporting  =  E_ALL &amp; ~E_NOTICE
> /etc/init.d/apache2 restart

< Getting Help | Administration Tool problems >



Installation on the microscope computer

Only processing-side of Leginon system is needed

Package requirement

Python and Support Packages (Note that python 2.5 must be used):

This list does not include the python XML module because it is included in the python package for Windows. You should generally be able to use the most recent versions of these packages that are available from their respective web sites. Just be sure to always get the version that is compatible with Python 2.5. If you are having trouble with the most recent version, try to use the specific versions listed here:

Python 2.5* http://www.python.org
Python for Windows extension (pywin32) http://sourceforge.net/projects/pywin32/
wxPython 2.5.2.8 or newer http://www.wxpython.org
MySQL Python client 1.2 or newer http://sourceforge.net/projects/mysql-python 1.2.3 doesn't have window installer, yet, use 1.2.2
Python Imaging Library (PIL) 1.1.4 or newer http://www.pythonware.com/products/pil/
NumPy 1.0b5 (tested, others may work) http://www.scipy.org
SciPy 0.5.1 or newer http://www.scipy.org

*Python 2.5 is the only python version that we have compiled numExtension. libCV and comarray in. Therefore no other python version works for now.

SVN client used for check out from our repository

This required for following this instruction. We have used Tortois SVN client. Alternatively, you may copy the required NRAMM source files from another computer.

Name: Download site:
Tortoise SVN client http://tortoisesvn.tigris.org

Required supporting programs for the CCD camera from camera makers

Install and register the following programs for CCD cameras from the two makes. Most likely, you already have these installed when the camera and TEM software was installed:

Camera Make: File:
Gatan TecnaiCCD.dll
Tietz CAMC4.exe*

Note: We have experienced slowness of the CAMC4.exe comes with later version Tecnai TUI/TIA. Replacing it with an earlier version of CAMC4.exe resolved the problem

Supporting programs for film exposure

Install the following if you need film exposure on FEI Tecnai TEM through Leginon, available through FEI. Please contact Max Otten: mto@feico.com and request for adaexp.exe that works with your version of Tecnai user interface program.

Name: File:
exposure adaptor adaexp.exe

Packages required from NRAMM

These are the sub-packages of myami that you will install with the python installer.

Name: Purpose:
leginon modular TEM image acquisition
pyami general functions
sinedon Leginon/database interaction
pyscope microscope control and monitoring
imageviewer image viewing for tomography

For FEI Eagle Camera or Gatan Camera that uses TIA, comarray package needs to be install with python
Special Instructions for FEI Eagle Camera

Because numextension, comarray and libcv would require extra compilers if you build them yourself, we have created Windows installers for them for python 2.5 and made them available at http://ami.scripps.edu/redmine/projects/leginon/files.

These are the Leginon v2.0 python 2.5 compiled packages installed through python installer on Windows. Leginon v2.1 uses the same files.

Downloadfile Name Purpose:
numextension-2.0.0.win32-py2.5.exe c extension for numerical processing
comarray-2.0.0.win32-py2.5.exe com module output conversion to array
libCV-0.2.win32-py2.5.exe small c library of algorithm from computer vision field

Installation

1. Register TecnaiCCD.dll, CAMC4.exe (For Tietz camera), and adaexep.exe (For film exposure)

Install Python and supporting packages with their installers

Excute the installer files and follow the instructions.

2. Install the Windows Installer Files from Leginon website http://ami.scripps.edu/redmine/projects/leginon/files

Execute the installer files and follow the instructions. Do not execute comarray-2.0.0.win32-py2.5.3x3 if your camera uses TIA. See earlier section above.

3. Check out SVN Source Files from the repository

Use your mouse to do the following

4. Install the packages you downloaded from NRAMM svn repository

5. Run updatecom.py

From a command line window:

cd C:\python25\Lib\Site-Packages\pyScope
C:\python25\python.exe updatecom.py

The python window appears should say show the required type libraries it found:

Generating .py files from type libraries...
initializing TEM Scripting Error, cannot find typelib for "TEM Scripting" 
initializing Tecnai Scripting done.
initializing TOM Moniker done.
initializing Tecnai Low Dose Kit done.
initializing Tecnai Exposure Adaptor done.

initializing Tietz CCD Camera done.

The output is of course depending on what is available on your microscope computer. You should have either "Tecnai Scripting" or the pairing of "TEM Scripting" and "TOM Moniker".

You will only find Tecnai Exposure Adaptor (Scripting for film exposure) if you ask FEI for it.

The script should generate a few files in C:\\python25\Lib\win32com\gen_py with seemly scrambled names such as BC0A2B03-19FF-11D3-AE00-00A024CBA50Cx0x1x9.py

6. Configure leginon.cfg:

Follow the instructions in Configure leginon.cfg located in the section for Linux installation but note the location of the configuration files follows. In addition, if the storage disk is mapped onto the Windows PC as drive Z, this mapping should be included in leginon.cfg. See below.

7. Configure sinedon.cfg:

Follow instruction in Configure sinedon.cfg in the section for Linux installation but note the location of the configuration files follows.

8. Configure instruments.cfg:


2.2 release needs additional configuration

The file contains other examples of microscope and camera drivers that we distribute from NRAMM.

9. Additional setup on Tietz cameras

Register the Tietz ping callback function. From a command line window:

cd C:\python25\Lib\Site-Packages\pyscope
C:\python25\python.exe tietzping.py

10. For strange dimension cameras

Some Tietz camera dimensions are slightly larger than a standard size, for example, 2084 x 2084 instead of the standard 2048 x 2048. Some software will have trouble dealing with these dimensions. It is recommended to force the camera to the lower standard size (some multiple of 2^n). Modify the function that gets camera dimension in tietz.py, gatan.py, or tia.py depending on which camera you are using.

 def getCameraSize(self):
    return {'x': 2048, 'y': 2048}

11. Create Leginon Admin and Leginon Client shortcut in Start menu menu under Leginon

This instruction applies to Windows XP.

12. Mapping Drives (Optional):

Although we don't recommend it, it is possible to run minimal Leginon directly on the Windows machine, Since the database and web servers are not there, you probably will be saving the images through a Samba server on a network drive also available to the Linux machine. If you do so, you will need to map the network drive. For example, if your Samba server has a hostname your_smbserver, and you have set up a share called [your_share_point] which points to /your_data_path/ and leginon data will be saved under a folder in /your_data_path/leginon/.

Additional Software (Optional):

TightVNC (http://www.tightvnc.com) if you get tired of going into the microscope room just to open the column valves.


< Additional Database Server Setup | Steps needed for Installation Using Database Administration Tools >



Installation Trouble shooting

  1. Getting Help
  2. Installation/Update problems
  3. Administration Tool problems
  4. Test run operation problems
  5. Network problems
  6. Troubles with Imaging
  7. Troubles with Calibrations

< Using Project Management Tools | Microscope Set-up >



Install Apache Web Server

1. Install the Apache Web Server with the YaST or yum utility.

2. Find "httpd.conf".
This is /etc/httpd/conf/httpd.conf on CentOS and /etc/apache2/httpd.conf on SuSE

sudo nano /etc/httpd/conf/httpd.conf

3. Edit the "httpd.conf" configuration file with the following:

 DirectoryIndex index.html index.php

 HostnameLookups On
 

Note: It may be possible to edit httpd.conf in YaST2 as well.

4. If you plan to enable the web interface user login feature, the ServerName directive should be set to a resolvable host name and UseCanonicalnames should be turned on. This will ensure the link provided in the email to verify user registration is valid. Follow the example below replacing YourServer.yourdomain.edu with your servers name.

     ServerName YourSever.yourdomain.edu  

     UseCanonicalName On
  

5. Restart the web server.

apachectl restart
     or
sudo /sbin/service httpd restart     (ON CentOS/RHEL/Fedora)
     or
/etc/sbin/rcapache2 restart   (ON SuSE)
     or
/sbin/service httpd restart
If you want to start the web server automatically at boot on SuSE
sudo /sbin/chkconfig apache2 on  #SuSE
sudo /sbin/chkconfig httpd on  #CentOS/RHEL/Fedora

< Configure php.ini | Check php information >



Install External Packages

Appion allows you to use and pass data between multiple image processing packages from one integrated user interface. The image processing packages must be installed on your computer so that Appion can interface with them. You do not need to have all the packages installed for Appion to run, but you must have the packages installed that support the specific operations you wish to execute.


< Configure sinedon.cfg | Install EMAN >



cd /your_download_area
cd myami
sudo ./pysetup.sh install

That will install each package, and report any failures. To determine the cause of failure, see the generated log file "pysetup.log". If necessary, you can enter a specific package directory and run the python setup command manually. For example, if sinedon failed to install, you can try again like this:

cd sinedon
sudo python setup.py install

python-site-package-path: where the installed python packages went:

Python installer put the packages you installed into its site-packages directory. This enables all users on the same computer to access them. The easiest way to discover where your installed package is loaded from by python is to load a module from the package using interactive python command lines like this:

Start the python command line from shell:

python

Import a module from the package. Let's try sinedon here. All packages installed through the above setup.py script should go to the same place.
At the python prompt (python>) type:

import sinedon

If the module is loaded successfully, call the module attribute path (two underscrolls before "path" and two underscrolls after) will return the location of the module it is loaded from

sinedon.__path__
['/usr/lib/python2.4/site-packages/sinedon']

In this case, /usr/lib/python2.4/site-packages/ is your python-site-package-path. If you go to that directory, you will find all the packages you just installed.

Save this value as an environment variable for use later, for bash:

export PYTHONSITEPKG='/usr/lib/python2.4/site-packages'

or C shell
setenv PYTHONSITEPKG '/usr/lib/python2.4/site-packages'


Install Leginon Packages

cd /your_download_area
cd myami
sudo ./pysetup.sh install

That will install each package, and report any failures. To determine the cause of failure, see the generated log file "pysetup.log". If necessary, you can enter a specific package directory and run the python setup command manually. For example, if sinedon failed to install, you can try again like this:

cd sinedon
sudo python setup.py install

python-site-package-path: where the installed python packages went:

Python installer put the packages you installed into its site-packages directory. This enables all users on the same computer to access them. The easiest way to discover where your installed package is loaded from by python is to load a module from the package using interactive python command lines like this:

Start the python command line from shell:

python

Import a module from the package. Let's try sinedon here. All packages installed through the above setup.py script should go to the same place.
At the python prompt (python>) type:

import sinedon

If the module is loaded successfully, call the module attribute path (two underscrolls before "path" and two underscrolls after) will return the location of the module it is loaded from

sinedon.__path__
['/usr/lib/python2.4/site-packages/sinedon']

In this case, /usr/lib/python2.4/site-packages/ is your python-site-package-path. If you go to that directory, you will find all the packages you just installed.

Save this value as an environment variable for use later, for bash:

export PYTHONSITEPKG='/usr/lib/python2.4/site-packages'

or C shell
setenv PYTHONSITEPKG '/usr/lib/python2.4/site-packages'


< Perform system check | Configure leginon.cfg >



Install phpMyAdmin

You are not required to install phpMyAdmin for Appion or Leginon, however, it is a useful tool for interfacing with the mysql databases.

Install supporting packages

Name: Download site: yum package name SuSE rpm name
PHP http://php.net/downloads.php php
php-mysql php-mysql

Install phpMyAdmin

If you have not already installed phpMyAdmin, do so. The yum installation is:

sudo yum -y install phpMyAdmin

Configure phpMyAdmin

Edit the phpMyAdmin config file /etc/phpMyAdmin/config.inc.php and change the following lines:

sudo nano /etc/phpMyAdmin/config.inc.php
$cfg['Servers'][$i]['AllowRoot']     = FALSE;
$cfg['Servers'][$i]['host']          = 'mysqlserver.INSTITUTE.EDU';

Edit the phpMyAdmin apache config file /etc/httpd/conf.d/phpMyAdmin.conf and change the following lines:

sudo nano /etc/httpd/conf.d/phpMyAdmin.conf
<Directory /usr/share/phpMyAdmin/>
   order deny,allow
   deny from all
   allow from 127.0.0.1
   allow from YOUR_IP_ADDRESS
</Directory>

Note: If you want to access phpMyAdmin from another computer, you can also add it to this config file with an allow from tag

Restart Web Server

Next restart the web server to take on the new setting

sudo /sbin/service httpd restart

Test the configuration

To test the phpMyAdmin configuration, point your browser to http://YOUR_IP_ADDRESS/phpMyAdmin or http://localhost/phpMyAdmin and login with the usr_object user.

A common problem is that the firewall may be blocking access to the web server and mysql server. On CentOS/Fedora you can configure this with the system config:

system-config-securitylevel

Firewall configuration is specific to different Unix distributions, so consult a guide on how to do this on non-RedHat machines.


< Install the Web Interface | Potential Problems >



Install supporting packages

Using the Required Supporting Packages table below, install any missing prerequisite packages by following the instructions for your specific Linux distribution.

For example, SUSE users can use YaST to install them; RedHat and CentOS users can use yum, Debian and Ubuntu uses apt-get.

We highly recommend using pre-built binary packages to install the programs. Installing from source can quickly become a nightmare! See also the previous page, Instructions_for_installing_CentOS_on_your_computer for Red Hat based systems.

Required supporting packages:

Name: Download site: yum package name SuSE rpm name
Python 2.4 or newer http://www.python.org python python-devel
wxPython 2.5.2.8 or newer http://www.wxpython.org wxPython python-wxGTK
MySQL Python client 1.2 or newer http://sourceforge.net/projects/mysql-python MySQL-python python-mysql
Python Imaging Library (PIL) 1.1.4 or newer http://www.pythonware.com/products/pil/ python-imaging python-imaging
NumPy 1.0.1 or newer http://numpy.scipy.org/ numpy numpy
SciPy 0.5.1 (tested, others may work)* http://www.scipy.org scipy python-scipy

If you use Python 2.4 or earlier, you also need to install the PyXML module . For more recent versions of Python, it is already included in the main Python package.

For CentOS, see Download additional Software page, if you have trouble finding these packages.

Scipy/Numpy

SUSE specific issues

You can test your numpy and scipy install with their build in test functions:

python -c 'import numpy; numpy.test(level=1)'
python -c 'import scipy; scipy.test(level=1)'

Numpy is more stable should be successful. Expect to see lots of errors with scipy.

Mac OS X 10.5+:

You can successfully install most of these packages on a Mac by downloading DMG files and clicking on the install programs. This is not for novice Mac user. Be warned, wxpython problems on Mac will make your life difficult in using Leginon gui. Don't make your mac the only processing server if it is Leginon that you will use mainly.

  1. First, start by downloading the Mac OS X Installer Disk Image (v2.6 recommended) from http://python.org/download/ and install the newer version of python
  2. Download and install numpy and scipy DMG files from http://sourceforge.net/projects/numpy/files/ and http://sourceforge.net/projects/scipy/files/
  3. Download and install wxPython DMG file from http://www.wxpython.org/download.php
Other program need more work:
  1. The Python Imaging Library (PIL) has be compiled from source, which also requires the Mac OS X Developer tools to be installed.


Download Leginon Files >



Install the MRC PHP Extension

MRC Tools is installed as a php extension and is required for displaying mrc files live on the web browser.

Make sure you have installed the prerequisite packages

You may find installation information for the following packages under Install Web Server Prerequisites.

php-devel

You can check whether php-devel is installed by typing:

phpize

Do not worry about any error message as long as the command is found.
 

php-GD/FFTW3-devel

Make sure that php-GD and FFTW 3 devel libraries are installed.

TODO: provide a screenshot of info.php when correctly installed.

Note:
MRCtools are compiled and added to php extension with php-devel package. MRCtools use GD and FFTW3 that need to be compiled from their development libraries while the extension is compiled. If GD and FFTW3 sources were downloaded and compiled directly on your computer, these development files are included. If (as in most cases) GD and FFTW3 are installed from rpm, they are not included. An error message will appear when you attempt to compile mrctools. In this case, you will need separate download and installation of GD-devel and FFTW3-devel. Search http://rpmfind.net/linux/rpm2html/ for GD-devel and FFTW3-devel for the rpm distribution needed for your system. More information on the gd library can be found here. If you find that you can only view images as png instead of jpg, it may be that you do not have gd jpeg support installed.

MRC Tools Installation

  1. Go to the myami/programs/php_mrc directory
    cd myami/programs/php_mrc
    
  2. Compile and install the MRC module
    phpize
    ./configure 
    make
    sudo make install
    

     
  3. Check that the mrc.so module exists in your php module directory
     
    (e.g., /usr/lib64/php/modules on 64bit CentOS/RHEL/Fedora). If you are unsure where the php module directory is, use http://localhost/info.php to find it under extension_dir.
     
    ls /usr/lib64/php/modules
      mrc.so
    

    For Suse
    ls /usr/lib64/php5/extensions
      mrc.so
    
  4. Edit your php configuration file, php.ini.
     
    If your linux distro does not have a /etc/php.d/ or /etc/php.d/conf.d/ directory where other .ini files reside, you may need to follow the alternate instructions below titled: Alternative approach if mrc module does not show up in info.php output.
     
  5. Restart your webserver
     
    Example commands:
    #SuSe
    /etc/init.d/apache2 restart 
    &nbsp;
    #CentOS
    sudo /sbin/service httpd restart 
    

     
    Note: Sometimes, the MRC module will not work even after restarting the webserver. Try restarting the whole computer:
    sudo reboot

     
  6. Verify the mrc tools installation
     
    Visit or refresh http://yourhost/info.php which you created earlier. It should have a section looking like this (The version should correspond to what you've just installed):
     

     
    If mrc is not listed, the extension did not get added in the right order.

Alternative approach if mrc module does not show up in info.php output

1. find in the info.php web page the location of "additional .ini files parsed" in the first table (such as /etc/php.d/conf.d/*).

2. Go to the directory and make a copy of any ini file to use as a template for mrc.ini

      >cd [additional_ini_directory]
      >cp gd.ini mrc.ini

3. Edit mrc.ini to the following

      ; comment out next line to disable mrc extension in php
      extension=mrc.so

4. Comment out mrc extension from php.ini (found in /etc/php.ini/ on a typical PHP installation)

      ;extension=mrc.so

5. Restart your webserver

      > /etc/init.d/httpd restart

Test the MRC module installation

In the myami/php_mrc (or myami/programs/php_mrc if installing from trunk) directory, you will find two test scripts, "ex1.php" and "ex2.php" and a test MRC image "mymrc.mrc".

Copy them to your top level web directory (for example on CentOS: /var/www/html/):

cd myami/programs/php_mrc
sudo cp ex1.php ex2.php mymrc.mrc /var/www/html/

Run the scripts with the following commands and visit the corresponding pages from the web server:
The expected results are shown below. If you get the same images, you've installed the extension properly.
Note: the "display" command is part of the ImageMagick package, which you may have to install.

web server: http://localhost/ex1.php

php -q ex1.php | display

web server: http://localhost/ex2.php

php -q ex2.php | display

Test files work but images not showing up in the ImageViewers?
Here's one way this was fixed.


< Download Appion and Leginon Files | Install SSH module for PHP >



Install the Web Interface

Install Leginon and Appion web tools for viewing images and performing image processing through the web server.

1. Install pyami

TODO: put the prereqs for this in Web Preq page rather than linking to the processing page.

If you have not yet installed Leginon/Appion python packages on this server, the web interface will at least need the myami/pyami package to do MRC to JPEG conversion. First install the supporting packages. Then install myami/pyami as follows:

cd myami/pyami
sudo python setup.py install

This will install the script "mrc2any" into /usr/bin/mrc2any (for typical linux system). You can customize the location with options to the setup.py command.
To be sure where it was installed, run:
which mrc2any

You will need to know that location when configuring below.

2. Copy the myami/myamiweb directory to your Apache web directory

Example:

cd myami

#CentOS example
sudo cp -vr myamiweb /var/www/html/ 

#this is temporary for setup, revert to 755 when finished with this page
sudo chmod 777 /var/www/html/myamiweb  

#if you have SELinux enabled this command will help
sudo chcon -R --type=httpd_sys_content_t /var/www/html

3. Configure your installation

There is a setup wizard available to help you set the configuration parameters for your installation. If you prefer not to use the wizard, there are instructions for manually editing the configuration file. If this is your first time creating the web tool configuration file, we recommend using the setup wizard.

Configuration using the setup wizard

The setup wizard will check your database connection, create required database tables, and perform default data initialization.

Manual configuration instructions (Advanced User)

Go to Install the Web Interface Advanced for the advanced configuration.

4. Revert permissions

sudo chmod 755 /var/www/html/myamiweb

5. Test the installation

Visit http://yourhost/myamiweb or http://localhost/myamiweb to confirm functionality.
You may also browse to the automatic web server troubleshooter at: http://localhost/myamiweb/test/checkwebserver.php

6. Turn off error checking in php.ini

Edit the following items in php.ini (found as /etc/php.ini on CentOS and /etc/php5/apache2/php.ini on SuSE) so that they look like the following:

display_errors = Off


< Install SSH module for PHP | Install phpMyAdmin >



Install the Web Interface Advanced

Manual configuration instructions (Advanced User)

Note: You may skip this section if you configured your installation with the setup wizard at http://localhost/myamiweb/setup.

Copy config.php.template to config.php and edit the latter by adding these parameters:
"config.php" should be located in /var/www/html/myamiweb/ on CentOS and /srv/www/htdocs/myamiweb/ on SuSE.

  1. define site base path
    This should be changed if the myamiweb directory is located
    in a sub-directory of the Apache web directory.
    ex. myamiweb is in /var/www/html/applications/myamiweb/ then
    change to define('BASE_PATH',"applications/myamiweb");
     
    define('BASE_PATH',"myamiweb"); 
    

     
  2. myamiweb login system
    // Browse to the administration tools in myamiweb prior to 
    // changing this to true to populate DB tables correctly.
    define('ENABLE_LOGIN', false);    
    

     
  3. Administrator email title and email address
    define('EMAIL_TITLE', 'The name of your institute');
    define('ADMIN_EMAIL', "example@institute.edu");
    

     
  4. SMTP Server setup (not required but recommended):
    define('ENABLE_SMTP', false);
    define('SMTP_HOST', 'mail.institute.edu');    //your smtp host
    

     
    1. When SMTP server requires authentication
      // --- Check this with your email administrator -- //
      // --- Set it to true if your SMTP server requires authentication -- //
      define('SMTP_AUTH', false);
      
      // --- If SMTP_AUTH is not required(SMTP_AUTH set to false, -- //
      // --- no need to fill in 'SMTP_USERNAME' & SMTP_PASSWORD -- //
      define('SMTP_USERNAME', "");
      define('SMTP_PASSWORD', "");
      

       
  5. Setup your MySQL database server parameters:
    define('DB_HOST', "");        // DB Host name
    define('DB_USER', "");        // DB User name
    define('DB_PASS', "");        // DB Password
    define('DB_LEGINON', "");    // Leginon database name
    define('DB_PROJECT', "");    // Project database name
    

     
  6. Enable Image Cache
    If you want to use caching function for faster image loading time in image viewer, change 'ENABLE_CACHE' to true.
    You can change the 'CACHE_PATH' to other location, but make sure the apache user has write access to this folder.
    // --- Enable Image Cache --- //
    define('ENABLE_CACHE', true);
    // --- caching location --- //
    // --- please make sure the apache user has write access to this folder --- //
    define('CACHE_PATH', '/srv/www/cache/');
    define('CACHE_SCRIPT', WEB_ROOT.'/makejpg.php');
    

Additional parameters needed for Appion Installations only:

  1. Enable the processing plug-in by uncommenting out the following line in the file`myamiweb/config.php`
    addplugin("processing");
    

     
  2. IMAGIC and Other features:
    // Check if IMAGIC is installed and running, otherwise hide all functions
    define('HIDE_IMAGIC', false);
    
    // hide processing tools still under development.
    define('HIDE_FEATURE', true);
    

     
  3. Add processing host information
     
    Appion version 2.2 and later:
    The following code should be added and modified for each processing host available.
    $PROCESSING_HOSTS[] = array(
    'host' => 'myhost.inst.edu',    
    'nproc' => 32,  // number of processors available on the host, not used
    'nodesdef' => '4', // default number of nodes used by a refinement job
    'nodesmax' => '280', // maximum number of nodes a user may request for a refinement job
    'ppndef' => '32', // default number of processors per node used for a refinement job
    'ppnmax' => '32', // maximum number of processors per node a user may request for a refinement job
    'reconpn' => '16', // recons per node, not used 
    'walltimedef' => '48', // default wall time in hours that a job is allowed to run
    'walltimemax' => '240', // maximum hours in wall time a user may request for a job
    'cputimedef' => '1536', // default cpu time in hours a job is allowed to run (wall time x number of cpu's) 
    'cputimemax' => '10000', // maximum cpu time in hours a user may request for a job
    'memorymax' => '', // the maximum memory a job may use
    'appionbin' => 'bin/', // the path to the myami/appion/bin directory on this host
    'appionlibdir' => 'appion/', // the path to the myami/appion/appionlib directory on this host
    'baseoutdir' => 'appion', // the directory that processing output should be stored in
    'localhelperhost' => '', // a machine that has access to both the web server and the processing host file systems to copy data between the systems
    'dirsep' => '/', // the directory separator used by this host
    'wrapperpath' => '', // advanced option that enables more than one Appion installation on a single machine, contact us for info 
    'loginmethod' => 'SHAREDKEY', // Appion currently supports 'SHAREDKEY' or 'USERPASSWORD' 
    'loginusername' => '', // if this is not set, Appion uses the username provided by the user in the Appion Processing GUI
    'passphrase' => '', // if this is not set, Appion uses the password provided by the user in the Appion Processing GUI
    'publickey' => 'rsa.pub', // set this if using 'SHAREDKEY'
    'privatekey' => 'rsa'      // set this if using 'SHAREDKEY'
    );
    

     
    Appion version 2.1 and prior:
    // --- Please enter your processing host information associate with -- //
    // --- Maximum number of the processing nodes                                    -- //
    // --- $PROCESSING_HOSTS[] = array('host' => 'host1.school.edu', 'nproc' => 4); -- //
    // --- $PROCESSING_HOSTS[] = array('host' => 'host2.school.edu', 'nproc' => 8); -- //
    
    // $PROCESSING_HOSTS[] = array('host' => '', 'nproc' => );
    

     
  4. Microscope spherical aberration constant
     
    Not needed for Appion version 2.2 and later. Version 2.1 and earlier only:
    $DEFAULTCS = "2.0";
    

We will not include the cluster registration now. It is covered in the last part of this document.


Go back to Install the Web Interface



Install Web Server Prerequisites

The myamiweb files are mostly php scripts that run at the web server. PHP, PHP-devel, gd, and fftw3 packages are required before installation of myamiweb and the mrc extension that handles the display of mrc files. Some of these packages may be found on the SuSE Linux DVD or included in common package repository. MySQL and the Apache Web Server can be downloaded from their respective websites.

Install Supporting Packages

Prerequisite packages for myamiweb:

Name: Download site: yum package name SuSE rpm name
Apache www.apache.org httpd apache2
php www.php.net php php
php-devel* rpmfind.net/linux/RPM/Development_Languages_PHP.html php-devel php-devel
php-mysql* rpmfind.net/linux/RPM/Development_Languages_PHP.html php-mysql php-mysql
php-gd www.php.ned/gd (Use gd2) php-gd php-gd
fftw3 library (including development libraries and header *) www.fftw.org (Use fftw3.x) fftw3-devel fftw3-devel
libssh2 developmental libraries http://www.libssh2.org libssh2-devel
phpMyAdmin (optional) http://www.phpmyadmin.net phpMyAdmin
GCC, the GNU Compiler Collection http://gcc.gnu.org gcc

Notes:


< Differences between Linux flavors | Configure php.ini >



Install Xmipp

Install documentation at Xmipp

Biocomputing Unit at the Spanish National Center of Biotechnology (CNB-CSIC) provides detailed documentation on how to install Xmipp on various systems. Below we cover our way to get it working on your system.

Install supporting packages

Name: Download site: CentOS package name Fedora package name SuSE rpm name
gcc-c++ gcc-c++
openmpi-devel openmpi-devel
libtiff-devel libtiff-devel
libjpeg-devel libjpeg-devel libjpeg-turbo-devel
zlib-devel zlib-devel

Install Xmipp from source

We recommend installing Xmipp from source to properly use the openmpi libraries that allows you to run on multiple processors

Download source code

Alternatively, you may download from the svn repo:

svn co http://newxmipp.svn.sourceforge.net/svnroot/newxmipp/tags/release-2.4/xmipp/ Xmipp-2.4-src

As of Feb 2012, this was required to compile the 2.4 source code.

Prepare Xmipp make files

Note: If you can not find the openmpi directory, make sure you have installed the openmpi package. The installation on CentOS using yum is: yum -y install openmpi-devel.

Compile the source code

Be sure to modify the path in the second command as needed. For example, on a 32 bit machine using 1.4-gcc the command is:
export PATH=$PATH:/usr/lib/openmpi/1.4-gcc/bin

sudo mpi-selector --verbose --yes --system --set `rpm --qf '%{NAME}-%{VERSION}-gcc-%{ARCH}\n' -q openmpi`
export PATH=$PATH:/usr/lib64/openmpi/1.3.2-gcc/bin
./scons.configure

Note: If you are installing Xmipp on x86_64 CentOS 6, you can use the following commands instead.

export PATH=/usr/lib64/openmpi/bin:$PATH
./scons.configure \
 MPI_LIBDIR=/lib/usr/lib64/openmpi/lib \
 MPI_INCLUDE=/lib/usr/lib64/openmpi/include \
 MPI_LIB=mpi
* Checking for MPI ... yes
./scons.compile
sudo mv -v Xmipp-2.4-src /usr/local/Xmipp

Setup environmental variables

You may need to log out and log back in for these changes to take place, or source the environment script:

 source /etc/profile.d/xmipp.sh

Test Xmipp

Test Xmipp by running ml_align2d program

xmipp_ml_align2d -h

This result should appear
2104:Argument -i not found or invalid argument
File: libraries/data/args.cpp line: 502
Usage:  ml_align2d [options] 
   -i <selfile>                : Selfile with input images 
   -nref <int>                 : Number of references to generate automatically (recommended)
   OR -ref <selfile/image>         OR selfile with initial references/single reference image 
 [ -o <rootname> ]             : Output rootname (default = "ml2d")
 [ -mirror ]                   : Also check mirror image of each reference 
 [ -fast ]                     : Use pre-centered images to pre-calculate significant orientations
 [ -thr <N=1> ]                : Use N parallel threads 
 [ -more_options ]             : Show all possible input parameters 


< Install SPIDER | Install UCSF Chimera >



Instructions for installing CentOS on your computer

Why CentOS?

If you have a new computer(s) for your Leginon/Appion installation, we recommend installing CentOS because it is considered to be more stable than other varieties of Linux.

CentOS is the same as Red Hat Enterprise Linux (RHEL), except that it is free and supported by the community.

We have most experience in the installation on CentOS and this installation guide has specific instruction for the process.

see Linux distribution recommendation for more.

Download the ISO disk of CentOS 5.x

Latest version tested at NRAMM: CentOS 5.8

Note: All formally released versions of Appion (versions 1.x and 2.x) run on CentOS 5.x. Appion developers, please note that the development branch of Appion is targeting CentOS 6.x and Appion 3.0 will run on CentOS 6.x.

  1. ISO files are available at
    1. http://wiki.centos.org/Download
    2. http://mirrors.kernel.org/centos/
  2. Click on i386 for 32bit machines or x86_64 for 64bit machines
  3. Pick a mirror and download 'CentOS-5.8-i386-bin-DVD-1of2.iso ' file

Confirm download went correctly

Perform a SHA1SUM confirmation:

sha1sum CentOS-5.8-i386-bin-DVD-1of2.iso

The result should be the same as in the sha1sum file provided by CentOS. This is found at the same location you downloaded the .iso file.
For example:

Burn ISO file to DVD disk

Use dvdrecord in Linux to burn disk.

dvdrecord -v -dao gracetime=10 dev=/dev/dvd speed=16 CentOS-5.8-i386-bin-DVD-1of2.iso 

Install CentOS with default packages

Add yourself to the sudoers file

Note: This step is optional, however you will need root access to complete the Appion Installation.

Make sure you have root permission.
Open the file in an editor. ex. vi /etc/sudoers
Look for the line: root ALL=(ALL) ALL.
Add this line below the root version:

your_username ALL=(ALL)       ALL

Logout and log back in with your username.

The CentOS installation is complete.


< Select Linux distribution to use | Network Configuration >




cs is the coefficient of spherical aberration in meters. Find out from TEM manufacture the proper value for your tem.

zplane is a number that gives the order of camera. If a camera with low zplane value is going to acquire an image, Leginon will attempt to retract all camera at higher zplane values.


Instrument Set-up

  1. Calibrations required on FEI microscopes
  2. Low dose shutter configuration for Gatan camera in Digital Micrograph program
  3. Tietz camera configuration
  4. Good Alignments Save Time
  5. Microscope Set-up Checklist

< Installation Troubleshooting | Start Leginon >



Iterative Stage Movement

Since we have observed that, at least on FEI computage, the targeting accuracy is higher when the distance of movement is smaller, a special option is put in regarding how a target is moved to the center for imaging at the next scale. This method of movement is currently used in MSI-RCT, MSI-RCT raster, and MSI-Tomography applications at the final exposure step.

IMPORTANT: Do no use this option before a targeting node that uses queuing option

IMPORTANT: Because this process need to reacquire the parent image at each iteration, the electron dose in the area WILL accumulate. Make sure the dose used for the parent image preset is minimal and DO NOT use an "Naviation Target Tolerance" that takes 10 or more iterations to achieve.

What does it do?

When a target on the parent image needs to be centered for the acquisition an iterative process is performed.
  1. The target position relative to the center of the detector (i.e., center of the parent image) is calculated.
  2. An attempt is made to bring the target to the center of the detector using the calibration available to it and the position of the target on the parent image.
  3. An image is acquired using the parent preset. The reacquired image is compared with the original image in the region of the targeting area to determine if the stage movement has brought the target to the center of the detector. The movement error is the position of the intended target relative to the center of the detector.
  4. If the movement error is larger than the "Navigator Target Tolerance" settings, the process is repeated using the reacquired image as the new parent image and the adjusted target on the new parent image.
  5. In the case that the movement error becomes larger than the previous iteration, a decision is made on whether the targeting is considered successful so that images will be acquired in the node or the targeting is considered as failed so that it moves on to the next target. The decision is determined by whether the final movement error is smaller than "Nagigator Acceptable Tolerance" settings.
In Acquisition Node Class, such as Square, Hole, Exposure
  1. Move type: Must use either stage position or modeled stage position
  2. Mover: Navigator
  3. Navigator Target Tolerance: Enter a positive number that is the target for the iterative movement. The iterative movement is not performed if this value is zero. A typical value is the limit of your goniometer movement accuracy at minimal movement. For example, on our F20 and well-tuned goniometer, this is typical set to 6e-8 m.
  4. Navigator Acceptable Tolerance: The cut-off for accepting an increased movement error as successful target centering.
  5. Final Image Shift: Compensate the final movement error with an image shift. Currently does not work on RCT node.

In Targeting Node used to select targets on images acquired by the above node. This means "Hole Targeting" node if iterative move is activated in "Square", and "Exposure Targeting" node if activated in "Hole".
  1. Queue up Targets: Must be off.


< Monitor Progress of Queued Targets



JAHC Hole Finder (Template Hole Finder)

The JAHC Hole Finder class is a variation of Hole Finder class. The purpose and operation is similar in the two node classes. The differences are 1: JAHC Hole Finder does not use edge image for correlation but the original, and 2: JAHC Hole Finder uses a scaled template image rather than a simple geometric ring for the correlation step. Like the Hole Finder, the values in this node vary so much from grid to grid (and from square to square) that the best way to find these parameters is by going through a step-by-step trial and error process. To proceed from one step of the hole targeting process to another, simply proceed from top to bottom through the display selection buttons in the image control panel. The display settings associated with each display selection are the locations where the JAHC Hole Finder parameters can be adjusted. To see the final acquisition and focus targets, enable only the Original, acquisition, and focus display selections.

Required bindings for recieving images and publishing targets:

previous Acquisition - (AcquisitionImagePublishEvent) -> JAHC Hole Finder
JAHC Hole Finder - (ImageTargetListPublishEvent) -> next Acquisition
JAHC Hole Finder - (QueuePublishEvent) -> next Acquisition

Required bindings for proper waiting among nodes:

JAHC Hole Finder- (ImageProcessDoneEvent) -> previous Acquisition
next Acquisition - (TargetListDoneEvent) -> JAHC Hole Finder

Settings

Image Control Panel

NOTE: To see the effects of Testing the settings for a particular Hole Finder step in the Image Control Panel, the corresponding JAHC Hole Finder step Display must be enabled before using the Test feature in that step's Display Settings.

Original

Display

To view the original input image without any image processing done to it, enable this button. Enabling this button will disable/override the Edge, Template, and Threshold Displays.

Display Settings

Template

The purpose of the Template step is to cross correlate a template of the properly sized template holes against the original image.

Display

To view the Template image, enable this button. Enabling this button will disable/override the Original, Edge, and Threshold Displays.

Display Settings

Threshold

The purpose of the Threshold step is to apply a threshold to the previous Template image. It is in unit of number of standard deviation above the mean. The Threshold image should have dots that represent the center of all the found holes.

Display

To view the Threshold image, enable this button. Enabling this button will disable/override the Original, Edge, and Template Displays.

Display Settings

Blobs

The purpose of the Blobs step is to begin to narrow down the "hole center dots" that have been found. This step serves as additional criteria for finding good holes.

Display

To view Blobs, either the Original, Edge, Template, or Threshold Displays must be enabled. The Blobs that pass this step will be shown with a turquoise crosshair.

Display Settings

Lattice

The purpose of the Lattice step is to determine whether the blobs or "hole center dots" fit in a lattice that describes how the hole layout.

Display

To view Lattice, either the Original, Template, or Threshold Displays must be enabled. The Lattice blobs that pass this step will be shown with a pink crosshair.

Display Settings

acquisition

The purpose of the acquisition step is to select holes of the proper ice thickness and arrange the desired acquisition target layout. The "focus" and "acquisition" JAHC Hole Finder steps Display Settings appear in the same window. For the purpose of this documentation to facilitate the separation of steps in the user interface, acquisition and focus will be addressed separately. Therefore, only the parameters pertaining to acquisition targets will discussed in this section. The parameters not covered in this section are part of the focus section.

Display

To view acquisition, either the Original, Edge, Template, or Threshold Displays must be enabled. The acquisition targets that pass this step will be shown with a green crosshair.

Display Settings

Ice Thickness Threshold:

Target Template:

focus

The purpose of the focus step is to focus targets near selected holes. The "focus" and "acquisition" Hole Finder steps Display Settings appear in the same window. For the purpose of this documentation to facilitate the separation of steps in the user interface, acquisition and focus will be addressed separately. Therefore, only the parameters pertaining to focus targets will discussed in this section. The parameters not covered in this section are part of the acquisition section.

Display

To view focus, either the Original, Edge, Template, or Threshold Displays must be enabled. The focus targets that pass this step will be shown with a blue crosshair.

Display Settings

Ice Thickness Threshold:

Target Template:


< Hole Depth | Manual Acquisition >



JEOL setup

more info

http://cryoem.nysbc.org/CemRobotics.html

instruments.cfg

[TEM]
class: jeol1230.jeol1230

Testing pyscope instrument script functions

On the instrument host of the instrument, a TEM host that uses Tecnai class, for example, you can launch python command line window and try to create an instance of the instrument and then call a function such as getMagnifications in that like this:

import pyscope.registry
s = pyscope.registry.getClass('jeol1230')()
s.getMagnifications()

Potential problems

import serial

>>> import pyscope.registry
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "c:\Python25\Lib\site-packages\pyscope\registry.py", line 9, in <module>
    import config
  File "c:\Python25\Lib\site-packages\pyscope\config.py", line 39, in <module>
    mod = imp.load_module(fullmodname, *args)
  File "c:\Python25\Lib\site-packages\pyscope\jeol1230.py", line 8, in <module>
    from pyscope import jeol1230lib
  File "c:\Python25\Lib\site-packages\pyscope\jeol1230lib.py", line 8, in <module>
    import serial
ImportError: No module named serial
>>>

you need to install "Python Serial Port Extensions" http://pypi.python.org/pypi/pyserial

defocus.cfg

>>> import pyscope.registry
>>> s = pyscope.registry.getClass('jeol1230')()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "c:\Python25\Lib\site-packages\pyscope\jeol1230.py", line 27, in __init__
    self.jeol1230lib = jeol1230lib.jeol1230lib()
  File "c:\Python25\Lib\site-packages\pyscope\jeol1230lib.py", line 25, in __init__
    self.zeroDefocus = self.readZeroDefocus()
  File "c:\Python25\Lib\site-packages\pyscope\jeol1230lib.py", line 35, in readZeroDefocus
    infile = open(self.defocusFile,"r")
IOError: [Errno 2] No such file or directory: 'C:\\Python25\\Lib\\site-packages\\pyScope\\defocus.cfg'
>>>

create an empty file called defocus.cfg

serial port permissions

>>> import pyscope.registry
>>> s = pyscope.registry.getClass('jeol1230')()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "c:\python25\Lib\site-packages\pyscope\jeol1230.py", line 27, in __init__
    self.jeol1230lib = jeol1230lib.jeol1230lib()
  File "c:\python25\Lib\site-packages\pyscope\jeol1230lib.py", line 25, in __init__
    self.zeroDefocus = self.readZeroDefocus()
  File "c:\python25\Lib\site-packages\pyscope\jeol1230lib.py", line 37, in readZeroDefocus
    line = lines[0]
IndexError: list index out of range
>>> s = pyscope.registry.getClass('jeol1230')()
close connection to JEOL1230 through COM1 port
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "c:\python25\Lib\site-packages\pyscope\jeol1230.py", line 27, in __init__
    self.jeol1230lib = jeol1230lib.jeol1230lib()
  File "c:\python25\Lib\site-packages\pyscope\jeol1230lib.py", line 18, in __init__
    self.ser = serial.Serial(port='COM1', baudrate=9600, bytesize=8, parity='N', stopbits=1, xonxoff = 0, timeout=10, rt
scts=0)
  File "serial\serialwin32.py", line 31, in __init__
    SerialBase.__init__(self, *args, **kwargs)
  File "serial\serialutil.py", line 261, in __init__
    self.open()
  File "serial\serialwin32.py", line 59, in open
    raise SerialException("could not open port %s: %s" % (self.portstr, ctypes.WinError()))
serial.serialutil.SerialException: could not open port COM1: [Error 5] Access is denied.
>>>

Known Bugs

Dictionary ordering problem of MySQL query, No temporary solution.

Temporary solution: See <link linkend="bad_default_reference">Operation Trouble
Shooting</link> on the subject.

Temporary solution: Always use preset manager when move type is image shift.

No temporary solution.

Temporary solution: Close leginon and clients and restart.

Temporary solution: Always use Presets Manager to send the preset to be used in
simulation first before usinging Simulate Targets tool.

Temporary solution: None.

Temporary solution: Hold down to Ctrl key to select and deselect multiple presets.
Shift key still means selecting all between the two clicks.

Note: This problem is caused by some bug in wxPython for LINUX.

Temporary solution: None.


Known Bugs for version 2.0

In addition to the bugs listed below, you may view the Known Bugs Report which contains a dynamic list of known bugs.

(New for 1.3) Navigator multiple move option does not work properly in MSI imaging
sequence with image shift as the move type.

Temporary solution: Always use preset manager when move type is image shift.

Web viewer may not display all targets on the parent image since target is
transferred to a different version.

No temporary solution.

Kill Application may not kill all process cleanly and may cause problem in
connecting to TEM or camera when a new application is reloaded.

Temporary solution: Close leginon and clients and restart.

Simulate Target use the current image shift as the target shift on top of its preset
shift. Therefore, the acquired image may carry an additional image shift if there is an
offset created from previouis acquisition.

Temporary solution: Always use Presets Manager to send the preset to be used in
simulation first before usinging Simulate Targets tool.

Some, although fewer, User Notification "processing " icons do not disappear but
stay pointing up after the node is done.

Temporary solution: None.

When running on LINUX system, Preset selection in /Presets Manager/Importing Presets
from Another Session/ add a selection when mouse is left-clicked rather than toggle the
selection as in convention.

Temporary solution: Hold down to Ctrl key to select and deselect multiple presets.
Shift key still means selecting all between the two clicks.

Note: This problem is caused by some bug in wxPython for LINUX.

Web 3way Image viewer does not always show in yellow the revised (i.e. after drift
correction) current target in the parent image.

Temporary solution: None.

Starting Manual Focus directly by clicking on the tool does not use preset but still
check for the preset assigned for the focuser node.


< Bug Fixes



Known Bugs 21

Please go to http://ami.scripps.edu/redmine/projects/leginon/issues and add Tracker-Bug as the filter to see all outstanding bugs. Those with status of New or Assigned are bugs that do not yet have a solution. Those in Code Review or Testing stage means that revisions have been made to fix the bug but have not yet been through Code Review (by a different developer) and/or Testing.


< Bug Fixes



Leginon "Calibrations" Application

  1. Importance of making calibrations
  2. Grids for Calibration
  3. Startup
  4. Creating Presets for the first time
  5. Pixel Size Calibration
  6. Bright and Dark reference images
  7. Image Shift matrix calibration
  8. Beam Shift matrix calibration
  9. Stage Position matrix calibration
  10. Modeled Stage Position calibration
  11. Checking Matrix and Modeled Stage Position Calibration
  12. Autofocus Calibration with Beam Tilt Node
  13. Dose (Camera Sensitivity) Calibration

< Leginon "Manual Application" | Multi-Scale Imaging Applications in General >



Leginon "Manual Application"

  1. The Application
  2. Startup
  3. Running "Manual" Application
  4. Advanced Features
  5. Using the Web viewer

< Start Leginon | Leginon "Calibrations" Application >



Leginon "MSI-Edge" Application

  1. Summary of this application
  2. Edge Hole Finder Set-up

< Leginon "MSI_T" Application | Leginon "MSI-Raster" Application >



Leginon "MSI-raster" Application

  1. Summary of this application
  2. raster finder nodes set-up
  3. Queuing Option
  4. Improving Autofocusing

< Leginon "MSI-T" Application | Leginon "MSI-RCT" and MSI-RCT raster" Applications >



Leginon "MSI-RCT" and MSI-RCT raster" Applications

  1. Summary of these applications
  2. RCT node set-up
  3. Presets for MSI-RCT applications
  4. RCT application calibration

< Leginon "MSI-raster" Application | Leginon "RobotMSI-Section" Application >



Leginon "MSI-T" Application

  1. Summary of this application
  2. Creating Template
  3. Hole Targeting Set-up for MSI-T
  4. Exposure Targeting Set-up for MSI-T

< Multi-Scale Imaging Applications in General | Leginon "MSI-Edge" Application >



Leginon "MSI-Tomography" Application

  1. Summary of this application
  2. Set-up Before Running
  3. Running the application
  4. Reading the tomography graphs
  5. Fitting the tilt axis model
  6. Full Protocol on a F30 with an energy filter
  7. Using "MSI-SimuTomography" Application for debugging

< Leginon "RobotMSI-Section" Application | Leginon "Robot-MSI-Screen" Applications >



Leginon "Robot-MSI-Screen" Applications

  1. Summary of these applications
  2. Operation
  3. Grid management
  4. Robot node
  5. 1st Pass application
  6. Evaluation application
  7. 2nd Pass application

< Leginon "MSI-Tomography" Application | Frequent Asked Questions >



Leginon "RobotMSI-Section" Application

Table of Contents

  1. Summary of this application
  2. Raster Generation node set-up
  3. Other special preference set-up
  4. Tips on Operation

< Leginon "MSI-RCT" and MSI-RCT raster" Applications | Leginon "MSI-Tomography" Application >



Leginon Brainstorm

2010-09-22, Anchi, Jim


Leginon Developer Guide

Brief description of some of the core code components

Brief description of some of the nodes

Useful diagonosis scripts


Leginon Main Page

Overview

Leginon is a system designed for automated collection of images from a transmission electron microscope.

Contact information:

Please email with general concerns.

Report bugs and request features as New issues at this site.

Use Leginon user forum for asking questions and to see answers to previous questions.

Software Installation Manual and User Guide:

Developer Guide:

Publications:

Primary Publication to Cite:

Additional References:

Software Availability and Licensing Information

Leginon is released under the Apache License, Version 2.0

Instructions for Using Leginon at Scripps.

Miscellaneous

Leginon Brainstorm


Leginon Manual

1. An introduction to Leginon

  1. What is the Leginon System?
  2. Terminology
  3. Graphical User Interface
  4. Minimum Requirements and current NRAMM setup
  5. Getting Started

2. Version Change Log

2. 1. Leginon System version 2.0

  1. pyScope Changes 2.0
  2. New User Features 2.0
  3. New Web Tool Features 2.0
  4. Bug Fixes 20
  5. Known Bugs 2.0

2. 2. Leginon System version 2.1

  1. pyScope Changes 2.1
  2. New User Features 2.1
  3. New Web Tool Features 2.1
  4. Bug Fixes 2.1
  5. Known Bugs 2.1

3. Upgrade Instructions

3. 1. Update within the same version using svn

3. 2. Upgrade from Previous versions to version 1.6

3. 3. Upgrade to Leginon System version 2.0 from version 1.6

  1. How to Update from v1.6 (Linux)
  2. How to Update from v1.6 (Microscope Windows Computer)
  3. Preparation before Using v2.x Routinely

3. 4. Upgrade to Leginon System version 2.1 from version 1.6

  1. How to Update from v1.6 (Linux)
  2. How to Update from v1.6 (Microscope Windows Computer)
  3. Preparation before Using v2.x Routinely

3. 5. Upgrade to Leginon System version 2.1 from version 2.0

  1. How to Update from v2.0 (Linux)
  2. How to Update from v2.0 (Microscope Windows Computer)

4. Complete Installation

  1. Four Parts of the Leginon System
  2. What is in this Chapter
  3. Possible Computer Set-up Configurations
  4. Network Configuration
  5. Where to register and download Leginon
  6. Database Server Installation
  7. Processing Server Installation
  8. Web Server Installation
  9. Installation on the microscope computer
  10. Steps needed for Installation Using Database Administration Tools
  11. Create a test project for testing
  12. Perform Microscope Setup and Test run
  13. Backup Practices

5. Leginon Administration Tools

  1. Recommandation for setup at a new institute
  2. Steps involved in the installation
  3. Set up for a new regular user
  4. More about Groups
  5. Revert Settings
  6. Applications
  7. Goniometer

6. Using Project Management Tools

  1. Recommendataion-Dividing projects by long-term goal
  2. Go to project tools page
  3. Add a new project
  4. Edit an existing project
  5. Grid management

7. Installation Troubleshooting

  1. Getting Help
  2. Installation/Update problems
  3. Administration Tool problems
  4. Test run operation problems
  5. Network problems
  6. Troubles with Imaging
  7. Troubles with Calibrations

8. Instrument Set-up

  1. Calibrations required on FEI microscopes
  2. Gatan camera configuration
  3. Tietz camera configuration
  4. Good Alignments Save Time
  5. Microscope Set-up Checklist

9. Start Leginon

  1. Test Leginon with Simulator
  2. Test Leginon on the Computer Controlling the Microscope
  3. Test Network Connection Between Remote and Microscope Computers
  4. Run Leginon Client on the Microscope Computer
  5. Start Leginon at your main working station remotely

10. Leginon "Manual Application"

  1. The Application
  2. Startup
  3. Running "Manual" Application
  4. Advanced Features
  5. Using the Web viewer

11. Leginon "Calibrations" Application

  1. Importance of making calibrations
  2. Grids for Calibration
  3. Startup
  4. Creating Presets for the first time
  5. Pixel Size Calibration
  6. Bright and Dark reference images
  7. Image Shift matrix calibration
  8. Beam Shift matrix calibration
  9. Stage Position matrix calibration
  10. Modeled Stage Position calibration
  11. Checking Matrix and Modeled Stage Position Calibration
  12. Autofocus Calibration with Beam Tilt Node
  13. Dose (Camera Sensitivity) Calibration

12. Multi-Scale Imaging Applications in General

  1. Multi-Scale Imaging Concept
  2. Ways of Moving to Targets in Nodes that acquire images inside MSI
  3. Flavors of MSI applications
  4. Summary of MSI applications
  5. Pre-MSI Set-up
  6. Initial MSI application preferences
  7. Special Operation Preference setup
  8. MSI Quick-start
  9. MSI set-up in more details
  10. Special Operation setup
  11. MSI Operation
  12. Optimizing Autofocus
  13. Adding a new focus sequence to a focus node
  14. Queuing option
  15. Queuing Example 1 - Exposure Targeting
  16. Queuing Example 2 - Hole Targeting only
  17. Queuing Example 3 - Both Exposure and Hole Targeting
  18. Monitor Progress of Queued Targets
  19. Iterative Stage Movement Option

13. Leginon "MSI-T" Application

  1. Summary of this application
  2. Creating Template
  3. Hole Targeting Set-up for MSI-T
  4. Exposure Targeting Set-up for MSI-T

14. Leginon "MSI-Edge" Application

  1. Summary of this application
  2. Edge Hole Finder Set-up

15. Leginon "MSI-raster" Application

  1. Summary of this application
  2. raster finder nodes set-up
  3. Improving Autofocusing

16. Leginon "MSI-RCT" and MSI-RCT raster" Applications

  1. Summary of these applications
  2. RCT node set-up
  3. Presets for MSI-RCT applications
  4. RCT calibration need

17. Leginon "RobotMSI-Section" Application

  1. Summary of this application
  2. Raster Generation node set-up
  3. Other special preference set-up
  4. Tips on Operation

18. Leginon "MSI-Tomography" Application

  1. Summary of this application
  2. Set-up Before Running
  3. Running the application
  4. Full Protocol on a F30 with an energy filter

19. Leginon "Robot-MSI-Screen" Applications

  1. Summary of these applications
  2. Robot node set-up
  3. 1st Pass application
  4. Evaluation application
  5. 2nd Pass application
  6. Operation

20. Frequent Asked Questions

  1. How does Leginon Name the Files?
  2. Why does the first Grid Image Not Numbered 00001?
  3. What is the definition of ice thickness in the hole finders?

21. Trouble shooting

  1. Getting Help
  2. Do and Do Not in leginon
  3. Pausing and Aborting during data collection
  4. General operation problems
  5. Hardware Troubles
  6. Troubles with Imaging
  7. Troubles with Targeting
  8. Troubles with Focusing and Drift Check
  9. Troubles with Calibrations
  10. Troubles with Tomography

22. Preferences Setup

  1. Initial MSI application preference setup
  2. MSI-Tomography Preferences
  3. Robot MSI-Section preference set-up

23. Node Descriptions

  1. Acquisition
  2. BeamFixer
  3. Beam Tilt Calibrator
  4. Beam Tilt Imager
  5. Click Target Finder
  6. Corrector
  7. Dose Calibrator
  8. Drift Manager
  9. The EM node
  10. FFT Maker
  11. Focuser
  12. Gon Modeler
  13. Hole Finder
  14. Hole Depth
  15. JAHC Hole Finder (Template Hole Finder)
  16. Manual Acquisition
  17. Matlab Target Finder
  18. Matrix Calibrator
  19. Mosaic Click Target Finder
  20. Mosaic Target Maker
  21. Navigator
  22. Pixel Size Calibrator
  23. Presets Manager
  24. Raster Finder
  25. Raster Filter
  26. RCT
  27. Robot
  28. RobotAtlasTargetFinder
  29. Tomography
  30. Transform Manager

24. Create and Edit Applications

  1. Use the Application Editor to create Leginon applications
  2. Reload and Edit an existing application
  3. Edit an existing application as an xml file
  4. Create Leginon "Simple Application"
  5. "Calibrations" Application
  6. "MSI-Edge" Application
  7. "MSI-T" Application
  8. "MSI-raster" Application
  9. "MSI-Tomography" Application
  10. "Manual" Application

Leginon System version 1.6

Version 1.6 contains enhancement that is not available in version 1.5 and release of a
series of Robot Screening application. Most significant changes are the split of Drift Manager
functions to Transform Manager which handles the transformation of targets using any level of
ancestry rather than one in the original Drift Manager. This allows an expansion of method that
is meant to improve targeting accuracy. There are also significant improvement in Tomography
node and its operation.

  1. pyScope Change
  2. New User Features
  3. Updated Applications (All)
  4. New Project Web Tool Features
  5. New dbemtool Web Tool Features (1.5.1)
  6. Bug Fixes
  7. Recommended Application Preference Changes when updated from version 1.5
  8. Known Bugs

< An introduction to Leginon | Update to Leginon System version 1.6 >



Leginon System version 2.0

Version 2.0 is the first combined release with Appion, our processing pipeline. All related sub-packages distributed by NRAMM are now under one svn control. The web tools (nicknamed myamiweb, pronounced like Miami-web) serves as the GUI for Appion. Basic Leginon functions are unchanged with bug fixes and convenient features added. Several options and enhancement were for large montage image acquisition on tissue sections, speeding up such lower magnification, large area operation. Changes in the more accurate image-shift targeting may require new calibrations.

  1. pyScope Changes 2.0
  2. New User Features 2.0
  3. New Web Tool Features 2.0
  4. Bug Fixes 2.0
  5. Known Bugs 2.0

Version Change Log ^



Leginon System version 2.1

Version 2.1 contains refinement of previously available features and some bug fixes. Most importantly, we found that certain TEM scripting version gives beam tilt value in unit other than radians. We encourage all Leginon users to the script provided with the new pyscope to check the scaling on the scopes to ensure proper performance.

  1. pyscope Changes 2.1
  2. New User Features 2.1
  3. New Web Tool Features 2.1
  4. Bug Fixes 2.1
  5. Known Bugs 2.1

Linux distribution recommendation

We list our experience and current progress here.

Our Preference : CentOS 5.x

If you have a new computer(s) for your Leginon/Appion installation, we recommend installing CentOS because it is considered to be more stable than other varieties of Linux.

CentOS is the same as Red Hat Enterprise Linux (RHEL), except that it is free and supported by the community.

We have most experience in the installation of the supporting packages on CentOS and this installation guide has specific instruction for the process.

Start at Instructions for installing CentOS on your computer.

Other known cases of success:

Fedora 10

Start at Instructions for installing Fedora on your computer

SuSE, Ubuntu

MacOS


Low dose shutter configuration for Gatan camera in Digital Micrograph program

Leginon uses Digital Micrograph software came with any Gatan camera to aquire images through a function call. It is therefore necessary to configure the camera in Digital Micrograph and the configuration need to be checked and be consistent among users of Leginon in order to use the same calibration.

First, find out which camera control digital output is connected physically to the pre-specimen shutter on the microscope. This should be the shutter used for low-dose imaging (beam-blank or pre-specimen shutter). You will need to find it out from your microscope engineer or those who install the camera. In most cases we've seen, this is shutter 1, also known as primary shutter in DM. The next part uses this as the example.

Second, start DM from the Menu bar, go to /Camera/Configure Camera...

This brings up the Camera Configuration Window.

  1. Set Shutter 1 to what is connected physically to your camera control box. In this examples, pre-specimen shutter. Set Shutter 2 to the other one (post-specimen in this example).
  2. Choose the Idle Shutter State. For low-dose mode, only pre-specimen shutter is used. Therefore, in this example, you would set Shutter 1 to closed and leave Shutter 2 to open.
  3. Choose to flip the camera axis if desired. Our standard at NRAMM makes the image acquired and displayed in DM or Leginon to have the same orientation as what is viewed as one sit at the microscope. You can check it by acquiring an object of known orientation such as an offsetted pointer device. At NRAMM, this happens to require a flip.

Third. now that the exposure will need to be made by opening the pre-specimen shutter, We do not know exactly which if any of the three built-in recording mode is used by the function call from Leginon, but they should be consistent in low dose imaging, any way. This is under the menu /Camera/Camera Setup

For each of the mode (Search/Focus/Exposure), since in this example shutter 1 (primary) is the pre-specimen shutter that is normally closed, you should uncheck the box on "Use Alternate Shutter".

To check that your shuttering is right, you need to look at the LED on the camera control box. While the microscope main screen is down, LED lights for the two shutters should be on, meaning the shutters are open. When the main screen is up and the camera is inserted, the shutters would go to idle state, with the one corresponds to the pre-specimen dimmed while the one for the post-specimen lit. Next, try to acquire an image through Leginon at a relative long exposure ( > 0.5 s), and watch the LEDs. The one for pre-specimen should light up during the time of the exposure and then become dim again.

Camera flipping and shutter settings are configured per computer user. If you have several users, you will need to sync the flipping practices and make sure all of you are shuttering correctly.

Also as a warning, different data acquisition packages also require different configuration. If you have users using SerialEM, for example, it is important to coordinate with them to avoid conflicts.


For Complete Installation, go to Calibration Application Chapter next.

< Calibrations required on FEI microscopes | Good Alignments Save Time>



Manual Acquisition

Manual Acquisition is a node that allows the electron microscopist to acquire CCD images manually while at the microscope. This node essentially creates a button to acquire images manually with Leginon and gives all the benefits of the Leginon database and image storage.

Required bindings: None

Toolbar

Settings

- Use low dose = When enabled, Leginon will switch the microscope from focus to exposure mode of the Low Dose kit to acquire the image and then return to focus mode.

- Low Dose pause "4" seconds = Wait this amount of time before acquiring an image when using Low Dose on the microscope and acquiring images with the Acquire feature in this node. Increase the time if the microscope does not change modes fast enough.


< JAHC Hole Finder (Template Hole Finder) | Matlab Target Finder >



Matlab Target Finder

The Matlabe Target Finder node behaves like other target finding nodes in that it takes images as input and outputs a list of targets. In this case, Leginon sends the image to an externally running Matlab process, which then sends the list of targets back to Leginon.

In order to use the Matlab Target Finder, you must:

In addition to the usual target finder settings, this node needs to be configured with the matlab function (.m file) that should be executed on the image. The function should take the image as input in the form of a two dimensional array. The output should be two arrays, one for focus targets and one for acquisition targets. Each is an array of x,y pairs. Here is a simple example where the function generates a constant set of targets for any input image:

example Matlab module for target finding

function [acquisition, focus] = example(image)
acquisition = [168, 234; 203, 54; 450, 390]
focus = [324, 42; 36, 248; 151, 94]


This generates three acquisition targets and three focus targets. Leginon will display the targets on the image and optionally allow the user to edit the targets before submitting them.

Required bindings for receiving images and publishing targets:

previous Acquisition - (AcquisitionImagePublishEvent) -> Hole Finder
Hole Finder - (ImageTargetListPublishEvent) -> next Acquisition
Hole Finder - (QueuePublishEvent) -> next Acquisition

Required bindings for proper waiting among nodes:

Hole Finder- (ImageProcessDoneEvent) -> previous Acquisition
next Acquisition - (TargetListDoneEvent) -> Hole Finder

Settings

Image Control Panel

NOTE: To see the effects of Testing the settings for a particular Hole Finder step in the Image Control Panel, the corresponding Hole Finder step Display must be enabled before using the Test feature in that step's Display Settings.

Image

Display

To view the original input image, enable this button.

Display Settings

acquisition

In Matlab target finder, the purpose of the acquisition setting is only for display and user selection.

Display

To view acquisition, the Image Display must be enabled. The acquisition targets that the finder chooses will be shown with a green crosshair.

focus

In Matlab target finder, the purpose of the focus setting is only for display and user selection.

Display

To view focus, , the Image Display must be enabled. The focus targets that the finder chooses will be shown with a blue crosshair.


< Manual Acquisition | Matrix Calibrator >



Matrix Calibrator

Matrix calibrator performs four different calibrations that based on linear transformation conversion: Image shift, beam shift, stage position, and image/beam shift

Required bindings

Required bindings to use preset instrument configuration set by presets manager:

PresetsManagerNode - (PresetChangedEvent) -> MatrixCalibratorNode

Matrix calibration is made by making N sets of measurements (specified by "N Average"). Each measurement set acquires three images, first at a given origin, second with an x-axis movement in the specified "Parameter" by the specified "Shift Fraction" of the image, and third with an y-axis movement by the same shift fraction. The resulting shifts in the acquired images are obtained by cross correlation. A transformation matrix is then generated for the measurement set. The origin is shifted by the "Interval" specified in the node, in meters before the next set of measurements is taken. At the end, the N matrixes obtained are averaged and saved in the database at the specific magnification and movement type and can be applied to any camera configuration. "Tolerance", expressed in fraction of image, is used as an error check. The calibration is considered failed when the measured movement is much different from that calculated from pixel calibration

Because the calibration is based on correlation of the acquired images, well contrasted images with the intended movement clearly shown but not by such a large amount that the apparent feature is altered is the key for sucessful calibrations.

Image shift calibration is useful only on FEI microscope where image shift/beam shift compensation is calibrated and stored at the scope. Without such stored calibration, Image shift/Beam shift calibration is required instead.

Toolbar

Settings

Parameter Settings

Image Control Panel

This panel controls which image is shown in the Image Display area.


< Matlab Target Finder | Mosaic Click Target Finder >



Microscope Set-up Checklist

This checklist is valid for users needing the full leginon capacity such as those of MSI application. "Manual" application users can set up the microscope in Low Dose Mode and follow their usual practice. The list in practical order includes alignments that are critical for Leginon operation and are ones Leginon can not perform, yet. Other alignments not mentioned here can often be refined within leginon. Conditions listed in [] show possible ways to check the alignment. In most cases, alignment is only needed if the check fails. * indicates tips for better results

The followings are optional alignment in LM mode. The alignment is needed only if serious problems are found and the alignment in general won't ever converge as nicely as those in HM mode.


< Good Alignments Save Time | Microscope Set-up ^



Minimum Requirements and current NRAMM setup

Electron Microscope with its Controling Computer (Windows)

Microscope need to have the capacity for external control and network connected (See Network Configuration section for details on that. Here are known examples of Leginon implementation:

CCD

Gatan, Tietz, Eagle-minimal 1kx1k; NRAMM 4kx4k

A Second Computer Running Linux (CentOS at NRAMM)

At NRAMM, we separate the three activities into different computers that serve about 15 people with three microscopes that could be running at the same time. All scopes share the same database, web server, and file server. Each microscope has its own processing computer.

We no longer consider using a computer with Windows PC as the second computer as an option. A group tried it and it could not handle the memory demand

CPU

Minimal 2 GHz;

NRAMM:

RAM

The whole system with its image processing, database query and web serving, needs a lot of memory. Realistically, you will need minimal of 4GB memory for all processing+database+web server activities for one microscope operation with 4k camera that serves two persons (one operates the scope, one just look at the images from the web viewers) at the same time. We know of at least one successful daily usage at this configuration. For 2k camera, an all-in-one computer with 3GB memory has also been used successfully. If you are buying a new computer, get at least 6GB memory would be a good idea.

At NRAMM, to serve about 15 people viewing images and with three microscopes that could be running at the same time:

Hard drive

10 GB for the softwares and maybe a few hours worth of data collection. Much larger
for routine use. NRAMM 45Tb and growing although some are archived.

Network connection speed

100 Mbps might be possible; NRAMM 1 Gbps

Leginon system components developed at Leginon home

Leginon Home: http://www.leginon.org/

Supporting packages and programs available through internet or your Linux distribution

There are minimum of ten packages or single programs, some of them are included in your
Linux distribution.

Leginon supporting programs available upon request

adaexp.exe that is required if film exposure is to be made through Leginon on FEI Tecnai
machines is available by request. Please contact Max Otten: (mto at nl.feico.com)
and let him know what version of the Tecnai user interface you are using.


< Graphical User Interface | Getting Started >



Modeled Stage Position calibration

The "GonioModeling" node, an instance of Modeler node class, models the goniometer/stage
movement to give a more accurate stage position/movement calibration. The stage position is
modeled in both x and y directions. For a more accurate calibration, many points or images
need to be acquired to give a more accurate mathematical fit to the function. This calibration
works best on a grid that will always give good cross correlations. Slot grids give large
areas that can cross correlate well, but this type of grid tends to drift. Negatively stained
grids or grids with dirts on it and carbon in the background will work well. Used Quantifoil
grid can be used, too, if there is enough dirt or large protein complex that keeps one hole
distinquishable from all others.

Modeled Stage Position calibration will also copy its results in image scale and rotation
in the form of stage position matrix calibration. Therefore, if Modeled Stage Position
calibration is performed in "GonioModeling" node, there is no need to calibration stage
position matrix alone in "Matrix" node.

How does modeled stage position calibration work?

There are two parts of results from doing a modeled stage calibration: 1) a function (in
the form of a harmonic series) that models the mechanical behavior of the stage, and 2) a
magnification adjustment (scaling and rotation) that allows the model function to be used at
different magnifications. Part 1 needs to be done at only one magnification, because the
result will be normalized in the database so that it can be used at any other magnification.
Part 2 needs to be done at any other magnifications that you wish to use this calibration.
The user interface of GonModeler node gives you two methods: "Fit Model" and "Rotation/Scale
Only" These two methods are really identical except for the final result they store in the
database. "Fit Model" will store both part 1 and 2 above. "Rotation/Scale Only" will only
store part 2 (and assumes that you already have part 1 done). Since "Fit Model" is
responsible for part 1, you generally need to measure a lot of points to get a good fit. You
will normally select between 2 and 5 terms for the harmonic series to get a good fit. The
"Mag Only" method will also fit a function to your measured points using the number of terms
you specify. But the resulting best fit function is not stored in the database. Only the
constant term of the resulting function is stored, because this can be used to scale the
existing normalized model function to the current magnification.

See ( http://ami.scripps.edu/publications/techreports/99-001/ ).

Starting from v1.4, the model can be used for building a mosaic of images (also called
an atlas).

Full calibration

NOTE: This full calibration needs to be completed for both the x and y axis, but at only
one magnification. The Magnification Adjustment calibration below can be after this has been
completed if the calibration needs to be improved.

  1. Microscope>Place a grid into the microscope that will cross correlate well at
    low magnifications or at the mag used for "sq" preset, e.g. 550x.
     
  2. Microscope>Go to 550x. (Use magnifications between 550x - 1100x for best
    results)
     
    or
     
    Leginon/Presets Manager> Select the "sq" preset for the calibration and send
    its parameter to the microscope.
     
  3. Leginon/Node Selector> select "Goniomodeling" node.
     
  4. Leginon/GonioModeling/Settings/Measurement>:
     
  5. Leginon/GonioModeling> left click "Measure" tool to start measuring shift of the image upon each movement. For all 200
    points to be completed, the process will take about 50 minutes
     
  6. Leginon/GonioModeling/Settings/Modeling>
    Check the parameters. Most of them should be filled in automatically according to
    the measurements just made.
     
  7. Leginon/GonioModeling> left click Calibrate tool to start model fitting.
     
  8. Once fitted, the data and the harmonic series fit for the mechanical error can be
    viewed through http://yourhost/myamiweb/admin.php under Goniometer. A good fit should look like this:
     

     
  9. Repeat steps 3 to 7 for the y axis. You can use the same label as the one for x
    axis. If your goniometer has no periodic deviation from a linear movement for the y
    axis, use 0 terms for harmonic series fitting.
     
  10. Use Navigation node to check the result of the calibration after both axes are fitted.

If the data are over fitted, the modeled move may be worse than the simple linear
matrix calibration. In such cases, it is better to decrease the number of terms in the
fitting and redo the Fit Model step. For example, on our Two older FEI Tecnai, the x periods
was ~ 62 microns and fitted well with 5 harmonic terms. The y axis did not have a true
harmonic model, therefore, 0 terms were used.

During a data acquisition session, if the targeted holes are not being centered, first
check image alignment between sq and hl presets. If it is o.k., redo the Mag Only
calibration (see below) for a shorter calibration time. If fails, the full calibration is
needed.

Full GonModeling Calibration Need for the Example MSI:

Preset magnification
sq 550

Trouble Shooting Bad Points in the Measurement

A bad point is an outlier imagex or imagey measurement. The imagex and imagey values are
displayed in the message log window. They comes from, in most cases, failure in finding the
correct correlation peaks. Not all bad points will be rejected correctly because they can
accidentally fall within the tolerance. Since they can only be removed within the database
once inserted, avoiding them is preferable.

To avoid bad points coming from false correlation peaks, you can do one or more of the
following:

NOTE: Some of the valid data points may be rejected if the tolerance is set too low in
the measurement. They are, however, important in defining the model that is aimed to correct
these deviations. The tolerance should be increased if well correlated shifts are
rejected.

Magnification and image rotation adjustment of the
model

NOTE: Do NOT reuse the same label name that was used for the Full calibration step
above.

Once a full calibration of the goniometer model is done at one magnification, a so-call
"Scale/Rotation-only" calibration is all that is needed for using the model at a different
magnification. Small number of measurements is used as well.

  1. Microscope>Place a grid into the microscope that will cross correlate well at
    low magnifications or at the mag to be calibrated
     
  2. Microscope>Go to the desired magnification.
     
    or
     
    Leginon/Presets Manager> Select the required preset for the calibration and
    send its parameter to the microscope.
     
  3. Leginon/Node Selector> select "Goniomodeling" node.
     
  4. Leginon/GonioModeling/Settings/Measurement>:
     
  5. Leginon/GonioModeling> left click Measure tool to start data acquisition.
     
  6. Leginon/GonioModeling/Settings/Modeling>
     
  7. Leginon/GonioModeling> left click Calibrate tool to start model fitting.
     
  8. Repeat steps 3 to 7 for the y axis. You can use the same label as the one for x
    axis.
     
  9. Use Navigation node to check the result of the calibration after both axes are calibrated.

GonModeling Mag Only Calibration Need for the Example MSI:

Preset magnification
gr 120
hl (optional if not acquiring tilted data) 5000

< Stage Position matrix calibration | Checking Matrix and Modeled Stage Position Calibration >



Monitor Progress of Queued Targets

Myamiweb that is the package that includes the web viewers has a script that estimate the time required to process the unfinished queue. Goto http://your_webserver/your_myamiweb/loi.php on a web browser where you can select your session to view the current count of the queue and the estimate time to completion. The estimate is based on processed queue of the same type in your session and will become more accurate once you have processed more queued targets automatically. This way, you can queue up enough for a good dinner or a hour of two on the beach.


< Queuing Example 3 - Both Exposure and Hole Targeting | Iterative Stage Movement Option >



More about Groups

Groups are used to associate users together. At the moment, Leginon does not use the group association for anything.

Add/Edit a Group

Remove a Group


< Set up for a new regular user | Revert Settings >



More about Groups

Groups are used to associate users together. At the moment, Leginon does not use the group association for anything.

Add/Edit a Group

Remove a Group


More about Instruments

This is used to add details about the microscope and CCD Leginon will be connected to. More than one instrument can be added with different configurations. The "import" function is useful if the instrument information has been stored on different machines in different Leginon databases.

Valid Instrument Names

TEM names: Camera names:

Add/Edit an Instrument

Remove an Instrument

Import an Instrument Pair


< More about Groups | Applications >



More about Instruments

This is used to add details about the microscope and CCD Leginon will be connected to. More than one instrument can be added with different configurations. The "import" function is useful if the instrument information has been stored on different machines in different Leginon databases.

Valid Instrument Names

TEM names: Camera names:

Add/Edit an Instrument

Remove an Instrument

Import an Instrument Pair


Mosaic Click Target Finder

Mosaic Click Target Finder is a type of TargetFinder Node. It handles the loading, save, displaying and target selection of a list of images and and their composite.

Required bindings for Mosaic Click Target Finder Node:

Grid Targeting - (ImageTargetListPublishEvent) - > AcquisitionNodeAlias
AcquisitionNodeAlias- (AcquisitionImagePublishEvent) -> MosaicClickTargetFinder
MosaicClickTargetFinder - (ImageTargetListPublishEvent) -> AcquisitionNodeAlias
ClickTargetFinder - (ReferenceTargetListPublishEvent) -> AlignZeroLossPeak or MeasureDose

Required bindings for MosaicClickTargetFinder Node if Reference Targets are used:

MosaicClickTargetFinder - (ReferenceTargetListPublishEvent) -> AlignZeroLossPeak or MeasureDose

Toolbar

Tiles

Mosaic Settings

Image Control Panel


< Matrix Calibrator | Mosaic Target Maker >



Mosaic Target Maker


< Mosaic Click Target Finder | Navigator >



MSI-Tomography Preferences

Many preferences for nodes in "MSI-Tomography" application are the same as in MSI with queuing option. The example here is based on a working condition at the Jensen Lab.

The following should be set up by the user "administrator" which will then be used as system-wide default preference for new users. Once the new user starts the application, he/she can customize his/her own preferences. Not all preference has independent function. Therefore if you change one preference, check for the preference(configuration) of other nodes that might depend on it.

Nodes that acquires images/Settings> except Tomography node

This application is normally used exclusively with the queuing option. Therefore, "wait for a node to process the image" option is always off. Note that the Process target type is default in all nodes except "Tomography Preview".

Table 16.4. Example MSI-Tomography node setup (Except Tomography node)

Node name: preset: move type (to reach the preset) : wait for a node to process the image: publish and wait for rejected targets: adjust target for shift: Process target type:
Grid Targeting gr N/A N/A N/A N/A N/A
Grid gr modeled stage position no no no acquisition
Square Q sq modeled stage position no no no acquisition
Hole Q hl modeled stage postion no yes yes acquisition
Z Focus hl modeled stage position no no yes focus
Tomography Preview preview modeled stage position no no yes preview
Tomo Focus fc modeled stage position no no yes focus

Remember to press the "+" button in order to assign a preset to a node.

Leave other setting options to default. These default options are:

Presets Manager

Settings that are the same as in other MSI applications in queuing mode

Z Focus node focus sequence example

Enter 3 focus steps in the sequence list box by typing the name in the entry box and press "+" on its right.

Select individual step in the list box and set the following parameters

Table 16.5. Example MSI-Tomography Z Focus Steps

Step: preset: focus method: Enabled:
Stage_Tilt_Auto hl Stage Tilt Yes
Beam_Tilt_Auto hl Beam Tilt Yes
Manual_after fc Manual No

For Stage_Tilt_Auto Step:

For Beam_Tilt_Auto Step:

Tomo Focus node focus sequence example

Enter 3 focus steps in the sequence list box by typing the name in the entry box and press "+" on its right.

Select individual step in the list box and set the following parameters

Table 16.6. Example MSI-Tomography Tomo Focus Steps

Step: preset: focus method: Enabled:
Stage_Tilt_Fine fa Stage Tilt Yes
Beam_Tilt_Fine fa Beam Tilt Yes
Manual_after fc Manual No

For Stage_Tilt_Fine Step:

For Beam_Tilt_Fine Step:

Tomography

Tomography has many unique settings:

  1. General Acquisition Settings:
     
  2. Acquisition Presets Order = tomo
     
  3. Acquisition Mover Settings (See Session on <link linkend="mover">Different ways to move targets</link> in the MSI chapter for details on how to optimize these settings:
     
  4. Tilt
     
  5. Exposure
     
    Tomography node divides the total dose by the number of tilt images it needs to acquire to calculate the real exposure time it uses, given the limit set by the user.
     
  6. Before Collection
     
  7. Misc.
     
  8. Model
     
    The goniometer model that predicts the defocus drift as a result of offset goniometer tilt axis relative to the detector imaging axis can be dynamically fitted. The following parameters are used to initialize the model fitting of the goniometer tilt axis. See Session on low magnification model fitting for more details.
     

Once the goniometer model gives satisfactory results, Keep the tilt axis parameters fixed is recommended with the model set to be initialized with the model of "only this preset"

Defocus prediction smoothing is default to use shifts of 4 tilt images. A larger number can be set if the goniometer behavior is particularly jiggly.

Dose Measurement and Align ZLP

Use defaults:


< Initial MSI application preference setup | Robot MSI-Section preference set-up >



MSI Operation

The following sections will describe how to operate the MSI application once set-up is complete. MSI operation can vary depending on the quality of the specimen in the microscope and how well the calibrations have been completed. Once squares are manually picked from the atlas, the entire acquisition process is capable of proceeding without human intervention. This sort of hands-off operation does depend on how well holes can be found in the images of squares and how well high magnification exposure and focus targets can be picked in the the image of a hole. If the stage is drifting, the Drift Monitor will not allow acquisition to continue until the drift has settled down. Manual intervention in the acquisition process can make the hole finders operate better. Manual check before and after the autofocus routine runs is also possible in the Focus node. Manually checking after the autofocus routine finishes is a way for the Leginon user to verify that the autofocus routine worked properly.

If the computer does not have a lot of memory, it is recommended that Leginon should be the only application running on the computer during an experiment because all the imaging and processing take up a lot of memory.

Start Leginon and MSI (if not already started)

1. local> start-leginon.py

2. Leginon Session> log in and select "Create session" if a new session is needed.

Create Session> Fill in needed information such as session name and comments. Select instrument and project, if project database is used. Image path is automatically selected.

3. Leginon Session> Select the session you have just created or use a previous session to start.

4. Leginon/Application/Run> Select the "MSI" application, the scope, and the local launcher. Click Run.

Reload the Atlas (Only if Leginon is being restarted)

Important
The Atlas should have already been created by following the MSI everyday set-up checklist.

How to reload atlas:

This is used if Leginon was stopped and restarted.

1. Leginon/Square Targeting/Mosaic > Enter the size of the mosaic atlas loaded into the image display for better resolution. For example, Scale image to: 2048 for more resolution, 512 for fast loading

2. Leginon/Square Targeting/Tiles > Select the atlas label in "Load tiles from mosaic." The most recent one is the default.

3. Leginon/Square Targeting/Tiles> Click "Load"

Select Squares on the atlas

Pick squares to collect data from by making selections on the atlas.

1. Leginon/Square Targeting> Refresh the target display by clicking .

2. Leginon/Square Targeting> Click the "acquisition" selection button .

3. Navigate around the atlas to find suitable squares for acquisition.

This step is purely empirical at this point (by eye). If using Quantifoil grids with ice, look for squares that have holes paler than the surrounding carbon. Although Leginon has automatic algorithm for square finding, the adjustment of parameters takes more time than what human can accomplish easily. Use the zoom to look at the holes more closely. Note that the zoom will take a long time on such a large image. Therefore...

NOTE: Be sure to be patient when clicking the zoom button, otherwise Leginon will
take a while to catch up to the number of zooms that have been asked for.

4. Click on squares that will be acquired.

5. Once all the targeted squares have been selected, click "Submit Targets."

6. Leginon will indicate where the next step is by showing active green icons next to the nodes that are being used. A question mark icon will appear when Leginon requires user interation. The message log for each node indicates what is happening that particular node.

Select Holes on the first image of a square

Pick holes to collect data from by making selections on the first image of a square.

1. Leginon/Hole Targeting> Check whether holes were selected (acquisition targets = green crosshair, focus target = blue crosshair).

2. Edit the targets by mouse left click (add) or right click (delete) on the target in the image viewer with the picking tool for the target type active.

3. If the hole selection is acceptable, uncheck "Allow for user verification of picked holes" in Leginon/Hole Targeting/Settings>.

4. If the hole selection is not acceptable, try adjusting the Hole Targeting node to find holes in the current image of a square. Refer to the Hole Targeting Set-up.

5. Click "Submit Targets"

Manually check focuser that uses Stage Z as the correction method

Manually checking the focus after eucentric focusing of hl images is recommended for bent grids.

1. When the Manual Focus window opens automatically (when Leginon reaches the Z Focus node), click "Eucentric focus to instrument" !http://ami.scripps.edu/software/leginon/images/icons/instrumentset.png. The rings of the CTF in the FFT should disappear if it is looking at the carbon support using fc preset. If hl preset is used to look at a hole during manual focus, look for the loss of contrast in IMAGE.

2. Adjust "Stage Z" until the image appears to be focused if not already so. Use a large step such as 5e-6 m.

3. If the defocus is consistently off by more than +/- 5 um., then the Beam Tilt calibrations (defocus) may need to be repeated.

Make sure that the stage is at eucentric height in the calibration and that the microscope has been well aligned.

4. Clicking the Stop button exits the maunal check.

5. Leginon/Z Focus/Focus Sequence> Disable "Manual_after" focus step when it is not required.

Select Exposure and Focus targets on the first image of a hole

Pick exposure and focus targets on the first image of a hole.

1. Leginon/Exposure Targeting> Click the Original, acquisition, and focus selections in the image control panel.

2. Check whether exposure (green crosshair) and focus (blue crosshair) targets were selected correctly.

3. Edit the targets by mouse left click (add) or right click (delete) on the target in the image viewer with the picking tool for the target type active.

4. If the exposure and focus selection is acceptable, uncheck "Allow for user verification of picked holes" in Leginon/Exposure Targeting/Settings>.

5. If the exposure and focus selection is not acceptable, try adjusting the Hole Finder to pick the correct targets. Refer to Exposure Targeting Set-up.

6. Click "Submit Targets"

Manually check focuser that uses Defocus as the correction method

Manually check the focus after the first high magnification images that are acquired. Then turn off "manual_after" focus step once it has been verified that the autofocus routine is properly correcting the defocus and astigmatism.

1. When the Manual Focus window opens automatically (when Leginon reaches the Focus node), click "Set Instrument" to send what Leginon thinks is zero defocus to the microscope. The rings of the CTF in the FFT should disappear once the defocus is at zero.

2. If the rings are still visable or are astigmatic in the FFT, then the Beam Tilt calibrations (defocus and stimator) may need to be repeated.

Make sure that the stage is at eucentric height and that the microscope has been well aligned.

3. Clicking the Stop button exits the manual check.

4. Leginon/Focus/Focus Sequence> Disable "Manual_after" focus step when it is not required.

View the images online

The images Leginon has acquired and published to the database can be viewed through the online viewers, the Leginon Image Viewer, the Leginon 3-Way Viewer, and the Leginon Observer Interface (LOI) which displays the currently acquired images.

1. Go to http://yourhost/myamiweb and open either the Leginon Image Viewer, the Leginon 3-Way Viewer, or the LOI.

2. Select today's Session from the pull-down list.

3. Have fun browsing through your images! You can view the parent images of images selected in the main viewer of the 3-way viewer in the smaller views by specify the appropriate preset.

Interruption

Targets that are submitted can no longer be modified individually from the node where you selected them. If you need to abort the unprocessed targets in a list, you need to go to the node that receive it and click on the "Abort" button. In other words, if you want to abort all remaining holes in a square, you need to abort at the "Hole" node.

The same is true with pausing. Pausing is usually used when the cryo stage requires refill. To allow proper tracking of targets and drift, we recommend that you pause at "Hole" node for the purpose if exposure targets are not queued.

More information about interrupting data collection can be found in the Trouble Shooting Chapter regarding pausing and aborting during data collection


< Special Operation setup | Optimizing autofocusing >



MSI Quick-start

Note: The following serves as a quick set-up guide for the MSI application and assumes you have set up Leginon before. Use default values unless otherwise specified. If you are choosing the hole and exposure targets manually, you can of course skip the part regarding setting up the hole finders.

  1. Important - Align the microscope
     
  2. Start Leginon (typically done on a computer in the microscope room) and load “MSI” application
     
  3. In Presets Manager, import presets from a previous day.
     
  4. Go to a "sacrificial" intact square with both filled and empty holes by moving the stage on the scope and save its position in Navigation node. If there are no squares with empty holes then burn through a filled hole. This square will be used for aligning presets and to set the I0 value for assessing ice thickness when setting up the hole finders
     
  5. (Skip if already reset defocus to Eucentric focus for LM in 1) Go to sq preset, find true focus at eucentric height, and set defocus to zero on the microscope if you have not done so.
     
  6. (Skip if already reset defocus to Eucentric focus for HM in 1)Go to fa preset. At the microscope, set stage at eucentric height, find true focus, and set defocus to zero on the microscope
     
  7. At the microscope, check and correct, if necessary, beam tilt pivot points and rotation center for HM mode
     
  8. Correct image shift for gr preset against hl preset
     
  9. (Skip if calibration is stable on this scope) Check modeled stage position matrix calibration for gr preset by navigate it in Navigation node. Within 10% error is satisfactory. If not, perform mag-only modeled stage calibration at gr preset using "Calibration" application.
     
  10. In Grid Targeting node, press Calculate Atlas, then Acquire. Atlas collection may take 10-20 min.
     
  11. Go to a broken square and save its position in Navigation node. Alternatively, select a broken square target from the atlas, submit it to move to the position but submit no hole targets when prompted to terminate the sequence. If there is no broken square, a hole can be burned at high mag where there is no support film.
     
  12. In Presets Manager and an exposure preset, set dose to 10e-/A^2 for exposure presets by balancing the beam intensity against the exposure time
     
  13. Update flat field correction for exposure presets by going to Correction node and acquire bright and dark images using the following settings:
     
  14. In Navigation, return to the intact square.
     
  15. Swing in the objective aperture and center it in diffration mode at an exposure preset.
     
  16. Return to imaging mode.
     
  17. Remove objective lens hysteresis
     
  18. Align image shifts and beam shifts for the fa, fc, hl, and sq presets against the exposure preset or, if fa and exposures are at the same magnification, use fa as reference to align hl and sq presets image shifts.
     
  19. At this point the user should not have to manually operate the microscope anymore and can run Leginon from a remote computer.
     
  20. In both Hole Targeting and Exposure Targeting, click Settings and check Allow for user verification of picked holes and check that queuing is off.
     
  21. In Z Focus node, in the focus sequence tool, enable the focus step "Manual_after"
     
  22. In Square Targeting, find the intact square on the grid atlas and submit it as a target. The location of the square is easy to find using the current position marker on the atlas.
     
  23. Check that targeting is good [+/- 5 um] and set up the hole-finder in Hole Targeting. Set I0 value from the average intensity of the empty hole. Make sure in Focus settings, Focus hole selection is set to Any Hole (or Good Hole if good holes are abundent) and then activate automatic hole finding option for future images.
     
  24. In Hole Targeting, submit an empty hole as an acquisition (green) target and a carbon supported area with a recognizable junk on it as a focus (blue) target.
     
  25. Check results of Z focusing to ensure focuser calibration is good at hl preset. [+/- 5 um or better]
     
  26. Check that targeting is good [+/- 1.5 um] and set up the hole-finder in Exposure Targeting. Set I0 value from the average intensity of the empty hole and then activate automatic hole finding option for future images.
     
  27. In Focus node, in the focus sequence tool, enable the focus step "Manual_after"
     
  28. Submit a focus target and an acquisition target from Exposure Targeting node.
     
  29. Check results of focusing to ensure focuser calibration is good [+/- 0.3 um or better]
     
  30. Check that targeting is good [+/- 100 nm]
     
  31. If everything checks out, turn off Manual_after step in Focus and Z Focus node, turn off user verification option in Hole Targeting and Exposure Targeting nodes, pick squares, and watch the data come in.
     

< Special Operation Preference setup | MSI set-up in more details >



MSI set-up in more details

This section shows some of the more important and complicated steps in the set-up checklist. It assumes that the user knows the nomenclatures. See the full documentation if you want the detailed explanation. It also assumes that general set-up and calibrations exist from previous sessions so that most calibrations can remain unchanged. The steps that are NRAMM specific are marked. MSI now features stage Eucentric height correction at each square.

NOTE: The Tietz imaging software (EMMenu) must be turned OFF before Leginon is started. In contrast to this, the Gatan imaging software (Digital Micrograph) must be ON before Leginon is started.

Starting Up

Set up is most stable with a good microscope alignment.

1. Initial alignment at the microscope See Chapter on Microscope setup for details.

2. Start python-based leginon main program amd leginon
client. See Chapter on Start Leginon.

"Exception EAccessViolation in module adaExp.exe at....
Access violation at address xxxx in module 'adaExp.exe'. Read of address xxxx"

3. Start your preferred "MSI" application.

Import existing presets

Save the alignment and empty position in Leginon

Retrieve the stored alignment or empty position in Leginon

Reset defocus to zero at eucentric focus in LM mode

1. Leginon/Presets Manager> Send the sq preset at LM mode by choosing the preset name and click the "To Scope" tool on the right of the preset selection box.

2. scope> Move the grid to a position on the "align" square,

3. scope> Use stage alpha wobbler to move the sample to eucentric height if hasn't done so.

4. scope> Focus the beam to see only a small area of the intact square. Turn the focus knob to find the point where a scattering halo goes through the minimum which indicates that it is at focus. This procedure finds the focus easier than looking for minimal contrast in LM mode.

5. scope> Reset defocus to zero.

Reset defocus to zero at eucentric focus in HM mode

1. Leginon/Presets Manager> Send the fa preset at HM mode by choosing the preset name and click the "To Scope" tool on the right of the preset selection box.

2. scope> Use stage alpha wobbler to fine the specimen height to eucentric.

4. scope> Focus the image.

5. scope> Reset defocus to zero.

Grid preset image shift refinement

1. Leginon/Presets Manager> Send a preset at an intermediate mag at HM mode as the reference (e.g. hl) "To Scope"

Note: sq preset in LM mode can be used if the image alignment between LM and HM
is known to be good.

2. scope> Move the grid to a position on the "align" square, either on a recognizable object or burn a good hole through ice at the center of the CCD as preparation for lower mag preset image shift correction.

3. Leginon/Presets Manager> Click on the tool "Align presets to each other" .

4. Check, adjust, and save the preset(s) to be aligned.

The left panel displays and navigate by "Stage Position" of the reference preset while the right panel displays and navigate by "Image Shift" of the preset to be aligned * Leginon/Presets Manager/Align Presets> Choose the reference (hl) preset on the left panel.

Note: "Navigate" means selecting the navigate tool on the top right of image display and then double clicking the location of the new center that is translated by the given TEM Parameter.

Grid preset stage position refinement

Stage position model Scale and Rotation is stable as long as the LM eucentric height defocus is set to zero before each session, although variation from day to day is normal. Check the stage movement calibration of gr preset by navigating it in Navigation node. Within 10% error is satisfactory since reaching a square does not require high accuracy. If not, perform stage model position scale and rotation calibration> at gr preset using "Calibration" application as following:

Why goniometer model is better.

1. scope> Remove the objective aperture.

2. Leginon> Run "Calibrations" Application

3. Leginon/Presets Manager> Send "gr" preset to scope.

4. Leginon/GonioModeling/Settings/Measurement> Set axis=x, Points=5,Tolerance=25%, and Interval=1e-05 m. Default model label is the session name.

5. Leginon/GonioModeling/Settings/Modeling> Set "Scale and Rotation Adjustment Only"=Yes. Other settings will be set automatically once measurements are finished.

6. Leginon/GonioModeling> Click on will start "Measure" the shifts of between points that are moved on x axis of the goniometer.

7. Leginon/GonioModeling> Click on will "Calibrate" the scale and rotation of the model on x axis of the goniometer.

8. Leginon/GonioModeling> repeat 4-7 with the axis set to y.

Acquire mosaic atlas of the grid

1. scope> Remove the objective apperture.

2. Leginon/Grid Targeting> Click "Settings" to check the preset used, the size and name of the atlas.

3. Leginon/Grid Targeting> Click "Calculate Atlas"

4. Leginon/Grid Targeting> Click "Submit Targets" to begin acquiring the atlas.

5. Leginon/Square Targeting> Follow the atlas progress in the display. (***There is no sign at the end currently other than that nothing happens for a long time and that the atlas dimension is the same in other direction when it is completed.)

6. scope> Insert the objective aperture.

7. Leginon/Presets Manager/Send an HM preset "To Scope" several times to cycle all magnifications and warm up the objective lens to minimize the image shift hysteresis in switching between LM and HM modes. If the scope has been in LM mode for a long time, wait for at least 30 min before final image shift refinement of needed LM preset during acquisition (i.e. sq)

Determine the proper exposure condition for exposure presets

Exposure presets are the base presets for data collection. To keep it to low dose condition such as 10 electron/Angstrum, measurement of dose is performed and the exposure time is adjusted. If scope or camera parameters are changed during the session, the dose value is no longer valid and should be remeasured.

1. Leginon/Navigation/Toolbar/Stage Locations Send the "empty" position "To scope".

2. Leginon/Presets Manager/Preset Selector> Select a high mag exposure (i.e. "en" or "ef"), confirm that the parameters are what you desire for the experiment, and then send "To Scope" .

3. scope> Expand the beam to at least cover the CCD (> medium circle mark on the viewing screen) and to the size you desire.

4. Leginon/Presets Manager/Preset Selector> If you have changed the size or location of the beam or other preset scope parameters at the scope, you must retrieve
the preset parameter "From scope" first before checking and saving the dose value.

5. Leginon/Presets Manager/Preset Selector> "Acquire dose image" for the selected preset.

6. Leginon/Presets Manager/Dose Image> Check the "Dose" value.

7. Leginon/Presets Manager/Dose Image> If desired dose is known, fill in the value and then click "Match". This will change exposure time to give a close match of
the value entered.

8. Leginon/Presets Manager/Dose Image> If not satisfied with the value, click "No", change the exposure time by editing the preset, and try again (No need to send
the preset "To scope" again for the repeat)

9. If the scope can not give such illumination to satisfy dose, exposure time and area requirement, alignment is required or change of gun lens or spot size is needed.

10. Leginon/Presets Manager> Copy the preset parameter to the other exposure preset.

Update bright and dark correction images for exposure presets

Exposure presets are the base presets for data collection. To make sure the best correction is applied to them, the correction images should be acquired prior to the experiment at session. Since no correlation is normally done on these images, only one channel is needed. Normalization image might need to be Bright and Dark reference images if a large chunk of region is blocked by a fallen debris.

1. Leginon/Presets Manager> Select a dose measured high mag exposure (i.e. "en" or "ef"), and then send "To Scope".

2. Leginon/Correction/Settings>

3. Leginon/Correction/Settings> Click OK to exit settings.

4. Leginon/Correction/Toolbar> Select "Raw image " from the pull down list of acquisition modes and then click on "Acquire" button next to the selector to view an image that is not corrected.

5. Leginon/Correction/Toolbar> Select "Dark reference" in the acquisition mode selector and then click "Acquire" to acquire the Dark reference image for this particular camera configuration.

6. Leginon/Correction/Toolbar> Select "Bright reference" and repeat the acquisition to obtain the Bright reference.

7. Leginon/Correction/Toolbar> Select "Corrected image" and then "Acquire" to view the corrected image. A corrected image should be free of artifacts and have
smaller standard deviation than the raw image, in general.

8. Leginon/Correction/Toolbar> If there are regions consistently over normalizes the acquired image, either select the region and use the "+" tool to "Add Region to Bad Pixel List", or click on to "Add Extreme Points to Bad Pixel List" one of more times to find the outliers. Right click on a shown bad pixel removes it from the list.

Medium mag preset image and beam shift refinement

Preset image shift alignment can be done follow the same procedure as the section "Grid preset image shift refinement" but is more efficient using the automated mode as follows.

1. Leginon/Presets Manager> Send one of the exposure preset as the reference (e.g. en) "To Scope"

2. scope> Move the grid to a position on the "align" square, either on a recognizable object or burn a good hole through ice at the center of the CCD as preparation for lower mag preset image shift correction.

3. Leginon/Presets Manager> Click on the tool "Align presets to each other" . The tool automatically select the reference preset that was selected in the Presets Manager mainpanel and choose a preset at closest magnification as the starting aligning preset.

4. Leginon/Presets Manager/Align Presets> Click "Start" to acquire the first image pair.

5. Check, adjust, and save the preset(s) to be aligned.

The left panel displays and navigate by "Stage Position" of the reference preset while the right panel displays and navigate by "Image Shift" of the preset to be aligned

6. Repeat the process if desired.

Go to MSI Operation section

The setup that requires you to be next to the microscope is completed. Go to the section on MSI Operation You can come back and continue on this section after you have learned how to go through the operation without automated hole finding.

Hole Targeting Set-up

We can use any image that is already loaded into Hole Targeting to adjust these parameters. The values in this node vary so much from grid to grid that the best way to find these parameters is by going through a step-by-step trial-and-error process. To see the final acquisition and focus targets, enable only the Original, acquisition, and focus display selections. Refer to Introduction Chapter on how the various tools behave in the control panel.

The loaded image normally comes from the image acquired through "Square" node when you submit targets on the grid atlas in "Square Targeting" node. You can also do a practice run using the default image comes with Leginon. To load the default image, leave the filename entry blank when you click "Load" in the hole finding settings window for the step "Original". The default values in the node gives an example of reasonable target finding with such a default image.

Setting up Hole Targeting Depends on which MSI flavor you are running:

1. MSI-Edge uses template matching of the edge image

2. MSI-T uses template matching of the original image

3. MSI-Raster creates raster points from a given origin

4. MSI-Tomography does not use automatic target finding. Therefore, it does not requires set up.

Exposure Targeting Set-up

Like hole targeting, we can use any image that is already loaded into Exposure Targeting to adjust these parameters. There is also a different default image came with Leginon for your practice.

Setting up Exposure Targeting Depends on which MSI flavor you are running.

1. MSI-Edge uses template matching of the edge image

2. MSI-T uses template matching of the original image

3. MSI-Raster creates raster points from a given origin

4. MSI-Tomography does not use automatic target finding. Therefore, it does not requires set up.

Autofocus Test

There are two focusers in MSI. "Z Focus" node usually moves stage in Z direction to Eucentric height at lower mags. "Focus" node usually just correct the defocus in the way equivalent to turning the focus adjustment knob on the scope at a higher mag. The defocus measurements in both nodes are based on the same principle of beam-tilt induced image shift. A correlation (normally phase) is used to obtain the image shift. Therefore, it is important to test and preform autofocus measurement at area with recognizable feature that does not move significantly during the defocus measurement.

The test use "Manual_after" focus step in the focus sequence for checking. Two procedures can be used to reach a area for good correlation measurements:

1. Using Simulate Target tool

2. Submitting focus target from Hole Targeting

Note: To use this procedure, there has to be a grid mosaic, and the Hole Targeting should allow user verification of targets

Check the performance of autofocus by the following criteria:

1. During autofocusing:

2. During manual focusing

Manual Focusing

Manual Focusing can be activated either by enabling "Manual_before/Manual_after" steps or directly when leginon is idle using (Z) Focus/Toolbar/MF.

< MSI Quick-start | Special Operation setup >



Multi-Scale Imaging Applications in General

  1. Multi-Scale Imaging Concept
  2. Ways of Moving to Targets in Nodes that acquire images inside MSI
  3. Flavors of MSI applications
  4. Summary of MSI applications
  5. Pre-MSI Set-up
  6. Initial MSI application preferences
  7. Special Operation Preference setup
  8. MSI Quick-start
  9. MSI set-up in more details
  10. Special Operation setup
  11. MSI Operation
  12. Optimizing autofocus
  13. Adding a new focus sequence to a focus node
  14. Queuing option
  15. Queuing Example 1 - Exposure Targeting
  16. Queuing Example 2 - Hole Targeting only
  17. Queuing Example 3 - Both Exposure and Hole Targeting
  18. Monitor Progress of Queued Targets
  19. Iterative Navigator Stage Movement

< Leginon "Calibrations" Application | Leginon "MSI-T" Application >



Multi-Scale Imaging Concept

Multi-Scale Imaging (MSI) is the back-bone of many Leginon applications. The setup and
calibrations required for an imaging sequence can be understood better when it is compared to
a low dose mode on a typical electron microscope such as FEI Tecnai.

Low Dose Kit

A typical low dose kit contains three modes: Exposure, Focus, and Search

This figure shows the steps of targeting an object for low dose image collection.
First, move the object (gray star) to the center of the viewing screen in Search Mode
(yellow circle). If properly aligned, then Focus at the set offset radius and angles,
and at last acquire final image at the center in Exposure mode (Red square).

Because of the large difference in magnification, it is often necessary to adjust
the image shift of the Search Mode to achieve proper alignment to Exposure mode.

Setup of the low-dose kit

Although not obvious to everyone, the low dose kit does require set up. These
include:

This figure illustrates the consequence of misalignment of image shift of the lower
magnification Search Mode to the Exposure Mode. The yellow circle represents the field of
the view in the search mode, the gray star an object that the user centers as a target for
final exposure (red square). When the image shift in the Search mode is not aligned to the
exposure, the object centered in the field of the view in Search mode is not centered in
the Exposure mode image. Note that in this case, the image shift offset origin of the two
Focus modes (black) is such that it is aligned with Exposure mode.

Leginon MSI analog of the Low Dose kit

Leginon separates the function of the low dose kit idea into three parts: defining the
presets, choosing Acquisition/Focus targets, and moving to a target on an image.

Low-Dose-Kit Equivalent Presets

The presets in Leginon can be set up like the three modes in the low dose kit with two
exceptions: First, there is only one Focus preset, and second, the focus preset has the
same image shift as the Exposure preset.

Low-Dose-Kit equivalent preset parameters:

Magnification (example): Preset name: Image Shift (x,y):
550 Search Aligned
100000 Focus 0,0*
50000 Exposure 0,0

*Focus Preset is also at image shift (0,0) since the target selected for it is
separated from that for Exposure Preset.

Acquisition and Focus Targets

Leginon users can select more than one type of targets on a single image. For a
low-dose-kit analog, we can define one or many Acquisition targets (used for acquiring
images at Exposure Preset) on an image acquired in the Search Preset. In addition, we
define one Focus target on the same image (for focusing at Focus Preset, of
course).

Because the focus targets can be selected independently from the those for the final
exposure, the image shift for the Focus preset is (0,0) rather than microns away from the
origin. At its current state, Leginon only focus at one position per low mag Search
image.

Moving to the Targets

When a person operates in low-dose mode, he/she finds a target on the image in the
viewing screen and move the stage according to its relative position to the viewing screen
to reach the target, i.e., center the target on the screen in Search mode. Leginon moves
to the targets using a similar logic. When a target is selected from an image acquired
using the Search Preset in Leginon, in order to acquire a new image in Focus or Exposure
mode at this target, the program move the target relative to the center of the CCD
detector using the knowledge (i.e., calibrations) of the Search Preset at which the old
image is acquired, not that of the Focus or Exposure Preset with which the new image will
be acquired.

This four paneled figure shows how Leginon performs a low-dose kit type of image acquisition
sequence where the focus target (blue) is first moved to the center of the CCD and then
the exposure target(green). Compare this with the one on low dose
kit
.

As a consequence, let's say that we decide to move to the target by moving the stage,
we will want the Exposure node to use the following settings: Preset-Exposure; Move
Type-Stage. However, the required stage position matrix calibration is at that of the
Search Preset.

Setup of the Presets in a low-dose equivalent MSI

Set up of the presets is therefore not very different from that for the low dose
kit.

Calibrations required

For the above imaging sequence, the calibration requirements with manual focusing and
target selection are


Ways of Moving to Targets in Nodes that acquire images inside MSI >



Navigator

The Navigator node is quite useful because it allows the user to test many of the calibrations that have been completed, such as image shift, beam shift, stage position, modeled stage position, and dose measurements (indirectly). Additionally, Navigator could be used to simply navigate across the grid in the microscope using Leginon calibrations and
acquire images directly. A iterative stage movement requested by Acquisition Node Class is also possible.

Required bindings to use preset instrument configuration set by presets manager:

PresetsManagerNode - (PresetChangedEvent) -> NavigatorNode

Required bindings to use Navigator to move to a target (iteratively) by Aquisition node class:

AcquisitionNode - (MoveToTargetEvent) -> NavigatorNode

Navigate using a calibration

A particular calibration, "stage position, image shift, modeled stage position, or beam shift," can be chosen to navigate across the grid (or the current image in Navigator). The "beam shift" calibration will center the beam. While using the "beam shift" TEM parameter option, try to double click towards the center of the beam (that is displayed in the CCD imaging area). The new image will try to center the beam around the point where the mouse was double clicked.

Iterative Move Navigation

Navigation, especially navigation by stage position movement, has error that is larger at larger moving distance. Therefore, the accuracy of the navigation by stage movement can be improved by multiple moves. By specifying the tolerance of the navigation error, Leginon can achieve more accurate navigation. This feature is activated by giving a non-zero value for "Move to within xx m of clicked position" within Navigator for direct click-and-move or from an Acquisition node class that uses Navigator as the mover.

Calibration Assessment

Calibration Error Checking can calculate and display how much error there is between the targets that were selected and how accurate the selected calibration moved to that target.

Save and Restore Stage Locations

Save (x, y) stage positions in the Stage Locations section to later revisit the same positions. Keep the From Scope gets X and Y Only check box enabled, otherwise the z will also be recorded (this is most probably not useful for later checking).

Save a new location:

Go to a saved location:

Update / Remove a saved location:

Settings


< Mosaic Target Maker | Pixel Size Calibrator >



Network Configuration

At NRAMM, our microscope, Leginon processing server, Database server, and Webserver are all within the same firewall. We Highly recommend it. If you absolutely can not do it in the same way, here are some information, however, be warned that we might not be able to help you if you are stuck.
  1. Ports used by Leginon
  2. Leginon bulletin board thread on Network problem - Leginon not seeing tecnai host.
  3. An example of working port-forwarding configuration
Troubleshooting network between main leginon processing server and TEM host:
  1. Try to ping TEM host from Leginon host using host name (not IP). If host name does not work, then you need to configure either your DNS server or your /etc/hosts file to know the host name to IP mapping.
  2. Pay attention to whether you need to use the fully qualified name, for example "myhost.scripps.edu" rather than just "myhost". If that is the case, then you must also use the fully qualified name in Leginon when connecting to clients.
  3. Try to ping Leginon host from TEM host. Again, you may need to adjust host name mapping. On Windows, there is "/etc/hosts" but it is located in a strange place: C:\Windows\System32\Drivers\etc\hosts. The first part of that may be slightly different depending on version of Windows.
  4. Start Leginon Client (launcher.py) on TEM host, then try to telnet to it from Leginon processing server
    "telnet temhost 55555" (replace with your hostname)
    If the connection is refused, then you have a firewall blocking connections on TEM host
  5. Try the opposite, running launcher.py on Leginon processing server, and telnet from TEM host. If that fails, then you have a firewall on Leginon processing host that is blocking incoming connections to port 55555
  6. Try test1.py and test2.py as described in bulletin board post above

< Select Linux distribution to use | Where to register and download Leginon >



Network problems

Leginon not seeing the microscope host

Microscope host that
runs Leginon client does not appear in the Launcher list on the Leginon processing
computer

Possible reasons: Testing and Solutions:

For more discussion, see the Leginon forum thread on network problems .


< Test run operation problems | Troubles with Imaging >



New dbemtool Web Tool Features (151)

Hide or exemplify an image in the viewers

Images can be one of the three status: Normal, Hidden, or Exemplar. Clicking on the hide
button above the displayed image where it is available moves the image from its current
list. In other words, to hide an image from any of the normal preset list, click on "hide"
while display a normal image. This image will now display only if "hidden" is selected from
the preset list. Clicking on "hide" above an image displayed in the hidden list removes it
from the "hidden" list and return it back to the normal list. Images put in the "exemplar"
list will also be shown in the normal list.

The mrc images are cached as jpegs in the viewers

The cache system allows faster access to the same image next time.

More options for image display intensity adjustment

You can manually define min/max of the display range in absolute number or relative
percentage, as well as in standard deviation unit based on the statistics of the image. The
manually determined values are saved for individual image displayed in the same panel until
the page is closed.

Queue counter in LOI

It updates the number of unprocessed queue targets and estimate how much time it will
still take to finish them.

Queue deletion tool in 3-way and LOI viewers

Click on this tool<inlinegraphic
fileref="http://ami.scripps.edu/software/leginon/images/images/deq_bt_off.gif"
format="GIF"/> above a displayed image pops up a window where you can remove targets
derived from that and all its descendent images. In other words. if you have put in the
queue targets from 10 holes, each selected from the same square image, you will delete all
theses targets if you perform queue deletion on the square image. Please use this
carefully.

Hole template and 2-way viewers

You can see your custom hole templates saved and used in the past leginon sessions in
the hole template viewer. 2-way viewer gives you a bigger view of the parent images than the
3-way viewer.

Model parameter display in the tomography viewer

The model paramters can be displayed for diagnosis by activating the check box.

Deletion candidate marking in the tomography viewer

The "Mark for deletion" button saves the selected tilt series in the leginon database in
a table that the system administrator can look up and delete from the file server in a later
time.

Appion processing function possible with installation

If you install Appion's processing server programs, the processing tag direct you to its
menu page.


New Project Web Tool Features

Grid entry for Robot Trays (1.1)

This is used to enter grid information for robot trays.

Appion processing database creation (1.2)

This is used to create and link the project to a new database ready for Appion usage.


< Updated Applications (All) | New dbemtool Web Tool Features (1.5.1) >



New User Features

General

Acquisition/Navigator Class

The following applies to an acquisition node that uses the navigator to move to its
target:

BeamFixer Class (New)

Simple beam shift adjustment to correct unstable beam position in long runs.

BeamTiltImager Class (New)

Visual aid to coma-tilt alignment. It is used to acquire images of beam tilt
difractogram tableau. The user can then click at the location of the tableau where he/she
considers as the coma-free and therefore adjust the beam tilt. See Node Description Chapter
for details.

Corrector Class

DriftManager Class

DTFinder Class (New)

Dynamic template finder is developed for tissue section imaging. An initial template is
defined by the user. The subsequent images it receives are then shifted and rotated against
the template to find the best match to the section so that the target selected on the
template can be transferred on to the new image.

FFTMaker Class

GridEntry Class (New)

Direct entry of grid information to Leginon database to organize the data acquired. The
main use is for simple one-pass grid screening of multiple grids when the robot does not
exist.

ImageProcessor Class (New)

Base class for process images of a completed image target list. Mainly used for
development of batch processing of the images acquired such as image stack creation of a
tilt series. An example of its use is in filenames.py.

ManualAcquisition Class

PresetsManager Class

PixelSizeCalibrator Class

Robot2 Class (Replacing Robot)

This class replaces Robot Class in all applications. It commnunicates to grid handling
robot(s) through database. A few default settings are changed to reflect it and also the
more general usage

TargetFilter Class

Tomography Class

TransformManager Class (New)

This class will eventually handle the transformation of an old target to a new one for
reacquisition after shift, tilt, and/or rotation in the grid plane. The current use is to
replace the shift adjustment in Drift Manager. As an option, it can transform targets based
on more than just its parent but all direct ancestors which makes the range of shift it can
handle much larger than the original drift manager implementation.


< pyScope Change | Updated Applications (All) >



New User Features for version 2.0

Graphical User Interface

Targeting Accuracy

Acquisition Node

TargetFinder Node and its subclasses

JAHCFinder Node (used in MSI-T)

Corrector Node

Beam Tilt Calibrator Node

Beam Tilt Imager Node (New)

Tomography Node

MSI-Section3step application


< PyScope Changes | New Web Tool Features >



New User Features 2.1

Film Exposure

DTFinder

FFTMaker

PresetsManager

RasterTargetFilter

TargetFilter

TargetRepeater, Acquisition

TestTargetFinder (New node class)


< PyScope Changes | New Web Tool Features >



New Web Tool Features for Version 2.0

User login feature

User login is designed to improve user experience when many users and many experiments are run and processed by Leginon and Appion. When the feature is activated, the user will see only projects belong to them unless he/she belongs to the administrator group. It is not required, but certain steps need to be taken if it is turned on later.

See User_Management

FFT resolution measurement tool

  1. available in the map pop up accessable by clicking on the image in any image viewer.

< New User Features > | Bug Fixes >



New Web Tool Features

Display of resolution ring in the power spectrum

Option for display power spectrum


< New User Features > | Bug Fixes >



Next Steps

Perform Administration Setup

See Next chapter on Administration Tools.

Create a test project

See the chapter on Using Project Management Tools.

Perform Microscope Setup and Test run

See the chapter on Start Leginon.


< Installation on the microscope computer | Backup Practices >



Node Descriptions

  1. Acquisition
  2. BeamFixer
  3. Beam Tilt Calibrator
  4. Beam Tilt Imager
  5. Click Target Finder
  6. Corrector
  7. Dose Calibrator
  8. Drift Manager
  9. The EM node
  10. FFT Maker
  11. Focuser
  12. Gon Modeler
  13. Hole Finder
  14. Hole Depth
  15. JAHC Hole Finder (Template Hole Finder)
  16. Manual Acquisition
  17. Matlab Target Finder
  18. Matrix Calibrator
  19. Mosaic Click Target Finder
  20. Mosaic Target Maker
  21. Navigator
  22. Pixel Size Calibrator
  23. Presets Manager
  24. Raster Finder
  25. Raster Filter
  26. RCT
  27. Robot
  28. RobotAtlasTargetFinder
  29. Tomography
  30. Transform Manager

< Preferences Setup | Create and Edit Applications >



Operation

Enter Grid Information through Project Web Form

  1. Go to http://your_host/myamiweb/project/project.php on a web browser.
  2. Select the Grid Tray Panel.
  3. Click on upload grids/tray

Set up robot and grids in its tray matching your entry

Leginon does not know if you switch grids and pretend!

Start Leginon

1st Pass Screening

  1. Starting node is the Robot node
  2. Enter in the settings the stage z value that will give the approximate eucentric height for the holder used.
  3. Select the robot tray
  4. Select grids in the Robot node and click "Start". You might need to click "Continue". too. It is a bug that is hard to remove without causing other problems. Right click removes a selection. Middle click displays the selected grid label
    The grids are imaged in the order of the grid selection.
  5. Activate user verification in "Square Targeting" and "Mid Mag Survey Targeting" nodes
  6. Use the first grid to optimize square finding and raster sizing and angles and then remove the user verification for full automation.

Evaluation

  1. Start the application under the same Leginon session. Microscope and robot not required by this application.
  2. Choose "hl" or "sq" preset as the child and "gr" preset as ancestor.
  3. Click next to get the first image.
  4. Choose targets and then click on "Transform" tool.
    Do not forget to transform if you modify the targets.
  5. Continue to "next" image until at the end.
  6. Select targets at the other child preset, too.

2nd Pass Screening


< Summary of these applications | Grid Registration >



Optimizing Autofocus

Focus, Z Focus, tomo Focus and other variation of focus nodes use the same Focus class but with different settings, focus sequence and position in the MSI sequence to achieve different effects. Each need to be optimized for your instrument and usage. The defaults we provide works for us but an understanding of how it works can help you having the smoothest run and getting the best data.

Node Name Found in Application Prerequisite Performance Target
Z Focus all MSI visible area on the grid grid almost at eucentric height, defocus zero is no more than what Focus node can handle
Focus most MSI grid almost at eucentric height to allow using only defocus to make correction without significant beam shift defocus zero is reset to within acceptable tolerance for final exposure
Tomo Focus MSI-Tomography grid close to eucentric height, defocus zero is at eucentric height grid is accurately set at eucentric height

What you should see during autofocus by beam tilt:

Here is an 512x512 example image pair acquired in Focus node at 0.14 nm/pixel at beam tilt separated by 0.8 mrad and -300 nm defocus:
focus1 image focus2 image

At Focus node of your MSI application, you can watch their display. Make sure that the beam has not shifted off the view (an indication of bad Beam Tilt Pivot Point Alignment) and the contrast does not reverse (Objective aperture not centered or too small for the beam tilt applied).

In the same node, you can make it display the correlation by selecting the display panel on the left of the image like this:

The correlation map shown in Leginon has origin (identical image correlation) at top left corner and is wrapped around so that peaks close to all corners means smaller shift than peaks close to the center of the correlation map. In this example, phase correlation is used, and focus2 is shifted from focus1 to the top-left by a distance of about 1/15 of the image. Therefore, we see a peak at bottom-right. and the phase correlation peak is sharp with flat background.

You may notice that the peak is elongated and have modulation around it. This is caused by the coma effect of the beam tilt. The coma effect changes the apparent defocus and astigmation so that the two images are not related only by a shift.

If you turn on also the Peak display, you can determine if the peak finding has correctly identify the maximal peak of the correlation map.

Optimizing the parameters for beam-tilt based defocus measurement:

In general, larger beam tilt and smaller pixel size give better accuracy of defocus measurement, and therefore autofocusing result. However, beam tilt coma-effect and the limitation of the objective aperture size, and the stability of the beam shift during the beam tilt process often determines the limit toward this end. On the other end, smaller beam tilt and larger imaging area both in number of pixels and in physical units give larger range of measurable defocus, and hence the range the correction can be made reliably.

For example, if you require an eucentric defocus accuracy of 0.1 micron while being able to handle an starting error of 500 micron. This is unlikely to be achieved in one focus sequence step.

Displacement of image, d, at defocus z as induced by a beam tilt of a is given approximately,

d = Cs * a^3 + z * a

where Cs is the spherical aberration constant. Two different defocus z1 and z2 would therefore see a difference in d as

d1-d2 = (z1-z2) * a

To tell a difference, the pixel size of the image need to be smaller than the displacement (d1-d2). Let's say that the beam tilt is limited by the objective aperture to have a maximal value of 0.01 radian, this means the pixel size to reach the autofocusing accuracy of 0.1 um will be 1 nm. A reliable image shift measurement is limited by other coma-effect and is in about 1/4 of the image from our experience. Therefore, the range of defocus it can handle is 1000 x 0.1 micron = 100 micron if 4kx4k image is used. Unfortunately, image processing of 4kx4k image is too slow still, so you are likely use 1kx1k with binned pixel to be 1 nm. As a result, the range of defocus this can handle is now 250 x 0.1 micron = 25 micron.

An additional consideration is the stability of the optics. If you use only the defocus correction to correct for 300 micron error, the scope alignment is unlikely stay optimal which is why Z Focus node pirmarily does adjustment of z height to move the stage to a range that is close to the eucentric heigh where scope alignment is performed. Furthermore, there are stronger defocus hysteresis if the magnification used in the adjacent focus sequence is very different.

To achieve the example requirement, you will need to do it in two steps if you are using 0.01 radian beam tilt:

  1. In Z Focus node, measure at 20 nm binned pixel of an (1kx1k binned by 4) image and make the correction by stage movement. This will ideally bring you to 2 micron of focus.
  2. In Focus node, measure at 1 nm binned pixel and make the correction by defocus adjustment.

If there is strong defocus hysteresis problem, you may add an intermediate autofocus step in either node to reduce the error in the final step.

Optimizing the fit limit for autofocus by beam-tilt:

There are more data than variable when we measure the image shift induced by beam-tilt to determine the defocus. Therefore, as a fitting residual can be calculated from the fit. If the residual is large, it indicates that the peak positions determined from correlating the two beam-tilted images are not reliable.

However, the fit residual is not normalized. Therefore, the value we set as the default limit in the focus step may not work if the preset pixel size and beam tilt values are very different from at NRAMM. The easiest way for find the proper fit residual limit is to perform autofocusing a few times, if the shift peaks as shown in the earlier part of this page looks good but its fit residual exceeds the fit limit you assigned, raise the fit limit in the autofocus step. Give it enough room for error but not to allow anything to get through the threshold because if you let random peaks go through the fit limit, it might want to change defocus by 1 meter when the focusing area is blank.


< MSI Operation | Adding a new focus sequence to a focus node >



Other special preference set-up

Defaults set by Administrator are listed in the chapter regarding Initial MSI application preference setup.


< Raster Generation node set-up | Tips on Operation >



Pausing and Aborting during data collection

Users may need to pause leginon data collection when filling cryo-stage and cold trap or making adjustment to image or beam shift of a preset or even perform certain microscopy alignment. Pausing is possible when leginon is waiting for user input at target finder level. Alternatively, pausing can be made in any acquisition node with the pause tool.

The pause tool (as well as the abort tool), when clicked, does not interrupt acquisition until the next possible point that is at the end of an acquisition sequence for a target. When the play tool is clicked at a later point of time, leginon should move the stage and image shift to that defined by the next image. Here are some examples of the valid pausing
points.

Currently, you can not pause at the following points:

Pausing in MSI application

For those using MSI-type of application, we recommand the following pausing point:

Case 1: Exposure Targets are NOT queued

Case 2: Exposure Targets are queued

Abort Targets already submitted

See http://ami.scripps.edu/redmine/boards/6/topics/146#message-187


< Do and Do Not in leginon | General operation problems >



Perform system check

In addition to the downloads from our svn repository, there are several other requirements that you will get either from your OS installation source, or from its respective website. The system check in the Leginon package checks your system to see if you already have these requirements.

cd myami/leginon/ 
python syscheck.py

If python is not installed, this, of course will not run. If you see any lines like "*** Failed...", then you have something missing. Otherwise, everything should result in "OK".


< Download Appion/Leginon Files | Install Leginon Packages >



Pixel Size Calibration

Pixel Size Calibration allows entry and simple extrapolation of pixel size values for various magnifications. The entry value should be calculated in (m/pixel). Enter pixel size for all the magnifications that will be used. Extrapolation can be used to enter the pixel sizes for magnifications that have not been calibrated at the microscope with a standard specimen, such as catalase crystals.

Confirm the camera settings by taking a test image with a preset sent to scope or set in the settings as described in Calibration without presets

Enter a known pixel size

  1. Leginon/Pixel Size/Toolbar> Click the Calibrate button .
     
  2. Leginon/Pixel Size/Pixel Size Calibration> Highlight the desired magnification and click Edit.
     
  3. Leginon/Pixel Size/Pixel Size Calibration/Edit Pixel Size> Enter the pixel size in m/pixel.
     
  4. Leginon/Pixel Size/Pixel Size Calibration/Edit Pixel Size> Enter a comment to describe how this pixel size was determined.
     
  5. Leginon/Pixel Size/Pixel Size Calibration/Edit Pixel Size> Click Save
     
  6. Leginon/Pixel Size/Pixel Size Calibration> Click Done

Extrapolate a pixel size

  1. Leginon/Pixel Size/Toolbar> Click the Calibrate button .
     
  2. Leginon/Pixel Size/Pixel Size Calibration> Highlight 1 or more magnifications to extrapolate the new mag. pixel size from.
     
  3. Leginon/Pixel Size/Pixel Size Calibration> Click Extrapolate
     
  4. Leginon/Pixel Size/Pixel Size Calibration/Extrapolate Pixel Size> Highlight the desired magnification to extrapolate the pixel size for.
     
  5. Leginon/Pixel Size/Pixel Size Calibration/Extrapolate Pixel Size> Enter a comment to describe how the new size was determined.
     
  6. Leginon/Pixel Size/Pixel Size Calibration/Extrapolate Pixel Size> Click Extrapolate and Save
     
  7. Leginon/Pixel Size/Pixel Size Calibration> Click Done
     
    Pixel Calibration Need for the Example MSI:
     
    Preset magnification
    gr 120
    sq 550
    hl 5000
    fc,fa,en,ef 50000

Acquire images of a standard crystal and calculate the pixel size from distance between the diffraction spots

  1. TEM>Insert the standard crystal such as catalase, aligned to eucentric height, and centerred on a well ordered area at 0.5-2 um. defocus.
     
  2. Leginon/Pixel Size/Toolbar> Click the Acquire button . The power spectrum of the image will be displayed.
     
  3. Leginon/Pixel Size/Toolbar> Click on the Measure button if several orders of diffractions can be seen.
     
  4. Leginon/Pixel Size/Pixel Size Measurement> Enter the lattice parameters of the crystal. The default is that of catalase.
     
  5. Leginon/Pixel Size/Panel> Use the ruler tool to measure the distance of two well-separated diffraction spots.
     
  6. Leginon/Pixel Size/Pixel Size Measurement> Enter the Miller indices of the spots and the distance measured in pixels on the spectrum.
     
  7. Leginon/Pixel Size/Pixel Size Measurement> Click on "Calculate Pixel Size". The result is shown below.
     
  8. repeat 5-7 on other pairs of spots or repeat the measurement. Alternatively, go to another crystal and repeat 2. (There is no need to close the settings window. The values calculate will stay until the TEM magnification of the image has changed.
     
  9. Leginon/Pixel Size/Pixel Size Measurement> Select from the pixel size calculated so far by highlighting them for averaging and save to database with a click on "Save Averaged Pixel Size From Selected".
     
  10. Leginon/Pixel Size/Pixel Size Measurement> Click Done

< Calibration without presets | Bright and Dark reference images >



Pixel Size Calibrator

At the moment Pixel Size Calibrator is only for inputting and extrapolating pixel size calibrations of the instrument. Noe real calibration is made. However, the instrument configuration applies as other calibrator nodes.

Required bindings to use preset instrument configuration set by presets manager:

PresetsManagerNode - (PresetChangedEvent) -> BeamTiltCalibratorNode

Settings


< Navigator | Presets Manager >



Ports used by Leginon

This information is useful if you want to open specific ports between computers with a
firewall in between.

There is no strict port assignment since we could potentially have more than one
Leginon process running on the same linux host talking to different TEM hosts. It is
probably good enough if you only worry about opening up the first few of those ports in
your firewall (maybe 49152 through 49160, or something like that).

See more discussion at Leginon bulletin board thread on Network problem - Leginon not seeing tecnai host.


Go up



Possible Computer Set-up Configurations

Computer(s) used for the whole Leginon system need to support five functions:
  1. TEM/Camera control and data output (by python-side packages of Leginon
    system)
    Note: The computer attached to the microscope/camera is used for this function. Therefore, it is on a Windows computer.
  2. General Leginon operation such as target selection and image processing (processing
    server of Leginon system)
  3. Image data storage.
  4. Other meta-data storage through MySQL database (by database server of Leginon
    system)
  5. Web server (using PHP-side of Leginon system).
    Important: The MRC module that is used to load mrc formatted files to the web pages is not compiled on Windows. Therefore, this function must be on a linux box unless you don't need to see the images.

The five functions can be distributed to five different computers on a network or all on
one single computer (with web server not viewing the images). However, since the latter minimal setup requires the use of the computer
attached to the microscope and digital camera for all functions, it is not advisable.

Processing server of Leginion is a multi-platform software, meaning it can run on both
Microsoft Windows and Linux, although we and others have found that Windows have trouble managing its memory for such a demanding task. MySQL used in the database server is also supported by multiple platforms. This is
not true for the Web server because the custom php-MRC module used in the web viewer only compiles
on linux machines. Therefore, one of the computer not part of the microscope/camera control must be a linux.
The following examples show several arrangements that take advantage of distributed system.
Other combinations are possible, but will basically be variations on one of the following
themes.

See special notes on Using Leginon on a system where the microscope and camera are controlled by different computers if it applies to you.

Configuration A

On the microscope/camera computer(s):

On the Linux computer:

Configuration B

One or more Windows computers that control the microscope and your digital camera ; 4 Linux computers (one for
each function) (Good for multiple microsopes, users and large-scale acquisition)

This is the set-up at NRAMM. It has the processing server side of Leginon installed on
the Windows computer attached to the microscope and on the Linux computer that is used for
running Leginon. A second Linux machine is dedicated to the database while the web-based
viewer is hosted by another server.

The data storage may be on one of these computers that is accessable by the web and the processing
computers.

See also Minimum_Requirements_and_current_NRAMM_setup

< What is in this Chapter | What Linux distribution should be used? >



Error executing the include macro (Page not found)


< Install phpMyAdmin



Pre-MSI Set-up

Design Presets

To start your own MSI experiment, you must decide what presets you want to use. Presets are used to define scope and camera parameters with which images are acquired.

MSI presets can be customized to your need of data collection. By matching nodes/subnodes in MSI with presets and move types, the behavior of the node is
defined.

For easy reference, preset names in MSI has been standardized at NRAMM although there is no reason they have to be called in the way they are now. They are abbreviated to 2 letter codes to reduce the length of the filenames that contains every preset used in its family history.

Example MSI preset nomenclature:

Preset name: abbrev for: in the context of:
gr grid em grid
sq square em grid square
hl hole quantifoil hole
fc focus focus image to be checked with fft
fa focus-auto automatic focusing
en exposure-near close-to-zero defocus exposure image in a focal pair
ef exposure-far far-from-zero defocus exposure image in a focal pair

Example MSI preset parameters (based on 120 or 200 kV high tension, 100 um C2 aperture and 100 um objective aperture on a 4k ccd with pixel size at 1.6 angstrom at scope nominal magnification of 50,000x):

Magnification: Preset name: Image Shift (x,y): Dimension: Binning: Beam Coverage: Exposure Time (ms): Spot Size: Defocus (m):
120 gr Aligned 512 8 max 20 4 0.0
550 sq Aligned 1024 4 1x CCD size 100 4 -2e-3
5000 hl Aligned 512 8 1x CCD 20 4 -1.5e-4
50000 fc 0,0 512 1 <~ 1x CCD 300 4 -2e-6
50000 fa 0,0 1024 4 >2x CCD 50 4 -2e-6
50000 en 0,0 4096 1 2x CCD 170 (10e/A^2) 4 -1e-6
50000 ef 0,0 4096 1 2x CCD 170 (10e/A^2) 4 -2e-6

The preset parameters in this example are chosen to give the following properties:

In designing your own preset, follow the above properties using a mag that gives the required coverage with your scope, camera, and grid mesh. If you have a 2k or 1k camera, binning may not be as necessary as for a 4k camera whose data acquisition time is 10-30 sec without binning.

Another Recent Preset Design Example (Aiming for better than 5 A resolution, although not yet proven)

Tecnai F20 200 kV high tension, Gun Lens 3 extraction voltage 4300, 50 um C2 aperture and 100 um objective aperture (except when obtaining grid atlas).
Camera is a 4k ccd with pixel size at 1.6 angstrom at scope nominal magnification of 50,000x):

Magnification: Preset name: Image Shift (x,y): Dimension: Binning: Beam Coverage: Exposure Time (ms): Dose (e/A^2): Spot Size: Defocus (m): C2 (um):
120 gr Aligned 512 8 max 20 n/a 4 0.0 100
1700 sq Aligned 1024 4 1x CCD size 10 n/a 4 -2e-4 50
5000 hl Aligned 1024 4 1x CCD 7 0.004 4 -1.5e-4 50
100000 fc 0,0 512 2 <~ 1x CCD 200 164 4 -2.9e-7 50
100000 fa 0,0 1024 4 ~4x CCD 50 2.5 4 -1.5e-6 50
100000 en 0,0 4096 1 1.3 um on the specimen 407 20 4 (-1e-6 to -2e-6) 50
29000 ed 0,0 3kx4k 1 1.3 um on the specimen 407 20 4 (-1e-6 to -2e-6) 50

Calibrations

If this is the first time calibrations have ever been completed for Leginon, complete all the calibrations listed in the chapter on calibrations. Calibrations are extremely important to operate the TEM in a consistent manner. As long as the calibrations are stable, later users do not need to perform them. Most calibrations are HT and magnification dependent. Therefore, new calibration may be required if your presets use different HT and/or magnification from all previous users.


< Summary of MSI applications | Initial MSI application preferences >



Preferences Setup

  1. Initial MSI application preference setup
  2. MSI-Tomography Preferences
  3. Robot MSI-Section preference set-up

< Trouble shooting | Node Descriptions >



Preparation before Using v2.x Routinely

Don't forget to perform TEM_Scripting_Beam_Tilt_Calibration for your FEI microscope

Import new applications from your myamiweb administration page if desired.

Start Leginon and reacquire all gain references.

If you have chosen to enable the myamiweb login feature during web server upgrade, you have to go through the following steps to make it usable to individual Leginon user in the way you specified:

  1. Go to http://yourhost/myamiweb page
  2. Log in as administrator. As default during the upgrade, a password identical to the username was temporarily assigned so that you can login.
  3. Change the user profile of the administrator and change the password so that it is not so obvious.
  4. Check profile of each Leginon user group at 'http://yourhost/myamiweb/addgroup.php'. Add groups and/or reassign group privilege if desired.
  5. Check profile of each Leginon user at 'http://yourhost/myamiweb/user.php'. Reassign to a different group if desired.
  6. Click on the project icon to go to project management tool page
  7. For each existing project, click on the project name to Edit an existing project
    1. Click on the Edit link besides the owner list to add new owners for the project.
    2. For each user who does not belong to a group with administrator privilege but requires access to the particular project, add he/she as an owner.
    3. Return to project summary page by clicking on "View Project" icon
  8. Have each Leginon user log in to http://yourhost/myamiweb and add their e-mail address to his/her profile and modify the password to something better than the default. The password in the database is encrypted. The e-mail address is used to send the user his/her forgotten password.

< How to Update from v1.6 (Microscope Windows Computer)



Presets for MSI-RCT applications

The main difference between MSI-RCT applications and other MSI's is that a low
magnification image is needed for the target transformation algorithm to reliably find
features to match between tilts. Two strategies has be used with success.

1st strategy:

The sq preset is set at a magnification in the HM mode so that hysteresis is minimized.
and the hl preset is eliminated The "sq" preset is used both at "Square" and "Centered
Square" nodes.

Presets and Magnification for a typical MSI-RCT

Preset magnification defocus (m)
gr 120 0
sq 1700 -2.5e-4
fc,fa,en 50000 (what you need)

2nd strategy:

The sq preset is set at the usual LM magnification. The hl preset is set at the low end
of HM mode. The "sq" preset is at "Square" node and "hl" preset is used at "Centered Square"
nodes.

Presets and Magnification for a typical MSI-RCT

Preset magnification defocus (m)
gr 120 0
sq 550 -2e-3
hl 1700 -2.5e-4
fc,fa,en 50000 (what you need)

< RCT node set-up | RCT calibration need >



Presets Manager

Configuring the Presets can be critical to many different applications. Presets describe camera configurations such as image size and exposure time as well as many other microscope parameters such as magnification and defocus. Different nodes can use these predefined presets to change conditions of the microscope and CCD.

Required bindings for using preset image shift alignment tool:

Presets Manager - (MoveToTargetEvent) -> NavigatorNode

Required bindings for using presets in any acquisition class (including focuser) of nodes:

AcquisitionNodeAlias - (ChangePresetEvent) -> Presets Manager
Presets Manager - (PresetChangedEvent) -> AcquisitionNodeAlias

Required bindings for nodes that can use preset instrument configuration set by presets manager:

PresetsManagerNode - (PresetChangedEvent) -> Node

Required bindings for auto dose measurement as initiated by MSI-Tomography:

TomographyNode - (MeasureDosePublishEvent) -> MeasureDoseNodeAlias
MeasureDoseNodeAlias - (ChangePresetEvent) -> Presets Manager

Available functions

Settings - Movement

Settings - Cycle

Hysteresis of image and beam shift is experienced everyday when using the microscope. This general hysteresis affects many Leginon calibrations. Keeping current in the lenses, particularly the objective lens, has been seen to help reduce the effects of this hysteresis. Likewise, stepping through magnifications in a fixed order (low to highest to low to highest etc.) has been empirically helped reducing the hysteresis effects.

It is highly recommended to leave the first two check boxes in this section (Leginon/Presets Manager/Settings) enabled. Cycle Magnification Only should be checked if the hysteresis from changing beam intensity is negligible.

Presets Selector and Cycle Order List

Sending Presets to the microscope

Adjusting Presets at the microscope

Acquistion / Dose Image

This section is used to acquire a "Dose Image" and calculate the electron dose per area on the specimen at the current preset using the averaged intensity of the image and various calibrations. The dose value is then updated in the database for the current preset. To acquire a dose image, no object must obstruct the path of the electron beam.

The dose calculated by this function relies on the camera sensitivity calibration obtained in the Dosecal node as well as the pixel size calibration. The result of the calibration is CCD sensitivity value that converts number of electrons to camera signal count (i.e. intensity).
With both information, the average CCD intensity of the Dose Image acquired through the Presets Manager can be used to calculate the dose in unit of electrons per angstrum. Change of preset scope parameters will reset the dose value.

Removing a Preset

Align Presets To Each Other

To align presets by image shift, first a global reference is chosen. The global reference serves two purposes. First as the parking preset that the scope returns to after acquiring images at various mags. Second as the preset for initial alignment. The automatic sequence centered at the magnification of the global reference First it aligns pairs of
magnification towards higher and higher magnification for those at higher magnification than the global reference and then toward lower and lower magnification for those at lower magnification than the global reference.

For each magnification, a preset is automatically chosen to be used in the alignment and is displayed in the window. The left panel displays the reference preset and the right panel displays the preset to be aligned. Navigate on the reference image moves the stage while navigate on the align image moves image shift.

The image shift is saved at each move to the specified preset but not other presets of the same magnification until "continue" is clicked.

To switch to custom alignment between arbitrary presets, change the preset assigned for either panel when the window is first open.

Create Presets from the current Session

Import Presets from a previous Session

Calibration Status

This section may prove to be very useful to troubleshoot calibration problems. Over time, certain calibrations may need to be repeated. This section will display the latest calibrations that were completed for the settings the current preset has and when they were completed.

If a new presets needs to be created. Then after creating the new preset, check this section to see which calibrations the new preset will need to be completed.

Parameters-Instruments

Select the instruments available on the scope client

CCD settings

Microscope settings

Film settings

An exposure onto film can be done instead of acquiring an image with the CCD. To acquire an image onto film, simply enable the "film" checkbox:

Energy Filter settings

If EFTEM is on, and if "Energe Filtered" is checked, the energy filter will be set to a width of the specified value when the preset is sent to the scope


< Pixel Size Calibrator | Raster Finder >



Processing Server Installation

  1. Install supporting packages
  2. Download Appion/Leginon Files
  3. Perform system check
  4. Install Appion/Leginon Packages
  5. Configure leginon.cfg
  6. Configure sinedon.cfg
  7. Configure .appion.cfg


< File Server Setup Considerations | Web Server Installation >



PyScope Change

With increasing number of instrument conflict, a configuration file is now required to
specify the instrument available on a host.


New User Features >



PyScope Changes


New User Features >



PyScope Changes 2.1

instruments.cfg is no longer included in the download

Script for checking beam tilt scale is included.

New cameras supported:


New User Features >



Queuing Example 1 - Exposure Targeting

Queuing targets for Exposure node is used when a large number of exposure images need to be acquired and immediate need of evaluation is required only up to intermediate mag of Hole images. One example for such data collection mode is during high throughput single particle data acquisition.

Configuration

Use the configuration for MSI until queuing is about to be used.

1. /Square/Toolbar/Setup/Wait for a node to process image = yes (as in depth-first MSI).

2. /Hole Targeting/Toolbar/Setup/Queue up targets=no (as in depth-first MSI).

3. /Hole/Toolbar/Setup/Wait for a node to process image = yes or no

yes: Pro-It won't cause problem if you forget to change this when you decide not to use queuing later. Con-Time is wasted while holefinder picks targets. (recommended)

no: Pro-It saves some time by acquiring images while holefinder and YOU are picking targets. Con-If you forget to switch it back on when you decide not to use queue later, many things can go wrong, starting from nodes competing for the microscope

4. /Exposure Targeting/Toolbar/Setup/Queue up targets=yes.

"Declare drift when queue is submitted" is optional but recommended. Use it if accurate targeting is required. The time required to finish target will be longer.

5. /Exposure Targeting/Toolbar/Setup/Declare drift when queue is submitted=yes.

You may leave it off if you do not require acturate targeting (>0.5 um). The time
required to finish target will be longer with the option on.

6. /Z Focus/Focus Sequence/Manual_after Enable=yes (optional but highly recommended because further z height adjustment in Focus node affects only the current hole in queuing mode)

Operation

1. Select square targets on grid atlas and submit as usual.

2. One sq image will be acquired and then "Hole Targeting" finds the targets on the sq image.

3. If user verification is turned on in "Hole Targeting", the targets should be submitted using "submit" tool.

4. The Z focus target will be processed first and the grid U-centered at the square.

5. Check if the grid is at U-center height in manual focus window. Note that you won't see nice Thon rings because the preset is "hl"

6. All hl images from the sq images will be acquired while "Exposure Targeting" finds the targets on each hl image if waiting in "Hole" node is off. Note that since the "Hole" node acquires images continuously, both hole finding and acquisition may compete for processing and memory time. If it affects your interaction with the program, just wait for the acquisition to complete.

7. If user verification is turned on in "Exposure Targeting", the targets should be submitted using "submit" tool.

8. You may refresh atlas in "Square Targeting" and repeat the above steps to add more targets to the queue.

9. The Queue is processed only when "Submit Queued Target" icon is clicked.

****Important: You should only do Submit Queued Target when leginon IS DONE acquiring image if there is no waiting on "Hole". Otherwise, the "Hole" and "Exposure" nodes may compete for the microscope and you can have images with the wrong magnification.

Interruption

Hole and Square acquisitions are paused and aborted as usual.

Once the queue is submitted there are several modes of interruption:

1. If leginon crashes during queue processing, the data queue acquisition can be resumed by "Submit Queued Target" in "Exposure Targeting" node.

2. Queued targets can be paused in "Exposure" node with the "pause" button and is the recommanded pausing point for the liquid nitrogen refill of the side-entry cryo stage.

3. The "Abort" button in "Exposure" node aborts the acquisition of the remaining targets from the same parent "hl" image and proceeds to process targets from next hole in the queue.

4. The "Abort Queue" button in "Exposure" node aborts all remaining targets in the queue.

5. If you want to pause queue processing and switch to depth-first mode temporarily, and then continue the queue processing, do the following:

6. Since the queued targets first reverts to its parent image stage position (including stage Z), you CAN NOT rescue bad U-centric height adjustment once the queue is submitted. You will have to abort the targets from the same square and hope the next square works.

7. You can still change image shift, beam shift, exposure time of the presets during queue processing. Again, pause the queue and first send the problem preset to scope before making adjustment. You are warmed that the current location will be sacrificed during this process if the sample is exposed to the beam during your adjustment.

Adding more targets to the queue

It is possible to add more targets to the queue even when the queue is still being processed. The reason is that "Submit Queued Target" really only signals that there are new targets updated to the queue that is to be processed.

1. Pause in "Exposure" node with the "pause" button and is the recommended pausing point for the liquid nitrogen refill of the side-entry cryo stage.

2. Go to "Square Targeting" node, submit more square targets.

3. Go to "Hole Targeting" node, submit more hole and z-focus targets as the images come in.

4. Go to "Exposure Targeting", submit to the queue more exposure and focus targets as the images

5. When you have enough targets, click on "Submit Queued Target" icon in "Exposure Targeting".

6. Go back to "Exposure", click on to continue data acquisition.


< Queuing option | Queuing Example 2 - Hole Targeting only >



Queuing Example 2 - Hole Targeting only

Queuing in "Hole Targeting" is useful when rare objects can be identified at "sq" preset and a quick survey of the grid is desirable before acquiring images at higher mags. An example for such a situation is for data acquisition of 2D crystals.

Configuration

1. /Square/Toolbar/Setup/Wait for a node to process image = yes or no

yes: Pro-won't cause problem if you forget to change this when you decide not to use queuing later. Con-time wasted while holefinder is picking targets.

no: Pro-saves some time by acquiring images while holefinder and YOU are picking targets. Con-if you forget to switch it back on when you decide not to use queue later, many things can go wrong, starting from nodes competing for the microscope

2. /Hole Targeting/Toolbar/Setup/Queue up targets=yes.

"Declare drift when queue is submitted" is not necessary because Z focus, which is the first targets for each square parent image will cause a drift declare of its own.

3. /Hole/Toolbar/Setup/Wait for a node to process image = yes (as in MSI depth-first mode).

4. /Exposure Targeting/Toolbar/Setup/Queue up targets=no (as in MSI depth-first mode).

Operation

1. Select square targets on grid atlas and submit as usual.

2. All sq images will be acquired while "Hole Targeting" finds the targets on each sq image if waiting in "Square" node is off. Note that since the square node acquires images continuously, both hole finding and acquisition may compete for processing and memory time. If it affects your interaction with the program, just wait for the acquisition to complete.

3. If you have just acquired many (such as 50) sq images in LM mode, the microscope has stayed in LM for a long time. It is advisable to set the instrument to one of the preset in HM mode as soon as the acquisitions are completed and check for possible image shift inconsistency between presets.

4. If user verification is turned on in "Hole Targeting", the targets should be submitted using "submit" tool.

5. The Queue is submitted and processed only when "Submit Queued Target" tool is clicked.

6. Since queuing is not turned on at "Hole" and "Exposure Targeting" in this case, the data acquisition is ordered as in depth-first mode so that the exposure/focus targets on a hole are acquired before the next hole.

7. In case when leginon crashes during queue processing, the data acquisition should be resumed by "Submit Queued Target" in "Hole Targeting" node.

Interruption

Once the queue is submitted there are several modes of interruption:

1. If leginon crashes during queue processing, the data queue acquisition can be resumed by "Submit Queued Target" in "Hole Targeting" node.

2. Exposure targets are paused and aborted as usual.

3. Queued targets can be paused in "Hole" node with "pause" button and is recommanded for the liquid nitrogen refill of the side-entry cryo stage.

4. The "Abort" button in "Hole" node aborts the acquisition of the remaining targets from the same parent "hl" image and proceeds to process targets from next square in the queue.

5. The "Abort Queue" button in "Hole" node aborts all remaining targets in the queue.

6. If you want to pause queue processing and switch to depth-first mode temporarily, and then continue the queue processing, do the following:

7. Since Z focus is performed as the first target in the queue from individual square and there is no more z reverting for other holes in the square, you can rescue bad U-centric height adjustment during "Hole" and "Exposure" acquisition as in the full depth-first mode.


< Queuing Example 1 - Exposure Targeting | Queuing Example 3 - Both Exposure and Hole Targeting >



Queuing Example 3 - Both Exposure and Hole Targeting

MSI-Tomography application is an example of such queuing set up. It is also the useful
when energy filter is used. It is chosen so that the microscope stays at the same presets as
long as possible to obtain all the images so that LM preset sq will not need to be used once
tomography data collection starts.

Configuration

1. /Square/Toolbar/Setup/Wait for a node to process image = no

The "no" setting saves time by acquiring images while holefinder and YOU are picking targets.

2. /Hole Targeting/Toolbar/Setup/Queue up targets = yes.

3. /Hole Targeting/Toolbar/Setup/Allow user verification of the selected targets=yes, if desired.

4. /Hole/Toolbar/Setup/Wait for a node to process image = no.

5. /Exposure Targeting/Toolbar/Setup/Queue up targets = yes.

6. /Exposure Targeting/Toolbar/Setup/Allow user verification of the selected targets = yes, if desired.

Operation

1. Select square targets on grid atlas and submit as usual.

2. All sq images will be acquired while "Hole Targeting" finds the targets on each sq
image since waiting in "Square" node is off. Note that since the square node acquires
images continuously, both hole finding and acquisition may compete for processing and
memory time. If it affects your interaction with the program, just wait for the
acquisition to complete.

3. If you have just acquired many (such as 50) sq images in LM mode, the microscope
has stayed in LM for a long time. It is advisable to set the instrument to one of the
preset in HM mode as soon as the acquisitions are completed and check for possible image
shift inconsistency between presets. If energy filter need to be on for higher
magnification imaging, do so now.

4. If user verification is turned on in "Hole Targeting", the targets should be
submitted using "submit" tool.

5. The Queue is submitted and processed only when "Submit Queued Target" tool is clicked.

6. Repeat the same target selection and submission process at "Exposure Targeting" node.

7. In case when leginon crashes during queue processing, the data acquisition should be resumed by
"Submit Queued Target" in "Exposure Targeting" node first. If nothing happens, it means the queue in that node is empty. In that case, repeat it in "Hole Targeting" to resume.

Interruption

Once the queue is submitted there are several modes of interruption:

1. If leginon crashes during queue processing, the data queue acquisition can be
resumed by "Submit Queued Target" in first the "Exposure Targeting Q" node, then if
nothing happens, in the "Hole Targeting" node.

2. Queued targets from "Hole Targeting" can be paused in "Hole" node with "pause"
button and is recommanded for the liquid nitrogen refill of the side-entry cryo stage.

3. The "Abort" button
in "Hole" node aborts the acquisition of the remaining targets from the same parent "hl"
image and proceeds to process targets from next square in the queue.

4. The "Abort Queue" button in "Hole" node aborts all remaining targets in the queue.

5. Exposure targets are paused and aborted in a way similar to the queued Hole Targets.


< Queuing Example 2 - Hole Targeting only | Monitor Progress of Queued Targets >



Queuing option

Introduction

Queuing option puts in a queue the selected targets on multiple images from the same acquisition node. The queue can then processed as a batch. Therefore, targets from multiple squares can be selected before any hole image image is acquired in any grid square. Alternatively, targets from multiple holes of the same square can be selected before any exposure is taken. Because the event bindings are identical in MSI application. Target processing scheme can be switched between the queuing (breadth-first) mode and the depth-first mode at appropriate point.

In queuing mode, the movement of the stage is more complicated as targets in the same subtree are not acquired in close time frame and often need readjustment of targets when it is finally the time to acquire the child image. This is all taken care of by the drift manager by reversing the stage position (including stage z) of the parent image when the first child image is to be acquired after the drift declared event. Users of the queuing mode should know that this frequent interaction with the drift manager makes the time for completing the target list longer but is necessary when targeting accuracy is important.

The other consideration is that if queuing is activated at Hole Targeting node so that a large number of images are acquired in "sq" preset at LM mode in a batch without ever cycling to HM presets, the objective lens may cool down sufficiently that the image alignment is different from during normal acquisition cycle. We recommend that either setting the scope to one of the HM mode, wait for 30 or more minute and recheck the image alignment or processing a smaller batch of "sq" preset each time so that the scope does not operate in LM for extended amount of time. Our experience is that it is better not to activate queuing at Hole Targeting but queue up only at exposure targeting so that the above problem is less likely to occur.

Trouble shooting

Initial Queuing set-up

The user should start with the preference and configuration of the nodes in MSI application in the depth-first mode and follow the quick start procedure. Once the function of all nodes are confirmed to be normal, then switch to queuing. There are two possible points for queuing, at Hole Targeting or at Exposure Targeting. The two can be used in any combination with the depth-first mode.

Warning: Do not use this option on the targeting node immediately after an acquisition node that moves to targets by iterative Navigator stage movement.

Example:

The algorithm for target adjustment can not handle this particular combination.

Configuration and operation rules for a chosen queuing point

Configuration of two nodes are affected by each queuing and they should be set in the following order if the two are currently processing data:

1. The option for "Queue up targets" should be selected in the HoleFinder. "Declare drift when queue is submitted" is optional. Use it if accurate targeting is required. The time required to finish target will be longer.

2. The acquisition node that acquires the image on which targets will be selected do not need to wait for HoleFinder node to process the image before next acquisition. This option is deselected in /Tool/Setup/. Leave it on if you are willing to wait for HoleFinder before next image acquisition.

In operation, the behavior of the above two nodes plus the acquisition node after the queuing holefinder are affected.

1. All targets submitted to the above-mentioned acquisition node will be acquired first(Waiting off) rather than one after each target submission (Waiting on). These targets would be considered "done" by Leginon at restart or target refresh.

2. The normal "submit" in the targetfinder only stores the selected targets in the queue rather than proceeding to target processing.

3. Upon "Submit Queue" the queued target list is processed by the next acquisition node in which individual targets can be aborted by the abort button , paused as in MSI, and the whole queue list can be aborted using the abort queue button .

4. The queued target list is in fact a list of lists where targets are grouped by their parent images. At the start of target processing of any unfinished sub-list by an acquisition node, leginon reverts the z stage position to that of the parent and processes rejected targets (i.e., the focus targets) first if the option is on as it is for "Hole" and "Exposure" nodes whether they have been processed previously. The rest of the unfinished acquisition targets are then processed.

5. The targets that generate images in the non-waiting acquisition node is considered done once acquired. Therefore, if Leginon is interrupted and restarted, you can not continue the acquisition and process the queued targets by submiting refreshed targets in "Square Targeting" node as in MSI. Instead, you should resubmit the queue in the corresponding holefinder node. Leginon will find out which targets have not been completed and continue the acquisition.


< Adding a new focus sequence to a focus node | Queuing Example 1 - Exposure Targeting >



Queuing Option - MSI-raster

Queuing option is also available in MSI Raster (1.1). See description in MSI application and substitute whereever "Hole" node is mentioned with "Sub-Square"


< raster finder nodes set-up | Improving Autofocusing >



Queuing Option - MSI-T

Queuing option is also available in MSI-T. See description in MSI application.


< JAHC finder nodes set-up



Raster Filter

It is really a raster generator. It adopted the name because it is a subclass of
TargetFilter that takes in targets and output targets.

Required bindings for recieving targets and publishing targets:

previous Target Finder - (TargetListPublishEvent) -> Raster Filter
Target Filter - (ImageTargetListPublishEvent) -> next Acquisition
Target Filter - (QueuePublishEvent) -> next Acquisition

Required bindings for proper waiting among nodes:

Raster Filter- (TargetListDoneEvent) -> previous Target Finder
next Acquisition - (TargetListDoneEvent) -> Raster Filter


< Raster Finder | RCT >



Raster Finder

A subclass of TargetFinder

Required bindings for recieving images and publishing targets:

previous Acquisition - (AcquisitionImagePublishEvent) -> Hole Finder
Hole Finder - (ImageTargetListPublishEvent) -> next Acquisition
Hole Finder - (QueuePublishEvent) -> next Acquisition

Required bindings for proper waiting among nodes:

Hole Finder- (ImageProcessDoneEvent) -> previous Acquisition
next Acquisition - (TargetListDoneEvent) -> Hole Finder


< Presets Manager | Raster Filter >



Raster finder nodes set-up

The user should setup the presets and the preference configuration of the nodes in MSI raster application in the way identical to MSI application. Since MSI raster application is used when continuous carbon support is used rather than holey film, the name of the nodes are changed accordingly so that the node "Hole Targeting" in MSI is now "Sub-Square Targeting" and "Hole" is now "Sub-Square". Both "Sub-Square Targeting" and "Exposure Targeting" nodes are now derived from "raster finder" node class and the following set-up apply to both nodes.

Initial Raster Finder Preference Setup in MSI-raster

Subsquare Targeting/Settings and Exposure Targeting/Settings>

Raster Finder basics

Raster finder works in five steps:

1. It creates raster points on the image defined by the center, the spacing between the points and the angle of the raster axis from the image axis. Number of points defines the number across each raster axis. The total number of raster points are also limited by the image size as no raster point is allowed outside the image.

A symmetric raster has equal spacing and number at both raster axis. If symetric is chosen, only x spacing and number need to be entered.

2. If an image acquired is loaded, it is possible to calculate the best spacing and angle to achieve a desired overlapping image. The calculator uses the preset used in the loaded image and the preset with which the raster images will be collected and their calibrations for the move type the raster targets will be moved by.

3. A polygon can be drawn by the user to limit the raster region that will be considered in the later steps. This is used mostly with tissue section imaging. No limit is imposed if no polygon points are picked on the image.

4. Ice thickness is used to limit the valid raster points to usable region.

5. Target templates are applied to the valid raster points to create the final acquisition and focus targets. The template can be constant, meaning that it is defined relative to the image coordinate. The template can also be convolved with the raster points which will create multiple targets, each defined relative to the coordinate of the valid raster points.

In this example, the acquisition targets are convolved with a relative target at (5,5), the focus target is a constant target at (70,70)

Select a raster on the first image of a square

Select a raster arrangement to collect data from by making selections on the first image of a square.

1. Go to Leginon/Sub-Square Targeting> It should display the current square image. If not, following MSI operation instruction on Selecting Squares on Atlas.

2. If the target selection is acceptable, uncheck User Check in Leginon/Sub-Square Targeting/Toolbar/Settings>.

For repeated experiments of the same type of sample and grid on the same scope and presets, Reference Intensity in "Acquistion or Focus Settings/Ice Thickness>" should be the only parameter that requires adjustment from day to day.

3. If the target spacing or orientation is not acceptable, try adjusting the Raster Finder to find holes in the current image of a square.

4. If the exposure and focus selection is not acceptable, try adjusting the Raster Finder to pick the correct targets.

5. Click Submit (in Leginon/Sub-Square Targeting/Toolbar> to process the final targets.

6. If the target selection is acceptable, uncheck User Check in Leginon/Sub-Square Targeting/Toolbar/Settings>.

Select Exposure and Focus targets on the first Sub-square image

Pick exposure and focus targets on the first hole preset (Sub-Square) image. The aim is normally to image all area on the sub-square image at higher magnification after a fine-focusing procedure.

1. Go to Leginon/Exposure Targeting> It should display the current Sub-Square image

2. Check whether exposure (red cross hair) and focus (blue cross hair) targets were selected correctly (in the correct raster fashion).

3. If the target selection is acceptable, uncheck User Check in Leginon/Exposure Targeting/Toolbar/Settings>.

4. If the target selection is not acceptable, try adjusting the Raster Finder to find holes in the current image of a sub-square.

5. Click Submit in Leginon/Exposure Targeting/Toolbar> to process the targets.

6. If the target selection is acceptable, uncheck User Check in Leginon/Exposure Targeting/Toolbar/Settings>.


< Summary of this application | Queuing Option >



Raster Generation node set-up

The Raster Generation node belongs to Raster Target Filter Class. It accepts a list of targets and then convolving each with a raster of targets.

Initial Preference Setup

The settings can be divided into two functions: First, the raster parameters, and second, an raster parameter calculator. The first can function without the second.

Raster Generation/Settings>

Raster Generation/Settings/Target Raster/Limiting Ellipse>

The algorithm first generate a raster of the above defined spacing and angle, and then use the following parameter to filter the targets whose image touches within the ellipse.

For example, the ellipse in this figure has a axis at 1 raster spacing while b axis is 2 raster spacing with angle of 25 deg. Only the images (assuming 0% overlapping and aligned with the raster axes) acquired by the green targets are accepted. Some approximation was involved in this calculation. You should experiment with your sample.

Raster Generation/Settings/Calculator>

Select raster parameter on the first set of test section images

The raster generation settings can be verified with the option activated. If there are uncertainty in the raster spacing and angle, it is worth testing with small rasters and view the results on web image viewers.

  1. Raster Generation> Give a guessed spacing and angle with a small number of points.
  2. Grid Center Targeting> Selecting one position as center of the raster on the grid atlas and submit
  3. Web 3wviewer>View the resulting hl images and its marking on its parent gr image to adjust raster parameters for desired overlap and raster width.
  4. Raster Generation> Adjust the raster spacing and angle.
    bq. Once some targets have passed through the node, you can use the raster calculator to get the spacing and angle based on the raster preset and overlap percentage. (If the result raster looks very wrong on the Web Image viewer based on the calculation, try to inverse the angle (i.e., multiply by -1). We don't know why some work and some don't.)
  5. Repeat 2-4 until satisfied.

Editing targets on the subsequent images

If the ellipse does not follow the tissue of interest, manual editing of the raster points can be made with verification activated. Leginon will pause after each raster of targets is made. You can then right click to remove or left click to add targets. Click on Submit button to acquire images of the final target raster or click stop to abort data acquisition of these targets.


< Summary of this application | Other special preference set-up >



RCT

RCT stands for Random Conical Tilt. It can also used for Orthogonal Tilt image acquisition. This should be used with Navigator multiple move for best results.

Required bindings to Presets Manager:

RCTNode - (ChangePresetEvent) -> PresetsManagerNode
PresetManagerNode - (PresetChangedEvent) -> RCTNode

Required bindings to a Target Finder:

TargetFinderNode - (ImageTargetListPublishEvent) -> RCTNode
RCTNode - (TargetListDoneEvent) -> TargetFinderNode

Required Bindings with Navigator to allow (iterative) target move correction:

RCTNode - (MoveToTargetEvent) -> NavigatorNodeAlias

Required Bindings for waiting for drift to stop after tilting:

RCTrNode - (DriftMonitorRequestEvent) -> DriftManagerNode
DriftManagerNode - (DriftMonitorResultEvent) -> RCTNode

Required Binding to correct drift from tilting as well as thermal expansion:

RCTNode - (NeedTargetShiftEvent) - > DriftManagerNode
DriftManagerNode-(AcquisitionImageDriftPublishEvent) -> RCTNode

Required Bindings to use drift check image in the node (???):

DriftManagerNode - (AcquisitionImagePublishEvent) -> RCTNode


< Raster Filter | Robot >



RCT application calibration

RCT type of data collection need the normal MSI calibration. In addition, the followings are also required.


< Presets for MSI-RCT applications



RCT node set-up

Acquisition Settings that is unique to this node:

Testing feature finding algorithm

The default values in the RCT node may not work for your sample, trials should be made
to optimize the parameters. The good parameters should find hundreds, but not thousands of
features in your untilted image for good results.

1. Presets Manager> send the preset used in "Centered Square" to scope at the center
of a square.

2. RCT/toolbar> Click on the "acquire" button at the far right to acquire a test image
of which the feature finding algorithm will be applied after the acquisition.

3. RCT> Check the result of the numbers of feature found. A few hundred but not
thousands would be a good settings.

4. RCT/Settings> Adjust Min Feature Size (most sensitive) and/or Max Feature Size or
the filters and then repeat 2 and 3 to get better results.

5. Target templates are applied to the valid raster points to create the final
acquisition and focus targets. The template can be constant, meaning that it is defined
relative to the image coordinate. The template can also be convolved with the raster
points which will create multiple targets, each defined relative to the coordinate of
the valid raster points.


< Summary of this application | Presets for MSI-RCT applications >



Reading the tomography graphs

The graphs found in http://your_host/myamiweb/tomography/ are very useful for trouble shooting.

Figure 1 shows a typical result.

Figure 1

By activate "show model parameters" check box in the viewer, more plots are shown (Figure 2).

Figure 2

phi is the angle between the tilt axis with y-axis. offset is the distance between the tilt axis and the CCD center, z0 is the height difference between eucentric point and the untilted specimen.

To first approximation, if the object tomography application try to track is perfect in xy but off in z ( off eucentric, shown as z0 in the model parameter), the movement of the z-projected object during tilting follows a sine curve. On the other hand, if the object is perfect in z but offset on the xy plane in direction perpendicular to the tilt axis, the movement of the projected object follows a cosine curve, as shown here:

Therefore, the curve below on x-axis which is almost perpendicular to the tilt axis (phi ~ 0) suggests the specimen is 10 um ( = 7 um / sin(45 degrees) ) off in z and the tilt axis passes quite close to the center of the CCD.

Running the application

< Running the application | Fitting the tilt axis model >


Recommendation for setup at a new institute

Leginon/Appion Administrator

The user with username "administrator" is a special user in Leginon/Appion. It belongs to the administrator group with highest level of privileges if the login is enabled at the web server. For legion operation, once the setting preferences in a node that shares the same class and alias are defined by the administrator, all newly created users get these settings when they launch the node until they make changes themselves. This allows a faster setup per database (institute) for the beginners. The web server setup wizard should have guided you to create this user.

If you are the Leginon guru at your institute, you may want to start Leginon as the administrator and modify its node settings once you have figured out the appropriate values at your institute so that you won't have to check and modify them for every new users.

Regular users :

A Leginon?Appion user set in the adminstration tool defines his/her own Leginon preferences once changed from the "adminstrator" user default above. The user profile is also used for the login feature in the web imageviewers and Appion interface. It is important to know that this user is not related to the computer login user. Therefore, Follow the steps outlined in Set up for a new regular user section to register a new user.


Steps involved in the installation >



Recommendation for setup at a new institute

Leginon/Appion Administrator

The user with username "administrator" is a special user in Leginon/Appion. It belongs to the administrator group with highest level of privileges if the login is enabled at the web server. For legion operation, once the setting preferences in a node that shares the same class and alias are defined by the administrator, all newly created users get these settings when they launch the node until they make changes themselves. This allows a faster setup per database (institute) for the beginners. The web server setup wizard should have guided you to create this user.

If you are the Leginon guru at your institute, you may want to start Leginon as the administrator and modify its node settings once you have figured out the appropriate values at your institute so that you won't have to check and modify them for every new users.

Regular users :

A Leginon?Appion user set in the adminstration tool defines his/her own Leginon preferences once changed from the "adminstrator" user default above. The user profile is also used for the login feature in the web imageviewers and Appion interface. It is important to know that this user is not related to the computer login user. Therefore, Follow the steps outlined in Set up for a new regular user section to register a new user.


Recommendataion-Dividing projects by long-term goal

Division by long-term goal guarantee continuity across users.


Installation >



Recommended Application Preference Changes when updated from version 15

Adjust Target For Drift Check Box is now a choice

If you checked "adjust target for drift" in any node of Acquisition class, it should be
changed to select "one" ancestor. A python script "update16.py" is provided for a complete
update of such setting in all related nodes. If the drift is so large that the different
versions of the parent images can not be correlated, you should change the choice from "one"
to "all" ancestors.


Recommended Application Preference Changes when updated from version 15

Tomography,Tomography Preview, Tomography Focus

Please follow the preferences suggested in the new <link linkend="Tomo_pref"

MIS-Tomography Preference recommendation</link>.


redux

redux is a library for loading an image, doing some basic processing and generating a viewable image.

Goals

Potential uses

Current design as of 5/12/2011

New Ideas as of 7/13/2011

Investigating gstreamer as a framework on which to build redux. gstreamer allows plugins called "elements" to be connected together to form a pipeline or graph that does multimedia processing. Here is an example application built using the command line program "gst-launch":

gst-launch filesrc location=example.png ! pngdec ! jpegenc ! filesink location=test.jpg

README file:

INTRODUCTION
Redux is a utility for running a pipeline of simple image processing routines.
The main purpose is to produce display worthy images (JPEG, PNG, etc) from
raw MRC images.  It includes a caching mechanism to reduce processing time at
the expence of disk or memory usage.

INSTALL:
prerequisites: python2.6 and above, numpy, scipy, pyfilesystem, pyami, numextension
    Install using "python setup.py install" or just use a local sandbox and just
make sure redux is in your pythonpath

USING IT:
There are two basic ways to use redux.  The first is to use it directly as a
python package.  You import redux and do processing in your python script.
The second is to start a redux server, which can be located elsewhere on your
network.  You then make requests to the server using the client of your choice
(python, php, etc.).

TRY IT:
    Run the stand-alone redux script (bin/redux).  Without any options or
arguments, it will print out a help message.

To Do:
    cache management, clean up old files, etc.
    server and client config scripts
    security

Load and Edit an existing application

  1. in Application Editor, select Application/Load> to select the desired application from the pull-down menu.
     
  2. Make the changes to the application.

For example, to change the class of a target finder node while retaining its bindings, right click on the name of the node (ended with the word "Targeting") and choose property, choose the class you want to replace it with in the pop-up window, and click o.k.

  1. Application/ Save As> to save all the changes with a changed application name.
    OR
  2. Application/ Save> to overwrite existing application as a new version.

< Use the Application Editor to create Leginon applications | Edit an existing application as an xml file >



How to reload atlas:

This is used if Leginon was stopped and restarted.

1. Leginon/Square Targeting/Mosaic > Enter the size of the mosaic atlas loaded into the image display for better resolution. For example, Scale image to: 2048 for more resolution, 512 for fast loading

2. Leginon/Square Targeting/Tiles > Select the atlas label in "Load tiles from mosaic." The most recent one is the default.

3. Leginon/Square Targeting/Tiles> Click "Load"


Revert Settings

Revert Settings is a tool for use with the Leginon image acquisition software.

Leginon settings for the applications are saved in the database during the installation. When a user use Leginon the first time, the settings or the Appion/Leginon administrator user will be loaded. The user can change them and Leginon will remember the new values from then on.

In the case that a user incorrectly modifies Leginon application settings, the user or an administrator may revert all the settings of a specific user to the default values.

  1. Click on the Revert Settings icon
  2. Choose the user in the list, and click on the Revert button.
Expected result:

Robot

Robot node sits between robot controlling program and other Leginon acquisition sequence.

Leginon Robot node communicates with the grid-loading robot controlling program to:

  1. check that the robot exists and is activated
     
  2. tell the robot to load/unload a specific grid
     
  3. hear from the robot when the grid loading/unloading is successful/failed

Note: This node works only with NRAMM grid loading robot. You should modify it to suit your robot for the above functions. As long as it has the same event binding to perform the following functions, your custom node can be used with any Leginon acquisition sequence.

For normal MSI application, the user select grids from an existing grid tray in the Robot node first, then the node interacts with an acquisition sequence in the Leginon application to:

  1. start the image acquisition sequence
     
  2. receive a notice that the acquisition sequence is completed
     
    In the case of 2nd acquisition sequence of grids with targets selected on the old grid atlas, the robot need to also
     
  3. recieve information on which grid to be loaded

Normal MSI application Required bindings:

Robot - (MakeTargetListEvent) -> MosaicTargetMaker
target handler such as Acquisition or TargetFilter - (TargetListDone) -> Robot

Required bindings for 2nd Pass application that re-registrate targets on the specific grid:

Robot - (GridLoadedEvent) -> RobotAtlasTargetFinder
RobotAtlasTargetFinder - (UnloadGridEvent) -> Robot
RobotAtlasTargetFinder - (QueueGridEvent) -> Robot

Additional Requirement: project database with robot grid and tray information.


< RCT | RobotAtlasTargetFinder >



RobotAtlasTargetFinder

RobotAtlasTargetFinder node display old grid atlas of all grids from the same session, allow targets to be picked or loaded, initiate, readjust the targets according to a reacquired image from the robot-reloaded grid, and publish the new targets for proper imaging in the 2nd pass.

Required bindings with Robot node:

Robot - (GridLoadedEvent) -> RobotAtlasTargetFinder
RobotAtlasTargetFinder - (UnloadGridEvent) -> Robot
RobotAtlasTargetFinder - (QueueGridEvent) -> Robot

Required bindings to publish new targets and wait for them to be done:

RobotAtlasTargetFinder - (ImageTargetListPublishEvent) -> next Acquisition
next Acquisition - (TargetListDoneEvent) -> RobotAtlasTargetFinder

Required bindings to reacquire a image to readjust the targets on the grid:

RobotAtlasTargetFinder - (ChangePresetEvent) -> Presets Manager
Presets Manager - (PresetChangedEvent) -> RobotAtlasTargetFinder


< Robot | Tomography >



Robot MSI-Section preference set-up

Raster Generation

The settings can be divided into two functions: First, the raster parameters, and second, an raster parameter calculator. The first can function without the second.

Raster Generation/Settings>

Raster Generation/Settings/Target Raster/Limiting Ellipse>

The algorithm first generate a raster of the above defined spacing and angle, and then use the following parameter to filter the targets whose image touches within the ellipse.

For example, the ellipse in this figure has a axis at 1 raster spacing while b axis is 2 raster spacing with angle of 25 deg. Only the images (assuming 0% overlapping and aligned with the raster axes) acquired by the green targets are accepted. Some approximation was involved in this calculation. Therefore the results is not exact. You should experiment with your sample.

Raster Generation/Settings/Calculator>

Section Z Focus Node/Final Section Node

With final targets directly selected from grid atlas, drift management does not function properly. Therefore, all drift managememt functions should be turned off.

Settings/Image Acquisition>

Final Section Node

As the last acquisition node, waiting should be turned off and rejected focus targets should be acquired first.

Settings/Image Acquisition>


< MSI-Tomography Preferences



Robot node

Robot node uses Robot2 class which commnunicates to the robot controller through database and robot server specific to the avialable grid-loading robot or robots. The grid tray and grids will not appear unless they are registered in the database. For consistent run, Default Z Position in its settings should be set according to the aproximate eucentric height for the holder used.


< Register the grids in the database | 1st Pass application >



Running "Manual" Application

  1. Leginon/Manual> Open the "Settings" tool and configure the settings:
     
    Important-Use low dose kit option should be set to yes if using the low dose kit on Tecnai. Low Dose Pause Time need to be set to 5 sec or more to complete the mode change.
     
    Recommendations-
  2. Leginon/manual/Settings> Save and close the settings by pressing "OK" button.
     
  3. Adjust the exposure time in the setting and/or beam size/spot size on the scope to achieve the desired dose and coverage in exposure mode, if low-dose kit is used.
     
  4. Microscope> Search the grid for interested area and focus as normally performed.
     
  5. Microscope> If low dose mode is used, leave TEM in Focus model. Leave the screen at up position if "Main Screen/Up before acquire" is not checked in the settings. No need to put on beam blank.
     
  6. Leginon/manual> Click on the "Acquire" tool to acquire the image.
     
  7. Microscope> If low dose mode is used, Leginon will force the pre-specimen shutter close, switch the scope to exposure mode to acquire the image and then switch back to the original mode.

< Startup | Advanced Features >



Running the application

Import Notes about Image Intensity Recorded through
Tomography Node

Tomography node saves the images in a different format from other Acquisition nodes. By
default, the flat-field correct CCD counts are multiplied by 10 and converted to signed
16-bit integer before the image is displayed and saved. This makes CCD counts of 3276.8 or
larger overflow to negatives. Other Leginon Acquisition images are saved as float without
manipulation.

To avoid this problem, find out what exposure time corresponds to the fractionated dose
from your tilt angle step and range and total dose and take an image at tomo preset with
such an exposure in Navigation node. You will need to reduce the total dose if a good
fraction of the counts are larger than 3200 even though it would not appear to be saturated
in the float scale without the 10x factor. Alternatively, change the scale factor in
Tomography node.

Multiscale Imaging

Using Tomography Preview

Dose Measurement

If "Measure Dose before collection" is checked in Tomography node, the stage will be
moved to the reference target and a dose image of the "tomo" preset will be acquired (center
512x512 of whateven binning of the preset) before each tilt series if the interval between
the series is longer than the limit time set in the settings of Dose Measurement node. The
measured value will then be used to recalculate the proper exposure time for tomography
imaging.

For this function to behave properly, the followings should be done during
operation:

Align Zero Loss Peak

This function applies only to Gatan energy filter EFTEM. If "Align ZLP before
collection" is checked in Tomography node, the stage will be moved to the reference target
and starts the procedure to align zero loss peak before each tilt series if the interval
between the series is longer than the limit time set in the settings of Dose Measurement
node.

For this function to behave properly, the followings should be done during
operation:

What is a Good Tilt-Axis Model?

The goniometer-tilt-axis-based tracking model developed by Zheng et. al. corrects the
specimen height (z-axis) by a change of defocus using measured shift of feature shifts in
the images (x and y-axes). The tracking in the x and y directions does not involve the use
of such model, but is done by smooth curve fitting or preceding tilts. Therefore, to judge
the adequacy of the model, one should check the resulting defocii of the images in the
series remain unchanged.

On the other hand, the feature tracking in x and y is likely to fail only if the tilting
does not induce a smooth shift of the imaging feature a sudden drop of specimen position at
a particular tilt angle often throws off the smooth curve fitting. It is possible to reduce
such effect by increasing the number of data points included in the smoothing as set in the
model section of the tomography node settings window. Otherwise, the goniometer need to be
serviced.

Tomography Trouble Shooting section covers many of the problems we have encountered.


< Set-up Before Running | Reading the tomography graphs >


Run Leginon Client on the Microscope Computer

Leginon Client is run on the microscope-controlling computer (and the robot controlling computer, if applicable) so that the main Leginon program on the remote computer can launch the necessary node at the right place. For example, in order for the remote computer to get and set microscope parameters, the Instrument node need to be launched on the microscope-controlling computer. Before starting Leginon Client, check that your camera controlling software is set up properly for Leginon interaction:

Using a Gatan Camera

  1. Open Digital Micrograph (or check that the Tietz software is closed).
     
  2. insert the Gatan CCD in Digital Micrograph.

Using a Tietz Camera

  1. Close Tietz TCL program
     
  2. Put camera switch box to select CCD.

Start Leginon Client


Exception EAccessViolation in module adaExp.exe at ....

Access violation at address xxxx in module 'adaExp.exe'. Read of address xxxx" 

Do NOT touch this message box, or leginon client will need restarting.

If the camera is controlled separately from the scope host, Start Leginon Client there, too.

See Using_Leginon_on_a_system_where_the_microscope_and_camera_are_controlled_by_different_computers.

< Test Network Connection Between Remote and Microscope Computers | Start Leginon at your main working station remotely >



Linux distribution recommendation

We list our experience and current progress here.

Our Preference : CentOS 5.x

If you have a new computer(s) for your Leginon/Appion installation, we recommend installing CentOS because it is considered to be more stable than other varieties of Linux.

CentOS is the same as Red Hat Enterprise Linux (RHEL), except that it is free and supported by the community.

We have most experience in the installation of the supporting packages on CentOS and this installation guide has specific instruction for the process.

Start at Instructions for installing CentOS on your computer.

Other known cases of success:

Fedora 10

Start at Instructions for installing Fedora on your computer

SuSE, Ubuntu

MacOS


< Possible Computer Set-up Configurations | Network Configuration >



Set-up Before Running

Preset Design

Preset design includes the normal gr, sq, hl, fa, and fc presets as in MSI. "tomo" preset is the preset used to collect the final tomogram. "preview" is set at minimal dose to check the quality of the region before final acquisition. The table here is for FEI Tecnai F30. For F20, your may use standard MSI application presets with the addition of "tomo" and "preview" at the magnification apropriate to your specimen.

Example Multiscale Tomography preset parameters (on FEI Tecnai F30)

Magnification: Preset name: Image Shift (x,y): Dimension: Binning: Beam Coverage: Exposure Time (ms): Spot Size: Defocus (m): Skip when cycling:
220 gr Aligned* 512 8 max 25 8 -1e-3 no**
480 sq Aligned* 1024 4 1x CCD size 125 8 -1.5e-3 no**
4500 hl Aligned* 1024 4 1x CCD 125 8 -1.2e-5 no
34000 fc 0,0 1024 1 <~ 1x CCD 500 8 -1e-5 no
34000 fa 0,0 1024 4 <~ 2x CCD 100 8 -5e-6 no
34000 tomo 0,0 4096 1 >2x CCD 160 8 -1e-5 no
34000 preview 0,0 1024 4 2x CCD 12 (0.25e/A^2) 8 -1.2e-5 no

*The image shift for these presets need to be aligned against one of the high mag preset such as "fa" or "tomo".

**Protocol from Lu Gan suggest activate "Skip when cycling for these LM presets" after all tomography targets are selected in "Tomography Targeting" node so that these presets are not used any more. The newer protocol by Jian Shi does not do so.

Calibrations

This application has the same calibration requirement as MSI applications, no additional calibration is needed if the same magnification and camera configuration are used. The exception is that the Tomography node uses images acquired in the same node to make the off axis correction in the tilt axis. As the result, the calibration of the move type the Tomography node uses and at the magnification of "tomo" preset is required. Since we normally perform image-shift calibration for all magnifications, it should already be included.

Additional calibration needed for the Example MSI-Tomography

Preset magnification calibration type optional calibration
tomo 34000 image shift matrix stage position matrix or rotation and scale-only modeled stage position (if using tilt-corrected correlation)
hl 4500 modeled stage position

Again the calibration is required only once in most cases. See the chapter on calibration for more details.

Preferences and Settings

The default settings loaded at installation should be reasonably good for the first trial. See the section on MSI-Tomography preference settings in the chapter on initial MSI application preference setup.


< Summary of this application | Running the application >



Set up for a new regular user

A Leginon user set in the adminstration tool defines his/her own preferences once changed from the "adminstrator" user default above. It is also not related to the computer login user. Therefore, it is is necessary to go through the following steps to set up an existing computer user as a new Leginon user. With login feature activated in myamiweb, this user is also used for logging into the web server to see and process data belong to him/her:

Add a User From Administration web page

Create individual configuration if not set globally


< Steps involved in the installation | More about Groups >



Set up for a new regular user

A Leginon user set in the adminstration tool defines his/her own preferences once changed from the "adminstrator" user default above. It is also not related to the computer login user. Therefore, it is is necessary to go through the following steps to set up an existing computer user as a new Leginon user. With login feature activated in myamiweb, this user is also used for logging into the web server to see and process data belong to him/her:

Add a User From Administration web page

Create individual configuration if not set globally


Special Instructions for FEI Eagle Camera

We are still in the process of adapting the comarray package to work with the FEI Eagle cameras. The pre-packaged comarray EXE installer that we provide here will not work, so you will need to download comarray from our SVN repository and do a manual installation of the python module to your python site-packages. Here is the procedure:

Check out comarray to your local sandbox on a linux system like this:

 svn co http://ami.scripps.edu/svn/myami/trunk/comarray

Then copy it to your Windows system that hosts the camera. Or just check it out directly to the Windows system using a Windows SVN client.

Now browse through the files in your new comarray sandbox. You will find a folder "py2.5". In there you will find a few files including:

 __init__.py
 NumpySafeArraySlow.py
 NumpySafeArray.pyd
 NumpySafeArrayTIA.pyd
 setup.py

Make a new folder C:\Python25\Lib\site-packages\comarray\

Copy "__init__.py" and "NumpySafeArrayTIA.pyd" to the new site-packages/comarray folder.

In the site-packages/comarray folder, rename NumpySafeArrayTIA.pyd to NumpySafeArray.pyd


Special Operation Preference setup

Taking final exposures at very high magnification

Hysteresis of image shift at very high mags such as 200 kx can be reduced by setting the following configuration

  1. Presets Manager/Settings>
     
    Cycle Magnification Only = no
     
  2. If queuing is used at exposure targeting,
     
    Exposure Targeting/Settings>
     
    Declare drift when queue submitted = yes

Avoiding drift correction that uses LM sq preset

If the grid is flat and the offset of targets is small enough that it can be corrected in the hole image, we recommend using the Queuing option at Exposure Targeting. The sq preset is still used after Stage Z adjustment to correct the hole targets but will not be used when queued exposure targets are processed.

If the offset of targets is minimal even after stage Z adjustment, set the following to avoid using ancestor images obtained in LM for drift management purpose, queuing or not.

  1. Target Adjustment/Settings>
     
    Minimum Magnification =Lowest Magnification you want to allow the node to use for determining the new target.

Minimize the use of image shift for the final exposure (Approach 1)

Large image shift can cause sufficient beam tilt that creates problems such as bad autofocus, beam shift, and loss of resolution (but probably only if better than 4 angstrom is needed). Image shift is used in Leginon for targeting exposure because it is much more accurate than a single movement by the specimen goniometer, even after it is modeled for mechanical periodicity.

The accuracy of the stage movement is lower when it moves a long distance. Therefore, using iterative stage movement can improve the targeting, and therefore reduce the amount of image shift required for the final exposure. To use this feature, change the following preference in Hole node (or Subsquare node in MSI-Raster).

It is important to know that in order to check whether the precision is reached, image is taken at the preset at which the target is selected on (in this case, sq preset), so the dose should be kept at minimal. On our microscope 0.2 micron precision can be obtained within 2 to 3 moves.

Hole/Settings/Image Acquisition>

  1. Mover=navigator
     
  2. Navigator Target Tolerance = 2 e-7 m (or whatever tolerance you like): This sets the goal for multiple movement
     
  3. Navigator Acceptable Tolerance = 1 e-6 m (or whatever tolerance you like): If further movement causes an increase rather than a decrease of targeting accuracy, this value determines whether the target is aborted or not.
     
  4. Final Image Shift = No

Navigation/Settings/Error Checking and Correction>

  1. Preset cycle after each move = yes if your sq preset is in LM mode and you don't mind wait a little longer; = no if you don't have hysteresis problem staying in sq preset for the unknown amount of time during the iterative move.

Minimize the use of image shift for the final exposure (Approach 2)

A different approach is being developed to minimize image shift while maintaining final targeting accuracy-A combination of stage movement and image shift. This approach can only be used in limited cases such as targets selected for the tomography node or exposure node, and is only experimental in the latter case.

Tomography or Exposure/Settings/Image Acquisition>

  1. Move Type = modeled stage position
     
  2. Mover=navigator
     
  3. Navigator Target Tolerance = 1 e-7 m (or whatever tolerance you like)
     
  4. Navigator Acceptable Tolerance = 1 e-6 m (or whatever tolerance you like)
     
  5. Final Image Shift = Yes

Optimize autofocusing sequence

The focus sequence in Focus and Z Focus nodes can and should be optimize for specific cases. The activated sequence in the default setting is good for a flat holey grid and is meant for high resolution imaging at 50k x or higher. If accurate defocus is not important, focusing once per grid square may be sufficient, for which all focus sequence in Focus node can be deactivated and the same autofocus step can be added to Z Focus node instead.

There are two methods to determine the defocus automatically : Stage tilt (Equivalent to stage wobbling) and Beam tilt. There are also two possible ways for correcting the defocus measured: Defocus (Equivalent to turning the focusing knob on the scope and reset the defocus) and Stage Z (Moving the stage to the zero defocus height).

The following observations at NRAMM may help you determine what is the best to use:

  1. Both defocus determination method requires calculation correlation between two images. Therefore, the magnification and the location of the autofocusing should include area with contrast.
     
  2. The higher the magnification, the more accurate the defocus determination but the smaller the range of defocus the defocus determination can handle.
     
  3. Beam Tilt is more reproducible and preferred method to determine defocus in HM mode.
     
  4. Stage Tilt (Wobbling) is the preferred method to determine defocus in LM mode.

MSI-Raster Chapter contains an example of an alternative Z Focus node focus sequence for grid that show little contrast at medium magnifications.


< Initial MSI application preferences | MSI Quick-start >



Special Operation setup

Taking final exposures on film

If film is used to collect data with one or more exposure presets, Edit the preset setting in Presets Manager when you are ready to do so. The exposure time of the preset will be applied to film exposure. A warning message will come up when the cassette is exhausted and Leginon paused. You will need to reset the stock number after new film is added.

Acquiring images with the stage at a fixed alpha tilt

All targeting and focusing works on tilted specimen with correction made within Leginon automatically.

1. Z adjustment to the defocus allows images acquired from image-shifted targets to exhibit equivalent defocus regardless of location.

Additional stage position matrix calibration is therefore needed for MSI at hl preset magnification where the targets are selected in Hole node.

2. Distortion correction is made to beam-tilted images that are used for autofocusing to boost peak signal.

Rotation centers are therefore needed to be stored at the magnification and HT for fa and hl that are used in Z focus and Focus nodes for autofocusing, respectively. This is stored (and retrieved) in Beam Tilt node of Calibration application. Because rotation center may change from day to day, the correction is made only if the required rotation center is stored under the same session.

****Because of the additional calibrations, this is not recommended for beginners.


< MSI set-up in more details | MSI Operation >



Stage Position matrix calibration

Stage Position matrix calibrations can used to navigate at low magnifications (lower than
~1000x when accuracy of better than 2 um is not required. However, since the Modeled Stage
Position Rotation/Scale calibration also saves such matrix, this calibration is not necessary.
The procedure is provided here for reference.

How does matrix calibration work?

  1. Leginon/Presets Manager> Select the low mag preset for the calibration and send
    its parameter to the microscope.
     
  2. Microscope> Make sure there are distinguishable features for cross correlation
    in the range of movement to be used and that the beam is not clipping the area of CCD
    acquisition. Removing the objective aperture may be necessary.
     
  3. Leginon/NodeSelector> select "Matrix" node.
     
  4. Acquire test image and change the Camera Configuration in "setting" window to values
    that will produce a good image in a reasonable exposure time. Don't forget that
    "Overwrite Preset" has to be checked if you want to change the Camera Configuration in
    the node.
     
  5. Leginon/Matrix/Toolbar/Settings> select correlation method in the window. Phase
    correlation is especially efficient in cases where periodic pattern exist. The pattern
    often causes cross correlation peak search to misidentify the correct peak in the
    multiple peak correlation map.
     
  6. Leginon/Matrix/Toolbar> select "stage position" as the Parameter and open the
    "Parameter Setting" window.
     
  7. Leginon/Matrix/Matrix Settings> Change "Average # position" to a number 1+ (less
    than 10 for a faster calibration). The value 1 will give a moderate to poor calibration.
    Recommendations are as follow:
     
  8. Leginon/Matrix/Toolbar> left-click (Execute icon) to calibrate.
     
  9. The image should be shifting 10-30% of the imaging area. The images can be
    monitored in Image Display Panel with display selection in image control panel set to
    "image". The cross correlation and its peak can also be displayed. There has to be
    recognizable imaging feature that moves with stage movement for good correlation at all
    time for a good calibration. For example, if the CCD is covered completely by the grid
    bar, the calibration will certainly fail.
     
  10. Use Navigation node to check the result of the calibration.

< Beam Shift matrix calibration | Modeled Stage Position calibration >



Startup

Microscope Setup

  1. Setup normal or low dose mode configuration.
     
  2. Align the scope.

Run Leginon Client on the Microscope/Camera Computer

See Instruction in "Start Leginon" Chapter about Run Leginon Client on the Microscope Computer

Start Leginon

See Instruction in "Start Leginon" Chapter about Run Leginon at your main working station

Launch the Application

Leginon/Main menu/Application> select "Run...." and choose the application named "Manual", select the microscope/camera hostname for "scope" and the local computer as "main", and then launch the application. See Using_Leginon_on_a_system_where_the_microscope_and_camera_are_controlled_by_different_computers if your camera and microscope are controlled by two computers.


< The Application | Running "Manual" Application >



Startup

Microscope Setup

  1. Setup normal mode configuration and deactivate the low dose kit if you have not done so.
     
  2. Align the scope.

Run Leginon Client on the Microscope Computer

See Instruction in "Start Leginon" Chapter about Run Leginon Client on the Microscope Computer

Start Leginon

See Instruction in "Start Leginon" Chapter about Run Leginon at your main working station

Launch the Application

Leginon/Main menu/Application> select "Run...." and choose the application named "Calibrations", select the microscope name as the instrument and the local computer as "main", and then launch the application.


< Grids for Calibration | Creating Presets for the first time >



Start Leginon

  1. Test Leginon with Simulator
  2. Test Leginon on the Computer Controlling the Microscope
  3. Test Network Connection Between Remote and Microscope Computers
  4. Run Leginon Client on the Microscope Computer
  5. Start Leginon at your main working station remotely

< Microscope Set-up | Leginon "Manual Application" >


Start Leginon at your main working station remotely

  1. Set yourself up as a Leginon/Appion user
     
  2. Start the remote Leginon Client on the microscope
     
    Start the remote Leginon Client on the microscope as described in the previous section if you have not done so. For Tietz camera, this will need to be restarted every time you establish and then remove the connection to it.
     
  3. Start the main Leginon processing program
     
  4. Select a session
     
  5. Create new client host or select existing client host names to add to the remote client list
  1. Check your parameters:
     
  2. Make sure that the Leginon Client has been started on each of the host in your list before finishing the wizard. See Using_Leginon_on_a_system_where_the_microscope_and_camera_are_controlled_by_different_computers.
     
  3. Choose "Finish" in the set up wizard to start the session.

< Run Leginon Client on the Microscope Computer | What is next .



What is next


< Start Leginon at your main working station remotely


Steps involved in the installation using administration tools on your web server.

See Installation Troubleshooting and the Leginon Forum searching for "admin" if you run into problems.

Go to administration page

Open a web browser. Go to 'http://yourhost/myamiweb/admin.php'
If the login system is activated, you will have to log in as administrator user.

If you are using installed using the auto-installation script or myamiweb setup wizard, you should have a number of default groups and users already in your database:

Default Groups and Privileges:

Group name Description Privilege
administrators may view and modify all groups, users, projects and experiments in the system All at administration level
power users may view and modify anything that is not specifically owned by the default Administrator User View all but administrate owned
users may view and modify project that they own and view experiments that have been shared with the user Administrate/view only owned projects and view shared experiments
guests may view projects owned by the user and experiments shared with the user View owned projects and shared experiments

Default users

Username Firstname Lastname Displayed Group Description
administrator Leginon-Appion Administrator administrators Default leginon settings are saved under this user
anonymous Public User guests If you want to allow public viewing to a project or an experiment, assign it to this user

1. Add yourself as a User

Set up for a new regular user

A Leginon user set in the adminstration tool defines his/her own preferences once changed from the "adminstrator" user default above. It is also not related to the computer login user. Therefore, it is is necessary to go through the following steps to set up an existing computer user as a new Leginon user. With login feature activated in myamiweb, this user is also used for logging into the web server to see and process data belong to him/her:

Add a User From Administration web page

Create individual configuration if not set globally

2. Import Applications

If you have used auto-installation tool to install, you should have a few applications imported already. These include Calibrations, Manual, and a few flavors of MSI applications.

The most commonly used Leginon applications are included as part of the Leginon download. These XML files are in subdirectory of your Leginon download and installation called "applications". The XML files should be imported either using the web based application import tool. Each application includes "(1.5)" in its name to indicate that it will work with this new version of Leginon. The applications that carry the older version name are compatible with the older Leginon.

To find Leginon installation path on Linux:

 >start-leginon.py -v

Proceed to Next Chapter to Add a new project for testing installation

The rest of this chapter is for references.


Installation instruction: Add a new project for testing installation >
Chapter thread: < Recommandation for setup at a new institute | Set up for a new regular user >



Steps involved in the installation

See Installation Troubleshooting and Leginon Forum searching for "admin" if you run into problems.

Go to administration page

Open a web browser. Go to 'http://yourhost/myamiweb/admin.php'
If the login system is activated, you will have to log in as administrator user.

Add yourself as a User

Set up for a new regular user shared

Set up for a new regular user

A Leginon user set in the adminstration tool defines his/her own preferences once changed from the "adminstrator" user default above. It is also not related to the computer login user. Therefore, it is is necessary to go through the following steps to set up an existing computer user as a new Leginon user. With login feature activated in myamiweb, this user is also used for logging into the web server to see and process data belong to him/her:

Add a User From Administration web page

Create individual configuration if not set globally


< Steps involved in the installation | More about Groups >


Add your mircoscope as an TEM instrument

Add your CCD camera as an CCDCamera instrument

See the section on Instrument Tool for more details.

Import Applications

The most commonly used Leginon applications are included as part of the Leginon download. These XML files are in subdirectory of your Leginon download and installation called "applications". The XML files should be imported either using the web based application import tool. Each application includes "(1.5)" in its name to indicate that it will work with this new version of Leginon. The applications that carry the older version name are compatible with the older Leginon.

To find Leginon installation path on Linux:

 >start-leginon.py -v

Proceed to First Leginon Test Run Chapter

Leginon test runs test for tem/ccd controls and network communications. The rest of this chapter is for references.


Some Tietz camera dimensions are slightly larger than a standard size, for example, 2084 x 2084 instead of the standard 2048 x 2048. Some software will have trouble dealing with these dimensions. It is recommended to force the camera to the lower standard size (some multiple of 2^n). Modify the function that gets camera dimension in tietz.py, gatan.py, or tia.py depending on which camera you are using.

 def getCameraSize(self):
    return {'x': 2048, 'y': 2048}

Summary of MSI applications

All the MSI applications share the same scheme. They are 5-stage acquisition processes
which include a grid atlas, squares acquisition, holes (called subsquare in MSI-Raster)
acquisition, focusing, and final exposures (Tomography for MSI-Tomography). Target finding at
each stage leads to acquisition at the next stage. Drift management, eucentric height
correction, and autofocusing is also involved. The diagram below shows the flow of control in
MSI. The detailed event bindings involved are for advanced users only and can be found in the
chapter covering creating/editing application at the end of the full manual.

The black arrows show the flow of execution from the node where the arrow starts
on initiation of execution to the node that the arrow is pointed to. The green arrow shows
the control of target shift correction by drift manager. The red,blue, purple, and magenta
frames enclose nodes that processes acquisition, focus, reference and preview targets,
respectively. These nodes set presets through Presets Manager and moved to their targets
using either Presets Manager or Navigation node. The green frames are nodes for drift
management.

The following list is a cursory glance at the steps to run this application:

This chapter has been divided into sections to facilitate everyday usage:

Pre-MSI Set-up: Prior to setting up Leginon for the day, make sure that the presets have been designed and Leginon calibrated for your purpose.

MSI preferences and configuration: The comprehensive MSI preferences and configuration example.

MSI Quick Start checklist: A short check list for users who are familiar with the application and have saved preferences.

MSI set-up in more details: The more complicated MSI Leginon application set-up that should be completed before collecting data.

MSI queuing option: Introduction to the queuing option.

MSI Exposure Target queuing: The setup and operation of queuing mode for large number of exposure targets and/or for avoiding accessing sq presets after initial acquisition and targeting.

MSI Hole Target queuing: The setup and operation of queuing mode recommanded for quick overall survey of rare hole targets in grid squares.

Queuing at both levels: The setup and operation of queuing mode recommanded for more advanced user who will wait for one operation done before proceeding.

MSI Trouble shooting: This trouble shooting section addresses some of the possible challenges a Leginon user may face while using the MSI application.


< Flavors of MSI applications | Pre-MSI Set-up >



Summary of this application

MSI-Edge uses a template matching of the Edge image for hole finding both in "Hole Targeting" and "Exposure Targeting".

See the previous chapter for general description of all MSI applications:

Pre-MSI Set-up: Prior to setting up Leginon for the day, make sure that Leginon has been previously set-up (this step is in case the ambitious user decides to proceed to this section for the first time and hasn't gone through all the calibrations...).

MSI preferences and configuration: The comprehensive MSI preferences and configuration example.

MSI Quick Start checklist: A short check list for users who are familiar with the application and have saved preferences.

MSI set-up in more details: The more complicated MSI Leginon application set-up that should be completed before collecting data.

MSI queuing option: Introduction to the queuing option.

Queuing Example 1 - Exposure Targeting: The setup and operation of queuing mode for large number of exposure targets and/or for avoiding accessing sq presets after initial acquisition and targeting.

Queuing Example 2 - Hole Targeting only: The setup and operation of queuing mode recommended for quick overall survey of rare hole targets in grid squares.

Queuing Example 3 - Both Exposure and Hole Targeting: Use this only after you are familiar with the queuing operation.

MSI Trouble shooting: This trouble shooting sections addresses some of the possible challenges a Leginon user may face while using the MSI application.


Edge Hole Finder Set-up >



Summary of this application - MSI-raster

The Leginon "MSI-raster" application is essentially a duplicate of "MSI-Edge" or "MSI-T" except that the Hold Finder nodes have been replaced by Raster Finder nodes. The raster finder nodes can pick raster targets across an image in order to image negatively stained grids for example. MSI raster is a 5-stage acquisition process which includes a grid atlas, squares acquisition, holes acquisition, focusing, and final exposures. Target finding at each stage leads to acquisition at the next stage. Drift management and autofocusing is also involved. The following list is a cursory glance at the steps to run this application:

Since MSI raster is essentially the same as other MSI, reference "MSI in general" chapter for help on the entire process of setting up and operating MSI raster. The main difference is how to set-up the raster finder nodes.

Pre-MSI Set-up: Prior to setting up Leginon for the day, make sure that Leginon has been previously set-up (this step is in case the ambitious user decides to proceed to this section for the first time and hasn't gone through all the calibrations...).

MSI preference and configuration: The comprehensive MSI preferences and configuration example. The node name change in MSI raster are: "Hole Targeting" -> "Sub-Square Targeting" and "Hole" -> "Sub-Square".

MSI Quick Start checklist: A short check list for users who are familiar with the application and have saved preferences.

MSI set-up in more details: The more complicated MSI Leginon application set-up that should be completed before collecting data.

Queuing option: An option that groups human interaction together by putting the submitted targets from different images at the same level of target finders into a queue and process them later.

Trouble shooting: This trouble shooting sections addresses some of the possible challenges a Leginon user may face.

In this chapter:

Raster Finder nodes set-up: A short guide to set-up the raster finder nodes in the MSI raster Leginon application.

NOTE: The Tietz imaging software (EMMenu) must be turned OFF before Leginon is started. In contrast to this, the Gatan imaging software (Digital Micrograph) must be ON before Leginon is started.


raster finder nodes set-up >



Summary of these Applications

Random conical tilt (RCT) and orthogonal tilt reconstruction (OTR) image acquisition schemes require images pairs taken at two different tilt angles. The two Leginon "MSI-RCT" applications replace the Exposure node with a specialized node that acquire a batch of targets at one tilt and then the other. A feature matching algorithm is used to transform targets from the selected targets on one parent image at one tilt to the other tilt (and more tilts if needed).

The two applications differ in the target finding nodes. Therefore, MSI-RCT is suitable for specimen suspended in regular holes from support film such as Quantifoil and C-flat. MSI-RCT-raster is suitable for specimen lay down on continuous carbon film

See JAHC_finder_nodes_set-up and Raster_finder_nodes_set-up on how to setup automated targetfinders in the two cases.

Reference "MSI in general" chapter for help on the entire process of setting up . The main difference is that the preset used to acquire the parent image of RCT targeting is set at a magnification in the HM mode to give large viewing area and offer the stronger feature contrast needed for the target transformation between tilts.

Further reading

Pre-MSI Set-up: Prior to setting up Leginon for the day, make sure that Leginon has been previously set-up (this step is in case the ambitious user decides to proceed to this section for the first time and hasn't gone through all the calibrations...).

MSI preference & configuration: The comprehensive MSI preferences and configuration example. The node name change in MSI raster are: "Hole Targeting" -> "Square Centering", "Hole" -> "Centered Square", "Exposure Targeting" -> "RCT Targeting", "Focus" ->"RCT Focus", and "Exposure" ->"RCT".

MSI Quick Start checklist: A short check list for users who are familiar with the application and have saved preferences.

MSI set-up in more details: The more complicated MSI Leginon application set-up that should be completed before collecting data.

Queuing option: "RCT Targeting" node is operated in queuing mode.

Iterative Stage Movement: "RCT" node target centering uses this option.

Trouble shooting: This trouble shooting sections addresses some of the possible challenges a Leginon user may face.

In this chapter:

RCT nodes set-up: A short guide to set-up the raster finder nodes in the MSI raster Leginon application.

NOTE: The Tietz imaging software (EMMenu) must be turned OFF before Leginon is started. In contrast to this, the Gatan imaging software (Digital Micrograph) must be ON before Leginon is started.


RCT node set-up >



Summary of this application - MSI-T

The Leginon "MSI T" application uses JAHC Finder (Template Hole Finder) nodes to perform automated hole finding. This hole finder uses a template image of the the hole for correlation. Users should read Multi-Scale Imaging Applications in General chapter and consult this chapter when it comes to Hole Targeting and Exposure Targeting. We have the plan to consolidate the hole finders into one, but not in this version, yet.

Related pages:

Pre-MSI Set-up: Prior to setting up Leginon for the day, make sure that Leginon has been previously set-up (this step is in case the ambitious user decides to proceed to this section for the first time and hasn't gone through all the calibrations...).

MSI preference and configuration: The comprehensive MSI preferences and configuration example.

MSI Quick Start checklist: A short check list for users who are familiar with the application and have saved preferences.

MSI set-up in more details: The more complicated MSI Leginon application set-up that should be completed before collecting data.

Queuing option: An option that groups human interaction together by putting the submitted targets from different images at the same level of target finders into a queue and process them later.

Trouble shooting: This trouble shooting sections addresses some of the possible challenges a Leginon user may face.

In this chapter:

NOTE: JAHC stands for Joel's Amazing Holey Carbon, the experimental holed carbon support that is now sold as C-flat from Protochips Inc. Since it lacks the lips around the hole, this hole finder is especially useful.


Creating Template >



Leginon "MSI-Tomography" Application

Summary of this application

The Leginon "MSI-Tomography" application is originally contributed by Christian Soluway
and Grant Jensen at Caltech in collaboration with David Agard and Shawn Zhang at UC San
Francisco. Appion team has made some modification since. The documentation here is edited from
the protocol from Lu Gan and modified to reflect the new changes.

This application uses many of the same calibration as in other MSI applications. The
multiscale targeting and imaging also follows the same principle. Therefore, familiarity to
the latter will help. The following links are the relevant sections in MSI
applications.

MSI Quick Start checklist: A short check list for
users who are familiar with the application and have saved preferences.

MSI set-up in more details: The more complicated
MSI Leginon application set-up that should be completed before collecting data. Ignore the
automatic hole finding set-ups since this application uses user target selection and
queuing.

Queuing option: standard operation mode of
"MSI-Tomography".

Trouble shooting: This trouble shooting
sections addresses some of the possible challenges a Leginon user may face.


Set-up Before Running >



Summary of this application - Robot-MSI-Screen

"Robot-MSI-Screen" applications are a set of three applications designed for 2D-crystal screening. The screening uses a two-pass approach to reduce screening time on obviously bad trials. A user-interactive evaluation is made between the two automated robotic applications. Please refer to Cheng et. al. (2007) J. Struct. Biology vol.160, 324-331 for detail discussions and timing of the process.

If you don't have a grid insertion robot, you may use this set of application in robot "simulation" mode. However, because human does not repeat placing of the grids on the holder at the same accuracy as the robot, you may have to perform the two passes in tendom of the same grid.

Reference "MSI in general" chapter for help on the entire process of setting up and operation.

Pre-MSI Set-up: Prior to setting up Leginon for the day, make sure that Leginon has been previously set-up (this step is in case the ambitious user decides to proceed to this section for the first time and hasn't gone through all the calibrations...).

Initial_MSI_application_preferences: The comprehensive MSI preferences and configuration example. The data flow for RobotMSI-Screen 1st Pass and 2nd Pass are most similar to MSI-Raster application. The default settings loaded at the time of Leginon installation would make the application unique.

MSI Quick Start checklist: A short check list for users who are familiar with MSI applications.

MSI set-up in more details: The more complicated MSI Leginon application set-up that should be completed before collecting data.

Trouble shooting: This trouble shooting sections addresses some of the possible challenges a Leginon user may face.


Operation >



Summary of this application

"RobotMSI-Section" application is a simplified MSI-Raster with interface to grid-loading robot. Without the robot and project database structure for grid management (not released), this application can still be used with manual grid loading and entry of grid name at appropriate place. A better application "MSI-Section3step" is also available and should be used instead if possible.

Reference "MSI in general" chapter for help on the entire process of setting up and operation. Reference The set up of the Raster Generation node (of RasterTargetFilter Class) is very similar to Raster Finder nodes

Pre-MSI Set-up: Prior to setting up Leginon for the day, make sure that Leginon has been previously set-up (this step is in case the ambitious user decides to proceed to this section for the first time and hasn't gone through all the calibrations...).

MSI preference and configuration: The comprehensive MSI preferences and configuration example. The node name change in RobotMSI-Section are: "Grid Targeting" -> "Grid Targeting Robot" and "Hole" -> "Final Section". Nodes not found in this application are irrelevent for this application.

MSI Quick Start checklist: A short check list for users who are familiar with MSI applications.

MSI set-up in more details: The more complicated MSI Leginon application set-up that should be completed before collecting data.

Trouble shooting: This trouble shooting sections addresses some of the possible challenges a Leginon user may face.

In this chapter:

NOTE: The Tietz imaging software (EMMenu) must be turned OFF before Leginon is started. In contrast to this, the Gatan imaging software (Digital Micrograph) must be ON before Leginon is started.


^ Leginon "RobotMSI-Section" Application | Raster Generation node set-up >



TEM Scripting Beam Tilt Calibration

Purpose

Leginon and its subsystem pyscope uses the property Illumination.RotationCenter in Tecnai/TEM Scripting to set/get beam tilt values. We have noticed that some version of the TEM or Tecnai Scripting defines the function for set/get Ilumination.RotationCenter in units other than the original radians. Known versions with this problem are Tecnai 3.1.1 are Titan 1.0.0. We also know that it is fixed in Tecnai 3.1.2 and Titan 1.0.2 (Thanks to Wim Hagen for the information). Since Leginon need the values in radians, a scale factor need to be assigned. We do not not know which version requires non-default scale factors. Therefore, we recommend that all scopes be checked before using Leginon MSI applications with beam-tilt-based autofocusing.

Material

  1. Gold-shadowed diffraction grating replica for TEM calibration such as Ted Pella's prodoct #606 or #607.

Procedures

  1. Insert the specimen holder with the grid in the microscope
  2. From microscope-controlling PC, navigate to the installed myami/pyscope directory. Most likely C:\\Python25\Lib\site-packages\pyscope
  3. Find the python file get_beamtilt_scale.py
  4. If non-gold grid is used, modify the spacing value with a plain-text editor at the line
    gold_diffraction = wavelength/0.236e-9
    
  5. Start the script by double-left click on it.
  6. Follow the instruction to determine the scale factor.
  7. At the end of the script, the beam should be tilted back to the center and the script window closed. If the window does not close, force it to close should not cause any problem.
  8. In the same folder, find tecnai.py Open it with a plain-text editor or python's IDLE and look for the following lines close to the beginning of the file.
    # This scale convert beam tilt readout in radian to 
    # Tecnai or TEM Scripting Illumination.RotationCenter value
    # Depending on the version,  this may be 1.0 or closer to 6
    rotation_center_scale = 1.0
    
  9. replace the number in the last line with the rotation_center_scale determined while running get_beamtilt_scale.py

Terminology

Application

A Leginon application is image acquisition process that is built of several smaller
pieces called 'nodes'. An application defines your preferred scheme for how to acquire
images. An application definition includes which nodes to use, how they are connected, and
where they are running (possibly distributed across several machines). These three concepts
of applications (nodes, events, launchers) are described in more detail below. A typical
application involves several stages of image acquisition and image processing. Once an
application is designed, it can be used repeatedly for different sessions. An application
design can be exported for use on other Leginon installations.

Session

A session is defined as an execution from start to finish of a Leginon application. All
data (images, results, etc.) that are created by Leginon is associated with some session.
The first thing a user must do when starting Leginon is create a session, or continue an
existing session.

Instrument

An instrument is the microscope/camera system used for acquiring data during a
particular session. The facility at which Leginon is installed may have several different
microscopes, each with a unique camera setup. Each system is an instance of an
Instrument.

Node

Nodes are the building blocks of Leginon applications. Nodes are defined for specific
tasks. For instance, an "Acquisition" node is designed to acquire images when it receives
targets from another node, which is typically some type of 'TargetFinder' node. Nodes can
"publish" the data they create. This means they are making their data public for other nodes
to use. The other nodes can "research" to find a specific item of data. Nodes may
communicate with each other by generating "events".

Event

An event is a message sent out from a node to notify other nodes that something of
interest has happened. A common example is to announce that some data has been published.
Another example is to announce that some process has finished. The declaration of which
events are routed between which nodes is part of the application design process.

Manager

Manager is the master of all nodes in an application. Its existence is usually
transparent while running a session, but it is responsible for starting up the application
with all its nodes and event bindings. It works behind the scenes to ensure that events are
properly distributed throughout the system.

Launcher

A Launcher is the parent process for a set of nodes. There is typically one launcher
running on each machine that you intend to have nodes running on. The assignment of which
nodes will be started on a particular launcher is defined as part of the application.

Preset

A preset is a piece of data which encapsulates the state of an instrument. At any time,
the current state of an instrument (magnification, image shifts, camera settings, etc) can
be recorded for later use. There is a particular class of Node called the PresetsManager
which maintains a list of presets for the current Leginon session. These presets are used by
other nodes to set the state of the instrument prior to acquiring an image. This allows for
a series of images to be acquired at a consistent state, but possibly different targets (see
below). This is very similar to the "Low Dose" system on many microscopes, which consists of
a few presets like "Search", "Focus", and "Exposure". The Leginon PresetsManager is a more
generalized approach which allows for and unlimited number of presets to be used (like
several search presets at different magnifications, or multiple exposure presets at
different defocus).

Target

A target is a location where an image will be acquired. Targets are often selected from
existing images (using a TargetFinder node). Acquisition nodes are responsible for
interpreting Targets and then acquiring images of them.


< What is the Leginon System? | Graphical User Interface >



Testing pyscope instrument script functions

On the instrument host of the instrument, a TEM host that uses Tecnai class, for example, you can launch python command line window and try to create an instance of the instrument and then call a function such as getMagnifications in that like this:

import pyscope.registry
s = pyscope.registry.getClass('Tecnai')()
s.getMagnifications()

Error executing the include macro (Page not found)


< Install Ace2 | Processing Server Installation ^



Test Leginon on the Computer Controlling the Microscope

Using a Gatan Camera

  1. Open Digital Micrograph (or check that the Tietz software is closed).
     
  2. insert the Gatan CCD in Digital Micrograph.

Using a Tietz Camera

  1. Close Tietz TCL program
     
  2. Put camera switch box to select CCD.

Make sure that you have Leginon installed and configured

Start Leginon on the Microscope computer and Import Magnifications

  1. scope> Start Leginon (Either with the shortcut on the Desktop or follow the Start Menu-\Start\Programs\Leginon>Leginon)
     
  2. Leginon Setup Wizard> select "Create session" in session type. Even though you have created a session for simulation test, it is better to create a new session so that the path mapping difference betwee Windows and Linux does not cause confusion.
     
  3. Choose "Finish" in the set up wizard to start the session.
     
  4. Leginon/Main menu/Application> select "Run...." and choose the application named "Manual", both "main" and "scope" launchers will be set to the scope computer, and then launch the application.
     
  5. Leginon/Node Selector> select Instrument node.
     
  6. Leginon/Instrument> check that TEM is selected to display the parameters.
     
  7. Left-click on the tool "Get Magnification".
     
    This will import the valid TEM magnification from the microscope into the database.
     
    Note: During Leginon run an Application Error Message may pop up saying
     
    
    Exception EAccessViolation in module adaExp.exe at ....
    Access violation at address xxxx in module 'adaExp.exe'. Read of address xxxx
    
    

     
    Do NOT touch this message box, or leginon client will need restarting.

Acquiring the first real image

  1. scope> make sure you have beam and something other than a blank to image on the CCD.
     
  2. Leginon/Application/Run> select Manual Application.
     
  3. Leginon> From the list of nodes on the left panel, select Manual node.
     
  4. Leginon/Manual> Open the "Setting" tool and configure the settings:
     
  5. You should see your first real image acquired through Leginon in the image
    display panel.

Check on the Web viewer

Closing Leginon program on Windows

The best way to close Leginon program is to close the python command window (normally black) that shows up when the Leginon GUI appears since Leginon GUI window on Windows is controlled through the python command window

If you first close the GUI window, the python process is not ended. Therefore, the latter become frozen and you will have to wait for TaskManager to ask you to close the broken process.

Problem solving for the first mircoscope test

Most common problem at this point is that your TEM or CCDCamera does not show up in Leginon for use. It is caused by lack of proper functioning or non-communicating microscope scripting or CCD drivers to Leginon system's python wrapper in pyscope package. See Installation Troubleshooting and pyScope Bulletin Board regarding testing if pyscope is working for more.

If everything goes smoothly, test the network connection as in the next section and then do the same above image acquisition test through from the remote computer.


< Test Leginon with Simulator | Test Network Connection Between Remote and Microscope Computers >



Test Leginon with Simulator

Test Leginon with Simulator

TEM and CCD simulators are created automatically on the computer Leginon program started
at. They are convenient as a way to look around the GUI to try out buttons. The images
"acquired" are just random squares on background. Here we will use them to test the database
connection and storage disk mapping.

Start Leginon on the computer you will run the process

  1. Register as a Leginon user and then copy and personalize your configuration file before your first use.
  2. start-leginon.py (From any directory for Linux)
     
    OR
     
    from Start Menu: \Start\Programs\Leginon> Leginon (on Windows)
     
  3. Leginon Setup Wizard> select "Create session" in session type if a new session is needed.
     
  4. Leginon Setup Wizard> No need to edit client list as the computer where the program is started is automated added.
     
  5. Choose "Finish" in the set up wizard to start the session.

Acquiring the first simulated image

  1. Leginon/Application/Run> select Manual Application.
     
  2. Leginon> From the list of nodes on the left panel, select Manual node.
     
  3. Leginon/Manual> Open the "Setting" tool and configure the settings:
     
  4. You should see your first simulated image acquired through Leginon in the image display panel.

Check on the Web viewer

Follow the instruction in Manual Application Chapter.

Problem solving for the simulation test

Most problems regarding this test are caused by bad configuration. You should double
check your leginon.cfg, sinedon.cfg, config.php as outlined in
complete installation chapter. See Installation
Troubleshooting
, and the Leginon Forum or Web Tools Forum such as the topic " information not saved to db"
for common problems.

If everything goes smoothly, do a test directly on the computer controlling the microscope as in the next section.


Test Leginon on the Computer Controlling the Microscope >



Test Network Connection Between Remote and Microscope Computers

By far the biggest installation problem comes from network connection is block at the microscope computer from the remote computer where the main Leginon program is run. Here is a test to do before trying to start leginon operation at the remote computer. Leginon bulletin board has a thread that has various problems and solutions from users.

Start a Test Launcher on the Microscope Computer

  1. scope> go to the location where Leginon is installed, generally
    C:\Python25\Lib\site-packages\Leginon\
  2. scope> double click on test1.py. You should see something like this:
    INFO localtransport server created at location {'instance': <localtransport.Server object at 0x40e614cc>}
    INFO tcptransport server created at location {'hostname': 'myscope', 'port': 49152}
    INFO <class 'event.SetManagerEvent'> binding added for destination myscope, method <function printData at 0x40e63c34>
    ACCEPTING CONNECTIONS AT:  myscope:49152
    hit enter to kill
    

    **If the line before last says ACCEPTING CONNECTIONS ...., you have an opened port on this host.
     
  3. Write down the name of the hose, in this case "myscope", and the opened port, in this case "49152", and proceed to try to connect to that computer from the remote compute in the next step.

Attempt Connection from the Remote Computer

  1. remote linux computer> go to the location where Leginon is installed, type the following to find the location:
    start-leginon.py -v
  2. remote linux computer> start the 2nd test script with the host name of the microscope computer and its open port
    remote linux computer/Leginon>test2.py myscope 49152
    

    You should see something like this:
    INFO localtransport server created at location {'instance': <localtransport.Server object at 0x2b08e0d43810>}
    INFO tcptransport server created at location {'hostname': 'myremote', 'port': 49152}
    ACCEPTING CONNECTIONS AT:  myremote:49152
    INFO <class 'event.NodeAvailableEvent'> binding added for destination myremote, method <function printData at 0x2b08e0d51c80>
    CONNECTING TO:  myscope:49154
    WARNING localtransport client add failed
    INFO tcptransport client added
    INFO server location set to to {'TCP transport': {'hostname': 'myscope', 'port': 49154}}
    hit enter to kill
    
    INFO handling threaded
    INFO inserted in queue (class NodeAvailableEvent)
    INFO <class 'event.NodeAvailableEvent'> handling destination defcon1, method <function printData at 0x2b08e0d51c80>
    REMOTE CLIENT RESPONDED:  myscope:49154
    

If you get the last line "REMOTE CLIENT RESPONDED" with correct hostname and port, the
connection is fine. You can go to next section to test Leginon run on the remote
computer.

You can ignore the following error message print out in test1.py on the microscope PC when you exit it.

tcptransport.TransportError: No route to host

Problem solving tips

Most likely reason for the failure of the test: FIREWALL

Another possible reason for the failure of the test: HOST file requirement

Try add the client host in your host file on the main Leginon computer, and vice versa.

Modify your host file to include the host (Create it if not exist).

/etc/hosts

C:\\WINDOWS\system32\drivers\etc\hosts

C:\\WINNT\system32\drivers\etc\hosts

The Linux main Leginon computer also needs to identify itself by its hostname registered on Microscope Windows computer.

You can modify it using the "hostname" command.

To confirm what python thinks the hosname is, run the following in python command line:

import socket
socket.gethostname()

< Test Leginon on the Computer Controlling the Microscope | Run Leginon Client on the Microscope Computer >



Test run operation problems

Python and Leginon windows do not stay opened on
Windows PC

Why: Testing: Start Leginon from a python command window so that the error message can be
read

Windows/Start Menu/All Programs/Python2.5/Python (command line)

Missing modules

Why: Testing:

If the missing module is not installed under one of the Python module search path
found in the syscheck output, it need to be moved.

"Tecnai" does not show up in instrument list

Why: Testing: Import the module in pyScope package through a python command window so that
the error message can be read

Windows/Start Menu/All Programs/Python2.5/Python (command line)

For example, if "Tecnai" is missing from the instrument list, try
this:

Python>from pyScope import tecnai
Python>myscope = tecnai.Tecnai()
Python>myscope.getMagnification()

Magnification list not in the database

Why:
first time the TEM is used by leginon and the database, the valid magnification
for the instrument needs to be saved in the database.

Solution: On the scope: Leginon/Instrument> select the microscope to display
parameters and click "Get Magnification" button (The icon is of a calculator) on the
tool bar.

Leginon fails to aquire and save larger images

Why:

Solution:

Put on your computer more memory and more memory swap space.

Solution:

Let us know if you have one.

Leginon fails to move the goniometer after a new
installation or update of pyScope

Why:

Solution:

Double click updatecom.py to run it in the (installed) pyScope folder.


< Administration Tool problems | Network problems >



The Application

Manual Application is the simplest application example of leginon. It is designed for users who want direct interaction with the microscope but prefer the convenience of browsing through images with the leginon web-based viewer. The application records CCD images at user's command either using the current microscope setup in normal mode or switching automatically to the exposure mode setup in the low-dose mode. In other words, pressing the "Acquire" tool in the application's manual node is equivalent to hitting the "exposure" button on the microscope except that the image is recorded on CCD rather than on film. This application is still under development, especially regarding its use without the project database, an NRAMM internal database for tracking project information.

The following is a diagram showing control of functions in nodes and the location of them on the two launchers:


Startup >



The EM node

The EM node or tab is the node that is running on the microscope computer. This node is responsible for communicating to the microscope, CCD, and Leginon. Without the EM node, Leginon cannot control the microscope.

Required bindings: None

Microscope paramters

Select TEM to view and sometimes change microscope parameters

Camera parameters

The current camera parameters are displayed in Leginon/EM>

Information:

Settings:


< Drift Manager | FFT Maker >



Tietz camera configuration

Register the Tietz ping callback function. From a command line window:

cd C:\python25\Lib\Site-Packages\pyScope
C:\python25\python.exe tietzping.py

Some Tietz camera dimensions are slightly larger than a standard size, for example, 2084 x 2084 instead of the standard 2048 x 2048. Some software will have trouble dealing with these dimensions. It is recommended to force the camera to the lower standard size (some multiple of 2^n). Modify the function that gets camera dimension in tietz.py, gatan.py, or tia.py depending on which camera you are using.

 def getCameraSize(self):
    return {'x': 2048, 'y': 2048}


For Complete Installation, go to Calibration Application Chapter next.

< Calibrations required on FEI microscopes | Good Alignments Save Time>



Tips on Operation

Presets

Warm up objective lens after acquiring grid atlas

Grid Targeting Robot Node

Move Type

Section Z Focus Node

Pre-exposure

Queuing


< Other special preference set-up | Leginon "RobotMSI-Section" Application ^



Tomography

The Tomography node is a subclass of Acquisition. This node receives a Published Target List and navigates to each target using the specified Move Type. Then, a series of images at assigned tilt angles are acquired and published to the database. Many of the Algorithms are based on UCSF Tomo. The node can also initiate dose measurement and alignment of zero loss peak for Gatan energy filter.

Be aware that this node multiplies the CCD counts by 10 and converts the values into signed Int16 before it is displayed and saved as MRC file to reduce the file size. Therefore, a CCD count (after binning and flat-field correction) of 3276.8 or higher will overflow.

Required bindings:

TomographyNodeAlias- (ChangePresetEvent) -> PresetsManagerNode
PresetsManagerNode - (PresetChangedEvent) -> TomographyNodeAlias

Bindings with the previous target makers or click target finder:

TargetMakerNodeAlias - (ImageTargetListPublishEvent) -> TomographyNodeAlias
TomographyNodeAlias - (TargetListDoneEvent) -> TargetMakerNodeAlias

Optional Bindings with DriftManager to allow target correction after drift:

TomographyNodeAlias - (NeedTargetShiftEvent) -> DriftManagerNodeAlias
DriftManagerNodeAlias - (AcquisitionImageDriftPublishEvent) -> TomographyNodeAlias

Optional Bindings with another Acqusition subclass (for example, Focuser or Acquisition) that processes target types rejected by Tomography node:

TomographyNodeAlias - (ImageTargetListPublishEvent) -> AnotherAcquisitionSubNodeAlias
AnotherAcquisitionSubNodeAlias - (TargetListDoneEvent) -> TomographyNodeAlias

Optional Bindings to Reference subclass (for example, DoseMeasurement or AlighZLP) that initiates a set process at the reference target position:

TomographyNodeAlias - (DoseMeasurementPublishEvent) -> MeasureDoseNodeAlias
TomographyNodeAlias - (AlignZeroLossPeakPublishEvent) -> AlighZeroLossPeakAlias

Tomography Toolbar ( Leginon/Tomography/Toolbar> )

Tomography Settings ( Leginon/Tomography/Settings> )

The top portion is identical to Acquisition/Settings in an Acquisition node. Only the part related to Tomography is described.

Start at 0 degree and using a negative step cause the node to collect data in the negative angles first.


< RobotAtlasTargetFinder | Transform Manager >



Transform Manager

The Transform Manager handles all shift corrections that need to be done after drift is declared. The class will be expand to do transformation other than shift in the future.

By the request of an Acquisition Node, the transform manager reaquires ancestors of the target that requires transformation in order to create the transformed target.

Any acquisition or focuser node that need target correction requires two bindings.

AcquisitionNode or FocuserNode - (TransformTargetEvent) - > TransformManagerNode
TransformManagerNode-(TransformTargetDoneEvent) -> AcquisitionNode orFocuserNode

For TransformManager to change presets, two bindings are needed:

TransformManagerNode - (ChangePresetEvent) -> PresetsManagerNode
PresetsManagerNode -(PresetChangedEvent) -> TransformManagerNode

Settings

Toolbar


< Tomography



Troubles with Calibrations

Magnification list not consistent with that at the
microscope

Commonly Why: Instrument was not selected correctly when Leginon is installed

Solution: Check the parameters of the named instrument in Administration Tool


< Troubles with Imaging



Troubles with Calibrations - Troubleshooting

Matrix calibration fails

*Display correlation map in the matrix calibration node during the calibration can help identify the source of the failure.

Observations and Why:

Solutions:

Beam shift matrix calibration fails

Observations and Why:

Solutions:


< Troubles with Focusing and Drift Check | Troubles with Tomography >



Troubles with Focusing and Drift Check

Focuser and drift manager toggle back and forth forever

Commonly Why: Threshold set in focuser/autofocus is significantly smaller than that in drift manager in absolute scale. This is a bug in Leginon to some extend caused by a small movement of the image when the a new state of the beam is set so that the focuser records bigger drift than the drift manager.

Solution: Increase Focuser/Autofocus Drift Threshold and/or increase the wait time between checking drift in Drift Manager.

Still not working: Despike might not work in the corrector

Solution: Consider increasing Despike neighbor size (odd number only) or decreasing despike threshold.

Still not working: You are on a day with a lot of cosmic events that cause the cross correlation fails.

Solution: Finding a way to reduce exposure time might help as it reduces the possibility of cosmic ray hitting the CCD.

Failed autofocus in Focus node

Commonly Why:

Solutions:

Failed autofocus in Z Focus node

Commonly Why:

To identify which is the source, observe the image, correlation, and peak during beam tilt autofocusing. Also check in the log the residual value (so called min) of the fitting.

Solutions:

Objects reverse contrast during autofocus

In this case of autofocus failure, objects such as holes change from lighter than matrix to darker as if a dark-field image is collected during the autofocus beam tilts.

Commonly Why:

Solutions:


< Troubles with Targeting | Troubles with Calibrations >



Troubles with Imaging


< Network problems | Troubles with Calibrations >



Troubles with Imaging

Image is acquired but contains no real information

Commonly Why:

Image is acquired but contains artifacts either in image or in Fourier Transform

Commonly Why:

Can not read reference images that were acquired by other users

Commonly Why: You don't have permission to read their image files

Solution:

The person is not around when this happens:

Acquire your own reference images at the camera setting that needs the dark and bright images. However, Leginon always look for the most recent calibration in the database by anyone. Every user will have to do this everytime if the permission problem is not solved.

Beam shifts away from imaging area over time

Commonly Why:

Solutions:

Beam shifts away from imaging area only when targeting move type is image shift

Commonly Why:

Solutions:

If the accuracy of moving stage to eucentric height by the focus sequences in "Z Focus" is still not sufficient. Add another focus step performing the same task as Z_to_Encentric step. Repeating beam-tilt based autofocusing often improve the accuracy unless the calibration is off.

Still not working: You have chosen a target that requires too much image shift for an independent image shift from beam shift. This is necessary when the lower mag targetting is not good either because the preset image shifts are not aligned or the stage position movement is not properly modeled.

Solution: For image shift problem see solution for "Target is consistently off in the same direction and distance". For stage model problem, see "Modeled stage calibration" in setup notes.

Beam shifts away from imaging area when targeting move type is stage movement

Commonly Why:

Solution: Check and correct microscopic alignment error. Preset parameters checking and reset may be necessary after the correction.

Comments: If the problem persist, the original stage matrix calibration may have been performed with a bad alignment. The calibration should be redone with a well-aligned scope in LM mode.

Objective aperture appears off in "sq" preset when it is centered in HM mode

Commonly Why:

Solution: Check and correct microscopic alignment error. Preset parameters checking and reset may be necessary after the correction.

The specimen appears over-dosed in the high magnification images or the dark correction image has a high value (while using a Gatan CCD)

This issue may occur when the shutter is incorrectly configured through Digital Micrograph (the imaging software for the Gatan CCD that resides on the TEM computer) or simply a bad dose calibration or too long an exposure time. To issue these corrections:

  1. Set the "shutter" to "Auto" on the external control box attached to the TEM.
     
  2. Open Digital Micrograph on the Microscope computer and go to the Camera Set-up page.
     

The exposure image has a circular imprint of the beam at the size of the preset used for melting the ice

This issue may occur when the main screen is left up during very long (such as over 30 sec) ice melting and at high HT. Leginon has a mechanism that put the screen down during ice melting. It is caused by over-saturating the Phosphur layer on the CCD. If you see this effect, the screen may have failed to lower. Please test it by observing the screen movement with simulating target in any focuser node that has ice melt time set not to zero. Report the problem back to the leginon team if you are sure it is not your scope's problem.


< Hardware Troubles | Troubles with Targeting >



Troubles with Targeting

Grid mosaic is too small to see the details

Why:

Solution:

  1. Leginon/Square Targeting/Mosaic Settings> Change "Scale Image" to a larger
    size
     
  2. Leginon/Square Targeting/Mosaic Settings> Click "Apply" and then "Create" the
    mosaic atlas.

Grid mosaic is not patched together well

Commonly Why:

Solutions:

  1. Correct the alignemnt error or redo <link linkend="mcal_st_pos">stage position matrix calibration</link>
     
  2. Acquire a new atlas
     

Grid mosaic display in Leginon is different from that of the Web Viewer

Why:

Solution:

More Explanation:

Targeting is consistently off in the same direction and distance

Commonly Why: Image shifts in "hl", "sq", or "gr"presets are not aligned with the presets at higher mags. The low mag "sq" preset is especially prone to this problem.

Important: When the targeted image is off, it normally means the image shift of the preset where the target comes from is off. That is, if hole images appear off, it is not the image shift of "hl" preset that needs correcting but that of "sq" preset.

Solution:

Perform Preset Image Shift Alignment

Still not working: You may have an invalid combination of settings such as using Iterative Stage Movement while queuing up targets on the images so obtained.

Solution:

Targeting is consistently off in opposite direction from where you pick

Commonly Why: Camera configuration is different in calibration and now.

  1. All your targeting would be wrong. "Abort" target processing in the Target Watcher of "squares" and "holes".
     
  2. If you use the Tietz camera: scope/Leginon/Instrument/Camera> check your camera configuration. mirror should be ['vertical']. Change it if not, and "Set" the configuration.
     
  3. If you use the Gatan camera: scope/Digital Micrograph> check your camera configuration.
     
  4. Leginon/Presets Manager> send "sq" or "grid" "To Scope"
     
  5. Leginon/Navigation> "Acquire" an image with "Use this configuration" Unchecked in the Camera Configuration.
     
  6. Leginon/Navigation> "Navigate" by "Image Shift", "Beam Shift", or "Stage Position" to center on a reference object or burn mark made in the high mag presets. This is to check if it behaves correctly now.
     
  7. Select targets again, or, if atlas is wrong, republish the target list to make the atlas.

Hole targeting is inconsistently off or goes bad in the next run after correction

Commonly Why: Not well understood but may be related to microscopy alignment and settings such as normalization of lenses. up to 1.5 um error has been observed even with a reasonable calibration. The following solutions only works some times.

  1. Leginon/Drift Manager>"Declare Drift" to force correction for possible drift.
     
  2. Repeat image shift correction alignment as in the case when targeting is consistently off.
     
  3. Ignore the first targetted '"hole" in the "squares" image. The second and on are more consistent when there is a hysteresis problem.
     
  4. Repeat "Mag Only" Modeled Stage Calibration at the "square" preset.

Hole targeting is off more when the image shift target is away from the center of the image

Commonly Why: Not well understood but may be related to microscopy image shift causes different physical movement at different magnifications since Leginon uses the image shift calibration at the lower mag where the target comes from to determine the required image shift at the higher mag.

No current solution

Automatic hole finding fails to pick up good ice thickness after set up

Commonly Why:

Solutions

No broken grid square for dose measurement and ZLP alignment for MSI-Tomography

Solution


< Troubles with Imaging | Troubles with Focusing and Drift Check >



Troubles with Tomography

Unusual intensity range in the tomography image

Two possible reasons:

  1. The exposure time has been modified by the tomography node to spread the total dose to all images in the tomogram.
     
    Solution: Reduce the total dose or reduce preset beam intensity. You can find the real exposure time from the log panel of the tomography node or through the information page of the image in the web image viewers.
     
  2. The image intensity of images collected by the Tomography class node does not have the same meaning as in other images in Leginoon. The flat-field corrected intensity values are multiplied by 10 before the image is saved and displayed as MRC image as signed 16-bit integer. Therefore any original CCD count of 3276.8 or larger will overflow. All other images in Leginon are saved without manipulation as float. Therefore, the images obtained through tomography node and another acquisition nodes will appear differently in the both the web image viewer and within Leginon.
     
    Solution: Reduce the total dose.
     
    Find out what exposure time corresponds to the fractionated dose from your tilt angle step and range and total dose and take an image at tomo preset with such an exposure in Navigation node. You will need to reduce the total dose if a good fraction of the counts are larger than 3200 even though it would not appear to be saturated in the float scale without the 10x factor.

Large movement between tilted images

Find out how smooth the movement is by comparing the images.

If transition is smooth and linear:

  1. Magnification too high
     
    Solution: Lower the magnification or perform low-magnification rough model fitting.
     
  2. Optical axis offset model is too different from the initial guess for the non-linear least-square fitting.
     
    Solution: Perform low-magnification rough model fitting.

If transition is not smooth nor linear:

  1. Goniometer behavior unpredictable
     
    Solution: Service the goniometer.

Failure of xy feature tracking

Feature tracking in x and y axes is a 2nd order polynomial fit of preceeding data points. The default uses 5 data points. When a sudden jump occurs in the tracking error, it
tend to follow the trend of the last point. If the jump is a temporary clich in the goniometer, this tend to over correct the tracking error and eventually loose track as shown
in Figure 1. A possible fix is to increase the number of data points in the fitting. This can be set in the tomography setting "Smooth n tilts for defocus prediction". 4 in defocus
prediction is equivalent to 5 points (n+1) for xy tracking.

Figure 1

Large tracking error between the first and second tilt
images

The first image in each tilt group of the tilt series at the "start" angle (normally 0 deg) and the second image at tilt of "step" angle from the "start" angle do not use the
fitted model. It is assumed that the eucentric height judged by stage alpha wobbling in the "Tomo Focus" node gives a stage height that the tracking of feature by such a small tilt
would be good enough. In most cases this is a reasonable assumption. However, we have had experience of goniometer alignment problem where the assumption fails. The symptom is
illustrated in Figure 6 below. Note that the Feature tracking error is displayed as percentage of the image length.

Figure 2

This tilt series was taken with a starting angle of zero and at an image size of < 1 um. As can be seen here, apart from the 2 and minus 2 degree tilts, the tracking error was less
than 2 % of the image. Only the tracking of the feature between 0 and +/- 2 degrees are large. At close to 20 % error, this made the overlap between plus and minus 2 degrees unacceptable and
often cause popular alignment programs to misalign the two half of the series.

The first solution is of course to report it to your microscope service engineer. When we had this problem, many users noticed that it was difficult to adjust stage to eucentric height manually with alpha wobbler. Features jumped while the goniometer changed rotation direction. In addition, different magnitude of tilt range suggests different eucentric heights. It is not easy to fix this, so it might take a while. At the end, a loose screw was found which makes the motor slips when it starts to tilt in one of the direction.

Before the hardware is fixed physically, it is still possible collect tomograms. The model fitting of the overall curve in the above case gave z0 of +5 um through the whole tilt series (Figure not shown). Therefore, by moving the stage up by such an amount after the stage-tilt-based autofocusing can bring us to the correct height for tomography. This can be acheived by saving the "tomo eucentric" focus current to the database, align rotation center for this stage height and focus. Then change the correction type of the "Beam_Tilt_Fine" focusing step to "Stage Z".

Failure of model-based correction

The model used in the defocus correction in Leginon tomography node is a very simplified one. There are a few cases when the approach fails. Here are ones that we have encountered:

Y-axis looping

The microscope goniometer does not move on only the tilt axis. With its complex structure, a common problem is that when the stage is highly tilt, the position slips in the y-direction. This is known as looping. Figure 3 shows an example of this problem.

Figure 3

While the x-axis position shifts monotonically as a stable model should be, the y-axis in the positive tilt direction changes little from 0-30 degrees before it increases rapidly after 30 degrees. Even though the tracking in xy plane is still good, the defocii correction at these higher tilts may no longer be correct if the tilt axis parameters are fitted dynamically. Figure 4 shows the model parameters of the same tilt series where the fitted phi and offset starts to change above 30 degrees even though the tilt axis has not moved according to the shrinking behavior of the images during the tilts. Note that in this particular case the looping problem is still mild so that the over-correction is not very strong. only a small slope change is resulted in z0 prediction. In worst cases, the defocus over-correction is so large that the adjacent images can not correlate properly and even the xy tracking would fail. The spikes around zero tilt is a display data sorting error of the identical starting tilt of the two tilt groups.

Figure 4

Other than asking microscope service engineer to fix the looping, one can find the best fixed model in the series to apply to future tilt data collection. To make the fixed
model permantly saved to the database, follow these steps:

  1. tomography/settings/model>activate "keep the tilt axis parameters fixed".
  2. tomography/settings/model>initialize the model with "custom values". Enter best estimate of the fixed model. For example, in the positive direction, enter phi as
    -2.17 degrees and axis offset as -1.52 um. since these are the stable values up to the point the y-looping starts.
  3. tomography>collect a full tilt series. If the run is successful with good tracking in all three axis, the model will be saved in the database for this
    magnification.
  4. tomography/settings/model>From now on, you can initialize the model with "only this preset" or "this preset and lower mags"

Grid slips between the first and second tilt directions

When the holder does not hold the grid tightly, the grid slips to a different position when the first tilt direction ends and the goniometer quickly returns to zero tilt. Leginon is designed to adjust the target before the second tilt group starts. The default setting for this function is to use only the parent image (i.e. one ancestor) where the target comes from as reference. If the slip is larger than the size of the parent image, the adjustment may fail, and a random target would be acquired in the second tilt group.

Starting from Leginon 1.6, the target adjustment can be done with all ancestor images of the target by choosing "all" in the acquisition part of the tomography node setting to adjust target with all ancestors. The node "Target Adjustment" limits the lowest magnification that this target adjustment would go up in ancestry. The default is at 300x so that the presence of the objective aperture does not create difference in the reacquired ancestor image from its original.

Strong and continuous specimen drift

The model used in Leginon considers any shift of feature in the image a result of tilt axis not aligning to the center of the detector. With the phi and offset fixed, all errors are accumulated in z0 and results in bad defocus correction. There is no solution to this at the moment.


< Troubles with Calibrations - Troubleshooting



Trouble shooting

  1. Getting Help
  2. Do and Do Not in leginon
  3. Pausing and Aborting during data collection
  4. General operation problems
  5. Hardware Troubles
  6. Troubles with Imaging
  7. Troubles with Targeting
  8. Troubles with Focusing and Drift Check
  9. Troubles with Calibrations
  10. Troubles with Tomography

< Frequent Asked Questions | Preferences Setup >



Updated Applications (All)

Manual

Power spectrum can be automatically calucated from the acquired image and displayed in
its own node to allow easy inspection.

Calibrations

New binding required by Navigation node.

MSI

New binding required by Navigation node. Drift management is divided between Drift
Monitor and Target Adjustment. A Preview and a Beam Fixing node are now standard in all MSI
applications

Robot2 class that uses database as midpoint to communicate bettween leginon and the
robot controller replaces Robot class


< New User Features | New Project Web Tool Features >



Update from v11 and v12 NOT AVAILABLE

The updates from v1.1 and v1.2 are not availabe. You will have to first update to v1.3 in
order to update to v1.4 because of a change in database behavior.


Upgrade to Leginon System version 1.6 ^



Update from v13-Follow v14 update after performing these

The changes from v1.3 includes update of all in-house components of Leginon and dbemtools,
mrctools but not the database. A new configuration file (sinedon.cfg) is required. The updated
mrctools and dbemtools installation (required) is now performed through "php devel" so that it
can be customized according to the php version installed on the web server.

Install the supporting packages first if missing:

Follow the instruction for your specific Linux distribution.

For example, SUSE users can use YaST to install them

Name: Download site:
NumPy 1.0b5 or higher http://www.scipy.org
SciPy 0.5.1 or higher* http://www.scipy.org ",
http://repos.opensuse.org/science":http://repos.opensuse.org/science

*SciPy may not build properly on some versions of SuSE due to an incompatible LAPACK
package that comes with SuSE. You can get scipy as well as a compatible LAPACK etc. from
http://repos.opensuse.org/science (need to specify your SuSE version and machine
etc.)

Install php devel packages on the web server first if missing:

You can check whether php devel is installed by
typing

 >cd [webdirectory]            #/var/www/html in this example
>phpize

Follow the instruction for your specific Linux distribution. http://rpmfind.net/linux/RPM/Development_Languages_PHP.html has some
examples.

For example, SUSE users can use YaST to install them

Install the new mrctools

mrctools 1.4 will work better with Leginon 1.4 and 1.5. It is no longer included in
dbemtools and is now installed from php devel directory.

All MSI Applications

Calibration

None

Manual

None


Upgrade to Leginon System version 16 ^



Update from v14

Follow update instruction for update from v1.5. In addition, clean up leginon and sinedo
configuration as instructed here whether your installation is on Windows or Linux.

Clean up leginon.cfg:

Sinedon now have full control of database interaction, therefore, the database
configuration in leginon.cfg is no longer needed.

[Database]
host:[your_host]
name: <link linkend="db_example_names">dbemdata</link>
user: <link linkend="db_example_names">usr_object</link>
passwd:

Configure sinedon.cfg:

Since Leginon 1.5 release, Sinedon configuration can either be globally configured by
including sinedon.cfg with the sinedon installation or overwriten by users by including the
same-named file in his/her home directory.

See <link linkend="sinedon_cfg">sinedon configuration</link> subsection in Complete
Installation Chapter.


Upgrade to Leginon System version 16 ^



Update within the same version using svn

From time to time, we discover critical bugs that users are encouraged to update within the branch (x.x version) that they have checked out. Here is how to update when these situation arrives.

You still have the svn check out of the whole myami superpackage:

  1. Go to the myami directory
  2. Confirm that this checkout working sandbox is the branch you want:
  3. update the checkout
  4. For the each of the python subpackage that changes are made, redo the python installation with the same command you used originally. For example, if changes were made in leginon subpackage, you would install leginon by
  5. For changes made in myamiweb, you should just copy individual files involved to your webserver at the relevant locations. You may also replace the whole myamiweb directory over, but you will then need to cp config.php from the old copy into the new one.

Upgrade Instructions

  1. Update within the same version using svn
  2. Upgrade from earlier versions to version 1.6
  3. Upgrade to Leginon System version 2.0 from version 1.6
  4. Upgrade to Leginon System version 2.1 from version 1.6
  5. Upgrade to Leginon System version 2.1 from version 2.0
  6. Upgrade to Leginon System version 2.2 from version 2.1

< Version Change Log | Complete Installation >



Upgrade to Leginon System version 16

  1. Update from v1.1 and v1.2 NOT AVAILABLE
  2. Update from v1.3-Follow v1.4 update after performing these
  3. Update from v1.4
  4. How to Update from v1.5 (Linux)
  5. Import the new (1.6) applications included with Leginon
  6. How to Update from v1.5 (Window)
  7. Additional work at the computer controlling the microscope and camera (Window)
  8. Recommended Application Preference Changes when updated from version 1.5

Upgrade to Leginon System version 2.0 from version 1.6 >



Upgrade to Leginon System version 2.1 from version 1.6

Procedure for upgrading from 1.6 to 2.1 is identical to that to 2.0 Please follow its instruction but substitute for 2.1 where ever version 2.0 is called for.


How to Update from v1.6 (Linux) >



Upgrade to Leginon System version 2.1 from version 2.0

  1. How to Update from v2.0 (Linux)
  2. How to Update from v2.0 (Microscope Windows Computer)

< Upgrade to Leginon System version 2.0 from version 1.6



Upgrade to Leginon System version 22 from version 21

  1. How to Update from v2.1 (Linux)
  2. How to Update from v2.1 (Microscope Windows Computer)

< Upgrade to Leginon System version 2.1 from version 2.0



Upgrade to Leginon System version 2.x from version 1.6

  1. How to Update from v1.6 (Linux)
  2. How to Update from v1.6 (Microscope Windows Computer)
  3. Preparation before Using v2.x Routinely

< Upgrade from earlier versions to Leginon System version 1.6



Grid management

Grid management shared

You may register grid boxes and grids by projects. This is mainly used with grid handling
robot.


< Edit an existing project



< Operation | Robot Node >



Use the Application Editor to create Leginon applications

  1. Start a leginon session
     
  2. Select Menu/Application/Edit...> to start a new application
     
  3. Or Select Menu/Application/Load> to load an existing application for editing
     
  4. Rename an application or a launcher
     
    First selecting the item with left click and then click on it again to edit.
     
  5. Add a Launcher.
     
  6. Add a node within a Launcher.
     
  7. Add Event Bindings between nodes.
     
  8. Save the application through Application/Save> or Save As>

Reload and Edit an existing application >



Using "MSI-SimuTomography" Application for debugging

MSI-SimuTomography application uses the images and parameters saved for a particular tilt series to recreate and display what the algorithm has done during the data collection. It is mainly for spotting problems that was not observed since the users are often away from the computer running the Leginon during data collection.

The application is available in your myami installation under leginon/applications and you can import it following the instruction for Application Import through the web administration tools.

Starting the application

This application does not require the microscope to run and should always run on an existing session since you want to simulate an existing tilt series from an existing session.

  1. Start Leginon
    start-leginon.py
    
  2. Choose to return to the session that you want to run the simulator in, Edit the client list to remove the scope as an client so that you don't interfere someone else's running Leginon session.
  3. Leginon/Application/Run...> Choose from the run application list, "MSI-SimuTomography" to start the application
  4. Let all node launchers be your current computer, they have no consequences in this application.

Setup parameters

  1. Leginon/Tomography> click on settings tool for the node to open the settings window.
  2. Leginon/Tomography/Settings> select the tilt series that you want to recreate display and change other parameters if you want to see the effect of different correction method on the tracking process. By default, you should use "saved value for this series" as the model.
  3. Leginon/Tomography/Settings> click "OK" button to save and close the settings window.

Start and Observe the tracking process

Leginon/Tomography> click on "Simulated Target" tool to start the simulation. You can repeat the process as many times as you like.

The display layout looks like the tomography node in the actual data collection. You should check:
  1. Does the correlation peak appears at the expected position as indicated by the pair of images in the first two panels.
  2. Is there any error message appears in the Leginon logger window or at the text terminal where Leginon was launched.
  3. If you have changed the parameters used for correlating the images, does any of the print out in the text terminal regarding current Prediction or correlation in favor of finding the better tracking and/or correct position of the correlation peak?

If you find a better set of parameters, try them out on other tilt series in the same session to make sure that they do not cause degradation of tracking performance on them. If there is no problem, you can use the new parameter next time when you acquire tilt series of the similar sample.


< Full Protocol on a F30 with an energy filter | Leginon "MSI-Tomography" Application ^



Using Leginon at Scripps

Visitors Guide - Using Leginon and Appion at NRAMM


Before you arrive:

Register for an NRAMM user account

Submit a project for approval

Reserve time on the TEM


When you arrive:

Step 1: Set up your user accounts

Step 2: Receive an introduction to Redmine, the Leginon and Appion project management tool

Step 3: Receive an introduction to using Appion and the Appion/Leginon database tools


During your visit:

Running Leginon

Troubleshooting

If you believe you have found a bug in Leginon, try to find someone in the AMI group to help you. There may be a known solution to your problem. If all else fails, you can revert to using "leginon" instead of "betaleginon". This starts up an older stable version of Leginon, but may be missing some of the latest features.

Leginon

Appion


Using Leginon on a system where the microscope and camera are controlled by different computers

Newer digital camera often comes with its own Windows PC for faster processing. Leginon can handle this case by having one Leginon Client running on each of the Windows PC. The installation is identical on the two Windows PC except at two places:

When Leginon is used, the separated microscope/camera computers are accounted for by including both hosts in the client list and by opening applications that allow Leginon to put separate Instrument nodes on the two hosts. Therefore:

How to modify one-client application to be used in this two-client system:

We only made two-client applications that are more popular in the repository. If you need others made, here is the procedure.

  1. Start Leginon and a session on the Linux computer. No clients need to be connected for application editor.
  2. Choose to "Edit" under Application menu bar.
  3. Select the application need to be modified and load.
  4. Change the application name. Convention is to add "2" at the end of the name.
  5. Right click on the application name to add a launcher for camera. i.e., camera
  6. Right click on the new launcher to add a node. Choose EM class as the class of the node and give it an unique alias such as Camera.
  7. Save the application.

Using Project Management Tools

  1. Recommendataion-Dividing projects by long-term goal
  2. Go to project tools page
  3. Add a new project
  4. Edit an existing project
  5. Grid management

Project database and the php tools called "project" are designed to divide experiment
sessions into related groups. Experiments in each project usually are of the same of similar
specimens or under the same long-term goal. Security can be added to the data of a particular
project although the current release does not include the particular mechanism used at NRAMM.
Please contact us if you need such implementation. The results from different sessions of the
same project may be combined for analysis by Appion.


< Leginon Administration Tools | Installation Troubleshooting >



Using the Web viewer

  1. From any computer, start a Web Browser such as Netscape, Mozilla, Firefox, or Internet Explorer.
     
  2. Go to your local myamiweb site (http://YOUR_HOST/myamiweb) and select an Image Viewer. There are several to choose from:
     
    1. Image Viewer Overview
    2. Image Viewer
    3. 2 Way Viewer
    4. 3 Way Viewer
    5. Dual Viewer
    6. RCT

     
  3. Select the session to be viewed at the top. (Project database users can use the project selector to narrow down the sessions appeared in the session selector).
     
  4. Select from the image names appeared in the list on the left to view a particular image in the viewer.
     
  5. If the pixel calibration for the magnification of the image has been entered into dbem, you can click on the "i" button on the toolbar to get a report of the image information.

< Advanced Features



Version Change Log

  1. Leginon System version 2.0
  2. Leginon System version 2.1

< An introduction to Leginon | Upgrade Instructions >



Visitors Guide - Using Leginon and Appion at NRAMM


Before you arrive:

Register for an NRAMM user account

Submit a project for approval

Reserve time on the TEM


When you arrive:

Step 1: Set up your user accounts

Step 2: Receive an introduction to Redmine, the Leginon and Appion project management tool

Step 3: Receive an introduction to using Appion and the Appion/Leginon database tools


During your visit:

Running Leginon

Troubleshooting

If you believe you have found a bug in Leginon, try to find someone in the AMI group to help you. There may be a known solution to your problem. If all else fails, you can revert to using "leginon" instead of "betaleginon". This starts up an older stable version of Leginon, but may be missing some of the latest features.

Leginon

Appion


Ways of Moving to Targets in Nodes that acquire images inside MSI

Nodes that acquire images at each of the multi-scale mostly belong to a base class called Acquisition and have an icon that looks like a camera. There are many settings related to this main building block with many options for moving the received target to the detector center (targeting, in short).

Targets can be moved to the center of the detector for image acquisition using one of the
following calibrations:

There are two movers to chose from: Presets Manager and Navigation. Presets Manager provides
a simple one trial movement. It assumes that the move calibration is good enough to reach the
target directly. Navigation Node is more flexible, since it can be configured to perform
multiple trials. However, most of multiple movement benefit is only relevant in the case of
Stage Position/Modeled Stage Position move type. It is also not recommended to be used to
acquire images that queued targets will be selected on.

To achieve a movement of defined tolerance, movement by Navigation Node with multiple
trials checks the error of targeting after each trial move. If the error is larger than the
tolerance, the target location is recalculated from the current location, and the targeting
movement repeated. It was noticed that on FEI microscope, the movement error is lower if the
required move is smaller. Therefore this algorithm allows even a badly performed goniometer to
target accurately, at the expanse of multiple exposure in the general area. At low
magnification and highly binned short exposure, this is usually not a problem.

The settings in the Acquisition Class that determines the above tolerance is named
"Navigator Target Tolerance". You can set this setting to 0 which will turn off multiple move
option and perform the move as if it is Presets Manager.

Occasionally, the additional trials do not further reduce the targeting error due to
sluggishness of the goniometer movement. The user may want either to accept this closest
targeting or to abandon the acquisition sequence. The decision often lies in how long the
acquisition sequence is and how likely that such image with lower standard is likely to be
useful. For example, as a target for tomography tilt series, a missed target can translate to
30 min of wasted scope time. However, a slight miss that causes the target not centered but
still in the view is worth data collection effort.

The settings in the Acquisition Class that determines the above abort/proceed tolerance is
named "Navigator Acceptable Tolerance". The "Acceptable Tolerance" should always be larger
than the "Target Tolerance".

In addition, a final image shift can be applied to resulting multiple move location
although in most cases this does not improves the targeting if the targeting error is already
smaller than 1e-7 m.


< Multi-Scale Imaging Concept | Flavors of MSI applications >



Web Server Installation

The following applies to the computer that will host the web-accessable image viewers and project management tools. This also provides the main user interface for Appion.

  1. Differences between Linux flavors
  2. Install Web Server Prerequisites
  3. Configure php.ini
  4. Install Apache Web Server
  5. Check php information
  6. Download Appion and Leginon Files
  7. Install the MRC PHP Extension
  8. Install SSH module for PHP (Appion only)
  9. Install the Web Interface
  10. Install phpMyAdmin (optional)
  11. Troubleshooting


< Processing Server Installation | Additional Database Server Setup >



What is in this Chapter

Leginon runs under both the Linux and Microsoft Windows Operating systems. However, the
current php-mrctool can not be installed on Windows which means mrc images can not be viewed
on the web. See the section on Possible Computer Set-up Configurations for details.

The many components for the Leginon system are divided into packages and need to be
installed separately. It has been integrated with several third party software packages that
are necessary for its operation. The installation documentation will describe how to set-up
Leginon and give hints as to how to install and set-up the necessary third-party software.
This documentation is not intended to support the additional, but necessary third-party
software.

There has been interest in installing Leginon under Mac OS X. While this is possible in
theory, we have not been successful in installing a fully functional system. The two main
problems are (1) compilation of php-mrctool from the pre-installed php and (2) wxPython on Mac
is unable to hide bitmap objects which makes Leginon graphical user interface difficult to
use.

See Installation Troubleshooting and the Leginon Forum searching for "install" if you run into problems.


< Four Parts of the Leginon System | Possible Computer Set-up Configurations >



What is the definition of ice thickness in the hole finders

The ice thickness (t), as a first approximation, is proportional to the image contrast where image contrast is defined as the natural log of the ratio of the incident beam intensity (I0) to the transmitted beam intensity (I).

t = k * ln( I0 / I )

where k is known as mean free-mass thickness.

In various holefinders in Leginon, k is assumed to be 1 which makes t in an arbitrary unit. I0 is usually obtained from an empty hole under the same imaging condition, while I is that measured from the interested hole with ice. As demonstrated in our 2006 paper (J. Struct. Biol. v154,p303), k varies with defocus and can be affected by the presence of objective aperture. At high defocus, the relationship between image contrast and the ice thickness can also become non-linear. For practical purpose, it is important to maintain the same defocus when ice thickness of two experiment session is to be compared.


< Why is the first Grid Image Not Numbered 00001?



What is the Leginon System

Abstract

Leginon system includes the python-side programs that are writen in python and c, the
MySQL database and server, and the mainly php-based image and data viewers on a web
server.

The python-side programs provide a modular framework for building applications for TEM
image acquisition and analysis. Nodes can be connected through abstract events in Leginon's
modular architecture design. This gives Leginon the flexibility of application customization
at multiple levels. Because nodes can be launched from different machines, Leginon's
applications can inherently use distributed memory systems.

The MySQL-side database and server keep track of all information (metadata) accompanying
the acquired images efficiently.

The php-side web server and scripts retrieve information from the database and the file
storage system to display both raw information and organized reports.

NRAMM development includes the python-side and the php-side scripts. MySQL side uses
directly the open-source distribution.

The website http://leginon.scripps.edu/
is the central location for leginon information and links.

The Forums are where users and
developers post their questions and answers.

Official bug report and feature request should be entered through this website using the New Issue tab.


Terminology >



Where to register and download Leginon

http://www.leginon.org/ is the home.

Download Myami 2.1 (contains Appion and Leginon) using one of the following options:

Option 1: Release Version

 
This is a stable supported release available as a tar file.
 
myami-2.1.3.tar.gz
Unzip with

 tar -zxvf myami-2.1.3.tar.gz

 

Option 2: SVN Release Branch

 
This is a stable supported branch from our code repository.
Change directories to the location that you would like to checkout the files to (such as /usr/local) and then execute the following command:

svn co http://ami.scripps.edu/svn/myami/branches/myami-2.1 myami/

Note: If you are installing this file on a microscope Windows PC, you may use Tortoise SVN to checkout the files.
 

Option 3: SVN Development version

 
This contains features that may still be under development. It is not supported and may not be stable. Use at your own risk.

svn co http://ami.scripps.edu/svn/myami/trunk myami/

Note: If you are installing this file on a microscope Windows PC, you may use Tortoise SVN to checkout the files.


< Network Configuration | Database Server Installation >



Why is the first Grid Image Not Numbered 00001

Each target in the target list an Acquisition node class or subclass receives has a unique number. Grid atlas targets often contains targets that are out of range of the goniometer. These numbers are therefore skipped in the naming.


< How does Leginon Name the Files? | What is the definition of ice thickness in the hole finders? >



Windows Installation

Processing-side Leginon Windows Installation

Install Python and Support Packages (Note that python 2.5 must be used):

This list does not include pyton XML module because it is included in the python
package for window.

Name: Download site:
Python 2.5* http://www.python.org
Python for Windows extension (pywin32) http://sourceforge.net/projects/pywin32/
wxPython 2.5.2.8 or newer http://www.wxpython.org
MySQL Python client 1.2 or newer http://sourceforge.net/projects/mysql-python
Python Imaging Library (PIL) 1.1.4 or newer http://www.pythonware.com/products/pil/
NumPy 1.0b5 (tested, others may work) http://www.scipy.org
SciPy 0.5.1 or newer http://www.scipy.org
Tortoise SVN client http://tortoisesvn.tigris.org

*Python 2.5 is the only python version that we have compiled numExtension. libCV and
comarray in. Therefore no other python version works for now.

Execute the installer file and follow the directions.

Packages required from NRAMM

These are the packages you will install with the python installer.

Name: Purpose:
leginon modular TEM image acquisition
pyami general functions
sinedon Leginon/database interaction
pyscope microscope control and monitoring
imageviewer image viewing for tomography

Because numextension and libcv requires extra compilers, we have created window
installer for them for python 2.5 and made them available through http://www.leginon.org/.

These are the Leginon v2.0 python 2.5 compiled packages installed through python installer on Windows.

Downloadfile Name Installed Python Package File Purpose:
NumExtension-1.2.0.win32-py2.5.exe numextension.pyd c extension for numerical processing
libCV-0.2.win32-py2.5.exe libCV.pyd small c library of algorithm from computer vision field

Check out SVN Source Files from the depository

Use your mouse to do the following

Install the packages you downloaded from NRAMM svn depository

Download the two Window Installer Files from Leginon website

http://www.leginon.org/

Install individual packages

Excute the installer files and follow the instruction.

Mapping Drives:

If you plan to run Leginon directly on the Windows machine, such as in Configuration C, and your data files are served through a Samba server on a Linux machine, you will need to map the network drive. For example, if your Samba server has a hostname your_smbserver, and you have set up a share called [your_share_point] which points to /your_data_path/ and leginon data will be saved under a folder in /your_data_path/leginon/.

Configure leginon.cfg:

Follow the instructions in Configure leginon.cfg located in
the section for Linux installation but note the location of the configuration files
follows. In addition, if the storage disk is mapped onto the Windows PC as drive Z, this
mapping should be included in leginon.cfg. See above.

Configure sinedon.cfg:

Sinedon is designed to be able to interact with multiple databases.

Follow instruction in Configure sinedon.cfg in
the section for Linux installation but note the location of the configuration files
follows.

Create Leginon and Leginon Client shortcut in Start menu menu under Leginon

This instruction applies to Windows XP.

Additional Software (Optional):

TightVNC (http://www.tightvnc.com)

Database server Windows Installation

We do not do this at NRAMM. Please follow the instruction in Linux installation and
modify it for Windows at your own risk.

For a good Windows specific instruction for general PHP configuration with MySQL for
Apache 2 in Windows, try http://www.artfulsoftware.com/php_mysql_win.html.


< Web Server Installation | Additional installation on the microscope computer >