本文整理了Java中net.imglib2.view.Views.extendRandom()
方法的一些代码示例,展示了Views.extendRandom()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Views.extendRandom()
方法的具体详情如下:
包路径:net.imglib2.view.Views
类名称:Views
方法名:extendRandom
[英]Extend a RandomAccessibleInterval with a random-value out-of-bounds strategy.
[中]使用随机值越界策略扩展RandomAccessibleInterval。
代码示例来源:origin: imagej/imagej-ops
@Override
public ExtendedRandomAccessibleInterval<T, F> calculate(F input) {
return Views.extendRandom(input, min, max);
}
}
代码示例来源:origin: net.imglib2/imglib2
/**
* Expand a RandomAccessibleInterval as specified by border. source will be
* extended with a random-value out-of-bounds strategy.
*
* @param source
* the interval to expand.
* @param min
* the minimal random value
* @param max
* the maximal random value
* @return Expansion of the {@link RandomAccessibleInterval} source as
* specified by min, max, and border.
*/
public static < T extends RealType< T > > IntervalView< T > expandRandom( final RandomAccessibleInterval< T > source, final double min, final double max, final long... border )
{
return interval( extendRandom( source, min, max ), Intervals.expand( source, border ) );
}
代码示例来源:origin: imglib/imglib2
/**
* Expand a RandomAccessibleInterval as specified by border. source will be
* extended with a random-value out-of-bounds strategy.
*
* @param source
* the interval to expand.
* @param min
* the minimal random value
* @param max
* the maximal random value
* @return Expansion of the {@link RandomAccessibleInterval} source as
* specified by min, max, and border.
*/
public static < T extends RealType< T > > IntervalView< T > expandRandom( final RandomAccessibleInterval< T > source, final double min, final double max, final long... border )
{
return interval( extendRandom( source, min, max ), Intervals.expand( source, border ) );
}
代码示例来源:origin: imagej/imagej-ops
@Test
public void extendRandomTest() {
Img<DoubleType> img = new ArrayImgFactory<DoubleType>().create(new int[] { 10, 10 }, new DoubleType());
OutOfBounds<DoubleType> il2 = Views.extendRandom(img, 0, 0).randomAccess();
OutOfBounds<DoubleType> opr = ops.transform().extendRandomView(img, 0, 0).randomAccess();
il2.setPosition(new int[] { -1, -1 });
opr.setPosition(new int[] { -1, -1 });
assertEquals(il2.get().get(), opr.get().get(), 1e-10);
il2.setPosition(new int[] { 11, 11 });
opr.setPosition(new int[] { 11, 11 });
assertEquals(il2.get().get(), opr.get().get(), 1e-10);
}
内容来源于网络,如有侵权,请联系作者删除!