Scripting Resources for DigitalMicrograph™ |
STEM Decaffeinator |
|
Function |
Removes the flags and skips (STEM scan instabilities) from high resolution images. |
Version |
version:20191028, v1.0 |
Author |
D. R. G. Mitchell |
Acknowledgements |
This is derived directly from the Correct Flags and Skips script by Braidy et al., which no longer works. It resuses several of the functions from that script. The operation of the original script is described in the following paper. |
Comments |
Scan instabilities in the horizontal (flags) and vertical (skips) positioning of a scanning probe can degrade image constrast/resolution and give rise to vertical and horizontal streaking in FFTs derived from such images. The script by Braidy et al. was published in 2012, but has not been updated since. It will not currently run, as it has an external dependency on a third party plugin function which does not exist in more recent versions of that plugin. Braidy's script has been rewritten here to remove all such external dependencies. The original code made extensive use of global variables, which made maintenance of the script extremely difficult. Global variables have been eliminated in this revised script. The original script was also very lightly commented and some of the functions are, in places, opaque. For that reason, I have recycled several of the main computational functions, with only light editing to integrate them into this script. An outline of the script and a typical workflow are described at the start of the script listing. |
System Requirements |
Tested on GMS 2.32, but should be compatible with GMS 3. |
Known Issues |
The script works, but the results are patchy. It is not clear if there are bugs in the script. If anyone finds bugs, please let me know and I will fix them. However, I am not sold on the method in general. Typically, one captures STEM images with lattice rows or columns aligned (via scan rotation) to be horizontal or vertical respectively. The problem is that such images produce FFTs where spots are colinear (they appear in the same column as other spots), and this invalidates the method. To overcome this, images must be acquired at some arbitrary rotation to produce non-colinear FFT spots, the image processed, and then, if required, the image can be rotated to brings rows/columns to horizontal/vertical. This introduces black space in the image, and so cropping is then required. To my mind the advantages of correcting flags and skips are outweighed by the initial imaging and subsequent processing requirements. Furthermore, my testing has been on DigiScan-acquired images. Having used FEI, JEOL, Noran, Oxford and Bruker systems for STEM image acquisition over the years, it is my view that DigiScan is in a league of its own in terms of scan stability. This again rather negates the need for 'decaffeinating' the scanned image to stop the shakes. |
Supported |
I will correct obvious bugs, but due to the reservations expressed above, I will not be developing this script further. |
Included Files |
Source code. |
Source Code |
See attached script |