Class LocalSlices

Object
LocalSlices
All Implemented Interfaces:
BufferRetriever

public class LocalSlices extends Object implements BufferRetriever
Caches a small number of slices around which we wish to work, so the memory is efficiently accessed.
Author:
Owen Feehan
  • Constructor Details

    • LocalSlices

      public LocalSlices(int z, int windowSize, Voxels<UnsignedByteBuffer> voxels)
      Create with focus around a particular slice.
      Parameters:
      z - index of the slice in the z-dimension.
      windowSize - how big the windows is across the z-dimension for storing slices.
      voxels - the voxels whose z-dimension is traversed for slices.
  • Method Details

    • getLocal

      public Optional<UnsignedByteBuffer> getLocal(int relativeZIndex)
      Description copied from interface: BufferRetriever
      Get a buffer at a particular index in the z-dimension.

      The index is relative to a current position e.g. -1, -2, +1, +2 etc.

      If an invalid index is requested, then Optional.empty() is returned.

      Specified by:
      getLocal in interface BufferRetriever
      Parameters:
      relativeZIndex - the shift in the z index relative to the current z-slice's index
      Returns:
      the buffer corresponding to the z-index, if it exists.