Scripting Resources for DigitalMicrograph™


Dave Mitchell's DigitalMicrograph™ Scripting Website

Home | Scripts | Examples | Functions | Recent Updates | Tutorials | Resources | Publications | Consulting | Projects | Contact & Bio | Private | Search


Objective Astigmatism Helper
Fits an ROI to a live Camera View image (if the image is not 2^n x 2^n - where n is an integer). It then creates a live reduced FFT fitted with a series of yellow concentric circles, to aid correction of objective astigmatism.
version:20160314, v1.1
D. R. G. Mitchell
This is based on scripts by Bernhard Schaffer and Vincent Hou. The idea of attaching a key listener to an image to know when the image has been closed is Bernhard's.

Correcting objective astigmatism manually is best done by looking at the live FFT of a thin amorphous carbon film at around 100kx and underfocus. The resulting Thon rings in the FFT are circular when astigamtism has been corrected. It is imperative that the original image is square otherwise the rings will appear elliptical, even when astigmatism is not present. This script will use the whole live image, if it is square and is a power of 2 in size. If not it fits the largest possible region of interest to satisfy these criteria. The live reduced FFT is then generated. This is fitted with a series of concentric circles as a visual aid in assessing the roundness of the Thon rings.

Updates in v1-1. Added scaling to adjust the live image size to a preset value to make room for the FFT. This size can be changed by running the script with ALT held down.

System Requirements
Should be compatible with all recent versions of DigitalMicrograph. A live image of a carbon film must be displayed before running this script, with magnification, defocus and beam intensity (convergence) set so that the fine scale amorphous speckle of the film is evident. This ensures that the Thon rings are apparent in the FFT.
Known Issues
With the advent of GMS 2 the updated FFT routine no longer requires that the image be a power of 2 in dimension - it works on any size image. When taking FFTs from non-square images (eg from the Orius camera), the resulting FFT has the same aspect ratio as the source image (Orius aspect ratio is about 1:1.6). In the absence of any objective astigmatism, flattened ellipses (Thon Rings) are produced from such an image. Inexperienced users who then make these ellipses circular believe they are correcting astigmatism, when in fact they are adding it. Also, manually adding a reference circle to a Thon ring pattern is a useful visual aid, but again inexperienced users may not set the centre correctly, and if they release the SHIFT key before the mouse button (SHIFT constrains the oval annotation to be circular), they may end up with a slightly elliptical reference 'circle', potentially off-centre and this can cause them much bewilderment and choleric palpitation. This script heads all that off at the pass.
Included Files
Main script file.
Source Code

See attached script file