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

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

本文整理了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

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

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

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

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

  1. /**
  2. * Compose a list of same {@link Interval} and same {@link NumericType} A
  3. * {@link RandomAccessibleInterval RandomAccessibleIntervals} into a
  4. * {@link RandomAccessibleInterval} of some target {@link Type} B using a
  5. * {@link Converter} from {@link Composite} of A to B.
  6. *
  7. * @param components
  8. * @param composer
  9. * @param targetType
  10. * @return
  11. */
  12. final static public < A extends NumericType< A >, B extends Type< B > > RandomAccessibleInterval< B > composeNumeric(
  13. final List< RandomAccessibleInterval< A > > components,
  14. final Converter< NumericComposite< A >, B > composer,
  15. final B targetType )
  16. {
  17. return convert(
  18. Views.collapseNumeric( Views.stack( components ) ),
  19. composer,
  20. targetType );
  21. }

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

  1. /**
  2. * Compose a list of same {@link Interval} and same {@link NumericType} A
  3. * {@link RandomAccessibleInterval RandomAccessibleIntervals} into a
  4. * {@link RandomAccessibleInterval} of some target {@link Type} B using a
  5. * {@link Converter} from {@link Composite} of A to B.
  6. *
  7. * @param components
  8. * @param composer
  9. * @param targetType
  10. * @return
  11. */
  12. final static public < A extends NumericType< A >, B extends Type< B > > RandomAccessibleInterval< B > composeNumeric(
  13. final List< RandomAccessibleInterval< A > > components,
  14. final Converter< NumericComposite< A >, B > composer,
  15. final B targetType )
  16. {
  17. return convert(
  18. Views.collapseNumeric( Views.stack( components ) ),
  19. composer,
  20. targetType );
  21. }

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

  1. private static < T extends RealType< T >, U extends ComplexType< U > > RandomAccessibleInterval< U > calculateEigenValuesImpl(
  2. final RandomAccessibleInterval< T > tensor,
  3. final RandomAccessibleInterval< U > eigenvalues,
  4. final EigenValues< T, U > ev )
  5. {
  6. final Cursor< RealComposite< T > > m = Views.iterable( Views.collapseReal( tensor ) ).cursor();
  7. final Cursor< NumericComposite< U > > e = Views.iterable( Views.collapseNumeric( eigenvalues ) ).cursor();
  8. while ( m.hasNext() )
  9. ev.compute( m.next(), e.next() );
  10. return eigenvalues;
  11. }

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

  1. @Test
  2. public void defaultCollapseNumericTest() {
  3. Img<NativeARGBDoubleType> img = new ArrayImgFactory<NativeARGBDoubleType>().create(new int[] { 10, 10 },
  4. new NativeARGBDoubleType());
  5. CompositeIntervalView<NativeARGBDoubleType, NumericComposite<NativeARGBDoubleType>> il2 = Views
  6. .collapseNumeric((RandomAccessibleInterval<NativeARGBDoubleType>) img);
  7. CompositeIntervalView<NativeARGBDoubleType, NumericComposite<NativeARGBDoubleType>> opr = ops.transform()
  8. .collapseNumericView((RandomAccessibleInterval<NativeARGBDoubleType>) img);
  9. assertEquals(il2.numDimensions(), opr.numDimensions());
  10. CompositeView<NativeARGBDoubleType, NumericComposite<NativeARGBDoubleType>> il2_2 = Views
  11. .collapseNumeric((RandomAccessible<NativeARGBDoubleType>) img, 1);
  12. CompositeView<NativeARGBDoubleType, NumericComposite<NativeARGBDoubleType>> opr_2 = ops.transform()
  13. .collapseNumericView((RandomAccessible<NativeARGBDoubleType>) img, 1);
  14. assertEquals(il2_2.numDimensions(), opr_2.numDimensions());
  15. }

相关文章