Scripting Resources for DigitalMicrograph™

banner

Dave Mitchell's DigitalMicrograph™ Scripting Website

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

 

Measure Angles
Function
Measures the angle defined by three successive mouse positions on an image.
Version
version:20160703, v4.0
Author
D. R. G. Mitchell
Acknowledgements
Douglas Hague of Gatan is thanked for providing insights into the various co-ordinate systems used by DigitalMicrograph, used here to extract the coordinates of the mouse cursor. Bernhard Schaffer's example code showing the use of the keylistener was very helpful. Joana Polednia is thanked for testing the script.
Comments
This script has been completely rewritten to use a keylistener to listen for key strokes. This makes it a far more CPU efficient (background) script compared with the original, which just ran in a continuous GetKey() loop in the foreground. Mark three successive points on the image and the angle subtended will be reported. Instructions are provided in the Results window, the Progress Window and at the start of the script. The default size of the point labels can be changed by running the script with the ALT key held down. Use this script to measure crystal facet angles, interplanar angles in HRTEM and interspot angles in diffraction patterns.
System Requirements
Tested on GMS 2.3 running under WIndows 10, but should be compatible with all recent versions of DM.
Known Issues
-
Supported
Yes
Included Files
Main script file.
Source Code

See attached script file.