Class ChannelAggregator

Object
AnchorBean<ChannelAggregator>
ChannelAggregator
Direct Known Subclasses:
ProjectableBufferAggregator

public abstract class ChannelAggregator extends AnchorBean<ChannelAggregator>
A method of aggregating the voxels from many identically-sized Channels into one.

The Channels must also all share the same voxel-data-type, which also forms the aggregated type.

Author:
Owen Feehan
  • Constructor Details

    • ChannelAggregator

      public ChannelAggregator()
  • Method Details

    • addChannel

      public void addChannel(Channel channel, Logger logger) throws OperationFailedException
      Adds a Channel to the aggregation.
      Parameters:
      channel - the channel to add.
      logger - the logger to output warning messages to.
      Throws:
      OperationFailedException - if the dimensions do not match existing channels that were previously added.
    • aggregatedChannel

      public Channel aggregatedChannel() throws OperationFailedException
      Retrieve or create a Channel with containing the aggregated values.
      Returns:
      the channel, with newly created voxels, containing the mean-value of each voxel
      Throws:
      OperationFailedException - if not channels have been addded, so no mean exists.
    • existingDimensions

      protected abstract Optional<Dimensions> existingDimensions()
      The Dimensions to use for the aggregation.
      Returns:
      the dimensions, if at least one call to addChannel(Channel, Logger) has occurred, otherwise Optional.empty().
    • addChannelAfterCheck

      protected abstract void addChannelAfterCheck(Channel channel) throws OperationFailedException
      Adds a Channel to the aggregation - after checking channel has acceptable dimensions.
      Parameters:
      channel - the channel to add, guaranteed to have identical dimensions to any previous call to addChannel(Channel, Logger).
      Throws:
      OperationFailedException - if the dimensions do not match existing channels that were previously added.
    • retrieveCreateAggregatedChannel

      protected abstract Channel retrieveCreateAggregatedChannel()
      Retrieve or create an aggregated-channel of type outputType.

      This channel is the result of the aggregation operation.

      Returns:
      a Channel, either as already exists internally, or newly created.
    • maybeDropResolution

      protected Dimensions maybeDropResolution(Dimensions dimensions)
      Removes the Resolution component in Dimensions.
      Parameters:
      dimensions - to maybe remove resolution from.
      Returns:
      dimensions unchanged when ignoreResolution==false, otherwise dimensions without any resolution specified.