Package net.imglib2
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
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static 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[]dimensionsAsLongArray()Allocates a new long array with the dimensions of this object.default PointdimensionsAsPoint()Allocates 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 positive-
Methods inherited from interface net.imglib2.EuclideanSpace
numDimensions
-
-
-
-
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 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
default Point 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
static long[] verifyAllPositive(long... dimensions) throws InvalidDimensionsExceptionCheck that all entries indimensionsare positive- Parameters:
dimensions-- Returns:
dimensions- Throws:
InvalidDimensionsException- if any ofdimensionsis not positive (zero or negative).
-
verifyAllPositive
static int[] verifyAllPositive(int... dimensions) throws InvalidDimensionsExceptionCheck that all entries indimensionsare positive- Parameters:
dimensions-- Returns:
dimensions- Throws:
InvalidDimensionsException- if any ofdimensionsis not positive (zero or negative).
-
verify
static long[] verify(long... dimensions) throws InvalidDimensionsExceptionVerify thatdimensionsis not null or empty, and that all dimensions are positive. ThrowInvalidDimensionsExceptionotherwise.- Parameters:
dimensions- to be verified.- Returns:
dimensionsif successfully verified.- Throws:
java.lang.IllegalArgumentException- ifdimensions == nullordimensions.length == 0or any dimensions is zero or negative.InvalidDimensionsException
-
verify
static int[] verify(int... dimensions) throws InvalidDimensionsExceptionVerify thatdimensionsis not null or empty, and that all dimensions are positive. ThrowInvalidDimensionsExceptionotherwise.- Parameters:
dimensions- to be verified.- Returns:
dimensionsif successfully verified.- Throws:
java.lang.IllegalArgumentException- ifdimensions == nullordimensions.length == 0or any dimensions is zero or negative.InvalidDimensionsException
-
-