public final class KernelPointCursor extends Object
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.
Constructor and Description |
---|
KernelPointCursor(int index,
Point3i point,
Extent extent,
BinaryValuesByte binaryValues,
KernelApplicationParameters parameters)
Creates to be focused around a particular point in the image.
|
Modifier and Type | Method and Description |
---|---|
void |
decrementX()
Decrements the point and associated index by one in the X dimension.
|
void |
decrementY()
Decrements the point and associated index by one in the Y dimension.
|
void |
decrementYTwice()
Decrements the point and associated index by two in the Y dimension.
|
void |
decrementZ()
Decrements the point by one in the Z dimension.
|
Extent |
getExtent()
The size of the image the kernel iterates over.
|
int |
getIndex()
The index in the buffer that the kernel currently is focussed on.
|
Point3i |
getPoint()
The point around which the cursor may iterate.
|
void |
incrementIndexOnly()
Increments the current index state by one, without changing the current point state.
|
void |
incrementX()
Increments the point and associated index by one in the X dimension.
|
void |
incrementXTwice()
Increments the point and associated index by two in the X dimension.
|
void |
incrementY()
Increments the point and associated index by one in the Y dimension.
|
void |
incrementYTwice()
Increments the point and associated index by two in the Y dimension.
|
void |
incrementZ()
Increments the point by one in the Z dimension.
|
void |
incrementZTwice()
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 |
isOutsideOffUnignored()
True only when voxels outside the scene should not be ignored and considered as
off.
|
boolean |
isOutsideOn()
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 |
lessThanMaxX()
Whether the current point is less than the image's extent in the X-dimension?
|
boolean |
lessThanMaxY()
Whether the current point is less than the image's extent in the Y-dimension?
|
boolean |
nonNegativeX()
Whether the current point is non-negative in the X-dimension?
|
boolean |
nonNegativeY()
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.
|
public KernelPointCursor(int index, Point3i point, Extent extent, BinaryValuesByte binaryValues, KernelApplicationParameters parameters)
index
- the index in the buffer referring to point
.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.public void incrementX()
public void incrementXTwice()
public void decrementX()
public void incrementY()
public void incrementYTwice()
public void decrementY()
public void decrementYTwice()
public void incrementZ()
The associated index remains unchanged.
public void incrementZTwice()
The associated index remains unchanged.
public void decrementZ()
The associated index remains unchanged.
public void incrementIndexOnly()
public boolean isUseZ()
public boolean nonNegativeX()
public boolean nonNegativeY()
public boolean lessThanMaxX()
public boolean lessThanMaxY()
public boolean isBufferOn(UnsignedByteBuffer buffer)
buffer
- the buffer containing the value that will be tested.public boolean isBufferOff(UnsignedByteBuffer buffer)
buffer
- the buffer containing the value that will be tested.public boolean isOutsideOn()
public boolean isOutsideOffUnignored()
public int getIndex()
The buffer pertains to the X and Y dimensions only.
public void setIndex(int index)
The buffer pertains to the X and Y dimensions only.
public Point3i getPoint()
public Extent getExtent()
Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.