Module ij
Package ij.io

# Class TiffDecoder

java.lang.Object
ij.io.TiffDecoder

public class TiffDecoder extends Object
Decodes single and multi-image TIFF files. The LZW decompression code was contributed by Curtis Rueden.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final int`
`ARTIST`
`static final int`
`BITS_PER_SAMPLE`
`static final int`
`COLOR_MAP`
`static final int`
`COMPRESSION`
`static final int`
`DATE_TIME`
`protected boolean`
`debugMode`
`static final int`
`HOST_COMPUTER`
`static final int`
`IMAGE_DESCRIPTION`
`static final int`
`IMAGE_LENGTH`
`static final int`
`IMAGE_WIDTH`
`protected RandomAccessStream`
`in`
`static final int`
`IPLAB`
`static final int`
`JPEG_TABLES`
`static final int`
`META_DATA`
`static final int`
`META_DATA_BYTE_COUNTS`
`static final int`
`METAMORPH1`
`static final int`
`METAMORPH2`
`static final int`
`NEW_SUBFILE_TYPE`
`static final int`
`NIH_IMAGE_HDR`
`static final int`
`ORIENTATION`
`static final int`
`PHOTO_INTERP`
`static final int`
`PLANAR_CONFIGURATION`
`static final int`
`PREDICTOR`
`static final int`
`RESOLUTION_UNIT`
`static final int`
`ROWS_PER_STRIP`
`static final int`
`SAMPLE_FORMAT`
`static final int`
`SAMPLES_PER_PIXEL`
`static final int`
`SOFTWARE`
`static final int`
`STRIP_BYTE_COUNT`
`static final int`
`STRIP_OFFSETS`
`static final int`
`TILE_WIDTH`
`static final int`
`X_RESOLUTION`
`static final int`
`Y_RESOLUTION`

## Constructor Summary

Constructors
Constructor
Description
`TiffDecoder(InputStream in, String name)`
`TiffDecoder(String directory, String name)`

## Method Summary

Modifier and Type
Method
Description
`void`
`enableDebugging()`
`FileInfo[]`
`getTiffInfo()`
`void`
`saveImageDescription(byte[] description, FileInfo fi)`
Save the image description in the specified FileInfo.
`void`
`saveMetadata(String name, String data)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### NEW_SUBFILE_TYPE

public static final int NEW_SUBFILE_TYPE

See Also:
  - Constant Field Values

### IMAGE_WIDTH

public static final int IMAGE_WIDTH

See Also:
  - Constant Field Values

### IMAGE_LENGTH

public static final int IMAGE_LENGTH

See Also:
  - Constant Field Values

### BITS_PER_SAMPLE

public static final int BITS_PER_SAMPLE

See Also:
  - Constant Field Values

### COMPRESSION

public static final int COMPRESSION

See Also:
  - Constant Field Values

### PHOTO_INTERP

public static final int PHOTO_INTERP

See Also:
  - Constant Field Values

### IMAGE_DESCRIPTION

public static final int IMAGE_DESCRIPTION

See Also:
  - Constant Field Values

### STRIP_OFFSETS

public static final int STRIP_OFFSETS

See Also:
  - Constant Field Values

### ORIENTATION

public static final int ORIENTATION

See Also:
  - Constant Field Values

### SAMPLES_PER_PIXEL

public static final int SAMPLES_PER_PIXEL

See Also:
  - Constant Field Values

### ROWS_PER_STRIP

public static final int ROWS_PER_STRIP

See Also:
  - Constant Field Values

### STRIP_BYTE_COUNT

public static final int STRIP_BYTE_COUNT

See Also:
  - Constant Field Values

### X_RESOLUTION

public static final int X_RESOLUTION

See Also:
  - Constant Field Values

### Y_RESOLUTION

public static final int Y_RESOLUTION

See Also:
  - Constant Field Values

### PLANAR_CONFIGURATION

public static final int PLANAR_CONFIGURATION

See Also:
  - Constant Field Values

### RESOLUTION_UNIT

public static final int RESOLUTION_UNIT

See Also:
  - Constant Field Values

### SOFTWARE

public static final int SOFTWARE

See Also:
  - Constant Field Values

### DATE_TIME

public static final int DATE_TIME

See Also:
  - Constant Field Values

### ARTIST

public static final int ARTIST

See Also:
  - Constant Field Values

### HOST_COMPUTER

public static final int HOST_COMPUTER

See Also:
  - Constant Field Values

### PREDICTOR

public static final int PREDICTOR

See Also:
  - Constant Field Values

### COLOR_MAP

public static final int COLOR_MAP

See Also:
  - Constant Field Values

### TILE_WIDTH

public static final int TILE_WIDTH

See Also:
  - Constant Field Values

### SAMPLE_FORMAT

public static final int SAMPLE_FORMAT

See Also:
  - Constant Field Values

### JPEG_TABLES

public static final int JPEG_TABLES

See Also:
  - Constant Field Values

### METAMORPH1

public static final int METAMORPH1

See Also:
  - Constant Field Values

### METAMORPH2

public static final int METAMORPH2

See Also:
  - Constant Field Values

### IPLAB

public static final int IPLAB

See Also:
  - Constant Field Values

### NIH_IMAGE_HDR

public static final int NIH_IMAGE_HDR

See Also:
  - Constant Field Values

### META_DATA_BYTE_COUNTS

public static final int META_DATA_BYTE_COUNTS

See Also:
  - Constant Field Values

### META_DATA

public static final int META_DATA

See Also:
  - Constant Field Values

### in

protected RandomAccessStream in

### debugMode

protected boolean debugMode

## Constructor Details

### TiffDecoder

public TiffDecoder(String directory, String name)

### TiffDecoder

public TiffDecoder(InputStream in, String name)

## Method Details

### saveImageDescription

public void saveImageDescription(byte[] description, FileInfo fi)
Save the image description in the specified FileInfo. ImageJ saves spatial and density calibration data in this string. For stacks, it also saves the number of images to avoid having to decode an IFD for each image.

### saveMetadata

public void saveMetadata(String name, String data)

### enableDebugging

public void enableDebugging()

### getTiffInfo

public FileInfo[] getTiffInfo() throws IOException

Throws:
  `IOException`