Class ChannelAggregator
- Direct Known Subclasses:
ProjectableBufferAggregator
A method of aggregating the voxels from many identically-sized
Channel
s into one.
The Channel
s 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 TypeMethodDescriptionvoid
addChannel
(Channel channel, Logger logger) Adds aChannel
to the aggregation.protected abstract void
addChannelAfterCheck
(Channel channel) Adds aChannel
to the aggregation - after checkingchannel
has acceptable dimensions.Retrieve or create aChannel
with containing the aggregated values.protected abstract Optional
<Dimensions> TheDimensions
to use for the aggregation.protected Dimensions
maybeDropResolution
(Dimensions dimensions) Removes theResolution
component inDimensions
.protected abstract Channel
Retrieve 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 aChannel
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
Retrieve or create aChannel
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
TheDimensions
to use for the aggregation.- Returns:
- the dimensions, if at least one call to
addChannel(Channel, Logger)
has occurred, otherwiseOptional.empty()
.
-
addChannelAfterCheck
Adds aChannel
to the aggregation - after checkingchannel
has 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 theResolution
component inDimensions
.- Parameters:
dimensions
- to maybe remove resolution from.- Returns:
dimensions
unchanged whenignoreResolution==false
, otherwisedimensions
without any resolution specified.
-