loci.formats.in.LeicaMicrosystemsMetadata

## Class MultipleImagesReader

- java.lang.Object
- - loci.formats.FormatHandler
  - - loci.formats.FormatReader
    - - loci.formats.in.LeicaMicrosystemsMetadata.LMSFileReader
      - - loci.formats.in.LeicaMicrosystemsMetadata.MultipleImagesReader

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

      public class MultipleImagesReader
      extends LMSFileReader

  MultipleImagesReader presents a number of image files as one image reference
  Author:
    Constanze Wendlandt constanze.wendlandt at leica-microsystems.com

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class loci.formats.in.LeicaMicrosystemsMetadata.LMSFileReader

      `LMSFileReader.ImageFormat`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private boolean` | `dimensionsSwapped`
    `private LMSFileReader.ImageFormat` | `imageFormat`
    `private int` | `imageIndex`
    `private java.util.List<FormatReader>` | `readers`
    `private int` | `series`
    `private int` | `tileCount`

    - ### Fields inherited from class loci.formats.in.LeicaMicrosystemsMetadata.LMSFileReader

      `associatedXmlDoc, log, metaTemp, OLD_PHYSICAL_SIZE_DEFAULT, OLD_PHYSICAL_SIZE_KEY`

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

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

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

      `COMPRESSION_SUFFIXES, currentId, format, LOGGER, metadataOptions, suffixes`

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

      `CAN_GROUP, CANNOT_GROUP, MUST_GROUP`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MultipleImagesReader(XlifDocument xlif, int imageIndex)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close(boolean fileOnly)` Closes the currently open file.
    `int` | `getBitsPerPixel()` Gets the number of valid bits per pixel.
    `LMSFileReader.ImageFormat` | `getImageFormat()` Returns the file format in which actual image bytes are stored
    `int` | `getPixelType()` Gets the pixel type.
    `int` | `getRGBChannelCount()` Gets the number of channels returned with each call to openBytes.
    `int` | `getSizeC()` Gets the size of the C dimension.
    `private void` | `initReaders(java.util.List<java.lang.String> ids)` Creates an internal reader for each image file
    `boolean` | `isRGB()` Checks if the image planes in the file have more than one channel per `IFormatReader.openBytes(int)` call.
    `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.
    `void` | `reopenFile()` Reopen any files that were closed, and which are expected to be open while the reader is open.
    `void` | `setCoreMetadata(CoreMetadata cmd)`
    `void` | `setMetadataTempBuffer(MetadataTempBuffer metaTemp)`
    `void` | `setSeries(int no)` Sets the field MultipleImagesReader.series.
    `void` | `swapDimensions()` Rearranges frame order from ZSTC order (used in XLIFs) to desired CoreMetadata.dimensionOrder

    - ### Methods inherited from class loci.formats.in.LeicaMicrosystemsMetadata.LMSFileReader

      `addSeriesMeta, addSeriesMetaList, fileExists, getCore, makeFilterMetadata, setCore, translateMetadata, translateMetadata, useOldPhysicalSizeCalculation`

    - ### 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, close, coreIndexToSeries, fileGroupOption, flattenHashtables, get16BitLookupTable, get8BitLookupTable, getAcquisitionMode, getAdvancedSeriesUsedFiles, getAdvancedUsedFiles, getArcType, getAvailableOptions, getBinning, getCompression, getContrastMethod, getCoreIndex, getCoreMetadataList, getCorrection, getCurrentCore, 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, getOptimalTileHeight, getOptimalTileWidth, getPixelType, getPossibleDomains, getPulse, getRequiredDirectories, getResolution, getResolutionCount, getRotationTransform, getSeries, getSeriesCount, getSeriesMeta, getSeriesMetadata, getSeriesMetadataValue, getSeriesUsedFiles, getSeriesUsedFiles, getSizeT, getSizeX, getSizeY, getSizeZ, getThumbSizeX, getThumbSizeY, getTileColumns, getTileRows, getUnderlyingReaders, getUsedFiles, getUsedFiles, getZCTCoords, getZCTModuloCoords, hasCompanionFiles, hasFlattenedResolutions, initFile, isFalseColor, isGroupFiles, isIndexed, isInterleaved, isInterleaved, isLittleEndian, isMetadataComplete, isMetadataFiltered, isNormalized, isOrderCertain, isOriginalMetadataPopulated, isSingleFile, isThisType, isThisType, isThisType, isThisType, isThumbnailSeries, isUsedFile, openBytes, openBytes, openBytes, openPlane, openThumbBytes, readPlane, readPlane, readPlane, seriesToCoreIndex, setCoreIndex, setFillColor, setFlattenedResolutions, setGroupFiles, setId, setMetadataFiltered, setMetadataStore, setNormalized, setOriginalMetadataPopulated, setResolution, 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

    - #### readers

          private java.util.List<FormatReader> readers

    - #### imageFormat

          private LMSFileReader.ImageFormat imageFormat

    - #### tileCount

          private int tileCount

    - #### dimensionsSwapped

          private boolean dimensionsSwapped

    - #### series

          private int series

    - #### imageIndex

          private int imageIndex

  - ### Constructor Detail

    - #### MultipleImagesReader

          public MultipleImagesReader(XlifDocument xlif,
                                      int imageIndex)
                               throws FormatException,
                                      java.io.IOException

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

  - ### Method Detail

    - #### 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`
      Specified by:
        `openBytes` in class `FormatReader`
      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.

    - #### setSeries

          public void setSeries(int no)

      Sets the field MultipleImagesReader.series. Needs to be called before calling MultipleImagesReader.openBytes()
      Specified by:
        `setSeries` in interface `IFormatReader`
      Overrides:
        `setSeries` in class `FormatReader`

    - #### getRGBChannelCount

          public int getRGBChannelCount()

      Description copied from interface: `IFormatReader`
      Gets the number of channels returned with each call to openBytes. The most common case where this value is greater than 1 is for interleaved RGB data, such as a 24-bit color image plane. However, it is possible for this value to be greater than 1 for non-interleaved data, such as an RGB TIFF with Planar rather than Chunky configuration.
      Specified by:
        `getRGBChannelCount` in interface `IFormatReader`
      Overrides:
        `getRGBChannelCount` in class `FormatReader`

    - #### getBitsPerPixel

          public int getBitsPerPixel()

      Description copied from interface: `IFormatReader`
      Gets the number of valid bits per pixel. The number of valid bits per pixel is always less than or equal to the number of bits per pixel that correspond to `IFormatReader.getPixelType()`.
      Specified by:
        `getBitsPerPixel` in interface `IFormatReader`
      Overrides:
        `getBitsPerPixel` in class `FormatReader`

    - #### getPixelType

          public int getPixelType()

      Description copied from interface: `IFormatReader`
      Gets the pixel type.
      Specified by:
        `getPixelType` in interface `IFormatReader`
      Overrides:
        `getPixelType` in class `FormatReader`
      Returns:
        the pixel type as an enumeration from `FormatTools` static pixel types such as `FormatTools.INT8`.

    - #### getSizeC

          public int getSizeC()

      Description copied from interface: `IFormatReader`
      Gets the size of the C dimension.
      Specified by:
        `getSizeC` in interface `IFormatReader`
      Overrides:
        `getSizeC` in class `FormatReader`

    - #### isRGB

          public boolean isRGB()

      Description copied from interface: `IFormatReader`
      Checks if the image planes in the file have more than one channel per `IFormatReader.openBytes(int)` call. This method returns true if and only if `IFormatReader.getRGBChannelCount()` returns a value greater than 1.
      Specified by:
        `isRGB` in interface `IFormatReader`
      Overrides:
        `isRGB` 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 `LMSFileReader`
      Throws:
        `java.io.IOException`

    - #### initReaders

          private void initReaders(java.util.List<java.lang.String> ids)
                            throws FormatException,
                                   java.io.IOException

      Creates an internal reader for each image file
      Parameters:
        `ids` - list of file ids
      Throws:
        `FormatException`
        `java.io.IOException`

    - #### getImageFormat

          public LMSFileReader.ImageFormat getImageFormat()

      Description copied from class: `LMSFileReader`
      Returns the file format in which actual image bytes are stored
      Specified by:
        `getImageFormat` in class `LMSFileReader`

    - #### setMetadataTempBuffer

          public void setMetadataTempBuffer(MetadataTempBuffer metaTemp)

    - #### setCoreMetadata

          public void setCoreMetadata(CoreMetadata cmd)

    - #### swapDimensions

          public void swapDimensions()
                              throws FormatException

      Rearranges frame order from ZSTC order (used in XLIFs) to desired CoreMetadata.dimensionOrder
      Throws:
        `FormatException`

    - #### reopenFile

          public void reopenFile()
                          throws java.io.IOException

      Description copied from interface: `IFormatReader`
      Reopen any files that were closed, and which are expected to be open while the reader is open. This assumes that `IFormatHandler.setId(java.lang.String)` has been called, but close(false) has not been called.
      Specified by:
        `reopenFile` in interface `IFormatReader`
      Overrides:
        `reopenFile` in class `FormatReader`
      Throws:
        `java.io.IOException`

Copyright © 2026 Open Microscopy Environment