本文整理了Java中net.imglib2.view.Views.expandValue()
方法的一些代码示例,展示了Views.expandValue()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Views.expandValue()
方法的具体详情如下:
包路径:net.imglib2.view.Views
类名称:Views
方法名:expandValue
[英]Expand a RandomAccessibleInterval as specified by border. source will be extended with a constant value specified by the caller.
[中]按border指定的方式展开RandomAccessibleInterval。源将使用调用者指定的常量值进行扩展。
代码示例来源:origin: imglib/imglib2
/**
* Expand a RandomAccessibleInterval as specified by border. source will be
* extended with a constant value specified by the caller.
*
* @param source
* the interval to expand.
* @param value
* Constant extension of source.
* @return Expansion of the {@link RandomAccessibleInterval} source as
* specified by t and border.
*/
public static < T extends IntegerType< T > > IntervalView< T > expandValue( final RandomAccessibleInterval< T > source, final long value, final long... border )
{
final T extension = Util.getTypeFromInterval( source ).createVariable();
extension.setInteger( value );
return Views.expandValue( source, extension, border );
}
代码示例来源:origin: imglib/imglib2
/**
* Expand a RandomAccessibleInterval as specified by border. source will be
* extended with a constant value specified by the caller.
*
* @param source
* the interval to expand.
* @param value
* Constant extension of source.
* @return Expansion of the {@link RandomAccessibleInterval} source as
* specified by t and border.
*/
public static < T extends BooleanType< T > > IntervalView< T > expandValue( final RandomAccessibleInterval< T > source, final boolean value, final long... border )
{
final T extension = Util.getTypeFromInterval( source ).createVariable();
extension.set( value );
return Views.expandValue( source, extension, border );
}
代码示例来源:origin: imglib/imglib2
/**
* Expand a RandomAccessibleInterval as specified by border. source will be
* extended with a constant value specified by the caller.
*
* @param source
* the interval to expand.
* @param value
* Constant extension of source.
* @return Expansion of the {@link RandomAccessibleInterval} source as
* specified by t and border.
*/
public static < T extends RealType< T > > IntervalView< T > expandValue( final RandomAccessibleInterval< T > source, final float value, final long... border )
{
final T extension = Util.getTypeFromInterval( source ).createVariable();
extension.setReal( value );
return Views.expandValue( source, extension, border );
}
代码示例来源:origin: imglib/imglib2
/**
* Expand a RandomAccessibleInterval as specified by border. source will be
* extended with a constant value specified by the caller.
*
* @param source
* the interval to expand.
* @param value
* Constant extension of source.
* @return Expansion of the {@link RandomAccessibleInterval} source as
* specified by t and border.
*/
public static < T extends RealType< T > > IntervalView< T > expandValue( final RandomAccessibleInterval< T > source, final double value, final long... border )
{
final T extension = Util.getTypeFromInterval( source ).createVariable();
extension.setReal( value );
return Views.expandValue( source, extension, border );
}
代码示例来源:origin: imglib/imglib2
/**
* Expand a RandomAccessibleInterval as specified by border. source will be
* extended with a constant value specified by the caller.
*
* @param source
* the interval to expand.
* @param value
* Constant extension of source.
* @return Expansion of the {@link RandomAccessibleInterval} source as
* specified by t and border.
*/
public static < T extends IntegerType< T > > IntervalView< T > expandValue( final RandomAccessibleInterval< T > source, final int value, final long... border )
{
final T extension = Util.getTypeFromInterval( source ).createVariable();
extension.setInteger( value );
return Views.expandValue( source, extension, border );
}
代码示例来源:origin: imglib/imglib2
private static void testExpandFloatingPoint(
final long[] dims,
final double insideValue,
final double doubleExtension,
final float floatExtension,
final long... border) {
final RandomAccessibleInterval< DoubleType > rai = ArrayImgs.doubles( dims );
Views.iterable( rai ).forEach( px -> px.setReal( insideValue ) );
testValueExtended(
Views.expandValue( rai, doubleExtension, border ),
rai,
Intervals.expand( rai, border ),
new DoubleType( insideValue ),
new DoubleType( doubleExtension ) );
testValueExtended(
Views.expandValue( rai, floatExtension, border ),
rai,
Intervals.expand( rai, border ),
new DoubleType( insideValue ),
new DoubleType( floatExtension ) );
}
代码示例来源:origin: imglib/imglib2
private static void testExpandInteger(
final long[] dims,
final long insideValue,
final long longExtension,
final int intExtension,
final long... border) {
final RandomAccessibleInterval< LongType > rai = ArrayImgs.longs( dims );
Views.iterable( rai ).forEach( px -> px.setInteger( insideValue ) );
testValueExtended(
Views.expandValue( rai, longExtension, border ),
rai,
Intervals.expand( rai, border ),
new LongType( insideValue ),
new LongType( longExtension ) );
testValueExtended(
Views.expandValue( rai, intExtension, border ),
rai,
Intervals.expand( rai, border ),
new LongType( insideValue ),
new LongType( intExtension ) );
}
代码示例来源:origin: imglib/imglib2
private static void testExpandBoolean(
final long[] dims,
final boolean insideValue,
final boolean extension,
final long... border) {
final RandomAccessibleInterval<BitType> rai = ArrayImgs.bits( dims );
Views.iterable( rai ).forEach( px -> px.set( insideValue ) );
testValueExtended(
Views.expandValue( rai, extension, border ),
rai,
Intervals.expand( rai, border ),
new BitType( insideValue ),
new BitType( extension ) );
}
内容来源于网络,如有侵权,请联系作者删除!