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
ConstructorsModifierConstructorDescriptionprotectedCountedProjectableBuffer(VoxelsFactoryTypeBound<T> flatType, Extent extent) Creates with minimal parameters, as no preprocessing is necessary. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddVoxelBuffer(VoxelBuffer<T> voxelBuffer) Adds aVoxelBufferto the projection, as a single entity.protected abstract voidaddVoxelBufferInternal(VoxelBuffer<T> voxelBuffer, int z) Adds aVoxelBufferwithout incrementing the count.voidAdds aVoxelsto the projection, as a single entity.protected voiddivideVoxelsByCount(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, waitMethods 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:ProjectableBufferAdds aVoxelBufferto the projection, as a single entity.- Specified by:
addVoxelBufferin interfaceProjectableBuffer<T>- Parameters:
voxelBuffer- the voxel buffer to add.
-
addVoxels
Description copied from interface:ProjectableBufferAdds aVoxelsto the projection, as a single entity.- Specified by:
addVoxelsin interfaceProjectableBuffer<T>- Parameters:
voxels- the voxels to add (which contains one or more voxel-buffers).
-
addVoxelBufferInternal
Adds aVoxelBufferwithout 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
Voxelsof type T
-
divideVoxelsByCount
Divides all voxel values by the count of added voxels.- Parameters:
voxels- the voxels to divide
-