Class VoxelPartitionHistogram

Object
org.anchoranalysis.mpp.index.VoxelPartitionHistogram
All Implemented Interfaces:
VoxelPartition<org.anchoranalysis.math.histogram.Histogram>

public class VoxelPartitionHistogram
extends Object
implements VoxelPartition<org.anchoranalysis.math.histogram.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 Summary

    Constructors 
    Constructor Description
    VoxelPartitionHistogram​(int numberSlices, Supplier<org.anchoranalysis.math.histogram.Histogram> histogramFactory)
    Constructs a VoxelPartitionHistogram with a specified number of slices.
  • Method Summary

    Modifier and Type Method Description
    void addForSlice​(int sliceID, int val)
    Adds a value to the voxel partition for a specific slice.
    void cleanUp​(VoxelPartitionFactory<org.anchoranalysis.math.histogram.Histogram> factory)
    Cleans up the voxel partition using the provided factory.
    org.anchoranalysis.math.histogram.Histogram getCombined()
    Gets the combined voxel partition for all slices.
    org.anchoranalysis.math.histogram.Histogram getSlice​(int sliceID)
    Gets the voxel partition for a specific slice.
    int numberSlices()
    Gets the number of slices in the partition.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • VoxelPartitionHistogram

      public VoxelPartitionHistogram​(int numberSlices, Supplier<org.anchoranalysis.math.histogram.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 org.anchoranalysis.math.histogram.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<org.anchoranalysis.math.histogram.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<org.anchoranalysis.math.histogram.Histogram>
      Parameters:
      sliceID - The ID of the slice
      val - The value to add
    • getCombined

      public org.anchoranalysis.math.histogram.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<org.anchoranalysis.math.histogram.Histogram>
      Returns:
      The combined voxel partition
    • cleanUp

      public void cleanUp​(VoxelPartitionFactory<org.anchoranalysis.math.histogram.Histogram> factory)
      Description copied from interface: VoxelPartition
      Cleans up the voxel partition using the provided factory.
      Specified by:
      cleanUp in interface VoxelPartition<org.anchoranalysis.math.histogram.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<org.anchoranalysis.math.histogram.Histogram>
      Returns:
      The number of slices