use of net.imglib2.type.numeric.real.DoubleType in project imagej-ops by imagej.
the class ExtendMirrorSingleViewTest method extendMirrorSingleTest.
@Test
public void extendMirrorSingleTest() {
Img<DoubleType> img = new ArrayImgFactory<DoubleType>().create(new int[] { 10, 10 }, new DoubleType());
OutOfBounds<DoubleType> il2 = Views.extendMirrorSingle(img).randomAccess();
OutOfBounds<DoubleType> opr = ops.transform().extendMirrorSingleView(img).randomAccess();
il2.setPosition(new int[] { -1, -1 });
opr.setPosition(new int[] { -1, -1 });
assertEquals(il2.get().get(), opr.get().get(), 1e-10);
il2.setPosition(new int[] { 11, 11 });
opr.setPosition(new int[] { 11, 11 });
assertEquals(il2.get().get(), opr.get().get(), 1e-10);
}
use of net.imglib2.type.numeric.real.DoubleType in project imagej-ops by imagej.
the class ExtendPeriodicViewTest method extendPeriodicTest.
@Test
public void extendPeriodicTest() {
Img<DoubleType> img = new ArrayImgFactory<DoubleType>().create(new int[] { 10, 10 }, new DoubleType());
OutOfBounds<DoubleType> il2 = Views.extendPeriodic(img).randomAccess();
OutOfBounds<DoubleType> opr = ops.transform().extendPeriodicView(img).randomAccess();
il2.setPosition(new int[] { -1, -1 });
opr.setPosition(new int[] { -1, -1 });
assertEquals(il2.get().get(), opr.get().get(), 1e-10);
il2.setPosition(new int[] { 11, 11 });
opr.setPosition(new int[] { 11, 11 });
assertEquals(il2.get().get(), opr.get().get(), 1e-10);
}
use of net.imglib2.type.numeric.real.DoubleType in project imagej-ops by imagej.
the class ExtendViewTest method defaultExtendTest.
@Test
public void defaultExtendTest() {
Img<DoubleType> img = new ArrayImgFactory<DoubleType>().create(new int[] { 10, 10 }, new DoubleType());
OutOfBounds<DoubleType> il2 = Views.extend(img, new OutOfBoundsBorderFactory<DoubleType, RandomAccessibleInterval<DoubleType>>()).randomAccess();
OutOfBounds<DoubleType> opr = ops.transform().extendView(img, new OutOfBoundsBorderFactory<DoubleType, RandomAccessibleInterval<DoubleType>>()).randomAccess();
il2.setPosition(new int[] { -1, -1 });
opr.setPosition(new int[] { -1, -1 });
assertEquals(il2.get().get(), opr.get().get(), 1e-10);
il2.setPosition(new int[] { 11, 11 });
opr.setPosition(new int[] { 11, 11 });
assertEquals(il2.get().get(), opr.get().get(), 1e-10);
}
use of net.imglib2.type.numeric.real.DoubleType in project imagej-ops by imagej.
the class ExtendZeroViewTest method extendZeroTest.
@Test
public void extendZeroTest() {
Img<DoubleType> img = new ArrayImgFactory<DoubleType>().create(new int[] { 10, 10 }, new DoubleType());
OutOfBounds<DoubleType> il2 = Views.extendZero(img).randomAccess();
OutOfBounds<DoubleType> opr = ops.transform().extendZeroView(img).randomAccess();
il2.setPosition(new int[] { -1, -1 });
opr.setPosition(new int[] { -1, -1 });
assertEquals(il2.get().get(), opr.get().get(), 1e-10);
il2.setPosition(new int[] { 11, 11 });
opr.setPosition(new int[] { 11, 11 });
assertEquals(il2.get().get(), opr.get().get(), 1e-10);
}
use of net.imglib2.type.numeric.real.DoubleType in project imagej-ops by imagej.
the class UnaryRealTypeMathTest method assertRandomGaussian.
private void assertRandomGaussian(final double i, final double o) {
final DoubleType in = new DoubleType(i);
final DoubleType out = (DoubleType) ops.run(RandomGaussian.class, in.createVariable(), in);
assertEquals(o, out.get(), 0);
}
Aggregations