Script examples


Data simulation

Sine pattern.s Demonstrate the usage of icol and irow and setting a different color lookup table
2D plane wave.s Create 2D sine wave image with given angle and periodicity
Make gaussians.s Generate a 1D and 2D Gaussian distribution (demonstrate function overload)
Amorphous.s Make an image resembling a TEM image of an amorphous specimen
Crystal.s Produce an image resembling a noisy TEM image of a crystal with X-rays
Spherisize.s Take a square image, wrap it around a sphere, and then return the resulting image
Focal series.s Simulate a focal series of theoretical diffractograms
Transfer function, interactive.s Interactively draw and modify the contrast transfer function as a LinePlot

Display tools

Change calibration units.s Switch dimension calibration units in an image (demonstrate simple custom dialog)
Annotation scaling.s Scale all of the annotations on an image by a requested factor
Component example.s Add and read various text annotations (demonstrate usage of annotations in image documents)
Copying lineplot styles.s Copy display properties of front most LinePlot image to all other open LinePlot images
Timebar on image.s Display a digital clock on the front most image (demonstrate periodic tasks)
Display as HSB.s Display complex image as color encoded HSB image (phase = color, modulus = brightness)

Data tools

Bin 2D image.s Bin pixels in 2D images (demonstrate Slice2 command)
Bin 3D image.s Perform voxel binning in 3D images (demonstrate Slice3 command)
Scale 2D image.s Scale a 2D image by a requested factor either using sampling or bi-linear interpolation (demonstrate warp command)
Crop image to selection.s Crop 2D or 3D image based on selection and displayed slices.(demonstrate data extraction).
Rotational average.s Create a rotationally averaged image  (demonstrate warp command)
Merge images.s Combine two images of different intensity levels into one. Useful to merge diffraction patterns of different exposure times
Interactive histogram.s Compute histogram of the front most image and allow interactive change of histogram bins


External links


DigitalMicrograph script database (FELMI-ZFE)
Database of public domain scripts. Both command examples and application oriented scripts can be found here.

Stack overflow
Stack overflow is a general question and answer site for professional and enthusiast programmers. Please use the “dm-script” tag when asking questions or to search for related information. 

DigitalMicrograph scripting website (D.Mitchell)
Private page hosting various scripts and script-related information.

How to script
Private page hosting tutorial e-book on DigitalMicrograph scripting.

DigitalMicrograph scripting users group
Listserv hosted by Arizona State University.

Free DigitalMicrograph software

View Page

DigitalMicrograph software development kit (SDK)


Gatan Microscopy Suite 1.x SDK

Download     Request Password

Gatan Microscopy Suite 2.x SDK

Request License

Gatan Microscopy Suite 3.x SDK

Request License

Script support

Support Request