use of net.imglib2.algorithm.neighborhood.DiamondShape in project imagej-ops by imagej.
the class LocalThresholdTest method testOpMethods.
/**
* Test whether parameters for ops in {@link ThresholdNamespace} opmethods are
* correctly set.
*/
@Test
public void testOpMethods() {
ops.threshold().localMeanThreshold(out, in, new RectangleShape(3, false), 0.0);
ops.threshold().localMeanThreshold(out, in, new RectangleShape(3, false), new OutOfBoundsMirrorFactory<ByteType, RandomAccessibleInterval<ByteType>>(Boundary.SINGLE), 0.0);
ops.threshold().localMeanThreshold(out, in, new DiamondShape(3), 0.0);
ops.threshold().localMeanThreshold(out, in, new DiamondShape(3), new OutOfBoundsMirrorFactory<ByteType, RandomAccessibleInterval<ByteType>>(Boundary.SINGLE), 0.0);
ops.threshold().localBernsenThreshold(out, in, new RectangleShape(3, false), 1.0, Double.MAX_VALUE * 0.5);
ops.threshold().localBernsenThreshold(out, in, new RectangleShape(3, false), new OutOfBoundsMirrorFactory<ByteType, RandomAccessibleInterval<ByteType>>(Boundary.SINGLE), 1.0, Double.MAX_VALUE * 0.5);
ops.threshold().localContrastThreshold(out, in, new RectangleShape(3, false));
ops.threshold().localContrastThreshold(out, in, new RectangleShape(3, false), new OutOfBoundsMirrorFactory<ByteType, RandomAccessibleInterval<ByteType>>(Boundary.SINGLE));
ops.threshold().localMedianThreshold(out, in, new RectangleShape(3, false), 1.0);
ops.threshold().localMedianThreshold(out, in, new RectangleShape(3, false), new OutOfBoundsMirrorFactory<ByteType, RandomAccessibleInterval<ByteType>>(Boundary.SINGLE), 1.0);
ops.threshold().localMidGreyThreshold(out, in, new RectangleShape(3, false), 1.0);
ops.threshold().localMidGreyThreshold(out, in, new RectangleShape(3, false), new OutOfBoundsMirrorFactory<ByteType, RandomAccessibleInterval<ByteType>>(Boundary.SINGLE), 1.0);
ops.threshold().localNiblackThreshold(out, in, new RectangleShape(3, false), 1.0, 2.0);
ops.threshold().localNiblackThreshold(out, in, new RectangleShape(3, false), new OutOfBoundsMirrorFactory<ByteType, RandomAccessibleInterval<ByteType>>(Boundary.SINGLE), 1.0, 2.0);
ops.threshold().localPhansalkarThreshold(out, in, new RectangleShape(3, false), new OutOfBoundsMirrorFactory<ByteType, RandomAccessibleInterval<ByteType>>(Boundary.SINGLE), 0.25, 0.5);
ops.threshold().localPhansalkarThreshold(out, in, new RectangleShape(3, false));
ops.threshold().localSauvolaThreshold(out, in, new RectangleShape(3, false), new OutOfBoundsMirrorFactory<ByteType, RandomAccessibleInterval<ByteType>>(Boundary.SINGLE), 0.5, 0.5);
ops.threshold().localSauvolaThreshold(out, in, new RectangleShape(3, false));
/* Locally applied global threshold ops */
ops.threshold().huang(out, in, new RectangleShape(3, false), new OutOfBoundsMirrorFactory<ByteType, RandomAccessibleInterval<ByteType>>(Boundary.SINGLE));
ops.threshold().huang(out, in, new RectangleShape(3, false));
ops.threshold().ij1(out, in, new RectangleShape(3, false), new OutOfBoundsMirrorFactory<ByteType, RandomAccessibleInterval<ByteType>>(Boundary.SINGLE));
ops.threshold().ij1(out, in, new RectangleShape(3, false));
ops.threshold().intermodes(out, in, new RectangleShape(3, false), new OutOfBoundsMirrorFactory<ByteType, RandomAccessibleInterval<ByteType>>(Boundary.SINGLE));
ops.threshold().intermodes(out, in, new RectangleShape(3, false));
ops.threshold().isoData(out, in, new RectangleShape(3, false), new OutOfBoundsMirrorFactory<ByteType, RandomAccessibleInterval<ByteType>>(Boundary.SINGLE));
ops.threshold().isoData(out, in, new RectangleShape(3, false));
ops.threshold().li(out, in, new RectangleShape(3, false), new OutOfBoundsMirrorFactory<ByteType, RandomAccessibleInterval<ByteType>>(Boundary.SINGLE));
ops.threshold().li(out, in, new RectangleShape(3, false));
ops.threshold().maxEntropy(out, in, new RectangleShape(3, false), new OutOfBoundsMirrorFactory<ByteType, RandomAccessibleInterval<ByteType>>(Boundary.SINGLE));
ops.threshold().maxEntropy(out, in, new RectangleShape(3, false));
ops.threshold().maxLikelihood(out, in, new RectangleShape(3, false), new OutOfBoundsMirrorFactory<ByteType, RandomAccessibleInterval<ByteType>>(Boundary.SINGLE));
ops.threshold().maxLikelihood(out, in, new RectangleShape(3, false));
ops.threshold().minError(out, in, new RectangleShape(3, false), new OutOfBoundsMirrorFactory<ByteType, RandomAccessibleInterval<ByteType>>(Boundary.SINGLE));
ops.threshold().minError(out, in, new RectangleShape(3, false));
ops.threshold().minimum(out, in, new RectangleShape(3, false), new OutOfBoundsMirrorFactory<ByteType, RandomAccessibleInterval<ByteType>>(Boundary.SINGLE));
ops.threshold().minimum(out, in, new RectangleShape(3, false));
ops.threshold().moments(out, in, new RectangleShape(3, false), new OutOfBoundsMirrorFactory<ByteType, RandomAccessibleInterval<ByteType>>(Boundary.SINGLE));
ops.threshold().moments(out, in, new RectangleShape(3, false));
ops.threshold().otsu(out, in, new RectangleShape(3, false), new OutOfBoundsMirrorFactory<ByteType, RandomAccessibleInterval<ByteType>>(Boundary.SINGLE));
ops.threshold().otsu(out, in, new RectangleShape(3, false));
ops.threshold().percentile(out, in, new RectangleShape(3, false), new OutOfBoundsMirrorFactory<ByteType, RandomAccessibleInterval<ByteType>>(Boundary.SINGLE));
ops.threshold().percentile(out, in, new RectangleShape(3, false));
ops.threshold().renyiEntropy(out, in, new RectangleShape(3, false), new OutOfBoundsMirrorFactory<ByteType, RandomAccessibleInterval<ByteType>>(Boundary.SINGLE));
ops.threshold().renyiEntropy(out, in, new RectangleShape(3, false));
ops.threshold().shanbhag(out, in, new RectangleShape(3, false), new OutOfBoundsMirrorFactory<ByteType, RandomAccessibleInterval<ByteType>>(Boundary.SINGLE));
ops.threshold().shanbhag(out, in, new RectangleShape(3, false));
ops.threshold().triangle(out, in, new RectangleShape(3, false), new OutOfBoundsMirrorFactory<ByteType, RandomAccessibleInterval<ByteType>>(Boundary.SINGLE));
ops.threshold().triangle(out, in, new RectangleShape(3, false));
ops.threshold().yen(out, in, new RectangleShape(3, false), new OutOfBoundsMirrorFactory<ByteType, RandomAccessibleInterval<ByteType>>(Boundary.SINGLE));
ops.threshold().yen(out, in, new RectangleShape(3, false));
ops.threshold().rosin(out, in, new RectangleShape(3, false), new OutOfBoundsMirrorFactory<ByteType, RandomAccessibleInterval<ByteType>>(Boundary.SINGLE));
ops.threshold().rosin(out, in, new RectangleShape(3, false));
}
use of net.imglib2.algorithm.neighborhood.DiamondShape in project imagej-ops by imagej.
the class BlackTopHatTest method testSingleBlackTopHat.
@Test
public void testSingleBlackTopHat() {
final Shape shape = new DiamondShape(1);
final List<Shape> shapes = Arrays.asList(shape);
@SuppressWarnings("unchecked") final Img<ByteType> out1 = (Img<ByteType>) ops.run(ListBlackTopHat.class, Img.class, in, shapes);
final Img<ByteType> out2 = BlackTopHat.blackTopHat(in, shape, 1);
assertIterationsEqual(out2, out1);
}
use of net.imglib2.algorithm.neighborhood.DiamondShape in project imagej-ops by imagej.
the class ClosingTest method testSingleClose.
@Test
public void testSingleClose() {
final Shape shape = new DiamondShape(1);
final List<Shape> shapes = Arrays.asList(shape);
@SuppressWarnings("unchecked") final Img<ByteType> out1 = (Img<ByteType>) ops.run(ListClose.class, Img.class, in, shapes);
final Img<ByteType> out2 = Closing.close(in, shape, 1);
assertIterationsEqual(out2, out1);
}
use of net.imglib2.algorithm.neighborhood.DiamondShape in project imagej-ops by imagej.
the class ClosingTest method testListClose.
@Test
public void testListClose() {
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(ListClose.class, IterableInterval.class, in, shapes);
final Img<ByteType> out2 = Closing.close(in, shapes, 1);
assertIterationsEqual(out2, out1);
}
use of net.imglib2.algorithm.neighborhood.DiamondShape in project imagej-ops by imagej.
the class DilationTest method testListDilateFull.
@Test
public void testListDilateFull() {
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, true);
final Img<ByteType> out2 = Dilation.dilateFull(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());
}
Aggregations