DM3_Reader plugin for ImageJ
Author: Gregory Jefferis (jefferis AT gmail DOT com) Date(s):
- 23 June 2003 (Version 1.2.7 Beta) First version posted - 24 June 2003 (Version 1.2.8 Beta) Fixed setting of min/max brightness according to info in DM3 file - 25 June 2003 (Version 1.2.9 Beta) Fixed handling of unsigned 16-bit images - 25 June 2003 (Version 1.3.0 Beta) Removed calls to functions absent from Java versions =2.1.4 (Java v1.1.7) - 25 June 2003 (Version 1.3.1 Beta) Fixed Unicode conversion problem on MacOS9/MRJ. Tested fine with ImageJ 1.30 and MRJ 2.2.3 - 8 August 2003 (Version 1.3.2 Beta) Fixed a bug which meant that the last image contained in a DM3 file was always selected for opening, regardless of whether this was appropriate. Also fixed a bug handling calibration units - nm didn't work properly. - 25 August 2003 (Version 1.3.3) Public version - fixed one remaining bug with image choice uncovered by 8th August changes. - 7 May 2004 (Version 1.3.4) Fixed a bug preventing reading of unsigned 16 bit integer images. - 13 December 2005 (Version 1.3.5) - Adding handling of DIFFRACTION mode images (ie reciprocal space). . - 4 September 2006 (Version 1.3.6) Added storing of struct fields to tag list; this means that Digital Micrograph selection rectangles can be seen in Show Info. - 31 August 2007 (Version 1.3.7) Can now open data type 23 (RGBA_UINT8_3_DATA) images. Can also get a debug log by turning on Edit ... Options ... Misc ... Debug Mode. reading of unsigned 16 bit integer images. - 27 March 2008 (Version 1.3.8) Fixed a bug in which tag hashes were not cleared when reading a new file. Also small speed improvement by converting tags to String via StringBuffer. - 22 November 2011 (Version 1.4.1) Adds ability to read 3D stacks and RGB images. Fixes reading of RGBA_UINT8_3_DATA == ABGR images (which were being read as ARGB). Improves ability to identify "main" image automatically for opening. Adds a menu to choose which image to open when Alt/Option key is depressed before plugin is called. - 21 February 2013 (Version 1.4.2) Important bugfix to blreadDouble() which is used to read double values in metadata. An implementation error resulted in NaN values for perfectly valid metadata tags. Source: DM3_Reader.java Requires: ImageJ version >=1.29 Installation: Download DM3_Reader.class to the plugins folder and restart ImageJ. Description: The DM3_Reader plugin allows ImageJ to open files produced by Gatan's Digital Micrograph software, which is commonly used with Transmission Electron Microscopes. It is restricted to version 3 of this file format (the most recent version). It correctly reads in images that I have tested, setting the XY spatial scale. The minimum and maximum brightness thresholds are also set according to information in the DM3 file. All the data in DM3 format images is saved in the form of tags, which must be parsed by the reader. After extracting all of these tags they are copied to the "Info" property which can be accessed in ImageJ by the Image/Show Info menu command. Some of these tags may be useful eg sample name, magnification, exposure time etc. Documentation: None although the source code is quite well commented. The format of the DM3 file is succinctly described here. Limitations: The DM3 reader has now been tested with at least the following kinds of data: 16 bit signed and unsigned integer, 32 bit float, 24 bit RGB.
Limited to the following DM3 data types: UNSIGNED_INT8_DATA, SIGNED_INT16_DATA, UNSIGNED_INT16_DATA, SIGNED_INT32_DATA, UNSIGNED_INT32_DATA, REAL4_DATA, REAL8_DATA, BINARY_DATA, RGB_DATA, RGB_UINT8_1_DATA, RGB_UINT16_DATA, RGBA_UINT8_3_DATA
Limited support for 3D stacks since I have not had many to test.
I welcome any feedback on bugs
License: Copyright (c) 2003-, Gregory Jefferis, MRC Laboratory of Molecular Biology All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.