Package org.anchoranalysis.mpp.overlap
Class CountIntersectingVoxels
Object
CountIntersectingVoxels
Counts the number of intersecting voxels where bytes are encoded as region memberships.
This class provides methods to count intersecting voxels between two bounded voxel sets, optionally considering a global mask.
- Author:
- Owen Feehan
-
Constructor Summary
ConstructorsConstructorDescriptionCountIntersectingVoxels
(byte regionMembershipFlag) Creates a new instance with a specific region membership flag.CountIntersectingVoxels
(PredicateRegionMembership predicate) -
Method Summary
Modifier and TypeMethodDescriptionint
count
(BoundedVoxels<UnsignedByteBuffer> voxels1, BoundedVoxels<UnsignedByteBuffer> voxels2) Counts the number of intersecting voxels between two bounded voxel sets.int
countMasked
(BoundedVoxels<UnsignedByteBuffer> voxels1, BoundedVoxels<UnsignedByteBuffer> voxels2, Voxels<UnsignedByteBuffer> maskGlobal, byte onMaskGlobal) Counts the number of intersecting voxels between two bounded voxel sets, considering a global mask.
-
Constructor Details
-
CountIntersectingVoxels
public CountIntersectingVoxels(byte regionMembershipFlag) Creates a new instance with a specific region membership flag.- Parameters:
regionMembershipFlag
- the byte value representing region membership
-
CountIntersectingVoxels
public CountIntersectingVoxels(PredicateRegionMembership predicate)
-
-
Method Details
-
count
public int count(BoundedVoxels<UnsignedByteBuffer> voxels1, BoundedVoxels<UnsignedByteBuffer> voxels2) Counts the number of intersecting voxels between two bounded voxel sets.- Parameters:
voxels1
- the first set of bounded voxelsvoxels2
- the second set of bounded voxels- Returns:
- the count of intersecting voxels
-
countMasked
public int countMasked(BoundedVoxels<UnsignedByteBuffer> voxels1, BoundedVoxels<UnsignedByteBuffer> voxels2, Voxels<UnsignedByteBuffer> maskGlobal, byte onMaskGlobal) Counts the number of intersecting voxels between two bounded voxel sets, considering a global mask.- Parameters:
voxels1
- the first set of bounded voxelsvoxels2
- the second set of bounded voxelsmaskGlobal
- the global mask to apply during countingonMaskGlobal
- the value in the global mask that indicates a voxel should be considered- Returns:
- the count of intersecting voxels that also satisfy the global mask condition
-