Package org.anchoranalysis.mpp.index
Class IndexByRegion<T>
Object
IndexByRegion<T>
- Type Parameters:
T
- The type of the voxel partition
An index structure that organizes voxel partitions by region and slice.
-
Constructor Summary
ConstructorsConstructorDescriptionIndexByRegion
(VoxelPartitionFactory<T> factory, int numberRegions, int numberSlices) Constructs an IndexByRegion with a specified number of regions and slices. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addToVoxelList
(int regionID, int sliceID, int val) Adds a value to the voxel list for a specific region and slice.void
cleanUp
(VoxelPartitionFactory<T> factory) Cleans up the voxel partitions using the provided factory.getForAllSlices
(int regionID) Gets the combined voxel partition for all slices in a region.getForSlice
(int regionID, int sliceID) Gets the voxel partition for a specific slice in a region.int
Gets the number of slices in each region.
-
Constructor Details
-
IndexByRegion
Constructs an IndexByRegion with a specified number of regions and slices.- Parameters:
factory
- The factory to create voxel partitionsnumberRegions
- The number of regionsnumberSlices
- The number of slices per region
-
-
Method Details
-
getForAllSlices
Gets the combined voxel partition for all slices in a region. This method should only be used for read-only operations to maintain integrity with the combined list.- Parameters:
regionID
- The ID of the region- Returns:
- The combined voxel partition for the region
-
getForSlice
Gets the voxel partition for a specific slice in a region. This method should only be used for read-only operations to maintain integrity with the combined list.- Parameters:
regionID
- The ID of the regionsliceID
- The ID of the slice- Returns:
- The voxel partition for the specified region and slice
-
addToVoxelList
public void addToVoxelList(int regionID, int sliceID, int val) Adds a value to the voxel list for a specific region and slice.- Parameters:
regionID
- The ID of the regionsliceID
- The ID of the sliceval
- The value to add
-
cleanUp
Cleans up the voxel partitions using the provided factory.- Parameters:
factory
- The factory to use for cleanup
-
numSlices
public int numSlices()Gets the number of slices in each region.- Returns:
- The number of slices
-