use of net.imagej.ops.Op in project imagej-ops by imagej.
the class MapNeighborhoodTest method testMapNeighoodsWrongArgs.
@Test
@Ignore("There is no way to throw an error for invalid typed computers at the moment.")
public void testMapNeighoodsWrongArgs() {
final Op mapOp = ops.op(DefaultMapNeighborhood.class, out, in, new RectangleShape(1, false), new Increment());
// ClassCastException will be thrown
mapOp.run();
}
use of net.imagej.ops.Op in project imagej-ops by imagej.
the class MapNeighborhoodTest method testMapNeighborhoodsAccess.
/**
* Test if every neighborhood pixel of the image was really accessed during
* the map operation.
*
* @see DefaultMapNeighborhood
*/
@Test
public void testMapNeighborhoodsAccess() {
final Op mapOp = ops.op(DefaultMapNeighborhood.class, out, in, new RectangleShape(1, false), new CountNeighbors());
mapOp.run();
for (final ByteType t : out) {
assertEquals(9, t.get());
}
}
use of net.imagej.ops.Op in project imagej-ops by imagej.
the class MapNeighborhoodTest method testMapNeighborhoodsWithCenterAccess.
/**
* Test if every neighborhood pixel of the image was really accessed during
* the map operation.
*
* @see MapNeighborhoodWithCenter
*/
@Test
public void testMapNeighborhoodsWithCenterAccess() {
final Op mapOp = ops.op(MapNeighborhoodWithCenter.class, out, in, new RectangleShape(1, false), new CountNeighborsWithCenter());
mapOp.run();
for (final ByteType t : out) {
assertEquals(9, t.get());
}
for (final ByteType t : in) {
assertEquals(9, t.get());
}
}
use of net.imagej.ops.Op in project imagej-ops by imagej.
the class JoinTest method testJoinInplaceAndComputer.
@Test
public void testJoinInplaceAndComputer() {
final Op op = ops.op(DefaultJoinInplaceAndComputer.class, out, in, inplaceOp, computerOp);
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 JoinTest method testJoin2Inplaces.
@Test
public void testJoin2Inplaces() {
final Op op = ops.op(DefaultJoin2Inplaces.class, in, inplaceOp, inplaceOp);
op.run();
// test
final Cursor<ByteType> c = in.cursor();
while (c.hasNext()) {
assertEquals(2, c.next().get());
}
}
Aggregations