public interface VoxelsAssigner
The co-ordinates of the bounding-box, object-mask etc. are always relative to a particular coordinate frame.
Throughout the code-base, usually this interface is only exposed expecting global coordinates (i.e. not relative to anything else) for bounding-boxes etc.
Modifier and Type | Method and Description |
---|---|
void |
toAll()
Assigns to all the voxels
|
void |
toBox(BoundingBox box)
Assigns to only voxels inside a bounding-box
|
void |
toEitherTwoObjects(ObjectMask object1,
ObjectMask object2,
BoundingBox restrictTo)
Sets voxels to a value if the position is on in either of two masks
|
void |
toObject(ObjectMask object)
Sets voxels in a box to a particular value if they match an object-mask
|
void |
toObject(ObjectMask object,
BoundingBox restrictTo)
Sets voxels in a box to a particular value if they match a object-mask (but only a part of
the object-mask)
|
void |
toObjectIf(ObjectMask object,
java.util.function.IntPredicate voxelPredicate)
Sets voxels in a box to a particular value if they match an object-mask and a voxel
matches a predicate
|
boolean |
toObjectWhile(ObjectMask object,
java.util.function.IntPredicate voxelPredicate)
Sets voxels in a box to a particular value if they match an object-mask and each voxel
matches a predicate
|
void |
toVoxel(int x,
int y,
int z)
Assigns one particular voxel
|
default void |
toVoxel(Point3i point)
Assigns one particular voxel
|
default void toVoxel(Point3i point)
point
- point to assign tovoid toVoxel(int x, int y, int z)
x
- coordinate in x dimensiony
- coordinate in y dimensionz
- coordinate in z dimension (slice index)void toBox(BoundingBox box)
box
- the bounding-boxvoid toAll()
void toObject(ObjectMask object)
object
- the object-mask to restrict which values in the buffer are written tovoid toObjectIf(ObjectMask object, java.util.function.IntPredicate voxelPredicate)
Unlike toObjectWhile(ObjectMask, IntPredicate)
this operation will not abort if a
voxel fails to match a predicate, but rather keep on iterating through all voxels.
object
- the object-mask to restrict which values in the buffer are assignedvoxelPredicate
- the existing value of any voxel to be written must match this predicateboolean toObjectWhile(ObjectMask object, java.util.function.IntPredicate voxelPredicate)
If any one of the voxels in the object doesn't match the predicate, the operation is
aborted, and nothing is written at all. This behaviour is different to toObjectIf(org.anchoranalysis.image.voxel.object.ObjectMask, java.util.function.IntPredicate)
which will keep on iterating.
object
- the object-mask to restrict which values in the buffer are assignedvoxelPredicate
- the existing value of every voxel to be written must match this
predicate, otherwise no voxels are set at allvoid toObject(ObjectMask object, BoundingBox restrictTo)
Pixels are unchanged if they do not match the mask, or outside the part of the mask that is considered.
object
- the object-mask to restrict where voxels are setrestrictTo
- a restriction on where to process in the object-mask (expressed in the same
coordinates as object
).void toEitherTwoObjects(ObjectMask object1, ObjectMask object2, BoundingBox restrictTo)
object1
- first-objectobject2
- second-objectrestrictTo
- only process this region (which is sensibly part or all of the intersection
of the two objects bounding-boxes)Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.