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

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

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

Views.extendMirrorDouble介绍

[英]Extend a RandomAccessibleInterval with a mirroring out-of-bounds strategy. Boundary pixels are repeated.
[中]使用镜像越界策略扩展可随机访问的范围。边界像素重复。

代码示例

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

  1. @Override
  2. public ExtendedRandomAccessibleInterval<T, F> calculate(F input) {
  3. return Views.extendMirrorDouble(input);
  4. }

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

  1. public ExtendMirrorDouble(final RandomAccessibleInterval<T> img) {
  2. super(Views.interval(Views.extendMirrorDouble(img), img));
  3. }

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

  1. /**
  2. * Expand a RandomAccessibleInterval as specified by border. Out of bounds
  3. * pixels will be sampled by mirroring source. Boundary pixels are repeated.
  4. *
  5. * @param source
  6. * the interval to expand.
  7. * @return Expansion of the {@link RandomAccessibleInterval} source as
  8. * specified by border.
  9. */
  10. public static < T > IntervalView< T > expandMirrorDouble( final RandomAccessibleInterval< T > source, final long... border )
  11. {
  12. return interval( extendMirrorDouble( source ), Intervals.expand( source, border ) );
  13. }

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

  1. /**
  2. * Expand a RandomAccessibleInterval as specified by border. Out of bounds
  3. * pixels will be sampled by mirroring source. Boundary pixels are repeated.
  4. *
  5. * @param source
  6. * the interval to expand.
  7. * @return Expansion of the {@link RandomAccessibleInterval} source as
  8. * specified by border.
  9. */
  10. public static < T > IntervalView< T > expandMirrorDouble( final RandomAccessibleInterval< T > source, final long... border )
  11. {
  12. return interval( extendMirrorDouble( source ), Intervals.expand( source, border ) );
  13. }

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

  1. @Override
  2. public void compute(RandomAccessibleInterval<T> input, RandomAccessibleInterval<T> output) {
  3. RandomAccessibleInterval<T> in = input;
  4. for (int i = input.numDimensions() - 1; i >= 0; i--) {
  5. RandomAccessibleInterval<T> derivative = createRAI.calculate(input);
  6. if (dimension == i) {
  7. kernelBConvolveOp.compute(Views.interval(Views.extendMirrorDouble(in), input), derivative);
  8. } else {
  9. kernelAConvolveOps[i].compute(Views.interval(Views.extendMirrorDouble(in), input), derivative);
  10. }
  11. in = derivative;
  12. }
  13. addOp.compute(output, in, output);
  14. }

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

  1. @Override
  2. public void run() {
  3. // HACK: Explicit assignment is needed for OpenJDK javac.
  4. ExtendedRandomAccessibleInterval<T, Img<T>> extendedInput = Views.extendMirrorDouble(input);
  5. OutOfBounds<T> ura = extendedInput.randomAccess();
  6. // HACK: Explicit assignment is needed for OpenJDK javac.
  7. ExtendedRandomAccessibleInterval<FloatType, RandomAccessibleInterval<FloatType>> extendedD = Views.extendMirrorDouble(D);
  8. OutOfBounds<FloatType> dra = extendedD.randomAccess();
  9. Cursor<FloatType> incrementCursor = increment.localizingCursor();
  10. long[] position = new long[input.numDimensions()];
  11. float[][] D = initDiffusionTensorArray();
  12. float[] U = initDensityArray();
  13. incrementCursor.jumpFwd(chunk.getStartPosition());
  14. for (long j = 0; j < chunk.getLoopSize(); j++) {
  15. // Move input cursor.
  16. incrementCursor.fwd();
  17. // Move local neighborhood input cursor.
  18. ura.setPosition(incrementCursor);
  19. incrementCursor.localize(position);
  20. // Move diffusion tensor cursor in the fist N dimension
  21. for (int i = 0; i < position.length; i++) {
  22. dra.setPosition(position[i], i);
  23. }
  24. // Iterate in local neighborhood and yield values
  25. yieldDensity(ura, U);
  26. yieldDiffusionTensor(dra, D);
  27. // Compute increment from arrays
  28. incrementCursor.get().setReal(diffusionScheme(U, D));
  29. } // looping on all pixel
  30. }

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

  1. ExtendedRandomAccessibleInterval< T, RandomAccessibleInterval< T >> extendedInput = Views.extendMirrorDouble( input );
  2. OutOfBounds< T > ura = extendedInput.randomAccess();
  3. ExtendedRandomAccessibleInterval< FloatType, RandomAccessibleInterval< FloatType >> extendedD = Views.extendMirrorDouble( D );
  4. OutOfBounds< FloatType > dra = extendedD.randomAccess();

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

  1. @SuppressWarnings("unchecked")
  2. @Override
  3. public void compute(RandomAccessibleInterval<T> in, RandomAccessibleInterval<T> out) {
  4. final RandomAccessible<FloatType> convertedIn = Converters.convert(Views.extendMirrorDouble(in),
  5. converterToFloat, new FloatType());

代码示例来源:origin: net.preibisch/multiview-reconstruction

  1. b.copyBlock( Views.extendMirrorDouble( image ), block );

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

  1. @Test
  2. public void extendMirrorDoubleTest() {
  3. Img<DoubleType> img = new ArrayImgFactory<DoubleType>().create(new int[] { 10, 10 }, new DoubleType());
  4. OutOfBounds<DoubleType> il2 = Views.extendMirrorDouble(img).randomAccess();
  5. OutOfBounds<DoubleType> opr = ops.transform().extendMirrorDoubleView(img).randomAccess();
  6. il2.setPosition(new int[] { -1, -1 });
  7. opr.setPosition(new int[] { -1, -1 });
  8. assertEquals(il2.get().get(), opr.get().get(), 1e-10);
  9. il2.setPosition(new int[] { 11, 11 });
  10. opr.setPosition(new int[] { 11, 11 });
  11. assertEquals(il2.get().get(), opr.get().get(), 1e-10);
  12. }

相关文章