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

 

Frame Grabber
Function
Captures continuously the front-most live image (TEM, STEM etc) into a 3D Stack or to disk.
Version
version:20190909, v1.0
Author
D. R. G. Mitchell
Acknowledgements
-
Comments

This script captures continuously, whatever live image is shown front-most. The image may be from a CCD, DigiScan or even some other image source like a video camera. The script uses a listener and only captures the image when the very bottom right hand corner of the image changes. This ensures that it always captures a full frame scan from a serial acquisition image (eg STEM). This contrasts it with the STEM Averager script where captures are made at timed intervals and partially completed scans may result.

Image sequences can be captured into a 3D Stack for convenience, the size of the stack being limited only by the available RAM. Alternatively, frames can be spooled to hard disk, either in .dm4 or TIFF formats, enabling essentially limitless recording. Stacks can be subsequently aligned using Stack Alignment, enabling the effects of drift to be largely eliminated. Spooled files can be compiled into movies using the free ImageJ application or similar - see the TEM Recorder script header for details.

This script is provided in good faith. Use it at your own risk. The author accepts no responsibility for any losses or damages which arise from its use.

System Requirements
Tested on GMS 2.32, but should work on GMS 3.x.
Known Issues

This script is designed for use with slow imaging systems like DigiScan and older CCDs (eg UltraScan and Orius). Here the maximum frame rate is around 5 frames per second. The script overhead means that with very fast imaging systems (eg 25fps) it will still work, but frames will be dropped while the script is busy. Such fast imaging systems have their own tools for video rate capture and correcting drift in any case.

When working at fast rates and with large images (eg 1k x 1k) and spooling to disk, it is possible to saturate a spinning hard disk. This results in frames being dropped. To eliminate this bottleneck it is recommended to write to a fast solid state drive (SSD). These are typically 10x faster than spinning disks. Note writing in .dm4 format is 10-20% faster than TIFF. Saved .dm4 files can be batch converted after acquisition using the File/Batch Convert function in DigitalMicrograph.

3D Stacks can be very large (>1GB). If RAM runs low, your system may slow down and even crash. Before using this script close all unnecessary applications and close and save all open work in DigitalMicrograph. When capturing stacks, save them as soon as capture is complete and do not have more than one open at a time, unless you have a lot of RAM. If your microscope computer has limited RAM, you can spool your data to disk and then assemble the spooled files into a stack (Stack Alignment), on an offline computer with more RAM.

Supported
Yes
Included Files
Script file
Source Code

See the downloaded script.