Class KernelPointCursor
Object
KernelPointCursor
A mutable context around determining whether a particular point should be on or off
with a
BinaryKernel
.
It can be used to efficiently iterate over the neighbors around a particular point.
Both a Point3i
and an associated index (in a voxel buffer} are kept as mutable state,
that are generally changed together in a single operation.
- Author:
- Owen Feehan
-
Constructor Summary
ConstructorsConstructorDescriptionKernelPointCursor
(int index, Point3i point, Extent extent, BinaryValuesByte binaryValues, KernelApplicationParameters parameters) Creates to be focused around a particular point in the image. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Decrements the point and associated index by one in the X dimension.void
Decrements the point and associated index by one in the Y dimension.void
Decrements the point and associated index by two in the Y dimension.void
Decrements the point by one in the Z dimension.The size of the image the kernel iterates over.int
getIndex()
The index in the buffer that the kernel currently is focussed on.getPoint()
The point around which the cursor may iterate.void
Increments the current index state by one, without changing the current point state.void
Increments the point and associated index by one in the X dimension.void
Increments the point and associated index by two in the X dimension.void
Increments the point and associated index by one in the Y dimension.void
Increments the point and associated index by two in the Y dimension.void
Increments the point by one in the Z dimension.void
Increments the point by two in the Z dimension.boolean
isBufferOff
(UnsignedByteBuffer buffer) Is the value at the current index in this buffer corresponding to an off state?boolean
isBufferOn
(UnsignedByteBuffer buffer) Is the value at the current index in this buffer corresponding to an on state?boolean
True only when voxels outside the scene should not be ignored and considered as off.boolean
Whether to treat voxels that lie outside the scene as on (if true) or off (if false).boolean
isUseZ()
Whether to additionally apply the kernel along the Z dimension, as well as X and Y?boolean
Whether the current point is less than the image's extent in the X-dimension?boolean
Whether the current point is less than the image's extent in the Y-dimension?boolean
Whether the current point is non-negative in the X-dimension?boolean
Whether the current point is non-negative in the Y-dimension?void
setIndex
(int index) The index in the buffer that the kernel currently is focussed on.
-
Constructor Details
-
KernelPointCursor
public KernelPointCursor(int index, Point3i point, Extent extent, BinaryValuesByte binaryValues, KernelApplicationParameters parameters) Creates to be focused around a particular point in the image.- Parameters:
index
- the index in the buffer referring topoint
.point
- the point in the image (in three dimensions) where current focus resides.extent
- the size of the image.binaryValues
- what intensity values define on and off states.parameters
- parameters that influence how the kernel is applied.
-
-
Method Details
-
incrementX
public void incrementX()Increments the point and associated index by one in the X dimension. -
incrementXTwice
public void incrementXTwice()Increments the point and associated index by two in the X dimension. -
decrementX
public void decrementX()Decrements the point and associated index by one in the X dimension. -
incrementY
public void incrementY()Increments the point and associated index by one in the Y dimension. -
incrementYTwice
public void incrementYTwice()Increments the point and associated index by two in the Y dimension. -
decrementY
public void decrementY()Decrements the point and associated index by one in the Y dimension. -
decrementYTwice
public void decrementYTwice()Decrements the point and associated index by two in the Y dimension. -
incrementZ
public void incrementZ()Increments the point by one in the Z dimension.The associated index remains unchanged.
-
incrementZTwice
public void incrementZTwice()Increments the point by two in the Z dimension.The associated index remains unchanged.
-
decrementZ
public void decrementZ()Decrements the point by one in the Z dimension.The associated index remains unchanged.
-
incrementIndexOnly
public void incrementIndexOnly()Increments the current index state by one, without changing the current point state. -
isUseZ
public boolean isUseZ()Whether to additionally apply the kernel along the Z dimension, as well as X and Y?- Returns:
- true iff the kernel should additionally be applied along the Z dimension.
-
nonNegativeX
public boolean nonNegativeX()Whether the current point is non-negative in the X-dimension?- Returns:
- true iff the condition is fulfilled.
-
nonNegativeY
public boolean nonNegativeY()Whether the current point is non-negative in the Y-dimension?- Returns:
- true iff the condition is fulfilled.
-
lessThanMaxX
public boolean lessThanMaxX()Whether the current point is less than the image's extent in the X-dimension?- Returns:
- true iff the condition is fulfilled.
-
lessThanMaxY
public boolean lessThanMaxY()Whether the current point is less than the image's extent in the Y-dimension?- Returns:
- true iff the condition is fulfilled.
-
isBufferOn
Is the value at the current index in this buffer corresponding to an on state?- Parameters:
buffer
- the buffer containing the value that will be tested.- Returns:
- true if the value corresponds to an on state.
-
isBufferOff
Is the value at the current index in this buffer corresponding to an off state?- Parameters:
buffer
- the buffer containing the value that will be tested.- Returns:
- true if the value corresponds to an off state.
-
isOutsideOn
public boolean isOutsideOn()Whether to treat voxels that lie outside the scene as on (if true) or off (if false).- Returns:
- true if voxels lying outside the scene should be treated as on in the above circumstance, otherwise they are treated as off.
-
isOutsideOffUnignored
public boolean isOutsideOffUnignored()True only when voxels outside the scene should not be ignored and considered as off.- Returns:
- true iff both conditions above are true.
-
getIndex
public int getIndex()The index in the buffer that the kernel currently is focussed on.The buffer pertains to the X and Y dimensions only.
-
setIndex
public void setIndex(int index) The index in the buffer that the kernel currently is focussed on.The buffer pertains to the X and Y dimensions only.
-
getPoint
The point around which the cursor may iterate. -
getExtent
The size of the image the kernel iterates over.
-