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 Summary
Constructors Constructor Description NamedChannels(boolean rgb)Creates a newNamedChannelsinstance.NamedChannels(Stream<NamedChannels> channelsToCombine)Creates by combining multiple existingNamedChannels. -
Method Summary
Modifier and Type Method Description voidadd(String name, org.anchoranalysis.image.core.channel.Channel channel)Adds aChannelwith a name.booleanisRgb()Whether the channels originate from aStackthat is RGB, or not.Iterator<Map.Entry<String,org.anchoranalysis.image.core.channel.Channel>>iterator()Set<String>names()The names of theChannels.
-
Constructor Details
-
NamedChannels
public NamedChannels(boolean rgb)Creates a newNamedChannelsinstance.- Parameters:
rgb- whether the channels originate from an RGBStackor not.
-
NamedChannels
public NamedChannels(Stream<NamedChannels> channelsToCombine) throws org.anchoranalysis.core.exception.OperationFailedExceptionCreates by combining multiple existingNamedChannels.- Parameters:
channelsToCombine- theNamedChannelsto combine.- Throws:
org.anchoranalysis.core.exception.OperationFailedException- if the RGB-state is inconsistent acrossStacks.
-
-
Method Details
-
iterator
-
add
public void add(String name, org.anchoranalysis.image.core.channel.Channel channel) throws org.anchoranalysis.core.exception.OperationFailedExceptionAdds aChannelwith 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
The names of theChannels.- Returns:
- the channel names.
-
isRgb
public boolean isRgb()Whether the channels originate from aStackthat is RGB, or not.
-