use of net.imglib2.algorithm.neighborhood.HorizontalLineShape in project imagej-ops by imagej.
the class DilationTest method testListDilate.
@Test
public void testListDilate() {
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));
@SuppressWarnings("unchecked") final IterableInterval<ByteType> out1 = (IterableInterval<ByteType>) ops.run(ListDilate.class, IterableInterval.class, in, shapes, false);
final Img<ByteType> out2 = Dilation.dilate(in, shapes, 1);
final Cursor<ByteType> c1 = out1.cursor();
final Cursor<ByteType> c2 = out2.cursor();
while (c1.hasNext()) assertEquals(c1.next().get(), c2.next().get());
}
use of net.imglib2.algorithm.neighborhood.HorizontalLineShape in project imagej-ops by imagej.
the class OpeningTest method testListOpen.
@Test
public void testListOpen() {
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));
@SuppressWarnings("unchecked") final IterableInterval<ByteType> out1 = (IterableInterval<ByteType>) ops.run(ListOpen.class, IterableInterval.class, in, shapes);
final Img<ByteType> out2 = Opening.open(in, shapes, 1);
assertIterationsEqual(out2, out1);
}
use of net.imglib2.algorithm.neighborhood.HorizontalLineShape in project imagej-ops by imagej.
the class TopHatTest method testListTopHat.
@Test
public void testListTopHat() {
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));
@SuppressWarnings("unchecked") final IterableInterval<ByteType> out1 = (IterableInterval<ByteType>) ops.run(ListTopHat.class, IterableInterval.class, in, shapes);
final Img<ByteType> out2 = TopHat.topHat(in, shapes, 1);
assertIterationsEqual(out2, out1);
}
Aggregations