Class ChannelAggregator
- Direct Known Subclasses:
ProjectableBufferAggregator
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChannel(Channel channel, Logger logger) Adds aChannelto the aggregation.protected abstract voidaddChannelAfterCheck(Channel channel) Adds aChannelto the aggregation - after checkingchannelhas acceptable dimensions.Retrieve or create aChannelwith containing the aggregated values.protected abstract Optional<Dimensions> TheDimensionsto use for the aggregation.protected DimensionsmaybeDropResolution(Dimensions dimensions) Removes theResolutioncomponent inDimensions.protected abstract ChannelRetrieve or create an aggregated-channel of typeoutputType.Methods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
ChannelAggregator
public ChannelAggregator()
-
-
Method Details
-
addChannel
Adds aChannelto 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
Retrieve or create aChannelwith 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
TheDimensionsto use for the aggregation.- Returns:
- the dimensions, if at least one call to
addChannel(Channel, Logger)has occurred, otherwiseOptional.empty().
-
addChannelAfterCheck
Adds aChannelto the aggregation - after checkingchannelhas acceptable dimensions.- Parameters:
channel- the channel to add, guaranteed to have identical dimensions to any previous call toaddChannel(Channel, Logger).- Throws:
OperationFailedException- if the dimensions do not match existing channels that were previously added.
-
retrieveCreateAggregatedChannel
Retrieve or create an aggregated-channel of typeoutputType.This channel is the result of the aggregation operation.
- Returns:
- a
Channel, either as already exists internally, or newly created.
-
maybeDropResolution
Removes theResolutioncomponent inDimensions.- Parameters:
dimensions- to maybe remove resolution from.- Returns:
dimensionsunchanged whenignoreResolution==false, otherwisedimensionswithout any resolution specified.
-