Class NamedChannels

Object
org.anchoranalysis.plugin.image.task.channel.aggregator.NamedChannels
All Implemented Interfaces:
Iterable<Map.Entry<String,​org.anchoranalysis.image.core.channel.Channel>>

public class NamedChannels
extends Object
implements Iterable<Map.Entry<String,​org.anchoranalysis.image.core.channel.Channel>>
A collection of Channels each with an associated unique-name.
Author:
Owen Feehan
  • Constructor Details

    • NamedChannels

      public NamedChannels​(boolean rgb)
      Creates a new NamedChannels instance.
      Parameters:
      rgb - whether the channels originate from an RGB Stack or not.
    • NamedChannels

      public NamedChannels​(Stream<NamedChannels> channelsToCombine) throws org.anchoranalysis.core.exception.OperationFailedException
      Creates by combining multiple existing NamedChannels.
      Parameters:
      channelsToCombine - the NamedChannels to combine.
      Throws:
      org.anchoranalysis.core.exception.OperationFailedException - if the RGB-state is inconsistent across Stacks.
  • Method Details

    • iterator

      public Iterator<Map.Entry<String,​org.anchoranalysis.image.core.channel.Channel>> iterator()
      Specified by:
      iterator in interface Iterable<Map.Entry<String,​org.anchoranalysis.image.core.channel.Channel>>
    • add

      public void add​(String name, org.anchoranalysis.image.core.channel.Channel channel) throws org.anchoranalysis.core.exception.OperationFailedException
      Adds a Channel with a name.
      Parameters:
      name - a unique name for the channel.
      channel - the channel to add.
      Throws:
      org.anchoranalysis.core.exception.OperationFailedException - if a channel with the same name has already been previously added.
    • names

      public Set<String> names()
      The names of the Channels.
      Returns:
      the channel names.
    • isRgb

      public boolean isRgb()
      Whether the channels originate from a Stack that is RGB, or not.