Package net.imglib2.test
Class ImgLib2Assert
- java.lang.Object
-
- net.imglib2.test.ImgLib2Assert
-
public class ImgLib2Assert extends java.lang.Object
-
-
Constructor Summary
Constructors Modifier Constructor Description privateImgLib2Assert()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <A extends ValueEquals<B>,B>
voidassertImageEquals(RandomAccessibleInterval<? extends A> expected, RandomAccessibleInterval<? extends B> actual)Throws an AssertionError, if the content or intervals of the two images differ.static <A,B>
voidassertImageEquals(RandomAccessibleInterval<? extends A> expected, RandomAccessibleInterval<? extends B> actual, java.util.function.BiPredicate<A,B> equals)Throws an AssertionError, if the content or intervals of the two images differ.static voidassertImageEqualsIntegerType(RandomAccessibleInterval<? extends IntegerType<?>> expected, RandomAccessibleInterval<? extends IntegerType<?>> actual)Throws an AssertionError, if the content or intervals of the two images differ.static voidassertImageEqualsRealType(RandomAccessibleInterval<? extends RealType<?>> expected, RandomAccessibleInterval<? extends RealType<?>> actual, double tolerance)Throws an AssertionError, if the content or intervals of the two images differ.static voidassertIntervalEquals(Interval expected, Interval actual)Throws an AssertionError, if the two Intervals differ.static voidassertIntervalEquals(RealInterval expected, RealInterval actual, double tolerance)private static voidfail(java.lang.String message)(package private) static java.lang.StringintervalToString(Interval interval)private static java.lang.StringintervalToString(RealInterval interval)private static java.lang.StringpositionToString(Localizable localizable)
-
-
-
Method Detail
-
assertImageEquals
public static <A extends ValueEquals<B>,B> void assertImageEquals(RandomAccessibleInterval<? extends A> expected, RandomAccessibleInterval<? extends B> actual)
Throws an AssertionError, if the content or intervals of the two images differ. Comparision is done pixel wise usingValueEquals.valueEquals(Object).
-
assertImageEqualsRealType
public static void assertImageEqualsRealType(RandomAccessibleInterval<? extends RealType<?>> expected, RandomAccessibleInterval<? extends RealType<?>> actual, double tolerance)
Throws an AssertionError, if the content or intervals of the two images differ. Comparision is done pixel wise. Two pixels are considered equal, if the values returned byComplexType.getRealDouble()differ by less than "tolerance".
-
assertImageEqualsIntegerType
public static void assertImageEqualsIntegerType(RandomAccessibleInterval<? extends IntegerType<?>> expected, RandomAccessibleInterval<? extends IntegerType<?>> actual)
Throws an AssertionError, if the content or intervals of the two images differ. Comparision is done pixel wise. Two pixels are considered equal, if the values returned byIntegerType.getIntegerLong()are equal.
-
assertImageEquals
public static <A,B> void assertImageEquals(RandomAccessibleInterval<? extends A> expected, RandomAccessibleInterval<? extends B> actual, java.util.function.BiPredicate<A,B> equals)
Throws an AssertionError, if the content or intervals of the two images differ. Comparision is done pixel wise. Two pixels are considered equal, if the give predicate returns true.
-
assertIntervalEquals
public static void assertIntervalEquals(Interval expected, Interval actual)
Throws an AssertionError, if the two Intervals differ.
-
assertIntervalEquals
public static void assertIntervalEquals(RealInterval expected, RealInterval actual, double tolerance)
-
positionToString
private static java.lang.String positionToString(Localizable localizable)
-
intervalToString
static java.lang.String intervalToString(Interval interval)
-
intervalToString
private static java.lang.String intervalToString(RealInterval interval)
-
fail
private static void fail(java.lang.String message)
-
-