Class KernelPointCursor

Object
KernelPointCursor

public final class KernelPointCursor extends Object
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

    Constructors
    Constructor
    Description
    KernelPointCursor(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 Type
    Method
    Description
    void
    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
    The index in the buffer that the kernel currently is focussed on.
    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
    Is the value at the current index in this buffer corresponding to an off state?
    boolean
    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
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 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.
  • 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

      public boolean isBufferOn(UnsignedByteBuffer buffer)
      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

      public boolean isBufferOff(UnsignedByteBuffer buffer)
      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

      public Point3i getPoint()
      The point around which the cursor may iterate.
    • getExtent

      public Extent getExtent()
      The size of the image the kernel iterates over.