find cross grating distance

Category: Data Processing and Evaluation – Images
Description: Script to calculate the average distance of the squares from a cross grating sample image. Create a new hanning window filter in the Image Filtering floating window, leave the default name "Hanning Window Filter 0". Press Edit and change the strength to ~0.2. If you don't have this filtering plugin, just comment out line 64 and in line 63 change "nm" to "n" Just make sure, that the cross grating image is the front most image and execute the script It calculates the maximas of the autocorrelation image and then puts this pixel and its surroundings to zero and then searches for the next maxima. It assumes that the old calibration is somewhat correct. If it is not correct, measure the number of pixels in one square and divide it with 462.963. Put this value as the image scale. In the end a 1D image will be displayed, it shows all the calculated square distances and asks to cut away any outliers if there is some. For example at 10 kx the average size of the squares is about 37 pixels, then 1 or 2 pixel deviation from this might still be ok, then put the number 2 and everything above that will be cut away. At 80 kx the size is ~ 300 pixels, so here even 2-5 pixel deviation from this might be ok. HINT! For STEM image, make a histogram from the final image with appropriate number of bins (press alt+Histogram to change that). If you trust that your sample was not tilted with respect to the beam, then if you have two peaks, you have STEM distortion. With a bit more effort to the script, one might also calculate the angles...
Acknowledgements: subpixel info from V. Hou
Script version: 1.0
DM/GMS version: 1.4.2
Script written as a function: No
Source: Show code
Download Source Code: Download