Scripting Resources for DigitalMicrograph™ |
Distortion Correction |
|
Function |
Script to measure and correct distortion in an image containing a geometric array of features. |
Version |
version:20200901, v2.0 |
Author |
D. R. G. Mitchell |
Acknowledgements |
Thanks to Antonin Louiset for suggesting and testing the new non-orthogonal functionality introduced in v2.0. |
Comments |
Atomic resolution STEM images of geometrically regular lattices are often distorted by drift, charging and other microscope/specimen/room/user instabilities. This script enables the user to define a regular grid of markers which define where the atomic columns should be, in the absence of drift. The grid is then skewed/rotated and, where necessary, manually moved so that the markers are approximately located on the actual columns. Position refinement using a centre of gravity approach is then applied, so that the markers correctly identify the actual position of the columns. Using a 2D polynomial fitting routine, the experimental (distorted) lattice is then warped in two dimensions to bring it back into registry with the undistorted (user-defined) lattice. The local distortion is reported in a colour-coded map and also as a vector map. Here arrows at each marked atomic column position identify the direction of the distortion - with their length scaled appropriately. This script was designed ostensibly to clean up atomic resolution HAADF images which contain the effects of drift. However, it may be useful for measuring local distortions around dislocations, strain near interfaces etc, but only where drift is no longer a factor. It may also be useful for measuring any regular geometric array which is distorted by some perturbation - eg a ruled fiducial grid array on an tensile specimen after testing. Pressing the help ( ? ) button will list instructions into the Output (Results) window. Updated in v2.0 to include a Column Angle parameter. This specifies the inclination angle of the atomic columns (relative to vertical) and allows lattices which are non-orthogonal to be corrected. |
System Requirements |
Compatible with GMS 2.x and GMS 3.x |
Known Issues |
This method relies on locating each atomic column position by measuring its centre of gravity. This requires that images be high contrast (typically HAADF) and that there is sufficient pixel and spatial resolution to delineate each atomic column with a circle. High contrast is important and so pre-processing images via Fourier/Maximum Entropy-type filters may help. Since the 2D fitting routine relies on a 2D polynomial, it is important that as much of the image is fitted as possible. Using small sub-areas of the image results in poor fits at distant edges. Here, the negative warp value results in blank regions of image. Where drift skews the image so that what should be a vertical column of atoms disappears off the bottom left or right hand edge of the image, this script will correct that. However, the missing information results in a wedge of black space in the corrected image. For minor distortions this is not significant. For larger distortions the image must be cropped to exclude such a wedge. The Create Image from ROI script can be used to create an image from a rectangular region of interest on the corrected image. Obviously, the script warps the image to fit the grid specified by the user. Carrying out spatial measurements on such a grid is meaningless, since by definition, the spacings are what the user specifies. Care should be exercised when using/publishing processed images, and full disclosure in the methods section of the publication is mandatory. |
Supported |
Yes. |
Included Files |
zip archive containing the main script. Also included is a companion script which can be used to create a distorted synthetic HAADF image with which to practice. A brief guide is also included. |
Source Code |
See attached sip archive. |