use of net.imglib2.outofbounds.OutOfBoundsMirrorFactory in project imagej-ops by imagej.
the class DefaultCoarsenessFeature method mean.
/**
* Apply mean filter with given size of reactangle shape
*
* @param input
* Input image
* @param i
* Size of rectangle shape
* @return Filered mean image
*/
@SuppressWarnings("unchecked")
private Img<I> mean(final RandomAccessibleInterval<I> input, final int i) {
long[] dims = new long[input.numDimensions()];
input.dimensions(dims);
final byte[] array = new byte[(int) Intervals.numElements(new FinalInterval(dims))];
Img<I> meanImg = (Img<I>) ArrayImgs.unsignedBytes(array, dims);
OutOfBoundsMirrorFactory<ByteType, Img<ByteType>> oobFactory = new OutOfBoundsMirrorFactory<>(Boundary.SINGLE);
ops().run(MeanFilterOp.class, meanImg, input, new RectangleShape(i, true), oobFactory);
return meanImg;
}
use of net.imglib2.outofbounds.OutOfBoundsMirrorFactory 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.outofbounds.OutOfBoundsMirrorFactory 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.outofbounds.OutOfBoundsMirrorFactory 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.outofbounds.OutOfBoundsMirrorFactory 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());
}
Aggregations