Dr Chris Boothroyd: TIA (Emispec) file format


TIA (Tecnai imaging and analysis) is the program used on FEI Tecnai and Titan microscopes for acquiring and displaying scanned images and spectra. It is based on ES Vision, originally produced by the Emispec company, now taken over by FEI.

In this format, images and spectra are stored in a group of files (usually 2 but sometimes more). One file has the ending .emi and contains the screen layout information, the rest of the files (series file format) have the ending .ser and contain the image(s) and spectra themselves. No information has been published about the .emi format, but in most cases all the images and spectra are stored in the .ser files.

The format described here is for the .ser files and the information is taken both from a web page on the original Emispec web site (http://www.emispec.com/Support/SeriesFileFormat.asp), now no longer in existence and from information supplied by FEI.

The information relates to ES Vision 3.x, in later versions of TIA the format was updated to use 8 byte integers allowing files greater than 2GB.

The details of the .ser file format reproduced below can also be found on a pdf document supplied by FEI.

Overview

The series data file stores a number of 1D or 2D images, referred to as "elements". The images may be arranged in either a 1D line-scan or a 2D area-scan (or possibly higher dimensions). The images in the file do not necessarily have to be all the same size.

Thus files can contain up to 4 dimensions, as would be the case for example for an area-scan of CBED patterns.

Line-scan/area-scan

The line-scan or area-scan corresponds to scanning the beam across the specimen and recording an image or spectrum at each point. The number of dimensions of the scan is given by "NumberDimensions" and would be 1 for a line-scan and 2 for an area-scan. The number of pixels in each dimension is given by "DimensionSize" in the dimension array for each dimension.

"TotalNumberElements" gives the total number of images ("elements") and must be equal to the product of the "DimensionSize"s. "ValidNumberElements" is the number of images actually written to the file and would be less than "TotalNumberElements" if the acquisition was aborted.

Spectra/images

The number of dimensions of each image ("element") is given by the "DataTypeID" and may be 1 or 2 for 1D or 2D spectra/images.

The location (byte offset) of each image in the file is given by the Data offset array (one entry per image), which begins at byte "OffsetArrayOffset". Immediately following the data offset array is a tag offset array containing offsets to additional information about each image.

Each spectrum/image starts with a header containg the scale, type of data and length (x & y dimensions) followed by the image itself.

For SeriesVersion 0x0210 the byte offsets in the data offset array were 4 byte integers, so the maximum file size was 2GB for signed byte offsets. This gave a maximum of 256 2k fp images (for signed offsets). From SeriesVersion 0x0220 8 byte offsets are used allowing much larger file sizes.

The following is reproduced from the original Emispec web site with the changes made by FEI incorporated.

Overall structure

The file format consists of 6 parts:

  1. Header. Contains basic information about the file including unique file identifiers, data types, calibrations, number and dimensionality of the file and file offsets of the data and tag offset arrays.
  2. Dimension array. Stores information about the dimensionality of the data series.
  3. Data offset array. Contains file offsets of individual data elements.
  4. Tag offset array. Contains file offsets of individual data tags.
  5. Data elements. The actual individual data elements, stored as short-header binary objects.
  6. Data tags. The actual individual data tags, stored as short-header binary objects.

1. Header format

Begins at byte 0.

Byte Offset Data Type Data Size (Bytes) Name Description
0 Integer 2 ByteOrder Byte ordering indicator - value 0x4949 ('II') indicates little-endian (PC) byte ordering. All series files are written with this byte ordering, where the least-significant byte is stored first.
2 Integer 2 SeriesID Series identification word - value 0x0197 indicates ES Vision Series Data File
4 Integer 2 SeriesVersion Version number word - indicates the version of the Series Data File. Should be 0x0210 or 0x0220.
6 Integer 4 DataTypeID Indicates the type of data object stored at each element in the series. May be one of the following values:
0x4120 - Data elements are 1-dimensional arrays
0x4122 - Data elements are 2-dimensional arrays
10 Integer 4 TagTypeID Indicates the type of tab stored at each element in the series. May be one of the following values:
0x4152 - Tag is time only
0x4142 - Tag is 2-D position with time
14 Integer 4 TotalNumberElements Indicates the total number of data elements and tags referred to by the Dimension Array. Equals the product of the dimension sizes, and corresponds to the total number of addressable indices in the series.
18 Integer 4 ValidNumberElements Indicates the number of valid Data elements and Tags in the series data file. Normally equal to TotalNumberElements, may be less than TotalNumberElements if not all elements of the series file were written.
22 Integer 4/8 OffsetArrayOffset Indicates the absolute offset (in bytes) in the Series Data File of the beginning of the Data Offset Array.
OffsetArrayOffset size 4 bytes for SeriesVersion≤0x0210
OffsetArrayOffset size 8 bytes for SeriesVersion≥0x0220
26/30 Integer 4 NumberDimensions Indicates the number of dimensions of the Series Data File. This indicates the number of dimensions of the indices, NOT the number of dimensions of the data.

2. Dimension array format

Follows immediately after the header, beginning at byte offset 30/34. It consists of one or more adjacent structures of the following form. The length of each dimension structure is 32 + DescriptionLength + UnitsLength bytes.

Byte Offset Data Type Data Size (Bytes) Name Description
0 Integer 4 DimensionSize Indicates the number of elements in this dimension.
4 Float 8 CalibrationOffset Indicates the calibration value at element CalibrationElement.
12 Float 8 CalibrationDelta Indicates the calibration delta between elements of the series.
20 Integer 4 CalibrationElement Indicates the element in the series which has a calibration value of CalibrationOffset.
24 Integer 4 DescriptionLength Indicates the length of the Description string
28 Char * Description String of length DescriptionLength which describes this dimension.
* Integer 4 UnitsLength Indicates the length of the Units string.
* Char * Units String of length UnitsLength which is the name of units in this dimension.

3. Data offset array format

The Data Offset Array begins at byte offset OffsetArrayOffset. It consists of TotalNumberElemets 4/8 byte integers corresponding to the byte offsets of the individual data elements. The integers are 4 byte for SeriesVersion≤0x0210 and 8 byte for SeriesVersion≥0x0220.

4. Tag offset array format

The Tag Offset Array follows immediately after the Data Offset Array. It consists of TotalNumberElements 4/8 byte integers corresponding to the byte offsets of the individual data tags. The integers are 4 byte for SeriesVersion≤0x0210 and 8 byte for SeriesVersion≥0x0220.

5. Data element format

The following are the formats for 1-D and 2-D data.

1-D Data element format

1-D data has DataTypeID = 0x4120

Byte Offset Data Type Data Size (Bytes) Name Description
0 Float 8 CalibrationOffset Indicates the calibration value at element CalibrationElement.
8 Float 8 CalibrationDelta Indicates the calibration delta between elements of the array.
16 Integer 4 CalibrationElement Indicates the element in the array which has a calibration value of CalibrationOffset.
20 Integer 2 DataType Indicates the type of data stored at each element of the array. May be one of the following values:
1 - Unsigned 1-byte integer
2 - Unsigned 2-byte integer
3 - Unsigned 4-byte integer
4 - Signed 1-byte integer
5 - Signed 2-byte integer
6 - Signed 4-byte integer
7 - 4-byte float
8 - 8-byte float
9 - 8-byte complex
10 - 16-byte complex
22 Integer 4 ArrayLength Indicates the number of elements in the array
26 * * Data The actual data values.

2-D Data element format

2-D data has DataTypeID = 0x4122

Byte Offset Data Type Data Size (Bytes) Name Description
0 Float 8 CalibrationOffsetX Indicates the calibration value at element CalibrationElement in the X-direction.
8 Float 8 CalibrationDeltaX Indicates the calibration delta between elements of the array in the X-direction.
16 Integer 4 CalibrationElementX Indicates the element in the array in the X-direction which has a calibration value of CalibrationOffset.
20 Float 8 CalibrationOffsetY Indicates the calibration value at element CalibrationElement in the Y-direction.
28 Float 8 CalibrationDeltaY Indicates the calibration delta between elements of the array in the Y-direction.
36 Integer 4 CalibrationElementY Indicates the element in the array in the Y-direction which has a calibration value of CalibrationOffset.
40 Integer 2 DataType Indicates the type of data stored at each element of the array. May be one of the following values:
1 - Unsigned 1-byte integer
2 - Unsigned 2-byte integer
3 - Unsigned 4-byte integer
4 - Signed 1-byte integer
5 - Signed 2-byte integer
6 - Signed 4-byte integer
7 - 4-byte float
8 - 8-byte float
9 - 8-byte complex
10 - 16-byte complex
42 Integer 4 ArraySizeX Indicates the number of elements in the array in the X-direction (the array width).
46 Integer 4 ArraySizeY Indicates the number of elements in the array in the Y-direction (the array height).
50 * * Data The actual data values.

6. Data tag format

Time-only tag format

Time-only tags have TagTypeID = 0x4152

Byte Offset Data Type Data Size (Bytes) Name Description
0 Integer 2 TagTypeID Indicates the type of the tag - should have value 0x4152
2 ? 2 ? There have been a few reports that there are 2 extra undocumented bytes here
(2?) Integer 4 Time Indicates the time in ANSI-standard time as the number of seconds elapsed since Jan. 1, 1970.

Time and position tag format

Time and position tags have TagTypeID = 0x4142

Byte Offset Data Type Data Size (Bytes) Name Description
0 Integer 2 TagTypeID Indicates the type of the tag - should have value 0x4142
2 ? 2 ? There have been a few reports that there are 2 extra undocumented bytes here
(2?) Integer 4 Time Indicates the time in ANSI-standard time as the number of seconds elapsed since Jan. 1, 1970.
(6?) Float 8 PositionX Indicates the position in the X-direction of the tag.
(14?) Float 8 PositionY Indicates the position in the Y-direction of the tag.

Dr Chris Boothroyd | Info