use of net.imglib2.algorithm.neighborhood.RectangleShape in project imagej-ops by imagej.
the class LocalThresholdTest method testLocalMomentsThreshold.
/**
* @see LocalMomentsThreshold
*/
@Test
public void testLocalMomentsThreshold() {
ops.run(Moments.class, out, in, new RectangleShape(1, false), new OutOfBoundsMirrorFactory<ByteType, Img<ByteType>>(Boundary.SINGLE));
assertEquals(false, out.firstElement().get());
}
use of net.imglib2.algorithm.neighborhood.RectangleShape in project imagej-ops by imagej.
the class LocalThresholdTest method testLocalPhansalkarResultsConsistency.
/**
* @see LocalPhansalkarThresholdIntegral
* @see LocalPhansalkarThreshold
*/
@Test
public void testLocalPhansalkarResultsConsistency() {
Img<BitType> out2 = null;
Img<BitType> out3 = null;
try {
out2 = in.factory().imgFactory(new BitType()).create(in, new BitType());
out3 = in.factory().imgFactory(new BitType()).create(in, new BitType());
} catch (IncompatibleTypeException exc) {
exc.printStackTrace();
}
// Default implementation
ops.run(LocalPhansalkarThreshold.class, out2, normalizedIn, new RectangleShape(2, false), new OutOfBoundsMirrorFactory<ByteType, Img<ByteType>>(Boundary.SINGLE), 0.25, 0.5);
// Integral image-based implementation
ops.run(LocalPhansalkarThresholdIntegral.class, out3, normalizedIn, new RectangleShape(2, false), new OutOfBoundsMirrorFactory<ByteType, Img<ByteType>>(Boundary.SINGLE), 0.25, 0.5);
testIterableIntervalSimilarity(out2, out3);
}
use of net.imglib2.algorithm.neighborhood.RectangleShape in project imagej-ops by imagej.
the class LocalThresholdTest method testLocalOtsuThreshold.
/**
* @see LocalOtsuThreshold
*/
@Test
public void testLocalOtsuThreshold() {
ops.run(Otsu.class, out, in, new RectangleShape(1, false), new OutOfBoundsMirrorFactory<ByteType, Img<ByteType>>(Boundary.SINGLE));
assertEquals(false, out.firstElement().get());
}
use of net.imglib2.algorithm.neighborhood.RectangleShape in project imagej-ops by imagej.
the class LocalThresholdTest method testLocalRenyiEntropyThreshold.
/**
* @see LocalRenyiEntropyThreshold
*/
@Test
public void testLocalRenyiEntropyThreshold() {
ops.run(RenyiEntropy.class, out, in, new RectangleShape(1, false), new OutOfBoundsMirrorFactory<ByteType, Img<ByteType>>(Boundary.SINGLE));
assertEquals(false, out.firstElement().get());
}
use of net.imglib2.algorithm.neighborhood.RectangleShape in project imagej-ops by imagej.
the class LocalThresholdTest method testLocalNiblackResultsConsistency.
/**
* @see LocalNiblackThresholdIntegral
* @see LocalNiblackThreshold
*/
@Test
public void testLocalNiblackResultsConsistency() {
Img<BitType> out2 = null;
Img<BitType> out3 = null;
try {
out2 = in.factory().imgFactory(new BitType()).create(in, new BitType());
out3 = in.factory().imgFactory(new BitType()).create(in, new BitType());
} catch (IncompatibleTypeException exc) {
exc.printStackTrace();
}
// Default implementation
ops.run(LocalNiblackThreshold.class, out2, normalizedIn, new RectangleShape(2, false), new OutOfBoundsMirrorFactory<ByteType, Img<ByteType>>(Boundary.SINGLE), 0.2, 1.0);
// Integral image-based implementation
ops.run(LocalNiblackThresholdIntegral.class, out3, normalizedIn, new RectangleShape(2, false), new OutOfBoundsMirrorFactory<ByteType, Img<ByteType>>(Boundary.SINGLE), 0.2, 1.0);
testIterableIntervalSimilarity(out2, out3);
}
Aggregations