Package net.imglib2

Class AbstractLocalizable

java.lang.Object
net.imglib2.AbstractEuclideanSpace
net.imglib2.AbstractLocalizable
All Implemented Interfaces:
EuclideanSpace, Localizable, RealLocalizable
Direct Known Subclasses:
AbstractLocalizingCursor, AbstractLongListImg.LongListRandomAccess, AbstractOutOfBoundsValue, CellRandomAccess, MixedRandomAccess, OutOfBoundsBorder, OutOfBoundsPeriodic, Point, SlicingRandomAccess, TransformRandomAccess

public abstract class AbstractLocalizable extends AbstractEuclideanSpace implements Localizable
An abstract class that implements the Localizable interface using a long[] array to maintain position.
Author:
Stephan Preibisch, Stephan Saalfeld, Tobias Pietzsch
  • Field Details

    • position

      protected final long[] position
      The Localizable interface is implemented using the position stored here. Positionable subclasses, such as Point, modify this array.
  • Constructor Details

    • AbstractLocalizable

      public AbstractLocalizable(int n)
      Parameters:
      n - number of dimensions.
    • AbstractLocalizable

      protected AbstractLocalizable(long[] position)
      Protected constructor that re-uses the passed position array. This is intended to allow subclasses to provide a way to wrap a long[] array.
      Parameters:
      position - position array to use.
  • Method Details

    • localize

      public void localize(float[] pos)
      Description copied from interface: RealLocalizable
      Write the current position into the passed array.
      Specified by:
      localize in interface RealLocalizable
      Parameters:
      pos - receives current position
    • localize

      public void localize(double[] pos)
      Description copied from interface: RealLocalizable
      Write the current position into the passed array.
      Specified by:
      localize in interface RealLocalizable
      Parameters:
      pos - receives current position
    • localize

      public void localize(int[] pos)
      Description copied from interface: Localizable
      Write the current position into the passed array.
      Specified by:
      localize in interface Localizable
      Parameters:
      pos - receives current position
    • localize

      public void localize(long[] pos)
      Description copied from interface: Localizable
      Write the current position into the passed array.
      Specified by:
      localize in interface Localizable
      Parameters:
      pos - receives current position
    • getFloatPosition

      public float getFloatPosition(int d)
      Description copied from interface: RealLocalizable
      Return the current position in a given dimension.
      Specified by:
      getFloatPosition in interface RealLocalizable
      Parameters:
      d - dimension
      Returns:
      dimension of current position
    • getDoublePosition

      public double getDoublePosition(int d)
      Description copied from interface: RealLocalizable
      Return the current position in a given dimension.
      Specified by:
      getDoublePosition in interface RealLocalizable
      Parameters:
      d - dimension
      Returns:
      dimension of current position
    • getIntPosition

      public int getIntPosition(int d)
      Description copied from interface: Localizable
      Return the current position in a given dimension.
      Specified by:
      getIntPosition in interface Localizable
      Parameters:
      d - dimension
      Returns:
      dimension of current position
    • getLongPosition

      public long getLongPosition(int d)
      Description copied from interface: Localizable
      Return the current position in a given dimension.
      Specified by:
      getLongPosition in interface Localizable
      Parameters:
      d - dimension
      Returns:
      dimension of current position