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>

public abstract class CountedProjectableBuffer<T> extends Object implements ProjectableBuffer<T>
A projectable buffer that also keeps track of the number of voxels in it.
  • Field Details

    • voxelsSum

      protected final Voxels<FloatBuffer> voxelsSum
      Accumulates the sum of voxel values.
  • Constructor Details

    • CountedProjectableBuffer

      protected CountedProjectableBuffer(VoxelsFactoryTypeBound<T> flatType, Extent extent)
      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

      public void addVoxelBuffer(VoxelBuffer<T> voxelBuffer)
      Description copied from interface: ProjectableBuffer
      Adds a VoxelBuffer to the projection, as a single entity.
      Specified by:
      addVoxelBuffer in interface ProjectableBuffer<T>
      Parameters:
      voxelBuffer - the voxel buffer to add.
    • addVoxels

      public void addVoxels(Voxels<T> voxels)
      Description copied from interface: ProjectableBuffer
      Adds a Voxels to the projection, as a single entity.
      Specified by:
      addVoxels in interface ProjectableBuffer<T>
      Parameters:
      voxels - the voxels to add (which contains one or more voxel-buffers).
    • addVoxelBufferInternal

      protected abstract void addVoxelBufferInternal(VoxelBuffer<T> voxelBuffer, int z)
      Adds a VoxelBuffer 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

      protected Voxels<T> flattenFrom(Voxels<FloatBuffer> voxels)
      Flattens the accumulated voxels to the target type.
      Parameters:
      voxels - the voxels to flatten
      Returns:
      the flattened Voxels of type T
    • divideVoxelsByCount

      protected void divideVoxelsByCount(Voxels<FloatBuffer> voxels)
      Divides all voxel values by the count of added voxels.
      Parameters:
      voxels - the voxels to divide