loci.formats.gui

## Class BufferedImageReader

- java.lang.Object
- - loci.formats.ReaderWrapper
  - - loci.formats.gui.BufferedImageReader

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

      public class BufferedImageReader
      extends ReaderWrapper

  A reader wrapper for reading image planes as BufferedImage objects.

- - ### Field Summary

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

      `reader`

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

      `CAN_GROUP, CANNOT_GROUP, MUST_GROUP`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BufferedImageReader()` Constructs a BufferedImageReader around a new image reader.
    `BufferedImageReader(IFormatReader r)` Constructs a BufferedImageReader with the given reader.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static BufferedImageReader` | `makeBufferedImageReader(IFormatReader r)` Converts the given reader into a BufferedImageReader, wrapping if needed.
    `java.awt.image.BufferedImage` | `openImage(int no)` Obtains the specified image from the current file.
    `java.awt.image.BufferedImage` | `openImage(int no, int x, int y, int w, int h)` Obtains a sub-image of the specified image, whose upper-left corner is given by (x, y).
    `java.awt.image.BufferedImage` | `openThumbImage(int no)` Obtains a thumbnail for the specified image from the current file.

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

      `close, close, coreIndexToSeries, duplicate, fileGroupOption, get16BitLookupTable, get8BitLookupTable, getAdvancedSeriesUsedFiles, getAdvancedUsedFiles, getBitsPerPixel, getCoreIndex, getCoreMetadataList, getCurrentFile, getDatasetStructureDescription, getDimensionOrder, getDomains, getEffectiveSizeC, getFillColor, getFormat, getGlobalMetadata, getImageCount, getIndex, getIndex, getMetadataOptions, getMetadataStore, getMetadataStoreRoot, getMetadataValue, getModuloC, getModuloT, getModuloZ, getNativeDataType, getOptimalTileHeight, getOptimalTileWidth, getPixelType, getPossibleDomains, getReader, getRequiredDirectories, getResolution, getResolutionCount, getRGBChannelCount, getSeries, getSeriesCount, getSeriesMetadata, getSeriesMetadataValue, getSeriesUsedFiles, getSeriesUsedFiles, getSizeC, getSizeT, getSizeX, getSizeY, getSizeZ, getSuffixes, getSupportedMetadataLevels, getThumbSizeX, getThumbSizeY, getTileCodec, getTileCodecOptions, 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, isThisType, isThumbnailSeries, openBytes, openBytes, openBytes, openBytes, openCompressedBytes, openCompressedBytes, openPlane, openThumbBytes, reopenFile, seriesToCoreIndex, setCoreIndex, setFillColor, setFlattenedResolutions, setGroupFiles, setId, setMetadataFiltered, setMetadataOptions, setMetadataStore, setNormalized, setOriginalMetadataPopulated, setResolution, setSeries, unwrap, unwrap, unwrap`

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

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

- - ### Constructor Detail

    - #### BufferedImageReader

          public BufferedImageReader()

      Constructs a BufferedImageReader around a new image reader.

    - #### BufferedImageReader

          public BufferedImageReader(IFormatReader r)

      Constructs a BufferedImageReader with the given reader.

  - ### Method Detail

    - #### makeBufferedImageReader

          public static BufferedImageReader makeBufferedImageReader(IFormatReader r)

      Converts the given reader into a BufferedImageReader, wrapping if needed.

    - #### openImage

          public java.awt.image.BufferedImage openImage(int no)
                                                 throws FormatException,
                                                        java.io.IOException

      Obtains the specified image from the current file.
      Throws:
        `FormatException`
        `java.io.IOException`

    - #### openImage

          public java.awt.image.BufferedImage openImage(int no,
                                                        int x,
                                                        int y,
                                                        int w,
                                                        int h)
                                                 throws FormatException,
                                                        java.io.IOException

      Obtains a sub-image of the specified image, whose upper-left corner is given by (x, y).
      Throws:
        `FormatException`
        `java.io.IOException`

    - #### openThumbImage

          public java.awt.image.BufferedImage openThumbImage(int no)
                                                      throws FormatException,
                                                             java.io.IOException

      Obtains a thumbnail for the specified image from the current file.
      Throws:
        `FormatException`
        `java.io.IOException`

Copyright © 2026 Open Microscopy Environment