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 TypeMethodDescriptionvoid
addForSlice
(int sliceID, int val) Adds a value to the voxel partition for a specific slice.void
cleanUp
(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.int
Gets 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: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 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:VoxelPartition
Adds a value to the voxel partition for a specific slice.- Specified by:
addForSlice
in interfaceVoxelPartition<Histogram>
- Parameters:
sliceID
- The ID of the sliceval
- The value to add
-
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 interfaceVoxelPartition<Histogram>
- Returns:
- The combined voxel partition
-
cleanUp
Description copied from interface:VoxelPartition
Cleans up the voxel partition using the provided factory.- Specified by:
cleanUp
in interfaceVoxelPartition<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 interfaceVoxelPartition<Histogram>
- Returns:
- The number of slices
-