Class PlanarPlaneSubsetLocalizingCursor<T extends NativeType<T>>

Type Parameters:
T -
All Implemented Interfaces:
Iterator<T>, Cursor<T>, EuclideanSpace, PlanarImg.PlanarContainerSampler, Iterator, Localizable, RealCursor<T>, RealLocalizable, Sampler<T>, Typed<T>

public class PlanarPlaneSubsetLocalizingCursor<T extends NativeType<T>> extends AbstractLocalizingCursorInt<T> implements PlanarImg.PlanarContainerSampler
Cursor optimized for one plane in an PlanarImg.
  • Field Details

    • type

      private final T extends NativeType<T> type
      Access to the type
    • typeIndex

      private final Index typeIndex
    • container

      private final PlanarImg<T extends NativeType<T>, ?> container
      Container
    • sliceIndex

      private final int sliceIndex
      Current slice index
    • lastIndexPlane

      private final int lastIndexPlane
      Last index on the plane
    • maxX

      private final int maxX
    • dimX

      private final int dimX
  • Constructor Details

    • PlanarPlaneSubsetLocalizingCursor

      protected PlanarPlaneSubsetLocalizingCursor(PlanarPlaneSubsetLocalizingCursor<T> cursor)
      Copy Constructor
      Parameters:
      cursor - PlanarPlaneSubsetLocalizingCursor to copy from
    • PlanarPlaneSubsetLocalizingCursor

      public PlanarPlaneSubsetLocalizingCursor(PlanarImg<T,?> container, Interval interval)
      Constructor
      Parameters:
      container - PlanarImg this cursor shall work on.
      interval - Interval over which shall be iterated.
  • Method Details

    • getCurrentSliceIndex

      public final int getCurrentSliceIndex()
      Specified by:
      getCurrentSliceIndex in interface PlanarImg.PlanarContainerSampler
      Returns:
      the index of the slice the sampler is currently accessing.
    • get

      public final T get()
      Access the actual T instance providing access to a pixel, sub-pixel or integral region value the Sampler points at.
      Specified by:
      get in interface Sampler<T extends NativeType<T>>
    • getType

      public T getType()
      Description copied from interface: Typed
      Get an instance of T.

      It should not be assumed that the returned T instance is an independent copy. In particular, repeated calls to getType() may return the same instance.

      Specified by:
      getType in interface Sampler<T extends NativeType<T>>
      Specified by:
      getType in interface Typed<T extends NativeType<T>>
      Returns:
      an instance of T
    • copy

      Specified by:
      copy in interface Cursor<T extends NativeType<T>>
      Specified by:
      copy in interface RealCursor<T extends NativeType<T>>
      Specified by:
      copy in interface Sampler<T extends NativeType<T>>
      Specified by:
      copy in class AbstractLocalizingCursorInt<T extends NativeType<T>>
      Returns:
      - A new Sampler in the same state accessing the same values. It does NOT copy T, just the state of the Sampler. Otherwise use T.copy() if available. Sampler.copy().get() == Sampler.get(), i.e. both hold the same value, not necessarily the same instance (this is the case for an ArrayCursor for example)
    • hasNext

      public final boolean hasNext()
      Returns true if another step forward is possible.
      Specified by:
      hasNext in interface Iterator<T extends NativeType<T>>
      Specified by:
      hasNext in interface Iterator
      Returns:
      true, if there is another step forward is possible, otherwise false
    • fwd

      public final void fwd()
      Move forward.
      Specified by:
      fwd in interface Iterator
    • jumpFwd

      public final void jumpFwd(long steps)
      Move steps × forward.

      Highly recommended to override this with a more efficient version.

      Specified by:
      jumpFwd in interface Iterator
      Parameters:
      steps - number of steps to move forward
    • updatePositionFromIndex

      private void updatePositionFromIndex(int index)
    • reset

      public final void reset()
      Reset the Iterator, that is put it to where it would be if newly created.
      Specified by:
      reset in interface Iterator
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • offset

      private long offset(Interval interval)