Interface NamedChannelsMap

All Superinterfaces:
ChannelGetter
All Known Implementing Classes:
NamedChannelsConcatenate, OpenedNamedChannels

public interface NamedChannelsMap extends ChannelGetter
A collection of Channels, each identified by a unique name and a time-index.

All contained Channels must have the same dimensions, irrespective of name and time-index.

Author:
Owen Feehan
  • Method Details

    • getChannelOptional

      Optional<Channel> getChannelOptional(String channelName, int timeIndex, Logger logger) throws GetOperationFailedException
      Gets a channel if it exists, returning empty if it doesn't.
      Parameters:
      channelName - name of channel.
      timeIndex - point in time-series.
      logger - a logger for any non-fatal errors. Fatal errors throw an exception.
      Returns:
      the channel if it exists, or empty otherwise.
      Throws:
      GetOperationFailedException - if something goes wrong getting an existing channel (but never if a channel doesn't exist).
    • numberChannels

      int numberChannels()
      The number of channels that exist for the series.
      Returns:
      the number of channels.
    • channelNames

      Set<String> channelNames()
      All channel-names.
      Returns:
      a set view of all channel-names in the map.
    • sizeT

      int sizeT(Logger logger) throws ImageIOException
      The number of frames along the time-axis.
      Parameters:
      logger - a logger for any non-fatal errors. Fatal errors throw an exception.
      Returns:
      the number of time-frames.
      Throws:
      ImageIOException - if unable to successfully determine the number of frames.
    • dimensions

      Dimensions dimensions(Logger logger) throws ImageIOException
      The dimensions of each Channel.
      Parameters:
      logger - a logger for any non-fatal errors. Fatal errors throw an exception.
      Returns:
      the dimensions.
      Throws:
      ImageIOException - if unable to successfully determine the dimensions.
    • addAsSeparateChannels

      void addAsSeparateChannels(NamedStacks destination, int timeIndex, Logger logger) throws OperationFailedException
      Adds each Channel as a separate Stack in a NamedStacks.
      Parameters:
      destination - the NamedStacks into which each Channel is copied.
      timeIndex - the index of the time-frame, beginning at zero.
      logger - a logger for any non-fatal errors. Fatal errors throw an exception.
      Throws:
      OperationFailedException - if unable to add a Channel.
    • addAsSeparateChannels

      void addAsSeparateChannels(NamedProviderStore<TimeSeries> destination, int timeIndex, Logger logger) throws OperationFailedException
      Adds each Channel as a separate TimeSeries in a NamedProviderStore.

      Although added as a TimeSeries, each added Stack will have only a single-time frame at point 0, representing the channel found at timeIndex.

      Parameters:
      destination - the NamedStacks into which each Channel is copied.
      timeIndex - the index of the time-frame, beginning at zero.
      logger - a logger for any non-fatal errors. Fatal errors throw an exception.
      Throws:
      OperationFailedException - if unable to add a Channel.
    • allChannelsAsStack

      StoreSupplier<Stack> allChannelsAsStack(int timeIndex, Logger logger)
      Combines all channels as a single Stack at a particular time-frame.
      Parameters:
      timeIndex - the index of the time-frame, beginning at zero.
      logger - a logger for any non-fatal errors. Fatal errors throw an exception.
      Returns:
      a supplier for a newly created Stack, containing all Channels. The order depends on implementation.
    • isRGB

      boolean isRGB(Logger logger) throws ImageIOException
      Whether the channels describe an RGB image.

      In this case, there should be exactly three channels, named "red", "green" and "blue".

      Parameters:
      logger - a logger for any non-fatal errors. Fatal errors throw an exception.
      Returns:
      true if the channels describe an RGB image.
      Throws:
      ImageIOException - if this cannot be successfully inferred.