Class ChannelSource

Object
ChannelSource

public class ChannelSource extends Object
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

    Constructors
    Constructor
    Description
    ChannelSource(NamedStacks stackStore, ConsistentChannelChecker channelChecker, Optional<SizeXY> resizeTo, VoxelsResizer resizer)
    Creates a new ChannelSource instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    Channel
    extractChannel(String stackName, boolean checkType)
    Extracts a Channel from a particular Stack in stackStore.
    Channel
    extractChannel(String stackName, boolean checkType, int index)
    Extracts a Channel from a particular Stack in stackStore.
    Channel
    extractChannel(Stack stack, boolean checkType, int index)
    Extracts a Channel from a given Stack.
    NamedStacks
    A named set of Stacks from which Channels may be extracted.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ChannelSource

      public ChannelSource(NamedStacks stackStore, ConsistentChannelChecker channelChecker, Optional<SizeXY> resizeTo, VoxelsResizer resizer)
      Creates a new ChannelSource instance.
      Parameters:
      stackStore - A named set of Stacks from which Channels may be extracted.
      channelChecker - How to check that the Channels have consistent voxel data-type.
      resizeTo - If set, resizes all extracted channels in the XY dimensions.
      resizer - How to resize the Channels.
  • Method Details

    • extractChannel

      public Channel extractChannel(String stackName, boolean checkType) throws OperationFailedException
      Extracts a Channel from a particular Stack in stackStore.

      This Stack must be single-channeled.

      Parameters:
      stackName - the name of the Stack which contains the channel.
      checkType - if true, a call occurs to ConsistentChannelChecker to ensure all Channels have consistent voxel data-type.
      Returns:
      the extracted Channel, reused from stackStore.
      Throws:
      OperationFailedException - if the Stack is not single-channeled, or if non-consistent voxel data-type occurs.
    • extractChannel

      public Channel extractChannel(String stackName, boolean checkType, int index) throws OperationFailedException
      Extracts a Channel from a particular Stack in stackStore.
      Parameters:
      stackName - the name of the Stack which contains the channel.
      checkType - if true, a call occurs to ConsistentChannelChecker to ensure all Channels have consistent voxel data-type.
      index - the index of the channel to extract from the Stack.
      Returns:
      the extracted Channel, reused from stackStore.
      Throws:
      OperationFailedException - if the Stack cannot be retrieved, or if non-consistent voxel data-type occurs.
    • extractChannel

      public Channel extractChannel(Stack stack, boolean checkType, int index) throws OperationFailedException
      Extracts a Channel from a given Stack.
      Parameters:
      stack - the Stack from which to extract the channel.
      checkType - if true, a call occurs to ConsistentChannelChecker to ensure all Channels have consistent voxel data-type.
      index - the index of the channel to extract from the Stack.
      Returns:
      the extracted Channel, possibly resized.
      Throws:
      OperationFailedException - if non-consistent voxel data-type occurs.
    • getStackStore

      public NamedStacks getStackStore()
      A named set of Stacks from which Channels may be extracted.