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
Defines an extent in n-dimensional discrete space.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanallPositive(int... dimensions) Check whether all entries indimensionsare positivestatic booleanallPositive(long... dimensions) Check whether all entries indimensionsare positivelongdimension(int d) Get the number of pixels in a given dimension d.default voiddimensions(long[] dimensions) Write the number of pixels in each dimension into long[].default voiddimensions(Positionable dimensions) Write the number of pixels in each dimension intoPositionable.default long[]Allocates a new long array with the dimensions of this object.default PointAllocates a newPointwith the dimensions of this object.static int[]verify(int... dimensions) Verify thatdimensionsis not null or empty, and that all dimensions are positive.static long[]verify(long... dimensions) Verify thatdimensionsis not null or empty, and that all dimensions are positive.static int[]verifyAllPositive(int... dimensions) Check that all entries indimensionsare positivestatic long[]verifyAllPositive(long... dimensions) Check that all entries indimensionsare positiveMethods 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
Write the number of pixels in each dimension intoPositionable.- 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 withdimensions(long[]).- Returns:
- the dimensions
-
dimensionsAsPoint
Allocates a newPointwith the dimensions of this object. Please note that his method allocates a newPointeach time which introduces notable overhead in both compute and memory. If you query it frequently, you should allocate a dedicatedPointfirst and reuse it withdimensions(Positionable).- Returns:
- the dimensions
-
allPositive
static boolean allPositive(long... dimensions) Check whether all entries indimensionsare positive- Parameters:
dimensions-- Returns:
- true if all entries in
dimensionare positive, false otherwise
-
allPositive
static boolean allPositive(int... dimensions) Check whether all entries indimensionsare positive- Parameters:
dimensions-- Returns:
- true if all entries in
dimensionare positive, false otherwise
-
verifyAllPositive
Check that all entries indimensionsare positive- Parameters:
dimensions-- Returns:
dimensions- Throws:
InvalidDimensionsException- if any ofdimensionsis not positive (zero or negative).
-
verifyAllPositive
Check that all entries indimensionsare positive- Parameters:
dimensions-- Returns:
dimensions- Throws:
InvalidDimensionsException- if any ofdimensionsis not positive (zero or negative).
-
verify
Verify thatdimensionsis not null or empty, and that all dimensions are positive. ThrowInvalidDimensionsExceptionotherwise.- Parameters:
dimensions- to be verified.- Returns:
dimensionsif successfully verified.- Throws:
IllegalArgumentException- ifdimensions == nullordimensions.length == 0or any dimensions is zero or negative.InvalidDimensionsException
-
verify
Verify thatdimensionsis not null or empty, and that all dimensions are positive. ThrowInvalidDimensionsExceptionotherwise.- Parameters:
dimensions- to be verified.- Returns:
dimensionsif successfully verified.- Throws:
IllegalArgumentException- ifdimensions == nullordimensions.length == 0or any dimensions is zero or negative.InvalidDimensionsException
-