Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This document describes how to decipher a Tiff file created using the new Big Tiff format in ScanImage. The hex editor used in the examples displays the bytes as they appear in the Tiff file. Byte swapping needs to occur to decipher Tiff information and is presented in the examples.

Tiff Header Section

The Tiff Header Section contains Tiff Header information as defined in the Big Tiff Specification.

...

div
idTiffHeaderDiv1
stylemargin-left: 100px

ScanImage Static Metadata Section

This section contains static metadata collected from ScanImage at the time the Tiff file was created. Static metadata is data defining the state of the ScanImage system (determined by Machine Data File configuration and user selections made within ScanImage) that is relevant and unchanging for all the images in the Tiff file. Thus, this information applies to all images in the same Tiff file.

The static metadata section starts on the first byte directly following the Tiff Header section, which is at byte 16, and contains the following sections:

Magic Number

The Magic Number is a 4-byte unsigned number that identifies the file as a Tiff file created by ScanImage and is currently set to the decimal value, 117637889. This value is placed in the first four bytes of the Static Metadata section.

...

div
idTiffHeaderDiv1
stylemargin-left: 100px

ScanImage Tiff Version Number

The ScanImage Tiff Version Number for the release of ScanImage 2016 is set to 3. This is stored as a 4-byte unsigned number following the Magic Number, starting at byte 4 and continuing through byte 7, of the static metadata section.

...

div
idTiffHeaderDiv1
stylemargin-left: 100px

 

Non-Varying Frame Data Length

The Non-Varying Frame Data Length section is a 4-byte unsigned number that contains the size in bytes, including a NULL terminator, of the Non-Varying Frame data.  The actual Non-Varying frame data starts at byte 16 from the beginning of the Static Metadata section and is discussed in bullet item (5) Non-Varying Frame Data.

...

div
idTiffHeaderDiv1
stylemargin-left: 100px
 

ROI Group Data Length

The ROI Group Data Length section is a 4-byte unsigned number that contains the size in bytes, including a NULL terminator of the ROI Group data.  The actual ROI Group data starts immediately following the Non-Varying Frame Data and is discussed in bullet item (5) Non-Varying Frame Data.

...

div
idTiffHeaderDiv1
stylemargin-left: 100px

Non-Varying Frame Data

The Non-Varying Frame Data section contains the actual, unchanging data (excluding ROI Group data) including a NULL terminator, that pertains to all images in the Tiff file. The Non-Varying frame data starts at byte 16 from the beginning of the Static Metadata section.

...

Each Tiff Frame contains an IFD tag, called the ‘Software’ tag, that points to the start of the Non-Varying Frame data. This will be discussed as part of the Frame Specification later in this document.

ROI Group Data

The ROI Group Data section contains the actual ROI Group Data, including a NULL terminator. The ROI Group data starts at byte immediately following the Non-Varying Frame Data. Thus the start of the ROI Group Data can be found at the offset of byte 16 plus the size of the Non-Varying Frame Data from the beginning of the Static Metadata section.

  • The free version of ScanImage does not have the MROI (Multiple Regions of Interest) feature accessible to the user, and will not contain any data in this section.
  • Each Tiff Frame contains a tag, called the ‘Artist’ tag, that points to the start of the ROI Group Data. This will be discussed as part of the Frame Specification later in this document.

Frame Section

There is one frame section existent per image frame. Each Frame section consists of an IFD (Image File Directory) Header, followed by a section containing supplemental header information and finally the bytes that makeup the actual image.

IFD Header Section

The IFD Header Section contains all the IFD Tags used by ScanImage in the Tiff file. Each IFD Tag utilized by ScanImage is defined within the Tiff Specification. Each frame in the Tiff file contains the same set of IFD Tags filled with frame specific information.

...

Subsequent IFD Header sections start at the location indicated in the ‘Next IFD Header’ offset field in the IFD Header. This will be covered later in this section.

Number of Tags in the IFD

The number of tags is an unsigned 8-byte number stored at byte zero of the IFD header and contains the number of IFD Tags stored in the IFD Header. Below, the IFD Header starts at hex byte 0000 24AA and continues through hex byte 0000 24B0.

...

div
idTiffHeaderDiv1
stylemargin-left: 100px

IFD Tags

This section will list and illustrate all IFD Tags utilized by ScanImage, in the order they are placed in the IFD Header. There is one IFD Header defined for each image frame and each IFD Header contains the same Tags, whose values are filled with frame specific information. Each IFD Tag in a Big Tiff file contains 20 bytes. Refer to the Tiff Specification for more detailed information on each Tag.

...

This same technique is to be applied to each part of each IFD Tag in order to extract Tag specific information.

IFD Tag 256: Image Width

(Hex Value 0100, converted in the first 2 bytes of the IFD Tag section as 0001)

...

div
idTiffHeaderDiv1
stylemargin-left: 100px

IFD Tag 257: Image Length

(Hex Value 0101, converted in the first 2 bytes of the IFD Tag section as 0101)

...

div
idTiffHeaderDiv1
stylemargin-left: 100px

IFD Tag 258: Bits Per Sample Field

(Hex Value 0102, converted in the first 2 bytes of the IFD Tag section as 0201)

...

div
idTiffHeaderDiv1
stylemargin-left: 100px

IFD Tag 259: Compression Field

(Hex Value 0103, converted in the first 2 bytes of the IFD Tag section as 0301)

...

div
idTiffHeaderDiv1
stylemargin-left: 100px

IFD Tag 262: Photometric Interpretation Field

(Hex Value 0106, converted in the first 2 bytes of the IFD Tag section as 0601)

...

div
idTiffHeaderDiv1
stylemargin-left: 100px

IFD Tag 270: Image Description Field

(Hex Value 010E, converted in the first 2 bytes of the IFD Tag section as 0E01)

...

div
idTiffHeaderDiv1
stylemargin-left: 100px

IFD Tag 273: Strip Offsets Field

(Hex Value 0111, converted in the first 2 bytes of the IFD Tag section as 1101)

...

div
idTiffHeaderDiv1
stylemargin-left: 100px

IFD Tag 274: Orientation Field

(Hex Value 0112, converted in the first 2 bytes of the IFD Tag section as 1201)

...

div
idTiffHeaderDiv1
stylemargin-left: 100px

IFD Tag 277: Samples Per Pixel Field

(Hex Value 0115, converted in the first 2 bytes of the IFD Tag section as 1501)

...

div
idTiffHeaderDiv1
stylemargin-left: 100px

IFD Tag 278: Rows Per Strip Field

(Hex Value 0116, converted in the first 2 bytes of the IFD Tag section as 1601)

...

div
idTiffHeaderDiv1
stylemargin-left: 100px

IFD Tag 279: Strip Byte Counts Field

(Hex Value 0117, converted in the first 2 bytes of the IFD Tag section as 1701)

...

div
idTiffHeaderDiv1
stylemargin-left: 100px

IFD Tag 282: X Resolution Field

(Hex Value 011A, converted in the first 2 bytes of the IFD Tag section as 1A01)

...

div
idTiffHeaderDiv1
stylemargin-left: 100px

IFD Tag 283: Y Resolution Field

(Hex Value 011B, converted in the first 2 bytes of the IFD Tag section as 1B01)

...

div
idTiffHeaderDiv1
stylemargin-left: 100px

IFD Tag 284: Planar Configuration Field

(Hex Value 011C, converted in the first 2 bytes of the IFD Tag section as 1C01)

...

div
idTiffHeaderDiv1
stylemargin-left: 100px

IFD Tag 296: Resolution Unit Field

(Hex Value 0128, converted in the first 2 bytes of the IFD Tag section as 2801)

...

div
idTiffHeaderDiv1
stylemargin-left: 100px

IFD Tag 305: Software Package Field (Header Metadata Offset)

(Hex Value 0131, converted in the first 2 bytes of the IFD Tag section as 3101)

...

div
idTiffHeaderDiv1
stylemargin-left: 100px

IFD Tag 315: Artist Field (ROI Group Metadata Offset)

(Hex Value 013B, converted in the first 2 bytes of the IFD Tag section as 3B01)

...

div
idTiffHeaderDiv1
stylemargin-left: 100px

IFD Tag 339: Sample Format Field

(Hex Value 0153, converted in the first 2 bytes of the IFD Tag section as 5301)

...

div
idTiffHeaderDiv1
stylemargin-left: 100px
 

Next IFD Location

The final section of the IFD Header contains the byte offset, from the start of the Tiff file, to the Next IFD Header.

...

div
idTiffHeaderDiv1
stylemargin-left: 100px

Image Section

This section illustrates how to determine where an image starts. The offset byte for the start of an image from the beginning of the Tiff file, can be located in the Value field of the IFD Strip Offsets Field Tag (273, Hex 0111, converted to 1101). The following recaps a prior illustration of the IFD Strip Offsets Field.

...