Scripting Resources for DigitalMicrograph™

banner

Dave Mitchell's DigitalMicrograph™ Scripting Website

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

 

Acquire Rotate and Crop
Function
Acquires an image from a CCD camera, then rotates the image and crops it to eliminate the black space introduced by rotation.
Version
version:20160513, v1.0
Author
D. R. G. Mitchell
Acknowledgements
Thanks to Udit Sharma for suggesting and testing this script.
Comments

Engineered microstructures, such as transistors, gates etc are geometrically aligned. When acquiring images of such features using a CCD in TEM mode, the orientation of the features is often inclined relative to the image frame. Post-acquisition rotation and cropping (to eliminate the black space added by rotation) is time consuming. This script automates the acquisition, rotation and cropping process.

An image of a representative feature is acquired. The image feature which is required to be either horizontal or vertical is then marked with a line annotation. The script's Measure button will then measure the angle of that line (relative to horizontal). The script allows rotation which would bring that feature to either horizontal or vertical, and the image can also be flipped through 180 degrees.

Once set up, all subsequent images acquired through the script will have the same rotation applied. The option to crop out the black space introduced by rotation is given, as is the display of the raw (unrotated) image.

System Requirements
Tested on GMS 2.3 but should work with earlier versions. Tested on Gatan Orius and Gatan Ultrascan cameras. The script will automatically source the camera size and should work with all modern Gatan cameras.
Known Issues

When the Crop option is selected, the script excises the largest square region from the image which excludes the black space introduced by rotation. For small angles of rotation, the excised region will be quite large. However, as the rotation angle increases the excised region shrinks. For this reason it is better to always choose the smaller of the rotation angles needed to bring the feature of interest to either vertical or horizontal. For example, rotate 20 degrees to horizontal, rather than 70 degrees to vertical. If this results in an orientation which you do no you want, then use DigitalMicrograph to rotate the image 90 degrees.

Supported
Yes
Included Files
Source code
Source Code

See attached script