Interface OpenedImageFile

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
OpenedMultiFile

public interface OpenedImageFile extends AutoCloseable
An image file that has been opened for reading containing one or more series of image-Stacks.
Author:
Owen Feehan
  • Method Details

    • openCheckType

      default TimeSeries openCheckType(int seriesIndex, VoxelDataType channelDataType, Logger logger) throws ImageIOException
      Opens a time-series, and checks that it is a particular type.

      If it's not the correct type, an error is thrown.

      Parameters:
      seriesIndex - the index of the series to open.
      channelDataType - the expected data-type of the channels.
      logger - the logger.
      Returns:
      a newly created TimeSeries of images for the series.
      Throws:
      ImageIOException - if an error occurs reading the image during this operation.
    • open

      default TimeSeries open(Logger logger) throws ImageIOException
      Open the first series when we don't have a specific-type.
      Parameters:
      logger - the logger.
      Returns:
      a time-sequence of images.
      Throws:
      ImageIOException - if an error occurs reading the image to determine this information.
    • open

      TimeSeries open(int seriesIndex, Logger logger) throws ImageIOException
      Open when we don't have a specific-type.
      Parameters:
      seriesIndex - the index of the series of the open, zero-indexed.
      logger - the logger.
      Returns:
      a time-sequence of images.
      Throws:
      ImageIOException - if an error occurs reading the image during this operation.
    • numberSeries

      int numberSeries()
      The number of series (distinct sets of images) in the image-file.
      Returns:
      the number of series.
    • channelNames

      Optional<List<String>> channelNames(Logger logger) throws ImageIOException
      The names of each channel, if they are known.
      Parameters:
      logger - the logger.
      Returns:
      a list of the names, which should correspond (and have the same number of items) as numberChannels(Logger).
      Throws:
      ImageIOException - if an error occurs reading the image to determine this information.
    • numberChannels

      int numberChannels(Logger logger) throws ImageIOException
      The number of channels in the image-file e.g. 1 for grayscale, 3 for RGB.
      Parameters:
      logger - the logger.
      Returns:
      the number of channels.
      Throws:
      ImageIOException - if an error occurs reading the image to determine this information.
    • numberFrames

      int numberFrames(Logger logger) throws ImageIOException
      The number of frames in the image-file i.e. distinct images for a particular time-point.
      Parameters:
      logger - the logger.
      Returns:
      the number of frames.
      Throws:
      ImageIOException - if an error occurs reading the image to determine this information.
    • bitDepth

      int bitDepth(Logger logger) throws ImageIOException
      The bit-depth of the image voxels e.g. 8 for 8-bit, 16 for 16-bit etc.
      Parameters:
      logger - the logger.
      Returns:
      the bit-depth.
      Throws:
      ImageIOException - if an error occurs reading the image to determine this information.
    • timestamps

      The timestamps and file-attributes associated with the image.
      Returns:
      timestamps and file-attributes, either newly-created or reused.
      Throws:
      ImageIOException - if an error occurs reading the image to determine this information.
    • pyramid

      Metadata to describe an image-pyramid, if it exists for this opened-image.
      Returns:
      the metadata, or Optional.empty() if no pyramid exists.
      Throws:
      ImageIOException - if an error occurs reading the image to determine this information.
    • isRGB

      boolean isRGB(Logger logger) throws ImageIOException
      Whether the image-file has RGB encoded voxels.
      Parameters:
      logger - the logger.
      Returns:
      true if the image has RGB or RGBA encoded voxels, false otherwise.
      Throws:
      ImageIOException - if an error occurs reading the image to determine this information.
    • close

      void close() throws ImageIOException
      Closes the opened image-file, removing any intermediate data-structures.
      Specified by:
      close in interface AutoCloseable
      Throws:
      ImageIOException
    • dimensionsForSeries

      Dimensions dimensionsForSeries(int seriesIndex, Logger logger) throws ImageIOException
      The Dimensions associated with a particular series.
      Parameters:
      seriesIndex - the index of the series.
      logger - a logger for any non-fatal errors. Fatal errors throw an exception.
      Returns:
      the corresponding dimensions.
      Throws:
      ImageIOException - if any filesystem-related input-output failure occurs.
    • metadata

      default ImageMetadata metadata(int seriesIndex, Logger logger) throws ImageIOException
      Extracts metadata about the image.

      This may be called without later retrieving a channel from the image, so it is desirable that it is as computationally efficient as possible, for this use case.

      Parameters:
      seriesIndex - the index of the series.
      logger - the logger.
      Returns:
      the associated image metadata.
      Throws:
      ImageIOException - if any filesystem-related input-output failure occurs.