use of net.imglib2.exception.IncompatibleTypeException 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.exception.IncompatibleTypeException 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