Class ChannelSource
Object
ChannelSource
Extracts a set of
Channels from a NamedStacks, optionally resizing.
Checks may be applied to make sure all channels have the same voxel data-type.
-
Constructor Summary
ConstructorsConstructorDescriptionChannelSource(NamedStacks stackStore, ConsistentChannelChecker channelChecker, Optional<SizeXY> resizeTo, VoxelsResizer resizer) Creates a newChannelSourceinstance. -
Method Summary
Modifier and TypeMethodDescriptionChannelextractChannel(String stackName, boolean checkType) Extracts aChannelfrom a particularStackinstackStore.ChannelextractChannel(String stackName, boolean checkType, int index) Extracts aChannelfrom a particularStackinstackStore.ChannelextractChannel(Stack stack, boolean checkType, int index) Extracts aChannelfrom a givenStack.NamedStacksA named set ofStacks from whichChannels may be extracted.
-
Constructor Details
-
ChannelSource
public ChannelSource(NamedStacks stackStore, ConsistentChannelChecker channelChecker, Optional<SizeXY> resizeTo, VoxelsResizer resizer) Creates a newChannelSourceinstance.- Parameters:
stackStore- A named set ofStacks from whichChannels may be extracted.channelChecker- How to check that theChannels have consistent voxel data-type.resizeTo- If set, resizes all extracted channels in the XY dimensions.resizer- How to resize theChannels.
-
-
Method Details
-
extractChannel
Extracts aChannelfrom a particularStackinstackStore.This
Stackmust be single-channeled.- Parameters:
stackName- the name of theStackwhich contains the channel.checkType- if true, a call occurs toConsistentChannelCheckerto ensure allChannels have consistent voxel data-type.- Returns:
- the extracted
Channel, reused fromstackStore. - Throws:
OperationFailedException- if theStackis not single-channeled, or if non-consistent voxel data-type occurs.
-
extractChannel
public Channel extractChannel(String stackName, boolean checkType, int index) throws OperationFailedException Extracts aChannelfrom a particularStackinstackStore.- Parameters:
stackName- the name of theStackwhich contains the channel.checkType- if true, a call occurs toConsistentChannelCheckerto ensure allChannels have consistent voxel data-type.index- the index of the channel to extract from theStack.- Returns:
- the extracted
Channel, reused fromstackStore. - Throws:
OperationFailedException- if theStackcannot be retrieved, or if non-consistent voxel data-type occurs.
-
extractChannel
public Channel extractChannel(Stack stack, boolean checkType, int index) throws OperationFailedException Extracts aChannelfrom a givenStack.- Parameters:
stack- theStackfrom which to extract the channel.checkType- if true, a call occurs toConsistentChannelCheckerto ensure allChannels have consistent voxel data-type.index- the index of the channel to extract from theStack.- Returns:
- the extracted
Channel, possibly resized. - Throws:
OperationFailedException- if non-consistent voxel data-type occurs.
-
getStackStore
public NamedStacks getStackStore()A named set ofStacks from whichChannels may be extracted.
-