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

 

Calculate Range Map and Nearest Neighbour Histogram
Function

Script to compute the range between nearest neighbours in dot map images. A histogram of the nearest neighbour distances is also produced.

Version
version:130823, v1.0
Author
D. R. G. Mitchell
Acknowledgements
-
Comments
The shell of 8 nearest neighbours surrounding a pixel is investigated and then the next shell of 18, 28 and so on. The pixel value of the image is set to the shell distance of the nearest neighbour. An upper limit of shell distance can be entered, as the process becomes slower as the shell size increases. The process is stopped once all pixels in the image have been measured.
System Requirements
Should be compatible with all recent versions of DigitalMicrograph. The source image must be a dot map such as an x-ray map, where the dots are single pixels. The pixel values therein should be either 1 or 0, but the file type does not need to be binary.
Known Issues
For shell distances of more than 7 or so, and for larger images, this can a be a slow process. The script progress is reported in the Progress window as a percentage of pixels in the image that has been assessed.
Supported
Yes.
Included Files
Single script file.
Source Code
See attached script.