use of net.imagej.ops.Op in project imagej-ops by imagej.
the class InvertTest method assertIntegerInvert.
private <T extends IntegerType<T>> void assertIntegerInvert(final Img<T> in, final Img<T> out) {
final Op op = ops.op(Ops.Image.Invert.class, out, in);
assertSame(InvertIIInteger.class, op.getClass());
op.run();
Cursor<T> inCursor = in.localizingCursor();
Cursor<T> outCursor = out.localizingCursor();
while (inCursor.hasNext()) {
inCursor.fwd();
outCursor.fwd();
}
integerCompare(in, out, null, null);
}
use of net.imagej.ops.Op in project imagej-ops by imagej.
the class JoinTest method testJoinComputerAndInplace.
@Test
public void testJoinComputerAndInplace() {
final Op op = ops.op(DefaultJoinComputerAndInplace.class, out, in, computerOp, inplaceOp);
op.run();
// test
final Cursor<ByteType> c = out.cursor();
while (c.hasNext()) {
assertEquals(2, c.next().get());
}
}
use of net.imagej.ops.Op in project imagej-ops by imagej.
the class MapTest method testIterable.
@Test
public void testIterable() {
final Img<ByteType> in = generateByteArrayTestImg(true, 10, 10);
final Op nullary = Computers.nullary(ops, Ops.Math.Zero.class, ByteType.class);
ops.run(MapNullaryIterable.class, in, nullary);
for (final ByteType ps : in) assertEquals(ps.get(), 0);
}
Aggregations