Package net.imglib2

Interface Dimensions

    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Default Methods 
      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 dimensions​(Positionable dimensions)
      Write the number of pixels in each dimension into Positionable.
      default long[] dimensionsAsLongArray()
      Allocates a new long array with the dimensions of this object.
      default Point dimensionsAsPoint()
      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
    • Method Detail

      • 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:
        java.lang.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:
        java.lang.IllegalArgumentException - if dimensions == null or dimensions.length == 0 or any dimensions is zero or negative.
        InvalidDimensionsException