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

 

Faux Imaging Filter Libary
Function
Provides a library of imaging filter commands to enable offline development of GIF-based scripts.
Version
version:20200729, v1.0
Author
D. R. G. Mitchell
Acknowledgements
-
Comments

Writing scripts which access imaging filter hardware can be difficult, since this normally has to be done on the computer attached to the microscope/hardware. Typical instruments are heavily booked and this often entails script developers working long after hours. Code which accesses Gatan hardware - such as the Imaging Filter commands - will only work on DM installations which have the relevant plugin/hardware present, since the plugin extends the scripting language to include the additional commands to address the hardware. Running code which calls hardware on an offline DM installation with no such plugin/hardware will create errors and the code will not run because the script commands are not present.

This library contains all the imaging filter commands. If installed as a library in an offline version of DM, then scripts which invoke imaging filter commands can be run without generating errors. This allows the initial development of GIF-based scripts to be done offline. Only when the script is reasonably finalised is it necessary to move to the microscope to test and finalise timings and responses. Install this script as a Library (File/Install Script - choose the Library option).

This library includes a set of tags to store relevant settings which these library commands can acccess (as if there were a real GIF attached). These can be monitored and edited using the Faux Hardware Settings script.

 

System Requirements
Should be compatible with all recent versions of DigitalMicrograph and has no external dependencies.
Known Issues

This script will produce quasi-sensible responses to Imaging Filter functions calls. However, it will not be the same as having a GIF attached. In general, the idea is that you incorporate all the GIF-based code into your script. You may need to include some additional temporary lines of code to perhaps put some intensity into an 'acquired' frame or to provide a delay to simulate a camera exposure. Customisation of the library command responses is possible via use of the Faux Hardware Settings script. Where commands return taggroups or objects - these will be empty. You would need to add temporary code to simulate the contents of such objects, if this is necessary during script development.

The default settings which come with this script are, in part, based on the author's experience. However, in some instances the response are either unknown, or are likely to vary with hardware. Do not trust the default values here to be typical of what your system might use. Read the header on the Faux Hardware Settings script to get tips on how to test your hardware to see what values might be used, and then edit the default settings to match. In most cases, this is not important during the offline development stage, and can be worked out quickly, once the script is migrated to the microscope-based installation.

Supported
Yes
Included Files
Main script file.
Source Code

see attached script.