Class ProjectableBufferAggregator<T>
- Type Parameters:
T
- buffer type used for aggregationUnsignedByteBuffer
etc.
- Direct Known Subclasses:
MaxProjection
,MeanProjection
,MinProjection
,StandardDeviationProjection
An aggregator that calculates the aggregation of every voxel across successive channels
via a
ProjectableBuffer
.
This is achieved by maintaining a running sum for each voxel, and a total count of how many images were added.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addChannelAfterCheck
(Channel channel) Adds aChannel
to the aggregation - after checkingchannel
has acceptable dimensions.protected abstract ProjectableBuffer
<T> create
(VoxelDataType dataType, Extent extent) Creates theProjectableBuffer
used for aggregation.protected Optional
<Dimensions> TheDimensions
to use for the aggregation.protected Channel
Retrieve or create an aggregated-channel of typeoutputType
.Methods inherited from class org.anchoranalysis.image.bean.channel.ChannelAggregator
addChannel, aggregatedChannel, maybeDropResolution
Methods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
ProjectableBufferAggregator
public ProjectableBufferAggregator()
-
-
Method Details
-
existingDimensions
Description copied from class:ChannelAggregator
TheDimensions
to use for the aggregation.- Specified by:
existingDimensions
in classChannelAggregator
- Returns:
- the dimensions, if at least one call to
ChannelAggregator.addChannel(Channel, Logger)
has occurred, otherwiseOptional.empty()
.
-
addChannelAfterCheck
Description copied from class:ChannelAggregator
Adds aChannel
to the aggregation - after checkingchannel
has acceptable dimensions.- Specified by:
addChannelAfterCheck
in classChannelAggregator
- Parameters:
channel
- the channel to add, guaranteed to have identical dimensions to any previous call toChannelAggregator.addChannel(Channel, Logger)
.- Throws:
OperationFailedException
- if the dimensions do not match existing channels that were previously added.
-
retrieveCreateAggregatedChannel
Description copied from class:ChannelAggregator
Retrieve or create an aggregated-channel of typeoutputType
.This channel is the result of the aggregation operation.
- Specified by:
retrieveCreateAggregatedChannel
in classChannelAggregator
- Returns:
- a
Channel
, either as already exists internally, or newly created.
-
create
protected abstract ProjectableBuffer<T> create(VoxelDataType dataType, Extent extent) throws OperationFailedException Creates theProjectableBuffer
used for aggregation.- Parameters:
dataType
- the data-type to use for the aggregated channel.extent
- the size of the aggregated channel.- Returns:
- a newly created
ProjectableBuffer
of specified type and size. - Throws:
OperationFailedException
- if a buffer-type is unsupported.
-