use of net.imglib2.algorithm.neighborhood.RectangleShape in project imagej-ops by imagej.
the class LocalThresholdTest method testLocalShanbhagThreshold.
/**
* @see LocalShanbhagThreshold
*/
@Test
public void testLocalShanbhagThreshold() {
ops.run(Shanbhag.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 testLocalNiblackThresholdIntegral.
/**
* @see LocalNiblackThresholdIntegral
*/
@Test
public void testLocalNiblackThresholdIntegral() {
ops.run(LocalNiblackThresholdIntegral.class, out, in, new RectangleShape(3, false), new OutOfBoundsMirrorFactory<ByteType, Img<ByteType>>(Boundary.SINGLE), 0.2, 0.0);
assertEquals(true, out.firstElement().get());
}
use of net.imglib2.algorithm.neighborhood.RectangleShape in project imagej-ops by imagej.
the class LocalThresholdTest method testLocalNiblackThreshold.
/**
* @see LocalNiblackThreshold
*/
@Test
public void testLocalNiblackThreshold() {
ops.run(LocalNiblackThreshold.class, out, in, new RectangleShape(1, false), new OutOfBoundsMirrorFactory<ByteType, Img<ByteType>>(Boundary.SINGLE), 0.2, 0.0);
assertEquals(true, out.firstElement().get());
}
use of net.imglib2.algorithm.neighborhood.RectangleShape in project imagej-ops by imagej.
the class LocalThresholdTest method testLocalLiThreshold.
/**
* @see LocalLiThreshold
*/
@Test
public void testLocalLiThreshold() {
ops.run(Li.class, out, in, new RectangleShape(1, false), new OutOfBoundsMirrorFactory<ByteType, Img<ByteType>>(Boundary.SINGLE));
assertEquals(true, out.firstElement().get());
}
use of net.imglib2.algorithm.neighborhood.RectangleShape in project imagej-ops by imagej.
the class LocalThresholdTest method testLocalMeanResultsConsistency.
/**
* @see LocalMeanThresholdIntegral
* @see LocalMeanThreshold
*/
@Test
public void testLocalMeanResultsConsistency() {
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(LocalMeanThreshold.class, out2, in, new RectangleShape(2, false), new OutOfBoundsMirrorFactory<ByteType, Img<ByteType>>(Boundary.SINGLE), 0.0);
// Integral image-based implementation
ops.run(LocalMeanThresholdIntegral.class, out3, in, new RectangleShape(2, false), new OutOfBoundsMirrorFactory<ByteType, Img<ByteType>>(Boundary.SINGLE), 0.0);
testIterableIntervalSimilarity(out2, out3);
}
Aggregations