Focus/Tune menu commands
The Focus/Tune menu offers the following commands for controlling Autofocus and Autotuning:
|Measure Defocus||Measure current defocus.|
|Autofocus||Autofocus to the defined target value.|
|Move Focus Center||Shift center of focus from display point to center of field.|
|Check Autofocus||Assess ability to autofocus by measuring defocus at 3 levels.|
|Report Shift & Drift||Does focus detection and reports shift and drift.|
|Report On Existing||Report shift and drift from pictures already present in buffers A-C.|
|Show Existing Corr||Show the cross-correlation from pictures already present in A-C.|
|Show Image Stretch||For existing images, show the image that is stretched to compensate for specimen tilt.|
|Set Target||Enter target defocus to change to after autofocus.|
|Set Beam Tilt||Set amount of beam tilt for detecting defocus.|
|Set Offset||Set focus offset to apply before measuring defocus.|
|Set Threshold||Set threshold focus change for reiterating the autofocus.|
|Set Tilt Direction||Set the direction of beam tilt for autofocusing.|
|Set Min Binning||Set minimum total binning for correlating autofocus images from a direct detector.|
|Test Filter Cutoffs||Set trial parameters for filters in autofocus correlations.|
|Drift Protection||Use three autofocus pictures to protect against drift.|
|Set Absolute Limits||Set lower and upper absolute limits for autofocusing around eucentric focus.|
|Use Absolute Limits||Apply the lower and upper absolute limits when autofocusing|
|Limit Offset Defocus||Keep the offset defocus used to find focus within limits also.|
|Correct Astigmatism||Measure and correct for objective astigmatism.|
|Set Astig Beam Tilt||Set beam tilt to use for astigmatism calibration and/or correction.|
|Coma-free Alignment||Measure and correct for beam-tilt misalignment.|
|Set Coma Beam Tilt||Set the maximum beam tilt for coma-free alignment.|
|Set Coma Iterations||Set number of coma measurements to average over.|
|Run Another Iteration||Measure coma one more time and average with previous iterations.|
|Beam-Tilted FFT Array||Make Zemlin tableau: FFTs of images with beam tilted in 8 different directions.|
|Reset Defocus||Set the defocus shown in the microscope panel to zero.|
|Verbose||Output defocus shift and drift information to Log Window.|
Measure Defocus command (Focus menu)
This command is used to run the autofocus routine for measuring defocus, without changing to the target defocus. Upon completion, the program will inform you of the measured defocus and ask if you want to set the target defocus to this value. This procedure is typically used if one adjusts focus manually to give the desired image appearance, then measures defocus and uses the measured value to set the target.
Autofocus command (Focus menu)
This command will run the autofocus routine to measure defocus and then change focus to achieve the target defocus. If the indicated change in focus is greater than a preset threshold, then the program will change focus by at most twice the threshold amount, and repeat the autofocus routine. This threshold is set with the Set Threshold command described below.
In STEM mode a completely different procedure is used, as described in the section on Autofocus in STEM Mode, and the target for defocus is always 0.
Move Center command (Focus menu)
This command can be used at high tilt to change the focus so as to move the visible center of focus by a desired amount. First click the left mouse button to set a display point at a place in the image with the desired focus. Then select this command. The center of the field in the next acquired image should be at the desired focus level.
Check Autofocus command (Focus menu)
This command can be used to assess how well autofocus will work. The program will measure defocus using the current parameters at the current defocus, and at +5 and -5 microns away from that defocus. It will then inform you of the measured defocus change as a fraction of the actual change in defocus in each direction. If these numbers are greater than 0.9, autofocusing will be fairly accurate even for relatively large changes. If the numbers are sufficiently large, autofocusing should work adequately during a tilt series; otherwise it will be unreliable.
Report Shift & Drift command (Focus menu)
Use this command to run the routine for measuring defocus and receive a report of the beam tilt-induced image shift plus the shift due to drift, all in pixels (unbinned pixels are reported if the images were binned). Drift protection must be selected to get a meaningful estimate of drift.
Report on Existing command (Focus menu)
Use this command to measure the beam tilt-induced image shift and the shift due to drift from pictures that are already in buffers A-C from a previous autofocusing operation. If drift protection is off, only the shift between pictures in buffers A and B will be reported.
Show Existing Corr command (Focus menu)
Use this command to display the autofocus cross-correlation from pictures that are already in buffers A-C from a previous autofocusing operation. The correlation will be placed in buffer A and existing images will be rolled up one buffer.
In STEM mode, this command will probably fail to work right unless the property STEMFocusShowBestAtEnd is added to the Properties file and set to 0.
Show Image Stretch command (Focus menu)
Use this command to see the stretch that is used to compensate for specimen tilt above 5 degrees, for pictures that are already in buffers A-C from a previous autofocus operation. The second image of the autofocus series will be replaced with the stretched version and the original will be copied down two buffers if rolling is allowed into that buffer. If binning is being applied to direct detector images, the stretching occurs after binning, so the replaced image will be binned. The program also reports the matrix applied to do the stretch in the log.
Set Target command (Focus menu)
This command is used to enter a specific target defocus for autofocusing. After the autofocus routine measures a defocus, it will change the focus setting so as to achieve this target level. Selecting this command brings up a dialog box for entering the number; the default value shown is the current target. Enter a defocus in microns.
Set Beam Tilt command (Focus menu)
This command is used to set the beam tilt that is used for autofocusing. Selecting this command brings up a dialog box with a default value equal to the current beam tilt value. The units are milliradians (mrad).
Set Offset command (Focus menu)
Use this command to set a focus offset that will be applied before any of the autofocusing operations invoked in the Focus menu. For example, if the offset is set to +5 µm, then when you choose to measure defocus, the program will change defocus by +5 µm, take pictures for measuring defocus, restore the defocus by -5 µm, and subtract 5 µm from the measured value to determine the current defocus. This option provides a way to autofocus to a target far from zero when the program is having difficulty autofocusing.
Set Threshold command (Focus menu)
Use this command to set the thresholds for repeating the autofocus procedure after a large change in defocus, and for applying the logic that can abort autofocus when iterations give inconsistent results. The current value of the threshold for repeating autofocus is the default value shown in the first dialog box. Whenever autofocusing changes the focus level by more than this amount, the program will repeat the autofocus operation. After entering this threshold, a second dialog box appears asking for the threshold for testing whether successive results are inconsistent. You can enter 0 to disable the tests for inconsistent autofocus. The testing will always be done for any non-zero value less than the threshold for repeating autofocus; values higher than the threshold for repeating will make the testing be skipped when changes are between the two threshold levels. The latter may be desirable when using very small thresholds for repeating.
Set Tilt Direction command (Focus menu)
Use this command to set the direction that the beam will be tilted during all autofocusing operations. Enter a number between 0 and 3, where 0 corresponds to tilting with the X coil only, 1 tilts with equal deflections on the X and Y coils, 2 tilts with the Y coil only, and 3 tilts with a negative deflection on X for a positive one on Y. Using a number different than 0, which was the only direction available before SerialEM 3.4, will cause the image to shift in different directions, at 45 degree increments from the shift at direction 0. Focus calibrations are specific to the current direction, so the calibration must be done at each direction to be used for autofocusing.
Set Min Binning command (Focus menu)
Use this command to set a minimum total binning to apply when correlating autofocus images from a direct detector. The autofocus routine does not apply any binning to the images that it correlates by default, but it is recommended that the Focus images themselves be taken with some binning to reduce the effects of fixed noise in the images. It can be difficult to take images with the needed binning with direct detectors because their high gain values make binned images saturate easily. Thus, this command allows one to process autofocus images obtained with lower binning as if they had been taken with higher binning. Enter the desired total binning. When autofocusing, the program either applies additional binning to reach the specified binning, or reduces the cutoff and rolloff of the high-frequency filter to achieve an equivalent effect, or a combination of the two. For example, if the total minimum binning is set to 4, unbinned images will be binned by 4 for correlating, images with binning 2 will be binned by 2 again, and images with binning 3 will be correlated with the filter parameters multiplied by 0.75. Although this feature currently is applied only for direct detectors, it could easily be provided for other cameras if the need arose.
Test Filter Cutoffs command (Focus menu)
Use this command to set the cutoff and rolloff parameters for the low and high ferquency filters applied when correlating autofocus images. The 'Test' in the name of the command refers to the fact that values are not retained between program sessions. If a filter change is needed, it should be set in the SerialEMproperties.txt file. First enter the frequency at which the high-frequency filter starts to cut off, in reciprocal pixels. Then enter the sigma value for the rolloff of the filter. In both cases, smaller numbers filter more. These parameters may need to be adjusted when there are severe problems with fixed noise in the correlation images. To change them in the properties file, add lines starting with 'FocusFilterRadius2' and/or 'FocusFilterSigma2'. The third property is the sigma for the low-frequency filter, an inverted Gaussian that is zero at zero frequency and rises to 1. Its property entry is 'FocusFilterSigma1', but the current default should be effective.
Drift Protection command (Focus menu)
Use this command to toggle between having two or three pictures taken for autofocusing. With three pictures, the program can separate shift due to drift from the beam tilt-induced image shift used to determine defocus. The measured defocus will thus be accurate if the drift is constant.
Set Absolute Limits command (Focus menu)
Use this command to set limits for the absolute focus that can be accessed during autofocusing. The main purpose of such limits would be to prevent failures in taking images due to the Falcon Dose Protector, but they might be useful in other situations. The first step is to set the microscope to eucentric focus, which you could do by pressing a Eucentric Focus button or by making the stage eucentric and focusing a specimen. After you confirm that the scope is at eucentric focus, the program asks you to enter the lower and upper limits for defocus relative to that point, in microns; these are assumed to be negative and positive, respectively. The program changes focus to each level and records the absolute focus value. The limits will not be applied unless you turn on the next option.
Use Absolute Limits command (Focus menu)
This command toggles whether the absolute focus limits entered with the previous command are applied during autofocusing. Autofocus will abort whenever changing the defocus to the target value would make focus exceed the limits.
Limit Offset Defocus command (Focus menu)
This command toggles whether a defocus offset for autofocusing will be included when determining whether an absolute focus limit is being exceeded. If it is included, the program will not attempt to measure defocus at a focus level exceeding the limits; if it is not included, the limits will apply only to a new focus needed to reach the target defocus. This option should be turned on for Falcon cameras but should not be needed in other situations.
Correct Astigmatism command (Focus menu)
Use this command to measure and correct for objective astigmatism. The procedure first measures defocus and changes to the focus used for the astigmatism calibration that fits the current conditions. It then measures beam-tilt induced image shift for beam tilts in three directions and uses this information to solve for the astigmatism. If the change in stigmator settings is large enough, it then repeats the procedure one or two times.
The beam tilt used is set with the Set Astig Beam Tilt command. It does not need to be the same as the beam tilt used for the calibration, which is recommended to be done at twice the beam tilt normally used for autofocusing. You may need to remove the objective aperture to run this operation with such a beam tilt, but it should be possible to get adequate results with the aperture in and a lower beam tilt, if necessary. Before running this command for the first time, you should use the List Calibrations command in the Calibration - Focus & Tuning menu to check what beam tilts and magnifications have been used for calibration. The calibrations are also specific to probe mode on an FEI scope or alpha on a JEOL, so if the Correct Astigmatism command is disabled, it may be because there is no calibration for your current conditions.
The Focus parameters are used, just as for autofocusing, so be sure that autofocusing is working well before running this routine.
This procedure will be more accurate at higher magnifications, but should work at magnifications where the pixel size for data acquisition is around 1 nm. The routine uses the calibration from the nearest calibrated magnification.
Set Astig Beam Tilt command (Focus menu)
Use this command to set the beam tilt that will be used either to calibrate astigatism or to correct it. On a non-FEI scope, the entry box will tell you the scaling from percent of full scale to milliradians, so that you can use a standardized value if desired.
Coma-free Alignment command (Focus menu)
Use this command to measure and correct for beam-tilt misalignment (coma). The procedure measures focus, changes to the focus at which a coma calibration was done, and measures beam-tilt induced image shift for positive and negative beam tilts in X and Y directions. From the difference between displacements, it estimates the current beam tilt and adjusts for it. To reduce the inaccuracy of the measurement, this procedure can be run for additional iterations (one more by default, adjustable with the Set Coma Iterations command). On each iteration, the estimated coma-free beam tilt is averaged with that estimated on the previous iterations; at the end the final adjustment is reported. After running this command, an additional iteration can be run and averaged in with the Run Another Iteration command.
The beam tilt used is determined by the value entered with the Set Coma Beam Tilt command, which must match the value for an existing coma-free calibration. In fact, the beam tilt here is half of the maximum tilt used for the calibration. Before running this command for the first time, you should use the List Calibrations command in the Calibration - Focus & Tuning menu to check what beam tilts have been used for calibration. These calibrations are specific to probe mode on an FEI scope or alpha on a JEOL. The Coma-free Alignment command is disabled unless there is a calibration at some magnification that matches the current conditions as well as the beam tilt setting.
The Focus parameters are used, just as for autofocusing, so be sure that autofocusing is working well before running this routine. Accurate measurement of displacement differences requires a high magnification as well as large beam tilts, so you may need to run the routine at whatever magnification is calibrated.
This command cannot be run in Low Dose mode, because the beam-tilt alignment is different at the shifted location of the Focus area.
Use the Beam-Tilted FFT Array command to assess how good the coma-free alignment is. The precision or reproducibility of the routine can be assessed by running the script command 'CorrectComa -1' several times in a row to find the misalignment without correcting it, which lets you see how much the reported misalignment varies.
Set Coma-free Beam Tilt command (Focus menu)
Use this command to set the maximum beam tilt for coma-free calibrations. That beam tilt will be used for doing a calibration, and the coma-free alignment can be done only with a beam tilt that matches what was used for a calibration. The entry box will list the beam tilts for all calibrations that match the current probe mode (on an FEI scope) or alpha (on a JEOL). If there are no such calibrations, for a non-FEI scope, the box will show the scaling from percent of full scale to milliradians, so that an appropriately large percentage value can be entered.
Set Coma Iterations command (Focus menu)
Use this command to adjust the number of iterations, or misalignment measurements to be averaged, for an initial run of the Coma-free Alignment command.
Run Another Iteration command (Focus menu)
Use this command after the Coma-free Alignment command to make one more measurement of misalignment and average it with the previous results. This command can be used repeatedly if necessary.
Beam-Tilted FFT Array (Focus menu)
Use this command to create a Zemlin tableau, in which the FFTs of images taken with the beam tilted in 8 different directions are arranged around a central FFT taken with no beam tilt. Images are currently taken with the Focus parameters, so these parameters as well as the defocus need to be set to give informative FFTs with good Thon rings if possible. If a focus calibration is available, the direction of beam tilt is set so that the long axis of the Thon rings is approximately tangential. However, this is just for a nice appearance: the direction of this axis is not an indicator of how well beam tilt is adjusted. Rather, when there is no coma, the FFTs on opposite sides of the center should look the same, with the same direction and elongation to the rings.
The program will first ask what beam tilt to use, in milliradians on an FEI scope or percent of full scale on other scopes.
Image shift is set to zero before the images are taken. The command can be run in Low Dose mode and currently, it will go to the focus area before setting image shift to zero so that it can take on-axis images with the Focus parameters. At this point the IS/PLA readout in the Scope Status panel will show the underlying shift of the Focus area, not 0.
The full tableau will be 1020x1020 pixels, with each FFT reduced to 510x510 then cropped to 340x340. A dialog may be added to set alternative imaging and size parameters, but for now parameters can be controlled with the 'ZemlinTableau' script command. For example, the following script can be used to set the defocus to -1 micron, take full-field images with binning 1 and exposure 1 second, and make a larger tableau image with only half as much cropping outside each FFT.
focus = -1.
exposure = 1.
binning = 1
change = $focus - $curFocus
SetCameraArea F F
SetBinning F $binning
SetExposure F $exposure
ZemlinTableau 6 450 70
Reset Defocus command (Focus menu)
Use this command to reset the defocus readout in the Microscope Status panel to zero, without actually changing microscope focus. On an FEI scope, this simply does the same thing as the Reset Defocus command in the Microscope User Interface. On a JEOL, the defocus readout is set to zero when the program starts and this is the only way to change it.
Verbose command (Focus menu)
This command toggles more complete output from focusing operations. With the option selected, the shift and drift information are printed in the Log window on every autofocus, as well as the cross-correlation coefficient between unfiltered images. With the option not selected, the measured defocus value and the use of a secondary peak will still be reported to the Log window, but only if it is already open.