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

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

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

Views.permuteCoordinatesInverse介绍

[英]Inverse Bijective permutation of the integer coordinates in each dimension of a RandomAccessibleInterval.
[中]在随机可访问区间的每个维度上整数坐标的逆双射置换。

代码示例

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

  1. @Override
  2. public IntervalView<T> calculate(RandomAccessibleInterval<T> input) {
  3. return Views.permuteCoordinatesInverse(input, permutation);
  4. }

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

  1. /**
  2. * Inverse bijective permutation of the integer coordinates of one dimension
  3. * of a {@link RandomAccessibleInterval}.
  4. *
  5. * @param source
  6. * must have dimension(dimension) == permutation.length
  7. * @param permutation
  8. * must be a bijective permutation over its index set, i.e. for a
  9. * lut of length n, the sorted content the array must be
  10. * [0,...,n-1] which is the index set of the lut.
  11. * @param d
  12. * dimension index to be permuted
  13. *
  14. * @return {@link IntervalView} of permuted source.
  15. *
  16. * @deprecated use {@link Views#permuteCoordinatesInverse(RandomAccessibleInterval, int[], int)}
  17. */
  18. @Deprecated
  19. public static < T > IntervalView< T > permuteCoordinateInverse( final RandomAccessibleInterval< T > source, final int[] permutation, final int d )
  20. {
  21. return permuteCoordinatesInverse(source, permutation, d);
  22. }

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

  1. /**
  2. * Inverse bijective permutation of the integer coordinates of one dimension
  3. * of a {@link RandomAccessibleInterval}.
  4. *
  5. * @param source
  6. * must have dimension(dimension) == permutation.length
  7. * @param permutation
  8. * must be a bijective permutation over its index set, i.e. for a
  9. * lut of length n, the sorted content the array must be
  10. * [0,...,n-1] which is the index set of the lut.
  11. * @param d
  12. * dimension index to be permuted
  13. *
  14. * @return {@link IntervalView} of permuted source.
  15. *
  16. * @deprecated use {@link Views#permuteCoordinatesInverse(RandomAccessibleInterval, int[], int)}
  17. */
  18. @Deprecated
  19. public static < T > IntervalView< T > permuteCoordinateInverse( final RandomAccessibleInterval< T > source, final int[] permutation, final int d )
  20. {
  21. return permuteCoordinatesInverse(source, permutation, d);
  22. }

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

  1. @Test
  2. public void permuteCoordinatesInverseOfDimensionTest() {
  3. Img<DoubleType> img = new ArrayImgFactory<DoubleType>().create(new int[]{2, 2}, new DoubleType());
  4. Cursor<DoubleType> c = img.cursor();
  5. MersenneTwisterFast r = new MersenneTwisterFast(SEED);
  6. while (c.hasNext()) {
  7. c.next().set(r.nextDouble());
  8. }
  9. IntervalView<DoubleType> out = Views.permuteCoordinatesInverse(img, new int[]{0, 1}, 1);
  10. Cursor<DoubleType> il2 = out.cursor();
  11. RandomAccess<DoubleType> opr = ops.transform().permuteCoordinatesInverseView(img, new int[]{0, 1}, 1).randomAccess();
  12. while (il2.hasNext()) {
  13. il2.next();
  14. opr.setPosition(il2);
  15. assertEquals(il2.get().get(), opr.get().get(), 1e-10);
  16. }
  17. }

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

  1. @Test
  2. public void defaultPermuteCoordinatesInverseTest() {
  3. Img<DoubleType> img = new ArrayImgFactory<DoubleType>().create(new int[]{2, 2}, new DoubleType());
  4. Cursor<DoubleType> c = img.cursor();
  5. MersenneTwisterFast r = new MersenneTwisterFast(SEED);
  6. while (c.hasNext()) {
  7. c.next().set(r.nextDouble());
  8. }
  9. Cursor<DoubleType> il2 = Views.permuteCoordinatesInverse(img, new int[]{0, 1}).cursor();
  10. RandomAccess<DoubleType> opr = ops.transform().permuteCoordinatesInverseView(img, new int[]{0, 1}).randomAccess();
  11. while (il2.hasNext()) {
  12. il2.next();
  13. opr.setPosition(il2);
  14. assertEquals(il2.get().get(), opr.get().get(), 1e-10);
  15. }
  16. }

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

  1. @Test
  2. public void testIntervalPermuteInverseCoordinates() {
  3. Img<DoubleType> img = ArrayImgs.doubles(2, 2);
  4. Cursor<DoubleType> c = img.cursor();
  5. MersenneTwisterFast r = new MersenneTwisterFast(SEED);
  6. while (c.hasNext()) {
  7. c.next().set(r.nextDouble());
  8. }
  9. IntervalView<DoubleType> expected = Views.permuteCoordinatesInverse(img, new int[]{0, 1});
  10. Cursor<DoubleType> e = expected.cursor();
  11. RandomAccessibleInterval<DoubleType> actual = ops.transform().permuteCoordinatesInverseView(img, new int[]{0, 1});
  12. RandomAccess<DoubleType> actualRA = actual.randomAccess();
  13. while (e.hasNext()) {
  14. e.next();
  15. actualRA.setPosition(e);
  16. assertEquals(e.get().get(), actualRA.get().get(), 1e-10);
  17. }
  18. assertTrue(Intervals.equals(expected, actual));
  19. }

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

  1. @Test
  2. public void testIntervalPermuteInverseDimensionCoordinates() {
  3. Img<DoubleType> img = ArrayImgs.doubles(2, 2);
  4. Cursor<DoubleType> c = img.cursor();
  5. MersenneTwisterFast r = new MersenneTwisterFast(SEED);
  6. while (c.hasNext()) {
  7. c.next().set(r.nextDouble());
  8. }
  9. IntervalView<DoubleType> expected = Views.permuteCoordinatesInverse(img, new int[]{0, 1}, 1);
  10. Cursor<DoubleType> e = expected.cursor();
  11. RandomAccessibleInterval<DoubleType> actual = ops.transform().permuteCoordinatesInverseView(img, new int[]{0, 1}, 1);
  12. RandomAccess<DoubleType> actualRA = actual.randomAccess();
  13. while (e.hasNext()) {
  14. e.next();
  15. actualRA.setPosition(e);
  16. assertEquals(e.get().get(), actualRA.get().get(), 1e-10);
  17. }
  18. assertTrue(Intervals.equals(expected, actual));
  19. }
  20. }

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

  1. final TransformView< LongType > bijectivePermutation = new TransformView< LongType >( img, t );
  2. final TransformView< LongType > inverseBijectivePermutation = new TransformView< LongType >( bijectivePermutation, t.inverse() );
  3. final IntervalView< LongType > viewTransformed = Views.permuteCoordinatesInverse( img, PermutationTransformTest.lut );
  4. final IntervalView< LongType > identity = Views.permuteCoordinates( viewTransformed, PermutationTransformTest.lut );

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

  1. final TransformView< IntType > inversed = new TransformView< IntType >( transformed, inverse );
  2. final IntervalView< IntType > viewTransformed = Views.permuteCoordinatesInverse( this.img, this.lut, this.d );
  3. final IntervalView< IntType > identity = Views.permuteCoordinates( viewTransformed, this.lut, this.d );

相关文章