Package org.anchoranalysis.mpp.index
Class VoxelPartitionHistogram
Object
VoxelPartitionHistogram
- All Implemented Interfaces:
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 Summary
ConstructorsConstructorDescriptionVoxelPartitionHistogram(int numberSlices, Supplier<Histogram> histogramFactory) Constructs a VoxelPartitionHistogram with a specified number of slices. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddForSlice(int sliceID, int val) Adds a value to the voxel partition for a specific slice.voidcleanUp(VoxelPartitionFactory<Histogram> factory) Cleans up the voxel partition using the provided factory.Gets the combined voxel partition for all slices.getSlice(int sliceID) Gets the voxel partition for a specific slice.intGets the number of slices in the partition.
-
Constructor Details
-
VoxelPartitionHistogram
Constructs a VoxelPartitionHistogram with a specified number of slices.- Parameters:
numberSlices- The number of slices in the partitionhistogramFactory- A supplier function that creates new Histogram instances
-
-
Method Details
-
getSlice
Description copied from interface:VoxelPartitionGets 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:
getSlicein interfaceVoxelPartition<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:VoxelPartitionAdds a value to the voxel partition for a specific slice.- Specified by:
addForSlicein interfaceVoxelPartition<Histogram>- Parameters:
sliceID- The ID of the sliceval- The value to add
-
getCombined
Description copied from interface:VoxelPartitionGets the combined voxel partition for all slices. This method should only be used for read-only operations.- Specified by:
getCombinedin interfaceVoxelPartition<Histogram>- Returns:
- The combined voxel partition
-
cleanUp
Description copied from interface:VoxelPartitionCleans up the voxel partition using the provided factory.- Specified by:
cleanUpin interfaceVoxelPartition<Histogram>- Parameters:
factory- The factory to use for cleanup
-
numberSlices
public int numberSlices()Description copied from interface:VoxelPartitionGets the number of slices in the partition.- Specified by:
numberSlicesin interfaceVoxelPartition<Histogram>- Returns:
- The number of slices
-