use of net.imglib2.type.numeric.integer.ByteType in project imagej-ops by imagej.
the class LocalThresholdTest method testLocalSauvolaResultsConsistency.
/**
* @see LocalSauvolaThresholdIntegral
* @see LocalSauvolaThreshold
*/
@Test
public void testLocalSauvolaResultsConsistency() {
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(LocalSauvolaThreshold.class, out2, normalizedIn, new RectangleShape(2, false), new OutOfBoundsMirrorFactory<ByteType, Img<ByteType>>(Boundary.SINGLE), 0.5, 0.5);
// Integral image-based implementation
ops.run(LocalSauvolaThresholdIntegral.class, out3, normalizedIn, new RectangleShape(2, false), new OutOfBoundsMirrorFactory<ByteType, Img<ByteType>>(Boundary.SINGLE), 0.5, 0.5);
testIterableIntervalSimilarity(out2, out3);
}
use of net.imglib2.type.numeric.integer.ByteType in project imagej-ops by imagej.
the class LocalThresholdTest method testLocalIsoDataThreshold.
/**
* @see LocalIsoDataThreshold
*/
@Test
public void testLocalIsoDataThreshold() {
// NB: Test fails for RectangleShapes of span 1
ops.run(IsoData.class, out, in, new RectangleShape(2, false), new OutOfBoundsMirrorFactory<ByteType, Img<ByteType>>(Boundary.SINGLE));
assertEquals(true, out.firstElement().get());
}
use of net.imglib2.type.numeric.integer.ByteType in project imagej-ops by imagej.
the class LocalThresholdTest method testLocalPercentileThreshold.
/**
* @see LocalPercentileThreshold
*/
@Test
public void testLocalPercentileThreshold() {
ops.run(Percentile.class, out, in, new RectangleShape(1, false), new OutOfBoundsMirrorFactory<ByteType, Img<ByteType>>(Boundary.SINGLE));
assertEquals(false, out.firstElement().get());
}
use of net.imglib2.type.numeric.integer.ByteType in project imagej-ops by imagej.
the class LocalThresholdTest method testLocalHuangThreshold.
/**
* @see LocalHuangThreshold
*/
@Test
public void testLocalHuangThreshold() {
ops.run(Huang.class, out, in, new RectangleShape(1, false), new OutOfBoundsMirrorFactory<ByteType, Img<ByteType>>(Boundary.SINGLE));
assertEquals(true, out.firstElement().get());
}
use of net.imglib2.type.numeric.integer.ByteType in project imagej-ops by imagej.
the class LocalThresholdTest method testLocalTriangleThreshold.
/**
* @see LocalTriangleThreshold
*/
@Test
public void testLocalTriangleThreshold() {
ops.run(Triangle.class, out, in, new RectangleShape(1, false), new OutOfBoundsMirrorFactory<ByteType, Img<ByteType>>(Boundary.SINGLE));
assertEquals(false, out.firstElement().get());
}
Aggregations