Constructor and Description |
---|
Intervals() |
Modifier and Type | Method and Description |
---|---|
static FinalInterval |
addDimension(Interval interval,
long minOfNewDim,
long maxOfNewDim)
Create new interval by adding a dimension to the source
Interval . |
static boolean |
contains(Interval containing,
Interval contained)
Test whether the
containing interval completely contains the
contained interval. |
static boolean |
contains(Interval containing,
Localizable contained)
Test whether the
containing interval contains the
contained point. |
static boolean |
contains(RealInterval containing,
RealInterval contained)
Test whether the
containing interval completely contains the
contained interval. |
static boolean |
contains(RealInterval containing,
RealLocalizable contained)
Test whether the
containing interval contains the
contained point. |
static FinalInterval |
createMinMax(long... minmax)
Create a
FinalInterval from a parameter list comprising minimum
and maximum coordinates. |
static FinalRealInterval |
createMinMaxReal(double... minmax)
Create a
FinalRealInterval from a parameter list comprising
minimum and maximum coordinates. |
static FinalInterval |
createMinSize(long... minsize)
Create a
FinalInterval from a parameter list comprising minimum
coordinates and size. |
static FinalRealInterval |
createMinSizeReal(double... minsize)
Deprecated.
|
static int[] |
dimensionsAsIntArray(Dimensions dimensions)
Create a
int[] with the dimensions of an Interval . |
static long[] |
dimensionsAsLongArray(Dimensions dimensions)
Create a
long[] with the dimensions of a Dimensions . |
static boolean |
equalDimensions(Dimensions a,
Dimensions b)
Tests whether two
Dimensions have the same size. |
static boolean |
equalDimensions(Interval a,
Interval b)
Deprecated.
|
static boolean |
equals(Interval a,
Interval b)
Tests whether two intervals are equal in their min / max.
|
static boolean |
equals(RealInterval a,
RealInterval b)
Tests whether two
RealInterval s are equal in their min / max. |
static boolean |
equals(RealInterval a,
RealInterval b,
double tolerance)
Tests whether two
RealInterval s are equal in their min / max. |
static FinalInterval |
expand(Interval interval,
Dimensions border)
Grow/shrink an interval in all dimensions.
|
static FinalInterval |
expand(Interval interval,
long... border)
Grow/shrink an interval in all dimensions.
|
static FinalInterval |
expand(Interval interval,
long border)
Grow/shrink an interval in all dimensions.
|
static FinalInterval |
expand(Interval interval,
long border,
int d)
Grow/shrink an interval in one dimensions.
|
static FinalInterval |
hyperSlice(Interval interval,
int d)
Take a (n-1)-dimensional slice of a n-dimensional interval, dropping the
d axis.
|
static FinalInterval |
intersect(Interval intervalA,
Interval intervalB)
Compute the intersection of two intervals.
|
static FinalRealInterval |
intersect(RealInterval intervalA,
RealInterval intervalB)
Compute the intersection of two intervals.
|
static FinalInterval |
invertAxis(Interval interval,
int d)
Invert the bounds on the d-axis of the given interval
|
static boolean |
isEmpty(Interval interval)
Check whether the given interval is empty, that is, the maximum is
smaller than the minimum in some dimension.
|
static boolean |
isEmpty(RealInterval interval)
Check whether the given interval is empty, that is, the maximum is
smaller than the minimum in some dimension.
|
static Interval |
largestContainedInterval(RealInterval ri)
Compute the largest
Interval that is contained in the specified
RealInterval . |
static double[] |
maxAsDoubleArray(RealInterval interval)
Create a
double[] with the maximum of a RealInterval
. |
static int[] |
maxAsIntArray(Interval interval)
Create a
int[] with the maximum of an Interval . |
static long[] |
maxAsLongArray(Interval interval)
Create a
long[] with the maximum of an Interval . |
static double[] |
minAsDoubleArray(RealInterval interval)
Create a
double[] with the minimum of a RealInterval
. |
static int[] |
minAsIntArray(Interval interval)
Create a
int[] with the minimum of an Interval . |
static long[] |
minAsLongArray(Interval interval)
Create a
long[] with the minimum of an Interval . |
static FinalInterval |
moveAxis(Interval interval,
int fromAxis,
int toAxis)
Create an interval with permuted axes.
|
static long |
numElements(Dimensions interval)
Compute the number of elements contained in an (integer)
Interval
. |
static long |
numElements(int... dimensions)
Compute the number of elements contained in an (integer) interval.
|
static long |
numElements(long... dimensions)
Compute the number of elements contained in an (integer) interval.
|
static FinalInterval |
permuteAxes(Interval interval,
int fromAxis,
int toAxis)
Create an interval with permuted axes.
|
static RandomAccessibleInterval<Localizable> |
positions(Interval interval)
Returns an image, where each pixel value is the position of the pixel
represented as
Localizable . |
static FinalInterval |
rotate(Interval interval,
int fromAxis,
int toAxis)
Create an interval that is rotated by 90 degrees.
|
static RealInterval |
scale(RealInterval interval,
double scale)
Return an
RealInterval that is scaled by the given factor. |
static Interval |
smallestContainingInterval(RealInterval ri)
Compute the smallest
Interval containing the specified
RealInterval . |
static String |
toString(Dimensions value)
Converts the
Dimensions into a string. |
static String |
toString(Interval value)
Returns a string that contains min, max and the dimensions of the
Interval . |
static String |
toString(RealInterval value)
Returns a string that contains min and max of the
RealInterval . |
static FinalInterval |
translate(Interval interval,
long... translation)
Translate an interval.
|
static FinalInterval |
translate(Interval interval,
long t,
int d)
Translate an interval in one dimension.
|
static FinalInterval |
translateInverse(Interval interval,
long... translation)
Translate an interval by
-translation . |
static FinalInterval |
union(Interval intervalA,
Interval intervalB)
Compute the smallest interval that contains both input intervals.
|
static FinalRealInterval |
union(RealInterval intervalA,
RealInterval intervalB)
Compute the smallest interval that contains both input intervals.
|
static FinalInterval |
zeroMin(Interval interval)
Returns an
Interval with the same dimensions as the given
interval, but min is all zero. |
public static FinalInterval createMinSize(long... minsize)
FinalInterval
from a parameter list comprising minimum
coordinates and size. For example, to create a 2D interval from (10, 10)
to (20, 40) use createMinSize( 10, 10, 11, 31 ).minsize
- a list of 2*n parameters to create a n
-dimensional interval. The first n parameters specify
the minimum of the interval, the next n parameters
specify the dimensions of the interval.public static FinalInterval createMinMax(long... minmax)
FinalInterval
from a parameter list comprising minimum
and maximum coordinates. For example, to create a 2D interval from (10,
10) to (20, 40) use createMinMax( 10, 10, 20, 40 ).minmax
- a list of 2*n parameters to create a n
-dimensional interval. The first n parameters specify
the minimum of the interval, the next n parameters
specify the maximum of the interval.@Deprecated public static FinalRealInterval createMinSizeReal(double... minsize)
createMinSize(long...)
for integer
intervals. Dimension is not defined for RealInterval
and
computing the max as min + dim - 1 does not make sense.
Create a FinalRealInterval
from a parameter list comprising
minimum coordinates and size. For example, to create a 2D interval from
(10, 10) to (20, 40) use createMinSize( 10, 10, 11, 31 ).
minsize
- a list of 2*n parameters to create a n
-dimensional interval. The first n parameters specify
the minimum of the interval, the next n parameters
specify the dimensions of the interval.public static FinalRealInterval createMinMaxReal(double... minmax)
FinalRealInterval
from a parameter list comprising
minimum and maximum coordinates. For example, to create a 2D interval
from (10, 10) to (20, 40) use createMinMax( 10, 10, 20, 40 ).minmax
- a list of 2*n parameters to create a n
-dimensional interval. The first n parameters specify
the minimum of the interval, the next n parameters
specify the maximum of the interval.public static FinalInterval expand(Interval interval, long border)
FinalInterval
, which is the input interval plus border
pixels on every side, in every dimension.interval
- the input intervalborder
- how many pixels to add on every sidepublic static FinalInterval expand(Interval interval, long... border)
FinalInterval
, which is the input interval plus border
pixels on every side, in every dimension.interval
- the input intervalborder
- how many pixels to add on every sidepublic static FinalInterval expand(Interval interval, Dimensions border)
FinalInterval
, which is the input interval plus border
pixels on every side, in every dimension.interval
- the input intervalborder
- how many pixels to add on every sidepublic static FinalInterval expand(Interval interval, long border, int d)
FinalInterval
, which is the input interval plus border
pixels on every side, in dimension d.interval
- the input intervalborder
- how many pixels to add on every sided
- in which dimensionpublic static FinalInterval translate(Interval interval, long t, int d)
FinalInterval
, which is the input interval shifted by t
in dimension d.interval
- the input intervalt
- by how many pixels to shift the intervald
- in which dimensionpublic static FinalInterval translate(Interval interval, long... translation)
FinalInterval
, which is the input interval shifted by
translation
.interval
- the input intervaltranslation
- by how many pixels to shift the intervalpublic static FinalInterval translateInverse(Interval interval, long... translation)
-translation
.
Create a FinalInterval
, which is the input interval shifted by
-translation
.interval
- the input intervaltranslation
- by how many pixels to inverse-shift the intervalpublic static FinalInterval addDimension(Interval interval, long minOfNewDim, long maxOfNewDim)
Interval
.
The Interval
boundaries in the additional dimension are set to
the specified values.
The additional dimension is the last dimension.interval
- the original intervalminOfNewDim
- Interval min in the additional dimension.maxOfNewDim
- Interval max in the additional dimension.public static FinalInterval invertAxis(Interval interval, int d)
interval
- the sourced
- the axis to invertpublic static FinalInterval hyperSlice(Interval interval, int d)
public static FinalInterval moveAxis(Interval interval, int fromAxis, int toAxis)
fromAxis
is moved to
toAxis
, while the order of the other axes is preserved.
If fromAxis=2 and toAxis=4, and axis order of interval
was XYCZT,
then an interval with axis order XYZTC would be created.public static FinalInterval permuteAxes(Interval interval, int fromAxis, int toAxis)
public static FinalInterval rotate(Interval interval, int fromAxis, int toAxis)
public static FinalInterval zeroMin(Interval interval)
Interval
with the same dimensions as the given
interval, but min is all zero.public static RealInterval scale(RealInterval interval, double scale)
RealInterval
that is scaled by the given factor.public static FinalInterval intersect(Interval intervalA, Interval intervalB)
FinalInterval
, which is the intersection of the input
intervals (i.e., the area contained in both input intervals).intervalA
- input intervalintervalB
- input intervalpublic static FinalRealInterval intersect(RealInterval intervalA, RealInterval intervalB)
RealInterval
, which is the intersection of the input
intervals (i.e., the area contained in both input intervals).intervalA
- input intervalintervalB
- input intervalpublic static FinalInterval union(Interval intervalA, Interval intervalB)
FinalInterval
that represents that interval.intervalA
- input intervalintervalB
- input intervalpublic static FinalRealInterval union(RealInterval intervalA, RealInterval intervalB)
RealInterval
that represents that interval.intervalA
- input intervalintervalB
- input intervalpublic static Interval smallestContainingInterval(RealInterval ri)
Interval
containing the specified
RealInterval
.ri
- input interval.public static Interval largestContainedInterval(RealInterval ri)
Interval
that is contained in the specified
RealInterval
.ri
- input interval.public static boolean isEmpty(Interval interval)
interval
- interval to checkpublic static boolean isEmpty(RealInterval interval)
interval
- interval to checkpublic static boolean contains(Interval containing, Localizable contained)
containing
interval contains the
contained
point. The interval is closed, that is, boundary points
are contained.contained
is in containing
.public static boolean contains(RealInterval containing, RealLocalizable contained)
containing
interval contains the
contained
point. The interval is closed, that is, boundary points
are contained.contained
is in containing
.public static final boolean contains(Interval containing, Interval contained)
containing
interval completely contains the
contained
interval.public static final boolean contains(RealInterval containing, RealInterval contained)
containing
interval completely contains the
contained
interval.public static long numElements(Dimensions interval)
Interval
.interval
.public static long numElements(int... dimensions)
dimensions
- dimensions of the interval.public static long numElements(long... dimensions)
dimensions
- dimensions of the interval.public static boolean equals(Interval a, Interval b)
public static boolean equals(RealInterval a, RealInterval b)
RealInterval
s are equal in their min / max.public static boolean equals(RealInterval a, RealInterval b, double tolerance)
RealInterval
s are equal in their min / max.
With respect to the given tolerance.public static boolean equalDimensions(Dimensions a, Dimensions b)
Dimensions
have the same size.@Deprecated public static boolean equalDimensions(Interval a, Interval b)
public static long[] dimensionsAsLongArray(Dimensions dimensions)
long[]
with the dimensions of a Dimensions
.
Keep in mind that creating arrays wildly is not good practice and
consider using the interval directly. See
Dimensions.dimensions(long[])
.
Consider using the more convenient Dimensions.dimensionsAsLongArray()
.
This method may be deprecated in a future release.
dimensions
- something which has dimensionslong[]
public static int[] dimensionsAsIntArray(Dimensions dimensions)
int[]
with the dimensions of an Interval
.
Keep in mind that creating arrays wildly is not good practice and consider using the interval directly.
dimensions
- something which has dimensionsint[]
public static long[] minAsLongArray(Interval interval)
long[]
with the minimum of an Interval
.
Keep in mind that creating arrays wildly is not good practice and
consider using the interval directly. See Interval.min(long[])
.
Consider using the more convenient Interval.minAsLongArray()
.
This method may be deprecated in a future release.
interval
- something with interval boundarieslong[]
public static int[] minAsIntArray(Interval interval)
int[]
with the minimum of an Interval
.
Keep in mind that creating arrays wildly is not good practice and consider using the interval directly.
interval
- something with interval boundariesint[]
public static long[] maxAsLongArray(Interval interval)
long[]
with the maximum of an Interval
.
Keep in mind that creating arrays wildly is not good practice and
consider using the interval directly. See Interval.max(long[])
.
Consider using the more convenient Interval.maxAsLongArray()
.
This method may be deprecated in a future release.
interval
- something with interval boundarieslong[]
public static int[] maxAsIntArray(Interval interval)
int[]
with the maximum of an Interval
.
Keep in mind that creating arrays wildly is not good practice and consider using the interval directly.
interval
- something with interval boundariesint[]
public static double[] maxAsDoubleArray(RealInterval interval)
double[]
with the maximum of a RealInterval
.
Keep in mind that creating arrays wildly is not good practice and
consider using the interval directly. See
RealInterval.realMax(double[])
.
Consider using the more convenient RealInterval.maxAsDoubleArray()
.
This method may be deprecated in a future release.
interval
- something with interval boundariespublic static double[] minAsDoubleArray(RealInterval interval)
double[]
with the minimum of a RealInterval
.
Keep in mind that creating arrays wildly is not good practice and
consider using the interval directly. See
RealInterval.realMin(double[])
.
Consider using the more convenient RealInterval.minAsDoubleArray()
This method may be deprecated in a future release.
interval
- something with interval boundariespublic static RandomAccessibleInterval<Localizable> positions(Interval interval)
Localizable
.interval
- Interval of the returned image.public static String toString(Interval value)
Interval
.public static String toString(RealInterval value)
RealInterval
.public static String toString(Dimensions value)
Dimensions
into a string.Copyright © 2015–2022 ImgLib2. All rights reserved.