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

 

Shift SADP Centre to Image Centre
Function
Shifts an off-centre SADP so that it is centred within the image.
Version
version:20190417, v1.0
Author
D. R. G. Mitchell
Acknowledgements
-
Comments

Most SADPs are slightly off-centre. This script allows them to be centred within their parent image. If no beam stop is present, a rectangular region of interest (ROI) can be drawn around the (000) spot. The script will find the centre of this spot using a centre of gravity approach. It will relocate the pattern so that this point is in the geometric centre of the image. If a beam stop is present, the above approach will not work. Instead a marker ROI (looks like a cross) can be placed at the approximate centre. The pattern will then be shifted to move this to the geometric centre of the image.

System Requirements
Should be compatible with all recent versions of DigitalMicrograph.
Known Issues

Shifting the pattern within its parent image leaves black space at the edges. For SADPs this is typically not visible.

Supported
Yes
Included Files
Main script file.
Source Code

see attached script.