Macros for SerialEM

From OPIC WIKI
Jump to: navigation, search

SerialEM is being developed by Boulder Laboratory for 3-D Electron Microscopy of Cells and is available for download at http://bio3d.colorado.edu/SerialEM/. Many of the macros available here are based on earlier versions written by Chen Xu (Brandeis University). Please send comments to juha(-at-)strubi.ox.ac.uk

Contents

Automated single particle data collection

AutoAcquire

This script is intended to be run with "Acquire at points" function of the Navigator panel. Typically the user would define a grid of points (every hole of a Quantifoil or Cflat grid) and run this Macro to acquire an image at each point. Buffer J should contain a View image of a centered hole (this image should be acquired using only the center of the field of view, adjust this in the Camera Properties). After moving to a new point / acquisition area, the stage position is aligned relative to this reference image. Defocus is changed by 0.01 micron after each image. This value should be adjusted depending on the starting defocus, the range to be covered and the number of of images acquired in each single run.

MacroName AutoAcquire

echo *** ACQUIRING IMAGE ***

echo *** Centering the acquisition area ***
Loop 2
  View 
  AlignTo J
  ShiftItemsByAlignment
  ResetImageShift
EndLoop

echo *** Centering the beam ***
Call CenterBeam

echo *** Settling drift ***
Call Drift

echo *** Acquiring a focus pair ***
Call FocusPair

echo *** Changing target defocus ***
IncTargetDefocus 0.01

Manual single particle data collection

Acquire

This macro is intended for manual data collection, where the user centers the acquisition area manually in View mode. This centering may involve a large image shift, which is first minimized by moving the stage. Then the same steps as in fully automated mode are run (beam centering, drift settling, focus pair acquisition). Effectively, the user only has to center a feature of interest, run the macro and repeat. This is beneficial if the sample is not fully covering the grid, is present only in some holes etc. Defocus is changed by 0.02 micron after each image. Typically we start collecting at -2.5 micron defocus and collect data gardually closer and closer to focus, finishing around -1.5 micron defocus.

MacroName Acquire

echo *** ACQUIRING IMAGE ***

echo *** Centering the acquisition area ***
Call CenterDetail

echo *** Centering the beam ***
Call CenterBeam

echo *** Settling drift ***
Call Drift

echo *** Acquiring a focus pair ***
Call FocusPair
V

echo *** Changing target defocus ***
IncTargetDefocus 0.02

General Macros

CenterBeam

Trial beam should be adjusted so that the beam edges are visible in the image

MacroName CenterBeam

T
CenterBeamFromImage
T

Drift

In this example, the allowed drift rate is 2 A / s.

MacroName Drift

# Adjust $interval so that delay is 20 s.
# This depends on your camera and imaging parameters such as binning
interval = 16.75
times = 50
crit = 40
Delay $interval
SuppressReports
ChangeFocus -6
F
ResetClock
Delay $interval
Loop $times index
   F
   ReportClock
   echo Total delay $reportedValue1 s
   AlignTo B
   ReportAlignShift
   ClearAlignment
   dx = $reportedValue3
   dy = $reportedValue4
   dist = sqrt $dx * $dx + $dy * $dy
   dist = $dist * 10
   echo Drift rate = $dist A / 20 s
   if $dist < $crit
      echo Drift is below threshold of $crit A / 20 s after trying $index time(s)
      break
   endif
   if $index < $times
      ResetClock
      Delay $interval
   else
      Echo Drift is ABOVE threshold of $crit A / 20 s after trying $index time(s)
   endif
EndLoop
ChangeFocus 6

FocusPair

Preview image is used for pre-exposure (which we believe is advantageous to reduce beam induced drift due to charging effects) and for final centering of the beam. The first image is taken and defocus defined by "defocus target" and the second image is taken 3 um further from focus. If you don't need focus pairs, simply remove or uncomment the relevant lines.

MacroName FocusPair

AutoFocus
AutoFocus

echo Taking a pre-exposure using Preview
Preview
CenterBeamFromImage
Delay 2

echo Taking a close-to-focus exposure using Record
Record
Save

echo Taking a further-from-focus exposure using Record
ChangeFocus -3
Record
Save
ChangeFocus 3

CenterDetail

Centers the detail in a View image by moving the stage so that the required image shift is less than 2 um. View images are heavily binned to speed up things, the original binning has to be set after running the script.

MacroName CenterDetail

max_shift = 2000
Copy A J
echo Centering detail by moving the stage so that maximum required image shift is $max_shift nm
Loop 5 i
   SetBinning V 8
   ResetShiftIfAbove $max_shift
   V
   AlignTo J
   ReportAlignShift
   dx = $reportedValue3
   dy = $reportedValue4
   shift = sqrt $dx * $dx + $dy * $dy
   if $shift < $max_shift
      echo Detail centered (image shift $shift nm)
      break
   endif
EndLoop
SetBinning V 2

TiltPair

A simple macro to take a pair of images, the first one untilted and the second one tilted. Useful for collecting data for handedness determination of complexes.

MacroName TiltPair
AutoFocus
Record
Save
View
TiltTo -5
View
AlignTo B
AutoFocus
Record
Save
TiltTo 0
ResetImageShift
View
Personal tools
Namespaces

Variants
Actions
Tools