net.imglib2.img.Img.randomAccess()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(4.7k)|赞(0)|评价(0)|浏览(146)

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

Img.randomAccess介绍

暂无

代码示例

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

@Override
public RandomAccess< LongType > randomAccess()
{
  return counts.randomAccess();
}

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

@Override
public RandomAccess< LongType > randomAccess( final Interval interval )
{
  return counts.randomAccess( interval );
}

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

/**
 * returns the nValue image's RandomAccess
 *
 * @return the RandomAccess containing the nValues
 */
protected RandomAccess<DoubleType> getNValuesRandomAccess() {
  return nValues.randomAccess();
}

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

@Override
public RandomAccess< LongType > randomAccess( final Interval interval )
{
  return counts.randomAccess( interval );
}

代码示例来源:origin: net.imagej/imagej-common

@Override
public RandomAccess<T> randomAccess(final Interval interval) {
  return img.randomAccess(interval);
}

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

@Override
public RandomAccess<T> randomAccess() {
  return img.randomAccess();
}

代码示例来源:origin: net.imagej/imagej-common

@Override
public RandomAccess<T> randomAccess() {
  return img.randomAccess();
}

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

@Override
public RandomAccess< LongType > randomAccess()
{
  return counts.randomAccess();
}

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

@Override
public RandomAccess<T> randomAccess(final Interval interval) {
  return img.randomAccess(interval);
}

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

/**
 * returns the pValue image's RandomAccess
 *
 * @return the RandomAccess containing the pValues
 */
protected RandomAccess<DoubleType> getPValuesRandomAccess() {
  return pValues.randomAccess();
}

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

/**
   * returns the gradient image's RandomAccess
   *
   * @return the RandomAccess containing the gradients
   */
  protected RandomAccess<DoubleType> getGradientsRandomAccess() {
    return gradients.randomAccess();
  }
}

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

/**
 * Construct an n-dimensional counter using a provided {@code Img<LongType>} to
 * store counts.
 */
public DiscreteFrequencyDistribution( final Img< LongType > img )
{
  counts = img;
  accessor = counts.randomAccess();
  resetCounters();
}

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

@Override
public RandomAccess< LabelingType< T > > randomAccess()
{
  final RandomAccess< I > rndAccess = img.randomAccess();
  return new LabelingConvertedRandomAccess< I, T >( rndAccess, generation, mapping );
}

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

/**
 * Construct an n-dimensional counter using a provided {@code Img<LongType>} to
 * store counts.
 */
public DiscreteFrequencyDistribution( final Img< LongType > img )
{
  counts = img;
  accessor = counts.randomAccess();
  resetCounters();
}

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

/**
 * Convenience helper to access single pixels
 */
protected < T extends RealType< T >> float get( final Img< T > image, final int[] pos )
{
  final RandomAccess< T > cursor = image.randomAccess();
  cursor.setPosition( pos );
  final float result = cursor.get().getRealFloat();
  return result;
}

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

@Test
public void testRandomAccess()
{
  final RandomAccess< UnsignedByteType > a = img.randomAccess();
  final long[] pos = new long[] { 28, 30, 5, 5, 12 };
  final long[] dist = new long[] { 2, 3, 4, 2, 1 };
  testlocalize( a, pos );
  testfwd( a, pos );
  testbck( a, pos );
  testmove( a, pos, 3 );
  testmove( a, pos, dist );
}

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

@Test
public void testLoopLine()
{
  // setup
  final Img< IntType > img = ArrayImgs.ints( 1, 1, 5 );
  final RandomAccess< IntType > ra = img.randomAccess();
  // process
  final Runnable loop = LoopUtils.createLineLoop( ra, img.dimension( 2 ), 2,
      () -> ra.get().set( 42 ) );
  loop.run();
  // test
  img.forEach( value -> assertEquals( 42, value.get() ) );
}

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

public void copyWithSourceIteration( final Img< IntType > srcImg, final Img< IntType > dstImg )
{
  final int[] pos = new int[ dimensions.length ];
  final Cursor< IntType > src = srcImg.localizingCursor();
  final RandomAccess< IntType > dst = dstImg.randomAccess();
  while ( src.hasNext() )
  {
    src.fwd();
    src.localize( pos );
    dst.setPosition( pos );
    dst.get().set( src.get() );
  }
}

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

@Test
public void testCopy() {
  ops.run(ConvertIIs.class, out, in,
    new CopyRealTypes<ShortType, ByteType>());
  final Cursor<ShortType> c = in.localizingCursor();
  final RandomAccess<ByteType> ra = out.randomAccess();
  while (c.hasNext()) {
    final short value = c.next().get();
    ra.setPosition(c);
    assertEquals(copy(value), ra.get().get());
  }
}

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

@Test
public void testNormalizeScale() {
  ops.run(ConvertIIs.class, out, in,
    ops.op(NormalizeScaleRealTypes.class, out.firstElement(), in.firstElement()));
  final Cursor<ShortType> c = in.localizingCursor();
  final RandomAccess<ByteType> ra = out.randomAccess();
  while (c.hasNext()) {
    final short value = c.next().get();
    ra.setPosition(c);
    assertEquals(normalizeScale(value), ra.get().get());
  }
}

相关文章