Interface Dimensions

All Superinterfaces:
EuclideanSpace
All Known Subinterfaces:
Img<T>, Interval, IterableInterval<T>, NativeImg<T,A>, RandomAccessibleInterval<T>, SubIntervalIterable<T>
All Known Implementing Classes:
AbstractCellImg, AbstractConvertedIterableInterval, AbstractConvertedIterableRandomAccessibleInterval, AbstractConvertedRandomAccessibleInterval, AbstractImg, AbstractInterval, AbstractListImg, AbstractLongListImg, AbstractNativeImg, AbstractWrappedInterval, ARGBScreenImage, ArrayImg, ArrayImgAWTScreenImage, BiConvertedIterableInterval, BiConvertedRandomAccessibleInterval, ByteAWTScreenImage, Cell, CellGrid.CellIntervals, CellImg, CompositeIntervalView, ConvertedIterableInterval, ConvertedRandomAccessibleInterval, DiscreteFrequencyDistribution, DoubleAWTScreenImage, FinalDimensions, FinalInterval, FloatAWTScreenImage, Grid.CellIntervals, Histogram1d, HistogramNd, ImgView, IntAWTScreenImage, IntervalIterator, IntervalView, IterableRandomAccessibleInterval, IterableTransformBuilder.IterableIntervalView, IterableTransformBuilder.Slice, IterableTransformBuilder.SubInterval, LazyCellImg, LazyCellImg.LazyCells, ListImg, LocalizingIntervalIterator, LocalizingZeroMinIntervalIterator, NtreeCursor, NtreeImg, OffsetableIntervalIterator, OffsetableLocalizingIntervalIterator, PlanarImg, PointSampleList, RandomAccessibleIntervalCursor, ShortAWTScreenImage, StackView, SubsampleIntervalView, UnsignedByteAWTScreenImage, UnsignedIntAWTScreenImage, UnsignedShortAWTScreenImage, WriteConvertedIterableInterval, WriteConvertedIterableRandomAccessibleInterval, WriteConvertedRandomAccessibleInterval, ZeroMinIntervalIterator

public interface Dimensions extends EuclideanSpace
Defines an extent in n-dimensional discrete space.
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    allPositive(int... dimensions)
    Check whether all entries in dimensions are positive
    static boolean
    allPositive(long... dimensions)
    Check whether all entries in dimensions are positive
    long
    dimension(int d)
    Get the number of pixels in a given dimension d.
    default void
    dimensions(long[] dimensions)
    Write the number of pixels in each dimension into long[].
    default void
    Write the number of pixels in each dimension into Positionable.
    default long[]
    Allocates a new long array with the dimensions of this object.
    default Point
    Allocates a new Point with the dimensions of this object.
    static int[]
    verify(int... dimensions)
    Verify that dimensions is not null or empty, and that all dimensions are positive.
    static long[]
    verify(long... dimensions)
    Verify that dimensions is not null or empty, and that all dimensions are positive.
    static int[]
    verifyAllPositive(int... dimensions)
    Check that all entries in dimensions are positive
    static long[]
    verifyAllPositive(long... dimensions)
    Check that all entries in dimensions are positive

    Methods inherited from interface EuclideanSpace

    numDimensions
  • Method Details

    • dimensions

      default void dimensions(long[] dimensions)
      Write the number of pixels in each dimension into long[].
      Parameters:
      dimensions -
    • dimensions

      default void dimensions(Positionable dimensions)
      Write the number of pixels in each dimension into Positionable.
      Parameters:
      dimensions -
    • dimension

      long dimension(int d)
      Get the number of pixels in a given dimension d.
      Parameters:
      d -
    • dimensionsAsLongArray

      default long[] dimensionsAsLongArray()
      Allocates a new long array with the dimensions of this object. Please note that his method allocates a new array each time which introduces notable overhead in both compute and memory. If you query it frequently, you should allocate a dedicated array first and reuse it with dimensions(long[]).
      Returns:
      the dimensions
    • dimensionsAsPoint

      default Point dimensionsAsPoint()
      Allocates a new Point with the dimensions of this object. Please note that his method allocates a new Point each time which introduces notable overhead in both compute and memory. If you query it frequently, you should allocate a dedicated Point first and reuse it with dimensions(Positionable).
      Returns:
      the dimensions
    • allPositive

      static boolean allPositive(long... dimensions)
      Check whether all entries in dimensions are positive
      Parameters:
      dimensions -
      Returns:
      true if all entries in dimension are positive, false otherwise
    • allPositive

      static boolean allPositive(int... dimensions)
      Check whether all entries in dimensions are positive
      Parameters:
      dimensions -
      Returns:
      true if all entries in dimension are positive, false otherwise
    • verifyAllPositive

      static long[] verifyAllPositive(long... dimensions) throws InvalidDimensionsException
      Check that all entries in dimensions are positive
      Parameters:
      dimensions -
      Returns:
      dimensions
      Throws:
      InvalidDimensionsException - if any of dimensions is not positive (zero or negative).
    • verifyAllPositive

      static int[] verifyAllPositive(int... dimensions) throws InvalidDimensionsException
      Check that all entries in dimensions are positive
      Parameters:
      dimensions -
      Returns:
      dimensions
      Throws:
      InvalidDimensionsException - if any of dimensions is not positive (zero or negative).
    • verify

      static long[] verify(long... dimensions) throws InvalidDimensionsException
      Verify that dimensions is not null or empty, and that all dimensions are positive. Throw InvalidDimensionsException otherwise.
      Parameters:
      dimensions - to be verified.
      Returns:
      dimensions if successfully verified.
      Throws:
      IllegalArgumentException - if dimensions == null or dimensions.length == 0 or any dimensions is zero or negative.
      InvalidDimensionsException
    • verify

      static int[] verify(int... dimensions) throws InvalidDimensionsException
      Verify that dimensions is not null or empty, and that all dimensions are positive. Throw InvalidDimensionsException otherwise.
      Parameters:
      dimensions - to be verified.
      Returns:
      dimensions if successfully verified.
      Throws:
      IllegalArgumentException - if dimensions == null or dimensions.length == 0 or any dimensions is zero or negative.
      InvalidDimensionsException