loci.formats.in

## Class TiffReader

- java.lang.Object
- - loci.formats.FormatHandler
  - - loci.formats.FormatReader
    - - loci.formats.SubResolutionFormatReader
      - - loci.formats.in.MinimalTiffReader
        - - loci.formats.in.BaseTiffReader
          - - loci.formats.in.TiffReader

- All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, ICompressedTileReader, IFormatHandler, IFormatReader, IMetadataConfigurable, IPyramidHandler

      public class TiffReader
      extends BaseTiffReader

  TiffReader is the file format reader for regular TIFF files, not of any specific TIFF variant.
  Author:
    Curtis Rueden ctrueden at wisc.edu, Melissa Linkert melissa at glencoesoftware.com

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private java.lang.String` | `calibrationUnit`
    `static java.lang.String[]` | `COMPANION_SUFFIXES`
    `private java.lang.String` | `companionFile`
    `private java.lang.String` | `description`
    `static int` | `IMAGEJ_TAG`
    `private static org.slf4j.Logger` | `LOGGER` Logger for this class.
    `private java.lang.Double` | `physicalSizeZ`
    `static java.lang.String[]` | `TIFF_SUFFIXES`
    `private ome.units.quantity.Time` | `timeIncrement`
    `private java.lang.Integer` | `xOrigin`
    `private java.lang.Integer` | `yOrigin`

    - ### Fields inherited from class loci.formats.in.BaseTiffReader

      `DATE_FORMATS`

    - ### Fields inherited from class loci.formats.in.MinimalTiffReader

      `canSeparateSeries, equalStrips, ifds, lastPlane, mergeSubIFDs, noSubresolutions, seriesToIFD, subResolutionIFDs, thumbnailIFDs, tiffParser, use64Bit`

    - ### Fields inherited from class loci.formats.SubResolutionFormatReader

      `core`

    - ### Fields inherited from class loci.formats.FormatReader

      `coreIndex, datasetDescription, domains, fillColor, filterMetadata, flattenedResolutions, group, hasCompanionFiles, in, indexedAsRGB, metadata, metadataStore, normalizeData, resolution, saveOriginalMetadata, series, suffixNecessary, suffixSufficient, THUMBNAIL_DIMENSION`

    - ### Fields inherited from class loci.formats.FormatHandler

      `COMPRESSION_SUFFIXES, currentId, format, metadataOptions, suffixes`

    - ### Fields inherited from interface loci.formats.IFormatReader

      `CAN_GROUP, CANNOT_GROUP, MUST_GROUP`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TiffReader()` Constructs a new Tiff reader.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `private boolean` | `checkCommentImageJ(java.lang.String comment)`
    `private boolean` | `checkCommentMetamorph(java.lang.String comment)`
    `void` | `close(boolean fileOnly)` Closes the currently open file.
    `java.lang.String[]` | `getSeriesUsedFiles(boolean noPixels)` Returns an array of filenames needed to open the current series.
    `protected void` | `initMetadataStore()` Populates the metadata store using the data parsed in `BaseTiffReader.initStandardMetadata()` along with some further parsing done in the method itself.
    `protected void` | `initStandardMetadata()` Parses standard metadata.
    `private void` | `parseCommentGeneric(java.lang.String comment)`
    `private void` | `parseCommentImageJ(java.lang.String comment)`
    `private void` | `parseCommentMetamorph(java.lang.String comment)`
    `private double` | `parseDouble(java.lang.String s)`
    `private int` | `parseInt(java.lang.String s)`
    `private void` | `populateMetadataStoreImageJ(MetadataStore store)` Checks the original metadata table for ImageJ-specific information to propagate into the metadata store.

    - ### Methods inherited from class loci.formats.in.BaseTiffReader

      `getExifTagName, getImageCreationDate, initFile, initMetadata, put, put, put, put, put, put, put, put, put, put, putDouble, putInt, putString`

    - ### Methods inherited from class loci.formats.in.MinimalTiffReader

      `copyTile, get16BitLookupTable, get8BitLookupTable, getCompressedByteCount, getIFDs, getOptimalTileHeight, getOptimalTileWidth, getThumbnailIFDs, getThumbSizeX, getThumbSizeY, getTileIndex, initTiffParser, isThisType, openBytes, openThumbBytes, reopenFile, setResolutionLevel`

    - ### Methods inherited from class loci.formats.SubResolutionFormatReader

      `coreIndexToSeries, flattenHashtables, getCoreIndex, getCoreMetadataList, getCurrentCore, getResolution, getResolutionCount, getSeries, getSeriesCount, seriesToCoreIndex, setCoreIndex, setResolution, setSeries`

    - ### Methods inherited from class loci.formats.FormatReader

      `addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMetaList, addMeta, addMetaList, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMetaList, close, fileGroupOption, getAcquisitionMode, getAdvancedSeriesUsedFiles, getAdvancedUsedFiles, getArcType, getAvailableOptions, getBinning, getBitsPerPixel, getCompression, getContrastMethod, getCorrection, getCurrentFile, getDatasetStructureDescription, getDetectorType, getDimensionOrder, getDimensionOrder, getDomains, getEffectiveSizeC, getExperimentType, getFilamentType, getFillColor, getFillRule, getFilterType, getFontFamily, getFontStyle, getGlobalMeta, getGlobalMetadata, getIlluminationType, getImageCount, getImmersion, getIndex, getIndex, getLaserMedium, getLaserType, getMarker, getMedium, getMetadataStore, getMetadataStoreRoot, getMetadataValue, getMicrobeamManipulationType, getMicroscopeType, getModuloC, getModuloT, getModuloZ, getNamingConvention, getPixelType, getPixelType, getPossibleDomains, getPulse, getRequiredDirectories, getRGBChannelCount, getRotationTransform, getSeriesMeta, getSeriesMetadata, getSeriesMetadataValue, getSeriesUsedFiles, getSizeC, getSizeT, getSizeX, getSizeY, getSizeZ, getTileColumns, getTileRows, getUnderlyingReaders, getUsedFiles, getUsedFiles, getZCTCoords, getZCTModuloCoords, hasCompanionFiles, hasFlattenedResolutions, isFalseColor, isGroupFiles, isIndexed, isInterleaved, isInterleaved, isLittleEndian, isMetadataComplete, isMetadataFiltered, isNormalized, isOrderCertain, isOriginalMetadataPopulated, isRGB, isSingleFile, isThisType, isThisType, isThisType, isThumbnailSeries, isUsedFile, makeFilterMetadata, openBytes, openBytes, openBytes, openPlane, readPlane, readPlane, readPlane, setFillColor, setFlattenedResolutions, setGroupFiles, setId, setMetadataFiltered, setMetadataStore, setNormalized, setOriginalMetadataPopulated, updateMetadataLists`

    - ### Methods inherited from class loci.formats.FormatHandler

      `checkSuffix, checkSuffix, getFormat, getMetadataOptions, getNativeDataType, getSuffixes, getSupportedMetadataLevels, setMetadataOptions`

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

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

    - ### Methods inherited from interface loci.formats.IFormatHandler

      `getFormat, getNativeDataType, getSuffixes`

    - ### Methods inherited from interface loci.formats.IMetadataConfigurable

      `getMetadataOptions, getSupportedMetadataLevels, setMetadataOptions`

    - ### Methods inherited from interface loci.formats.ICompressedTileReader

      `getTileCodec, getTileCodecOptions, openCompressedBytes, openCompressedBytes`

- - ### Field Detail

    - #### LOGGER

          private static final org.slf4j.Logger LOGGER

      Logger for this class.

    - #### TIFF_SUFFIXES

          public static final java.lang.String[] TIFF_SUFFIXES

    - #### COMPANION_SUFFIXES

          public static final java.lang.String[] COMPANION_SUFFIXES

    - #### IMAGEJ_TAG

          public static final int IMAGEJ_TAG

      See Also:
        Constant Field Values

    - #### companionFile

          private java.lang.String companionFile

    - #### description

          private java.lang.String description

    - #### calibrationUnit

          private java.lang.String calibrationUnit

    - #### physicalSizeZ

          private java.lang.Double physicalSizeZ

    - #### timeIncrement

          private ome.units.quantity.Time timeIncrement

    - #### xOrigin

          private java.lang.Integer xOrigin

    - #### yOrigin

          private java.lang.Integer yOrigin

  - ### Constructor Detail

    - #### TiffReader

          public TiffReader()

      Constructs a new Tiff reader.

  - ### Method Detail

    - #### getSeriesUsedFiles

          public java.lang.String[] getSeriesUsedFiles(boolean noPixels)

      Description copied from interface: `IFormatReader`
      Returns an array of filenames needed to open the current series. If the 'noPixels' flag is set, then only files that do not contain pixel data will be returned. The first element in the array is expected to be the path passed to `IFormatHandler.setId(String)`, if appropriate based upon 'noPixels'. The remaining elements are expected to be in a consistent order; if a directory listing is necessary to build the list then it should be sorted first.
      Specified by:
        `getSeriesUsedFiles` in interface `IFormatReader`
      Overrides:
        `getSeriesUsedFiles` in class `FormatReader`

    - #### close

          public void close(boolean fileOnly)
                     throws java.io.IOException

      Description copied from interface: `IFormatReader`
      Closes the currently open file. If the flag is set, this is all that happens; if unset, it is equivalent to calling `Closeable.close()`.
      Specified by:
        `close` in interface `IFormatReader`
      Overrides:
        `close` in class `MinimalTiffReader`
      Throws:
        `java.io.IOException`

    - #### initStandardMetadata

          protected void initStandardMetadata()
                                       throws FormatException,
                                              java.io.IOException

      Description copied from class: `BaseTiffReader`
      Parses standard metadata. NOTE: Absolutely no calls to the metadata store should be made in this method or methods that override this method. Data will be overwritten if you do so.
      Overrides:
        `initStandardMetadata` in class `BaseTiffReader`
      Throws:
        `FormatException`
        `java.io.IOException`

    - #### initMetadataStore

          protected void initMetadataStore()
                                    throws FormatException

      Description copied from class: `BaseTiffReader`
      Populates the metadata store using the data parsed in `BaseTiffReader.initStandardMetadata()` along with some further parsing done in the method itself. All calls to the active `MetadataStore` should be made in this method and only in this method. This is especially important for sub-classes that override the getters for pixel set array size, etc.
      Overrides:
        `initMetadataStore` in class `BaseTiffReader`
      Throws:
        `FormatException`

    - #### checkCommentImageJ

          private boolean checkCommentImageJ(java.lang.String comment)

    - #### checkCommentMetamorph

          private boolean checkCommentMetamorph(java.lang.String comment)

    - #### parseCommentImageJ

          private void parseCommentImageJ(java.lang.String comment)
                                   throws FormatException,
                                          java.io.IOException

      Throws:
        `FormatException`
        `java.io.IOException`

    - #### populateMetadataStoreImageJ

          private void populateMetadataStoreImageJ(MetadataStore store)

      Checks the original metadata table for ImageJ-specific information to propagate into the metadata store.

    - #### parseCommentMetamorph

          private void parseCommentMetamorph(java.lang.String comment)

    - #### parseCommentGeneric

          private void parseCommentGeneric(java.lang.String comment)

    - #### parseInt

          private int parseInt(java.lang.String s)

    - #### parseDouble

          private double parseDouble(java.lang.String s)

Copyright © 2026 Open Microscopy Environment