Class ProcessVoxelNeighborAbsoluteWithSlidingBuffer<T>

Object
ProcessVoxelNeighborAbsoluteWithSlidingBuffer<T>
Type Parameters:
T - result-type that is collected
All Implemented Interfaces:
ProcessVoxelNeighborAbsolute<T>

public abstract class ProcessVoxelNeighborAbsoluteWithSlidingBuffer<T> extends Object implements ProcessVoxelNeighborAbsolute<T>
Like ProcessVoxelNeighborAbsolute but additionally includes a SlidingBuffer.
Author:
Owen Feehan
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected int
    The intensity value of the source voxel.
    protected int
    The change in the Z-dimension to reach this neighbor relative to the source coordinate.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Creates for a particular sliding buffer.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected int
    changedOffset(int xChange, int yChange)
    Calculates the offset in the buffer for a voxel, indicated by its relative-change in position.
    The size of the associated SlidingBuffer.
    protected int
    getInt(int index)
    Get a value from the buffer at a particular absolute position.
    protected int
    getInt(int xChange, int yChange)
    Get a value from the buffer at a particular relative position.
    void
    initSource(int sourceValue, int sourceOffsetXY)
    The value and offset for the source point (around which we process neighbors).
    void
    notifyChangeZ(int zChange, int z)
    Notifies the processor that there has been a change in z-coordinate.
    protected void
    putInt(int index, int valueToAssign)
    Assign a value to the buffer at a particular absolute position.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.anchoranalysis.image.voxel.iterator.neighbor.ProcessVoxelNeighborAbsolute

    collectResult, processPoint
  • Field Details

    • zChange

      protected int zChange
      The change in the Z-dimension to reach this neighbor relative to the source coordinate.
    • sourceValue

      protected int sourceValue
      The intensity value of the source voxel.
  • Constructor Details

    • ProcessVoxelNeighborAbsoluteWithSlidingBuffer

      protected ProcessVoxelNeighborAbsoluteWithSlidingBuffer(SlidingBuffer<?> slidingBuffer)
      Creates for a particular sliding buffer.
      Parameters:
      slidingBuffer - the buffer.
  • Method Details

    • initSource

      public void initSource(int sourceValue, int sourceOffsetXY)
      Description copied from interface: ProcessVoxelNeighborAbsolute
      The value and offset for the source point (around which we process neighbors).

      This function should always be called before ProcessVoxelNeighborAbsolute.processPoint(int, int, int, int).

      It can be called repeatedly for different points (resetting state each time).

      Specified by:
      initSource in interface ProcessVoxelNeighborAbsolute<T>
      Parameters:
      sourceValue - the intensity value of the source voxel.
      sourceOffsetXY - the offset of the source voxel in XY.
    • notifyChangeZ

      public void notifyChangeZ(int zChange, int z)
      Description copied from interface: ProcessVoxelNeighborAbsolute
      Notifies the processor that there has been a change in z-coordinate.
      Specified by:
      notifyChangeZ in interface ProcessVoxelNeighborAbsolute<T>
      Parameters:
      zChange - the change in the Z-dimension to reach this neighbor relative to the source coordinate.
      z - the Z-dimension coordinates for this point (the neighboring point) in global (absolute) terms i.e. not relative to a bounding-box.
    • extent

      public Extent extent()
      The size of the associated SlidingBuffer.
      Returns:
      the size.
    • changedOffset

      protected int changedOffset(int xChange, int yChange)
      Calculates the offset in the buffer for a voxel, indicated by its relative-change in position.
      Parameters:
      xChange - the relative change in the X-dimension, compared to the current buffer position.
      yChange - the relative change in the Y-dimension, compared to the current buffer position.
      Returns:
      the position in the buffer where the value is located.
    • getInt

      protected int getInt(int index)
      Get a value from the buffer at a particular absolute position.
      Parameters:
      index - the absolute position in the buffer.
      Returns:
      the value as an unsigned int.
    • getInt

      protected int getInt(int xChange, int yChange)
      Get a value from the buffer at a particular relative position.
      Parameters:
      xChange - the relative change in the X-dimension, compared to the current buffer position.
      yChange - the relative change in the Y-dimension, compared to the current buffer position.
      Returns:
      the value as an unsigned int.
    • putInt

      protected void putInt(int index, int valueToAssign)
      Assign a value to the buffer at a particular absolute position.
      Parameters:
      index - the absolute position in the buffer.
      valueToAssign - the value to assign.