User Tools

Site Tools



This shows you the differences between two versions of the page.

Link to this comparison view

plugin:utilities:python_dm3_reader:start [2019/04/12 13:13] (current)
Line 1: Line 1:
 +====== Python DM3 Reader ======
 +**This is an adaptation of the DM3_Reader plug-in as a Python module. It may by used to extract thumbnail, image data and metadata from GATAN DigitalMicrograph 3 files.**
 +This python module is a transposition and adaptation of the [[http://​​ij/​plugins/​DM3_Reader.html|DM3_Reader ImageJ plug-in]] by Greg Jefferis. It was initially meant to be called by a script indexing electron microscope images into a database.
 +This module now allows to extract various metadata (specimen, operator, HV, MAG, etc.) from GATAN DigitalMicrograph DM3 files. It may also extract and dump all metadata ("​Tags"​) and pass thumbnail and image data as PIL Images or Numpy arrays, as well as save the thumbnail view in a PNG file.
 +Use in your own script would typically require lines such as:
 +<code python>
 +import DM3lib as dm3
 +import matplotlib.pyplot as plt
 +# parse DM3 file
 +dm3f = dm3.DM3("​sample.dm3"​)
 +# print some useful image information
 +print "pixel size = %s %s"​%dm3f.pxsize
 +# display image
 +plt.matshow(dm3f.imagedata,​ vmin=dm3f.cuts[0],​ vmax=dm3f.cuts[1])
 +Please note: It has only been tested on single-image files (i.e. not stacks) and not all data types are implemented.
 +NEW: version 1.0, a significant code overhaul, and a more complete distribution;​ support added for more image data types.
 +  * Dependencies : [[http://​​products/​pil/​|Python Imaging Library]] ; [[http://​| NumPy]]/​[[http://​|SciPy]]
 +  * Python 3 not supported (for now)
 +Project homepage : [[http://​​pydm3reader/​|​pydm3reader]]
plugin/utilities/python_dm3_reader/start.txt ยท Last modified: 2019/04/12 13:13 (external edit)