Class AbstractImg<T>

java.lang.Object
net.imglib2.img.AbstractImg<T>
All Implemented Interfaces:
Iterable<T>, Dimensions, EuclideanSpace, Img<T>, Interval, IterableInterval<T>, IterableRealInterval<T>, RandomAccessible<T>, RandomAccessibleInterval<T>, RealInterval
Direct Known Subclasses:
AbstractListImg, AbstractLongListImg, AbstractNativeImg

public abstract class AbstractImg<T> extends Object implements Img<T>
TODO
Author:
Stephan Preibisch, Stephan Saalfeld
  • Field Details

    • n

      protected final int n
    • numPixels

      protected long numPixels
    • dimension

      protected final long[] dimension
    • max

      protected final long[] max
  • Constructor Details

    • AbstractImg

      public AbstractImg(long[] size)
  • Method Details

    • iterator

      public Iterator<T> iterator()
      Specified by:
      iterator in interface Iterable<T>
    • firstElement

      public T firstElement()
      Description copied from interface: IterableRealInterval
      Get the first element of this IterableRealInterval. This is a shortcut for cursor().next(). This can be used to create a new variable of type T using firstElement().createVariable(), which is useful in generic methods to store temporary results, e.g., a running sum over pixels in the IterableRealInterval.
      Specified by:
      firstElement in interface IterableRealInterval<T>
      Returns:
      the first element in iteration order.
    • numElements

      public static long numElements(long[] dim)
    • numDimensions

      public int numDimensions()
      Description copied from interface: EuclideanSpace
      Gets the space's number of dimensions.
      Specified by:
      numDimensions in interface EuclideanSpace
    • dimensions

      public void dimensions(long[] s)
      Description copied from interface: Dimensions
      Write the number of pixels in each dimension into long[].
      Specified by:
      dimensions in interface Dimensions
    • dimension

      public long dimension(int d)
      Description copied from interface: Dimensions
      Get the number of pixels in a given dimension d.
      Specified by:
      dimension in interface Dimensions
    • size

      public long size()
      Description copied from interface: IterableRealInterval

      Returns the number of elements in this Function.

      Specified by:
      size in interface IterableRealInterval<T>
      Returns:
      number of elements
    • toString

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

      public double realMax(int d)
      Description copied from interface: RealInterval
      Get the maximum in dimension d.
      Specified by:
      realMax in interface RealInterval
      Parameters:
      d - dimension
      Returns:
      maximum in dimension d.
    • realMax

      public void realMax(double[] m)
      Description copied from interface: RealInterval
      Write the maximum of each dimension into double[].
      Specified by:
      realMax in interface RealInterval
    • realMax

      public void realMax(RealPositionable m)
      Description copied from interface: RealInterval
      Sets a RealPositionable to the maximum of this Interval
      Specified by:
      realMax in interface RealInterval
    • realMin

      public double realMin(int d)
      Description copied from interface: RealInterval
      Get the minimum in dimension d.
      Specified by:
      realMin in interface RealInterval
      Parameters:
      d - dimension
      Returns:
      minimum in dimension d.
    • realMin

      public void realMin(double[] m)
      Description copied from interface: RealInterval
      Write the minimum of each dimension into double[].
      Specified by:
      realMin in interface RealInterval
    • realMin

      public void realMin(RealPositionable m)
      Description copied from interface: RealInterval
      Sets a RealPositionable to the minimum of this Interval
      Specified by:
      realMin in interface RealInterval
    • max

      public long max(int d)
      Description copied from interface: Interval
      Get the maximum in dimension d.
      Specified by:
      max in interface Interval
      Parameters:
      d - dimension
      Returns:
      maximum in dimension d.
    • max

      public void max(long[] m)
      Description copied from interface: Interval
      Write the maximum of each dimension into long[].
      Specified by:
      max in interface Interval
    • max

      public void max(Positionable m)
      Description copied from interface: Interval
      Sets a Positionable to the maximum of this Interval
      Specified by:
      max in interface Interval
    • min

      public void min(long[] m)
      Description copied from interface: Interval
      Write the minimum of each dimension into long[].
      Specified by:
      min in interface Interval
    • min

      public long min(int d)
      Description copied from interface: Interval
      Get the minimum in dimension d.
      Specified by:
      min in interface Interval
      Parameters:
      d - dimension
      Returns:
      minimum in dimension d.
    • min

      public void min(Positionable m)
      Description copied from interface: Interval
      Sets a Positionable to the minimum of this Interval
      Specified by:
      min in interface Interval
    • randomAccess

      public RandomAccess<T> randomAccess(Interval interval)
      Description copied from interface: RandomAccessible
      Create a random access sampler for integer coordinates.

      The returned random access is intended to be used in the specified interval only. Thus, the RandomAccessible may provide optimized versions. If the interval is completely contained in the domain, the random access is guaranteed to provide the same values as that obtained by RandomAccessible.randomAccess() within the interval.

      Specified by:
      randomAccess in interface RandomAccessible<T>
      Parameters:
      interval - in which interval you intend to use the random access.
      Returns:
      random access sampler