Class CountedProjectableBuffer<T>
Object
CountedProjectableBuffer<T>
- Type Parameters:
T
- type of buffer used, both as input and result, of the projection
- All Implemented Interfaces:
ProjectableBuffer<T>
A projectable buffer that also keeps track of the number of voxels in it.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Voxels
<FloatBuffer> Accumulates the sum of voxel values. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
CountedProjectableBuffer
(VoxelsFactoryTypeBound<T> flatType, Extent extent) Creates with minimal parameters, as no preprocessing is necessary. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addVoxelBuffer
(VoxelBuffer<T> voxelBuffer) Adds aVoxelBuffer
to the projection, as a single entity.protected abstract void
addVoxelBufferInternal
(VoxelBuffer<T> voxelBuffer, int z) Adds aVoxelBuffer
without incrementing the count.void
Adds aVoxels
to the projection, as a single entity.protected void
divideVoxelsByCount
(Voxels<FloatBuffer> voxels) Divides all voxel values by the count of added voxels.flattenFrom
(Voxels<FloatBuffer> voxels) Flattens the accumulated voxels to the target type.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.anchoranalysis.image.voxel.buffer.ProjectableBuffer
completeProjection
-
Field Details
-
voxelsSum
Accumulates the sum of voxel values.
-
-
Constructor Details
-
CountedProjectableBuffer
Creates with minimal parameters, as no preprocessing is necessary.- Parameters:
flatType
- the voxel data-type to use for the flattened buffer.extent
- the size expected for images that will be projected.
-
-
Method Details
-
addVoxelBuffer
Description copied from interface:ProjectableBuffer
Adds aVoxelBuffer
to the projection, as a single entity.- Specified by:
addVoxelBuffer
in interfaceProjectableBuffer<T>
- Parameters:
voxelBuffer
- the voxel buffer to add.
-
addVoxels
Description copied from interface:ProjectableBuffer
Adds aVoxels
to the projection, as a single entity.- Specified by:
addVoxels
in interfaceProjectableBuffer<T>
- Parameters:
voxels
- the voxels to add (which contains one or more voxel-buffers).
-
addVoxelBufferInternal
Adds aVoxelBuffer
without incrementing the count.- Parameters:
voxelBuffer
- the voxels to add.z
- the index (beginning at 0) of the z-slice that the voxels are from.
-
flattenFrom
Flattens the accumulated voxels to the target type.- Parameters:
voxels
- the voxels to flatten- Returns:
- the flattened
Voxels
of type T
-
divideVoxelsByCount
Divides all voxel values by the count of added voxels.- Parameters:
voxels
- the voxels to divide
-