net.imglib2.view.Views.expandValue()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(107)

本文整理了Java中net.imglib2.view.Views.expandValue()方法的一些代码示例,展示了Views.expandValue()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Views.expandValue()方法的具体详情如下:
包路径:net.imglib2.view.Views
类名称:Views
方法名:expandValue

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

  1. /**
  2. * Expand a RandomAccessibleInterval as specified by border. source will be
  3. * extended with a constant value specified by the caller.
  4. *
  5. * @param source
  6. * the interval to expand.
  7. * @param value
  8. * Constant extension of source.
  9. * @return Expansion of the {@link RandomAccessibleInterval} source as
  10. * specified by t and border.
  11. */
  12. public static < T extends IntegerType< T > > IntervalView< T > expandValue( final RandomAccessibleInterval< T > source, final long value, final long... border )
  13. {
  14. final T extension = Util.getTypeFromInterval( source ).createVariable();
  15. extension.setInteger( value );
  16. return Views.expandValue( source, extension, border );
  17. }

代码示例来源:origin: imglib/imglib2

  1. /**
  2. * Expand a RandomAccessibleInterval as specified by border. source will be
  3. * extended with a constant value specified by the caller.
  4. *
  5. * @param source
  6. * the interval to expand.
  7. * @param value
  8. * Constant extension of source.
  9. * @return Expansion of the {@link RandomAccessibleInterval} source as
  10. * specified by t and border.
  11. */
  12. public static < T extends BooleanType< T > > IntervalView< T > expandValue( final RandomAccessibleInterval< T > source, final boolean value, final long... border )
  13. {
  14. final T extension = Util.getTypeFromInterval( source ).createVariable();
  15. extension.set( value );
  16. return Views.expandValue( source, extension, border );
  17. }

代码示例来源:origin: imglib/imglib2

  1. /**
  2. * Expand a RandomAccessibleInterval as specified by border. source will be
  3. * extended with a constant value specified by the caller.
  4. *
  5. * @param source
  6. * the interval to expand.
  7. * @param value
  8. * Constant extension of source.
  9. * @return Expansion of the {@link RandomAccessibleInterval} source as
  10. * specified by t and border.
  11. */
  12. public static < T extends RealType< T > > IntervalView< T > expandValue( final RandomAccessibleInterval< T > source, final float value, final long... border )
  13. {
  14. final T extension = Util.getTypeFromInterval( source ).createVariable();
  15. extension.setReal( value );
  16. return Views.expandValue( source, extension, border );
  17. }

代码示例来源:origin: imglib/imglib2

  1. /**
  2. * Expand a RandomAccessibleInterval as specified by border. source will be
  3. * extended with a constant value specified by the caller.
  4. *
  5. * @param source
  6. * the interval to expand.
  7. * @param value
  8. * Constant extension of source.
  9. * @return Expansion of the {@link RandomAccessibleInterval} source as
  10. * specified by t and border.
  11. */
  12. public static < T extends RealType< T > > IntervalView< T > expandValue( final RandomAccessibleInterval< T > source, final double value, final long... border )
  13. {
  14. final T extension = Util.getTypeFromInterval( source ).createVariable();
  15. extension.setReal( value );
  16. return Views.expandValue( source, extension, border );
  17. }

代码示例来源:origin: imglib/imglib2

  1. /**
  2. * Expand a RandomAccessibleInterval as specified by border. source will be
  3. * extended with a constant value specified by the caller.
  4. *
  5. * @param source
  6. * the interval to expand.
  7. * @param value
  8. * Constant extension of source.
  9. * @return Expansion of the {@link RandomAccessibleInterval} source as
  10. * specified by t and border.
  11. */
  12. public static < T extends IntegerType< T > > IntervalView< T > expandValue( final RandomAccessibleInterval< T > source, final int value, final long... border )
  13. {
  14. final T extension = Util.getTypeFromInterval( source ).createVariable();
  15. extension.setInteger( value );
  16. return Views.expandValue( source, extension, border );
  17. }

代码示例来源:origin: imglib/imglib2

  1. private static void testExpandFloatingPoint(
  2. final long[] dims,
  3. final double insideValue,
  4. final double doubleExtension,
  5. final float floatExtension,
  6. final long... border) {
  7. final RandomAccessibleInterval< DoubleType > rai = ArrayImgs.doubles( dims );
  8. Views.iterable( rai ).forEach( px -> px.setReal( insideValue ) );
  9. testValueExtended(
  10. Views.expandValue( rai, doubleExtension, border ),
  11. rai,
  12. Intervals.expand( rai, border ),
  13. new DoubleType( insideValue ),
  14. new DoubleType( doubleExtension ) );
  15. testValueExtended(
  16. Views.expandValue( rai, floatExtension, border ),
  17. rai,
  18. Intervals.expand( rai, border ),
  19. new DoubleType( insideValue ),
  20. new DoubleType( floatExtension ) );
  21. }

代码示例来源:origin: imglib/imglib2

  1. private static void testExpandInteger(
  2. final long[] dims,
  3. final long insideValue,
  4. final long longExtension,
  5. final int intExtension,
  6. final long... border) {
  7. final RandomAccessibleInterval< LongType > rai = ArrayImgs.longs( dims );
  8. Views.iterable( rai ).forEach( px -> px.setInteger( insideValue ) );
  9. testValueExtended(
  10. Views.expandValue( rai, longExtension, border ),
  11. rai,
  12. Intervals.expand( rai, border ),
  13. new LongType( insideValue ),
  14. new LongType( longExtension ) );
  15. testValueExtended(
  16. Views.expandValue( rai, intExtension, border ),
  17. rai,
  18. Intervals.expand( rai, border ),
  19. new LongType( insideValue ),
  20. new LongType( intExtension ) );
  21. }

代码示例来源:origin: imglib/imglib2

  1. private static void testExpandBoolean(
  2. final long[] dims,
  3. final boolean insideValue,
  4. final boolean extension,
  5. final long... border) {
  6. final RandomAccessibleInterval<BitType> rai = ArrayImgs.bits( dims );
  7. Views.iterable( rai ).forEach( px -> px.set( insideValue ) );
  8. testValueExtended(
  9. Views.expandValue( rai, extension, border ),
  10. rai,
  11. Intervals.expand( rai, border ),
  12. new BitType( insideValue ),
  13. new BitType( extension ) );
  14. }

相关文章