use of net.imglib2.algorithm.neighborhood.DiamondShape in project imagej-ops by imagej.
the class ErosionTest method testSingleErodeFull.
@Test
public void testSingleErodeFull() {
final Shape shape = new DiamondShape(1);
@SuppressWarnings("unchecked") final Img<ByteType> out1 = (Img<ByteType>) ops.run(DefaultErode.class, Img.class, in, shape, true);
final Img<ByteType> out2 = Erosion.erodeFull(in, shape, 1);
assertIterationsEqual(out1, out2);
}
use of net.imglib2.algorithm.neighborhood.DiamondShape in project imagej-ops by imagej.
the class ErosionTest method testSingleErodeBitType.
@Test
public void testSingleErodeBitType() {
final Shape shape = new DiamondShape(1);
@SuppressWarnings("unchecked") final Img<BitType> out1 = (Img<BitType>) ops.run(DefaultErode.class, Img.class, bitIn, shape, false);
final Img<BitType> out2 = Erosion.erode(bitIn, shape, 1);
final Cursor<BitType> c1 = out1.cursor();
final Cursor<BitType> c2 = out2.cursor();
while (c1.hasNext()) assertEquals(c1.next().get(), c2.next().get());
}
use of net.imglib2.algorithm.neighborhood.DiamondShape in project imagej-ops by imagej.
the class ErosionTest method testSingleErode.
@Test
public void testSingleErode() {
final Shape shape = new DiamondShape(1);
@SuppressWarnings("unchecked") final Img<ByteType> out1 = (Img<ByteType>) ops.run(DefaultErode.class, Img.class, in, shape, false);
final Img<ByteType> out2 = Erosion.erode(in, shape, 1);
assertIterationsEqual(out1, out2);
}
use of net.imglib2.algorithm.neighborhood.DiamondShape 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.DiamondShape 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