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.
- Author:
- Owen Feehan
-
Method Summary
Modifier and TypeMethodDescriptionvoid
toAll()
Assigns to all the voxelsvoid
toBox
(BoundingBox box) Assigns to only voxels inside a bounding-boxvoid
toEitherTwoObjects
(ObjectMask object1, ObjectMask object2, BoundingBox restrictTo) Sets voxels to a value if the position is on in either of two masksvoid
toObject
(ObjectMask object) Sets voxels in a box to a particular value if they match an object-maskvoid
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, IntPredicate voxelPredicate) Sets voxels in a box to a particular value if they match an object-mask and a voxel matches a predicateboolean
toObjectWhile
(ObjectMask object, IntPredicate voxelPredicate) Sets voxels in a box to a particular value if they match an object-mask and each voxel matches a predicatevoid
toVoxel
(int x, int y, int z) Assigns one particular voxeldefault void
Assigns one particular voxel
-
Method Details
-
toVoxel
Assigns one particular voxel- Parameters:
point
- point to assign to
-
toVoxel
void toVoxel(int x, int y, int z) Assigns one particular voxel- Parameters:
x
- coordinate in x dimensiony
- coordinate in y dimensionz
- coordinate in z dimension (slice index)
-
toBox
Assigns to only voxels inside a bounding-box- Parameters:
box
- the bounding-box
-
toAll
void toAll()Assigns to all the voxels -
toObject
Sets voxels in a box to a particular value if they match an object-mask- Parameters:
object
- the object-mask to restrict which values in the buffer are written to
-
toObjectIf
Sets voxels in a box to a particular value if they match an object-mask and a voxel matches a predicateUnlike
toObjectWhile(ObjectMask, IntPredicate)
this operation will not abort if a voxel fails to match a predicate, but rather keep on iterating through all voxels.- Parameters:
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 predicate
-
toObjectWhile
Sets voxels in a box to a particular value if they match an object-mask and each voxel matches a predicateIf 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.- Parameters:
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 all- Returns:
- if at least one voxel was set
-
toObject
Sets voxels in a box to a particular value if they match a object-mask (but only a part of the object-mask)Pixels are unchanged if they do not match the mask, or outside the part of the mask that is considered.
- Parameters:
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 asobject
).
-
toEitherTwoObjects
Sets voxels to a value if the position is on in either of two masks- Parameters:
object1
- first-objectobject2
- second-objectrestrictTo
- only process this region (which is sensibly part or all of the intersection of the two objects bounding-boxes)
-