top bar

Micro-Manager Image File Stacks

In brief

In brief: A TIFF file or group of TIFF files that contain multiple acquired images per a single file. These files conform to the OME-TIFF specification, allowing them to be easily imported into a variety of analysis applications including anything that utilizes the Bio-Formats library.

Image File Stacks are designed to be easily imported into ImageJ without the need for a special reader plugin. A stack file can be dragged onto the ImageJ toolbar and will automatically open as a hyperstack with the same contrast settings used in Micro-Manager. Any acquisition comments typed into the Multi-Dimensional Acquisition window or the comments tab of the main Micro-Manager GUI can be viewed by pressing "i" with one of these files open in ImageJ.

By default, one file is created for each XY stage position (up to a maximum of 4 GB per file). In the tools-options menu, this can be changed to save all XY positions in a single file. This is especially useful for acquisitions using a large number XY positions. Since OME-TIFFs require that an identical String of XML metadata be embedded in each file in an acquisition, acquisitions that have a large number of XY positions with a small amount of data at each one waste space on disk and time by writing the same String of metadata in each file at the acquisition’s conclusion.

Writing to these files results in faster performance than writing to Seperate Image Files, in part because it minizes the number of system calls to create new files. This can be advantageous in situations where disk write speed is a limiting factor (i.e. writing to a server or collecting data at a high rate).

Format

Micro-Manager Image file stacks conform to both the TIFF Specification and OME TIFF Specification, contain data allowing them to be easily imported into ImageJ, store acquisition comments and display settings, and store an index map of the byte offsets of images within a file to allow for optimal reading performance.

Header

Bytes 0-7: Standard TIFF Header

8-11: Index map offset header (54773648)

12-15: Index map offset

16-19: Display settings offset header (483765892)

20-23: Display settings offset

24-27: Comments offset header (99384722)

28-31: Comments offset

32-35: Summary metadata header (2355492)

36-39: Summary metadata length

40-start of first IFD: 1 byte for each character of summary metadata


Image File Directories

Each IFD will contain the same set of TIFF tags, except for the first one in each file, which contains two ImageJ metadata tags, and two copies of the ImageDescription tag. One of these contains a string needed by ImageJ to recognize these files, and the other contains OME metadata. Although these tags appear in the first IFD, their values will not be written until the end of the file, when it is closed. The tags are written in the following order (non-standard TIFF tags have the values listed after them):


ImageWidth

ImageHeight

BitsPerSample

Compression

PhotometricInterpretation

ImageDescription (first IFD only)--contains OME XML metadata

a 2nd ImageDescription (first IFD only)-–contains ImageJ file opening information

StripOffsets

SamplesPerPixel

RowsPerStrip

StripByteCounts

XResolution

YResolution

ResolutionUnit

IJMetadataByteCounts (first IFD only) (50838)

IJMetadata (first IFD only) (50839)

MicroManagerMetadata (51123)


Immediately after these tags are written:

-4 bytes containg the offset of the next IFD (per the TIFF specification)

-In RGB files only, 6 bytes containing the values of the BitsPerSample tag Pixel values

-16 bytes containing the values of the XResolution and YResolution tags

-The value of the MicroManagerMetadata tag: 1 byte for each character of image metadata converted to a String


End of file

After the last IFD, the following constructs are written:

Index map

A listing of all the images contained in the file and their byte offsets. This allows a specific image to be quickly accessed without having to parse the entire file and read in image metadata. It consists of the following:

-A 4 byte header (3453623)

-4 bytes containing the number of entries in the index map

-20 bytes for each entry, with 4 bytes each allocated to the image’s channel index, slice index, frame index, position index, and byte offset of the image’s IFD within the file


ImageJ Metadata

A subset of the metadata used by the ImageJ TIFF writer (ij.io.TiffEncoder.java), which allows contrast settings and acquisition comments to propagate into ImageJ. The position and size of this metadata is specified by the IJMetadataCounts and IJMetadata tags in the first IFD.


OME XML Metadata

A string containing the OME XML metadata for this data set. This String is referenced by the first of the two ImageDescription tags in the first IFD of the file, in accordance with the OME-TIFF specification. Since this String must be identical for all files in a data set, it is not written for any file until the entire data set is closed at the conclusion of an acquisition.


ImageJ Image Description String

The ImageJ image description String that allows these files to opened correctly as hyperstacks in ImageJ. This String is referenced by the second of the two ImageDescription tags in the first IFD of the file.


Image display settings

Image display settings (channel contrast and colors), which are automatically rewritten whenever these are changed in an open data set. The first 4 bytes of this block contain the Display Settings Header (347834724), and the next 4 contain the number of subsequent bytes reserved for display settings. A String containing display settings (which are normally stored in a JSONObject) is written one byte per character.

Acquisition and Image comments

A String containing acquisition and Image comments. The first 4 bytes of this block contain the Comments Header (84720485), and the next 4 contain the length of String version of the JSONObject used to store acquisition comments. This String is rewritten whenever acquisition or image comments are changed.


--Henry Pinkard 7:35, 20th March 2013 (PDT)

© Micro-Manager : Vale Lab, UCSF 2006-2011 | All Rights Reserved | Contact