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

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

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

Views.collapseNumeric介绍

[英]Collapse the nth dimension of an n -dimensional RandomAccessible<T extends NumericType<T>> into an (n-1)-dimensional RandomAccessible< NumericComposite<T>>
[中]将n维随机可访问的n维折叠成一个(n-1)维随机可访问的<NumericComposite<T>>

代码示例

代码示例来源:origin: imagej/imagej-ops

@Override
public CompositeIntervalView<T, NumericComposite<T>> calculate(RandomAccessibleInterval<T> input) {
  return Views.collapseNumeric(input);
}

代码示例来源:origin: imagej/imagej-ops

@Override
  public CompositeView<T, NumericComposite<T>> calculate(RandomAccessible<T> input) {
    return Views.collapseNumeric(input, numChannels);
  }
}

代码示例来源:origin: net.imglib2/imglib2

/**
 * Compose a list of same {@link Interval} and same {@link NumericType} A
 * {@link RandomAccessibleInterval RandomAccessibleIntervals} into a
 * {@link RandomAccessibleInterval} of some target {@link Type} B using a
 * {@link Converter} from {@link Composite} of A to B.
 *
 * @param components
 * @param composer
 * @param targetType
 * @return
 */
final static public < A extends NumericType< A >, B extends Type< B > > RandomAccessibleInterval< B > composeNumeric(
    final List< RandomAccessibleInterval< A > > components,
    final Converter< NumericComposite< A >, B > composer,
    final B targetType )
{
  return convert(
      Views.collapseNumeric( Views.stack( components ) ),
      composer,
      targetType );
}

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

/**
 * Compose a list of same {@link Interval} and same {@link NumericType} A
 * {@link RandomAccessibleInterval RandomAccessibleIntervals} into a
 * {@link RandomAccessibleInterval} of some target {@link Type} B using a
 * {@link Converter} from {@link Composite} of A to B.
 *
 * @param components
 * @param composer
 * @param targetType
 * @return
 */
final static public < A extends NumericType< A >, B extends Type< B > > RandomAccessibleInterval< B > composeNumeric(
    final List< RandomAccessibleInterval< A > > components,
    final Converter< NumericComposite< A >, B > composer,
    final B targetType )
{
  return convert(
      Views.collapseNumeric( Views.stack( components ) ),
      composer,
      targetType );
}

代码示例来源:origin: net.imglib2/imglib2-algorithm

private static < T extends RealType< T >, U extends ComplexType< U > > RandomAccessibleInterval< U > calculateEigenValuesImpl(
    final RandomAccessibleInterval< T > tensor,
    final RandomAccessibleInterval< U > eigenvalues,
    final EigenValues< T, U > ev )
{
  final Cursor< RealComposite< T > > m = Views.iterable( Views.collapseReal( tensor ) ).cursor();
  final Cursor< NumericComposite< U > > e = Views.iterable( Views.collapseNumeric( eigenvalues ) ).cursor();
  while ( m.hasNext() )
    ev.compute( m.next(), e.next() );
  return eigenvalues;
}

代码示例来源:origin: imagej/imagej-ops

@Test
public void defaultCollapseNumericTest() {
  Img<NativeARGBDoubleType> img = new ArrayImgFactory<NativeARGBDoubleType>().create(new int[] { 10, 10 },
      new NativeARGBDoubleType());
  CompositeIntervalView<NativeARGBDoubleType, NumericComposite<NativeARGBDoubleType>> il2 = Views
      .collapseNumeric((RandomAccessibleInterval<NativeARGBDoubleType>) img);
  CompositeIntervalView<NativeARGBDoubleType, NumericComposite<NativeARGBDoubleType>> opr = ops.transform()
      .collapseNumericView((RandomAccessibleInterval<NativeARGBDoubleType>) img);
  assertEquals(il2.numDimensions(), opr.numDimensions());
  CompositeView<NativeARGBDoubleType, NumericComposite<NativeARGBDoubleType>> il2_2 = Views
      .collapseNumeric((RandomAccessible<NativeARGBDoubleType>) img, 1);
  CompositeView<NativeARGBDoubleType, NumericComposite<NativeARGBDoubleType>> opr_2 = ops.transform()
      .collapseNumericView((RandomAccessible<NativeARGBDoubleType>) img, 1);
  assertEquals(il2_2.numDimensions(), opr_2.numDimensions());
}

相关文章