SimpleTIFF.m v1.2 January 2005 by Harald Hauglin (harald.hauglin@basalmed.uio.no) SimpleTIFFRead::usage = "SimpleTIFFRead[filename] reads 8 and 16 bit integer and 32 bit real monochrome images and returns an array of pixel values" SimpleTIFFInfo::usage = "SimpleTIFFInfo[filename] returns a formatted table with basic image information and an overview of the TIFF tags" This is a package for reading non-standard grayscale TIFF files. The package parses the TIFF tags for basic info such as image size, and bit depth. Currently it only reads one image per TIFF file. Furthermore, the image data has to be located in one continuous block, although TIFF ver. 6.0 allows an image to be composed of strips of data not neccessarily located consecutively. I don't parse tags other than a neccessary minimum. 8 bit image data are assumed to be unsigned i.e. 0..255, 16 bit data are assumed to be unsigned and 32 bit data represent floating point numbers. Not supported: - multiple images in a single TIFF file - compressed TIFF data - 4 bit pixel values - full implementation of image strip reading - parsing of ASCII type TIFF headers - other TIFF classes such as RGB, bi-level, JPEG For a full overview of TIFF ver. 6.0, see http://partners.adobe.com/asn/developer/PDFS/TN/TIFF6.pdf Tested on - 16 bit integer and 32 bit floating point images generated by Xenogen IVIS Living Image software. - 16 bit images from Hamamatsu Wasabi - 8 bit images generated by ImageJ Installation advice: -------------------- - Place the file SimpleTIFF.m in one of the directories scanned by Mathematica ($Path), e.g. C:\Documents and Settings\All Users\Application Data\Mathematica\Applications for a Windows XP installation - Users of Mathematica ver. 4.x are strongly urged to install the FastBinaryFiles package by Todd Gayley and John Fultz (http://library.wolfram.com/infocenter/MathSource/354/) Other comments: --------------- This package is offered 'as is' - no warranty implied. All mistakes are my own. Please send comments and suggestions to harald.hauglin@basalmed.uio.no Revision history: ----------------- 1.0 Initial release 1.1 Added (somewhat) optimized binary file reading 1.2 Added checking of file existence and simple error handling