loci.formats.in

## Class VentanaReader

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

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

      public class VentanaReader
      extends BaseTiffReader

  VentanaReader is the file format reader for Ventana .bif files.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `(package private) class` | `VentanaReader.AreaOfInterest`
    `(package private) class` | `VentanaReader.Overlap`
    `(package private) class` | `VentanaReader.TIFFTile`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private java.util.List<VentanaReader.AreaOfInterest>` | `areas`
    `private static int` | `EXTRA_TAG_1`
    `private static int` | `EXTRA_TAG_2`
    `private static org.slf4j.Logger` | `LOGGER` Logger for this class.
    `private java.lang.Double` | `magnification`
    `private java.lang.Double` | `physicalPixelSize`
    `private int` | `resolutions`
    `static boolean` | `SPLIT_TILES_DEFAULT` Default value of `SPLIT_TILES_KEY`
    `static java.lang.String` | `SPLIT_TILES_KEY` MetadataOptions key for determining whether to report each tile as a separate series.
    `private int` | `tileHeight`
    `private VentanaReader.TIFFTile[]` | `tiles`
    `private int` | `tileWidth`
    `private static int` | `XML_TAG`
    `private static int` | `Z_TAG`

    - ### 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
    `VentanaReader()` Constructs a new Ventana reader.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close(boolean fileOnly)` Closes the currently open file.
    `int` | `fileGroupOption(java.lang.String id)` Returns an indication of whether the files in a multi-file dataset can be handled individually.
    `short[][]` | `get16BitLookupTable()` Gets the 16-bit color lookup table associated with the most recently opened image.
    `byte[][]` | `get8BitLookupTable()` Gets the 8-bit color lookup table associated with the most recently opened image.
    `protected java.util.ArrayList<java.lang.String>` | `getAvailableOptions()` Returns the list of available metadata options.
    `private int` | `getIFDIndex(int coreIndex)` Note that all planes for a particular resolution or extra image are packed into a single IFD, so the IFD index does not depend upon the plane (e.g.
    `int` | `getOptimalTileHeight()` Returns the optimal sub-image height for use with openBytes.
    `int` | `getOptimalTileWidth()` Returns the optimal sub-image width for use with openBytes.
    `private int` | `getScale(int resolution)`
    `int` | `getThumbSizeX()` Get the size of the X dimension for the thumbnail.
    `int` | `getThumbSizeY()` Get the size of the Y dimension for the thumbnail.
    `private int` | `getTileColumn(int index, int rows, int cols)`
    `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.
    `boolean` | `isThisType(java.lang.String name, boolean open)` Checks if a file matches the type of this format reader.
    `byte[]` | `openBytes(int no, byte[] buf, int x, int y, int w, int h)` Obtains a sub-image of the specified image plane into a pre-allocated byte array.
    `byte[]` | `openThumbBytes(int no)` Obtains a thumbnail for the specified image plane from the current file, as a byte array.
    `private void` | `parseXML(java.lang.String xml)`
    `private int` | `scaleCoordinate(int v, int resolution)`
    `private IFD` | `splitIFD(IFD ifd, int no)` Take the real IFD on disk and reshape it into something that represents only the given plane.
    `boolean` | `splitTiles()`

    - ### 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, getCompressedByteCount, getIFDs, getThumbnailIFDs, getTileIndex, initTiffParser, isThisType, 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, getAcquisitionMode, getAdvancedSeriesUsedFiles, getAdvancedUsedFiles, getArcType, 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, 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, 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

    - #### SPLIT_TILES_KEY

          public static final java.lang.String SPLIT_TILES_KEY

      MetadataOptions key for determining whether to report each tile as a separate series.
      See Also:
        Constant Field Values

    - #### SPLIT_TILES_DEFAULT

          public static final boolean SPLIT_TILES_DEFAULT

      Default value of `SPLIT_TILES_KEY`
      See Also:
        Constant Field Values

    - #### LOGGER

          private static final org.slf4j.Logger LOGGER

      Logger for this class.

    - #### XML_TAG

          private static final int XML_TAG

      See Also:
        Constant Field Values

    - #### Z_TAG

          private static final int Z_TAG

      See Also:
        Constant Field Values

    - #### EXTRA_TAG_1

          private static final int EXTRA_TAG_1

      See Also:
        Constant Field Values

    - #### EXTRA_TAG_2

          private static final int EXTRA_TAG_2

      See Also:
        Constant Field Values

    - #### magnification

          private java.lang.Double magnification

    - #### areas

          private java.util.List<VentanaReader.AreaOfInterest> areas

    - #### tileWidth

          private int tileWidth

    - #### tileHeight

          private int tileHeight

    - #### tiles

          private VentanaReader.TIFFTile[] tiles

    - #### resolutions

          private int resolutions

    - #### physicalPixelSize

          private java.lang.Double physicalPixelSize

  - ### Constructor Detail

    - #### VentanaReader

          public VentanaReader()

      Constructs a new Ventana reader.

  - ### Method Detail

    - #### splitTiles

          public boolean splitTiles()

      Returns:
        true if MetadataOptions are set so that each tile in the full resolution image will be returned as a separate series

    - #### fileGroupOption

          public int fileGroupOption(java.lang.String id)
                              throws FormatException,
                                     java.io.IOException

      Description copied from interface: `IFormatReader`
      Returns an indication of whether the files in a multi-file dataset can be handled individually. This method is only useful for formats and datasets which contain multiple files.
      Specified by:
        `fileGroupOption` in interface `IFormatReader`
      Overrides:
        `fileGroupOption` in class `FormatReader`
      Parameters:
        `id` - a file in the multi-file dataset
      Returns:
        an int indicating that we cannot, must, or might group the files. A return value of `FormatTools.MUST_GROUP` indicates that the files cannot be handled separately; the reader will always detect and read all files in the dataset. `FormatTools.CAN_GROUP` indicates that the files may be handled separately, but file grouping must then be disabled via `IFormatReader.setGroupFiles(boolean)`. `FormatTools.CANNOT_GROUP` indicates that the files must be handled separately; the reader will not attempt to read all files in the dataset (this is rare).
      Throws:
        `FormatException`
        `java.io.IOException`
      See Also:
        `FormatTools.MUST_GROUP`, `FormatTools.CAN_GROUP`, `FormatTools.CANNOT_GROUP`

    - #### isThisType

          public boolean isThisType(java.lang.String name,
                                    boolean open)

      Description copied from class: `FormatReader`
      Checks if a file matches the type of this format reader. Checks filename suffixes against those known for this format. If the suffix check is inconclusive and the open parameter is true, the file is opened and tested with `FormatReader.isThisType(RandomAccessInputStream)`.
      Specified by:
        `isThisType` in interface `IFormatReader`
      Overrides:
        `isThisType` in class `FormatReader`
        `open` - If true, and the file extension is insufficient to determine the file type, the (existing) file is opened for further analysis.

    - #### get8BitLookupTable

          public byte[][] get8BitLookupTable()
                                      throws FormatException,
                                             java.io.IOException

      Description copied from interface: `IFormatReader`
      Gets the 8-bit color lookup table associated with the most recently opened image. If no image planes have been opened, or if `IFormatReader.isIndexed()` returns false, then this may return null. Also, if `IFormatReader.getPixelType()` returns anything other than `FormatTools.INT8` or `FormatTools.UINT8`, this method will return null.
      Specified by:
        `get8BitLookupTable` in interface `IFormatReader`
      Overrides:
        `get8BitLookupTable` in class `MinimalTiffReader`
      Throws:
        `FormatException`
        `java.io.IOException`

    - #### get16BitLookupTable

          public short[][] get16BitLookupTable()
                                        throws FormatException,
                                               java.io.IOException

      Description copied from interface: `IFormatReader`
      Gets the 16-bit color lookup table associated with the most recently opened image. If no image planes have been opened, or if `IFormatReader.isIndexed()` returns false, then this may return null. Also, if `IFormatReader.getPixelType()` returns anything other than `FormatTools.INT16` or `FormatTools.UINT16`, this method will return null.
      Specified by:
        `get16BitLookupTable` in interface `IFormatReader`
      Overrides:
        `get16BitLookupTable` in class `MinimalTiffReader`
      Throws:
        `FormatException`
        `java.io.IOException`

    - #### openBytes

          public byte[] openBytes(int no,
                                  byte[] buf,
                                  int x,
                                  int y,
                                  int w,
                                  int h)
                           throws FormatException,
                                  java.io.IOException

      Description copied from interface: `IFormatReader`
      Obtains a sub-image of the specified image plane into a pre-allocated byte array.
      Specified by:
        `openBytes` in interface `IFormatReader`
      Overrides:
        `openBytes` in class `MinimalTiffReader`
      Parameters:
        `no` - the plane index within the current series.
        `buf` - a pre-allocated buffer.
        `x` - X coordinate of the upper-left corner of the sub-image
        `y` - Y coordinate of the upper-left corner of the sub-image
        `w` - width of the sub-image
        `h` - height of the sub-image
      Returns:
        the pre-allocated buffer `buf` for convenience.
      Throws:
        `FormatException` - if there was a problem parsing the metadata of the file.
        `java.io.IOException` - if there was a problem reading the file.
      See Also:
        `IFormatReader.openBytes(int, byte[], int, int, int, int)`

    - #### openThumbBytes

          public byte[] openThumbBytes(int no)
                                throws FormatException,
                                       java.io.IOException

      Description copied from interface: `IFormatReader`
      Obtains a thumbnail for the specified image plane from the current file, as a byte array.
      Specified by:
        `openThumbBytes` in interface `IFormatReader`
      Overrides:
        `openThumbBytes` in class `MinimalTiffReader`
      Throws:
        `FormatException`
        `java.io.IOException`

    - #### getThumbSizeX

          public int getThumbSizeX()

      Description copied from interface: `IFormatReader`
      Get the size of the X dimension for the thumbnail.
      Specified by:
        `getThumbSizeX` in interface `IFormatReader`
      Overrides:
        `getThumbSizeX` in class `MinimalTiffReader`

    - #### getThumbSizeY

          public int getThumbSizeY()

      Description copied from interface: `IFormatReader`
      Get the size of the Y dimension for the thumbnail.
      Specified by:
        `getThumbSizeY` in interface `IFormatReader`
      Overrides:
        `getThumbSizeY` in class `MinimalTiffReader`

    - #### 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`

    - #### getOptimalTileWidth

          public int getOptimalTileWidth()

      Description copied from interface: `IFormatReader`
      Returns the optimal sub-image width for use with openBytes.
      Specified by:
        `getOptimalTileWidth` in interface `IFormatReader`
      Overrides:
        `getOptimalTileWidth` in class `MinimalTiffReader`

    - #### getOptimalTileHeight

          public int getOptimalTileHeight()

      Description copied from interface: `IFormatReader`
      Returns the optimal sub-image height for use with openBytes.
      Specified by:
        `getOptimalTileHeight` in interface `IFormatReader`
      Overrides:
        `getOptimalTileHeight` in class `MinimalTiffReader`

    - #### getAvailableOptions

          protected java.util.ArrayList<java.lang.String> getAvailableOptions()

      Description copied from class: `FormatReader`
      Returns the list of available metadata options.
      Overrides:
        `getAvailableOptions` in class `FormatReader`

    - #### 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`

    - #### getScale

          private int getScale(int resolution)

      Parameters:
        `resolution` - the resolution for which to calculate a scale factor
      Returns:
        the scale factor between the full resolution image and the specified resolution

    - #### scaleCoordinate

          private int scaleCoordinate(int v,
                                      int resolution)

      Parameters:
        `v` - the coordinate in the full resolution
        `resolution` - the resolution for which to calculate a scale factor
      Returns:
        the scaled coordinate for the target resolution

    - #### getTileColumn

          private int getTileColumn(int index,
                                    int rows,
                                    int cols)

      Parameters:
        `index` - the tile index as stored in TileJointInfo nodes
        `rows` - the number of tile rows in an area of interest
        `cols` - the number of tile columns in an area of interest
      Returns:
        the tile column in grid order (corrects for snake ordering)

    - #### 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`

    - #### getIFDIndex

          private int getIFDIndex(int coreIndex)

      Note that all planes for a particular resolution or extra image are packed into a single IFD, so the IFD index does not depend upon the plane (e.g. Z section) needed.
      Parameters:
        `coreIndex` - the series or resolution for which to find an IFD
      Returns:
        the index into `MinimalTiffReader.ifds` for the given series and plane

    - #### splitIFD

          private IFD splitIFD(IFD ifd,
                               int no)
                        throws FormatException,
                               java.io.IOException

      Take the real IFD on disk and reshape it into something that represents only the given plane. This should preserve all tags except Z_TAG, and crop the tile byte count and offset arrays to match only the tiles for the given plane. This is necessary because the tile count in the real IFD is X * Y * Z.
      Throws:
        `FormatException`
        `java.io.IOException`

    - #### parseXML

          private void parseXML(java.lang.String xml)
                         throws java.io.IOException

      Throws:
        `java.io.IOException`

Copyright © 2026 Open Microscopy Environment