Class AbstractImg<T>

    • Field Detail

      • n

        protected final int n
      • numPixels

        protected long numPixels
      • dimension

        protected final long[] dimension
      • max

        protected final long[] max
    • Constructor Detail

      • AbstractImg

        public AbstractImg​(long[] size)
    • Method Detail

      • iterator

        public java.util.Iterator<T> iterator()
        Specified by:
        iterator in interface java.lang.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)
      • 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
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.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
      • 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
      • 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
      • 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.
      • 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