use of net.imglib2.type.numeric.integer.ByteType in project imagej-ops by imagej.
the class ErosionTest method testListErodeFull.
@Test
public void testListErodeFull() {
final List<Shape> shapes = new ArrayList<>();
shapes.add(new DiamondShape(1));
shapes.add(new DiamondShape(1));
shapes.add(new RectangleShape(1, false));
shapes.add(new HorizontalLineShape(2, 1, false));
final Img<ByteType> out2 = Erosion.erodeFull(in, shapes, 1);
@SuppressWarnings("unchecked") final IterableInterval<ByteType> out1 = (IterableInterval<ByteType>) ops.run(ListErode.class, IterableInterval.class, in, shapes, true);
assertIterationsEqual(out1, out2);
}
use of net.imglib2.type.numeric.integer.ByteType in project imagej-ops by imagej.
the class ErosionTest method testListErode.
// @Test
public void testListErode() {
final List<Shape> shapes = new ArrayList<>();
shapes.add(new DiamondShape(1));
shapes.add(new DiamondShape(1));
shapes.add(new RectangleShape(1, false));
shapes.add(new HorizontalLineShape(2, 1, false));
final Img<ByteType> out2 = in.copy();
Erosion.erode(Views.extendValue(in, new ByteType((byte) -128)), out2, shapes, 1);
@SuppressWarnings("unchecked") final IterableInterval<ByteType> out1 = (IterableInterval<ByteType>) ops.run(ListErode.class, IterableInterval.class, in, shapes, false);
assertIterationsEqual(out1, out2);
}
use of net.imglib2.type.numeric.integer.ByteType in project imagej-ops by imagej.
the class OpeningTest method testSingleOpen.
@Test
public void testSingleOpen() {
final Shape shape = new DiamondShape(1);
final List<Shape> shapes = Arrays.asList(shape);
@SuppressWarnings("unchecked") final Img<ByteType> out1 = (Img<ByteType>) ops.run(ListOpen.class, Img.class, in, shapes);
final Img<ByteType> out2 = Opening.open(in, shape, 1);
assertIterationsEqual(out2, out1);
}
use of net.imglib2.type.numeric.integer.ByteType in project imagej-ops by imagej.
the class TopHatTest method testSingleTopHat.
@Test
public void testSingleTopHat() {
final Shape shape = new DiamondShape(1);
final List<Shape> shapes = Arrays.asList(shape);
@SuppressWarnings("unchecked") final Img<ByteType> out1 = (Img<ByteType>) ops.run(ListTopHat.class, Img.class, in, shapes);
final Img<ByteType> out2 = TopHat.topHat(in, shape, 1);
assertIterationsEqual(out2, out1);
}
use of net.imglib2.type.numeric.integer.ByteType 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());
}
}
Aggregations