Interface NamedChannelsMap
- All Superinterfaces:
ChannelGetter
- All Known Implementing Classes:
NamedChannelsConcatenate,OpenedNamedChannels
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 Summary
Modifier and TypeMethodDescriptionvoidaddAsSeparateChannels(NamedProviderStore<TimeSeries> destination, int timeIndex, Logger logger) voidaddAsSeparateChannels(NamedStacks destination, int timeIndex, Logger logger) allChannelsAsStack(int timeIndex, Logger logger) Combines all channels as a singleStackat a particular time-frame.All channel-names.dimensions(Logger logger) The dimensions of eachChannel.getChannelOptional(String channelName, int timeIndex, Logger logger) Gets a channel if it exists, returning empty if it doesn't.booleanWhether the channels describe an RGB image.intThe number of channels that exist for the series.intThe number of frames along the time-axis.Methods inherited from interface org.anchoranalysis.image.io.channel.input.ChannelGetter
getChannel, hasChannel
-
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
All channel-names.- Returns:
- a set view of all channel-names in the map.
-
sizeT
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
The dimensions of eachChannel.- 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 - Parameters:
destination- theNamedStacksinto which eachChannelis 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 aChannel.
-
addAsSeparateChannels
void addAsSeparateChannels(NamedProviderStore<TimeSeries> destination, int timeIndex, Logger logger) throws OperationFailedException Adds eachChannelas a separateTimeSeriesin aNamedProviderStore.Although added as a
TimeSeries, each addedStackwill have only a single-time frame at point 0, representing the channel found attimeIndex.- Parameters:
destination- theNamedStacksinto which eachChannelis 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 aChannel.
-
allChannelsAsStack
Combines all channels as a singleStackat a particular time-frame. -
isRGB
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.
-