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

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

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

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

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

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

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

/**
 * Expand a RandomAccessibleInterval as specified by border. Out of bounds
 * pixels will be sampled by mirroring source. Boundary pixels are repeated.
 *
 * @param source
 *            the interval to expand.
 * @return Expansion of the {@link RandomAccessibleInterval} source as
 *         specified by border.
 */
public static < T > IntervalView< T > expandMirrorDouble( final RandomAccessibleInterval< T > source, final long... border )
{
  return interval( extendMirrorDouble( source ), Intervals.expand( source, border ) );
}

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

/**
 * Expand a RandomAccessibleInterval as specified by border. Out of bounds
 * pixels will be sampled by mirroring source. Boundary pixels are repeated.
 *
 * @param source
 *            the interval to expand.
 * @return Expansion of the {@link RandomAccessibleInterval} source as
 *         specified by border.
 */
public static < T > IntervalView< T > expandMirrorDouble( final RandomAccessibleInterval< T > source, final long... border )
{
  return interval( extendMirrorDouble( source ), Intervals.expand( source, border ) );
}

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

@Override
public void compute(RandomAccessibleInterval<T> input, RandomAccessibleInterval<T> output) {
  RandomAccessibleInterval<T> in = input;
  for (int i = input.numDimensions() - 1; i >= 0; i--) {
    RandomAccessibleInterval<T> derivative = createRAI.calculate(input);
    if (dimension == i) {
      kernelBConvolveOp.compute(Views.interval(Views.extendMirrorDouble(in), input), derivative);
    } else {
      kernelAConvolveOps[i].compute(Views.interval(Views.extendMirrorDouble(in), input), derivative);
    }
    in = derivative;
  }
  addOp.compute(output, in, output);
}

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

@Override
public void run() {
  // HACK: Explicit assignment is needed for OpenJDK javac.
  ExtendedRandomAccessibleInterval<T, Img<T>> extendedInput = Views.extendMirrorDouble(input);
  OutOfBounds<T> ura = extendedInput.randomAccess();
  // HACK: Explicit assignment is needed for OpenJDK javac.
  ExtendedRandomAccessibleInterval<FloatType, RandomAccessibleInterval<FloatType>> extendedD = Views.extendMirrorDouble(D);
  OutOfBounds<FloatType> dra     = extendedD.randomAccess();
  Cursor<FloatType> incrementCursor         = increment.localizingCursor();
  long[] position = new long[input.numDimensions()];
  float[][] D = initDiffusionTensorArray();
  float[] U = initDensityArray();
  incrementCursor.jumpFwd(chunk.getStartPosition());
  for (long j = 0; j < chunk.getLoopSize(); j++) {
    // Move input cursor.
    incrementCursor.fwd();
    // Move local neighborhood input cursor.
    ura.setPosition(incrementCursor);
    incrementCursor.localize(position);
    // Move diffusion tensor cursor in the fist N dimension
    for (int i = 0; i < position.length; i++) {
      dra.setPosition(position[i], i);
    }
    // Iterate in local neighborhood and yield values
    yieldDensity(ura, U);
    yieldDiffusionTensor(dra, D);
    // Compute increment from arrays
    incrementCursor.get().setReal(diffusionScheme(U, D));
  } // looping on all pixel
}

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

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

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

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

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

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

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

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

相关文章