Class VoxelPartitionHistogram

Object
VoxelPartitionHistogram
All Implemented Interfaces:
VoxelPartition<Histogram>

public class VoxelPartitionHistogram extends Object implements VoxelPartition<Histogram>
A voxel partition implementation using histograms to represent voxel value distributions.

This class maintains a histogram for each slice and a combined histogram for all slices.

  • Constructor Details

    • VoxelPartitionHistogram

      public VoxelPartitionHistogram(int numberSlices, Supplier<Histogram> histogramFactory)
      Constructs a VoxelPartitionHistogram with a specified number of slices.
      Parameters:
      numberSlices - The number of slices in the partition
      histogramFactory - A supplier function that creates new Histogram instances
  • Method Details

    • getSlice

      public Histogram getSlice(int sliceID)
      Description copied from interface: VoxelPartition
      Gets the voxel partition for a specific slice. This method should only be used for read-only operations to maintain integrity with the combined list.
      Specified by:
      getSlice in interface VoxelPartition<Histogram>
      Parameters:
      sliceID - The ID of the slice
      Returns:
      The voxel partition for the specified slice
    • addForSlice

      public void addForSlice(int sliceID, int val)
      Description copied from interface: VoxelPartition
      Adds a value to the voxel partition for a specific slice.
      Specified by:
      addForSlice in interface VoxelPartition<Histogram>
      Parameters:
      sliceID - The ID of the slice
      val - The value to add
    • getCombined

      public Histogram getCombined()
      Description copied from interface: VoxelPartition
      Gets the combined voxel partition for all slices. This method should only be used for read-only operations.
      Specified by:
      getCombined in interface VoxelPartition<Histogram>
      Returns:
      The combined voxel partition
    • cleanUp

      public void cleanUp(VoxelPartitionFactory<Histogram> factory)
      Description copied from interface: VoxelPartition
      Cleans up the voxel partition using the provided factory.
      Specified by:
      cleanUp in interface VoxelPartition<Histogram>
      Parameters:
      factory - The factory to use for cleanup
    • numberSlices

      public int numberSlices()
      Description copied from interface: VoxelPartition
      Gets the number of slices in the partition.
      Specified by:
      numberSlices in interface VoxelPartition<Histogram>
      Returns:
      The number of slices