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

 

Remove Elliptical Distortion
Function
Function to remove elliptical distortion from an image, such as a diffractogram or diffraction pattern.
Version
version:20211014, v1.0
Author
D. R. G. Mitchell
Acknowledgements

Edgar Voelkl is thanked for the code which rewraps an unwrapped image.

Comments

The function takes as its arguments an image containing elliptical distortion, and the parameters of the ellipse which describes that distortion. These parameters can be measured using the Ellipse Fitting Analysis script package. This function will correct the distortion, making an elliptical pattern round. This replicates the functionality of the Undistort script - with is part of the aforementioned script package. That package also contains a supporting script called 'Create Synthetic Elliptical Patterns', which can be used to create some test data with which to experiment with this function.

The script will not work with Complex images, such as FFTs. These should be converted into Real, 4 Byte Images using the Edit/Change Data Type menu item in DigitalMicrograph.

 

 

 

System Requirements
Tested on GMS 2.32, but should work on all versions of GMS.
Known Issues
The technique makes extensive use of the warp() function, which used bilinear interpolation. This introduces some error, so some very minor distortion may remain after correction.
Supported
Yes.
Included Files
Main script.
Source Code

see attached script