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

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

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

Img.copy介绍

暂无

代码示例

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

public PointSpreadFunction( final File xmlBasePath, final String file, final Img< FloatType > img )
{
  this.xmlBasePath = xmlBasePath;
  this.file = file;
  if ( img != null )
    this.img = img.copy(); // avoid changes to the PSF if an actual image is provided
  this.modified = true; // not initialized from disc, needs to be saved
}

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

@Override
public Img<T> copy() {
  return img.copy();
}

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

@Override
public ImgPlus<T> copy() {
  return new ImgPlus<>(img.copy(), this);
}

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

@Override
public DiscreteFrequencyDistribution copy()
{
  return new DiscreteFrequencyDistribution( counts.copy() );
}

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

@Override
public DiscreteFrequencyDistribution copy()
{
  return new DiscreteFrequencyDistribution( counts.copy() );
}

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

public Img< FloatType > getPSFCopy()
{
  if ( img == null )
    img = IOFunctions.openAs32Bit( new File( new File( xmlBasePath, subDir ), file ), new ArrayImgFactory<>() );
  return img.copy();
}

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

protected void loadFileIfNecessary(File file)
{
  if (raiMap.containsKey( file ))
    return;
  
  final ImagePlus imp = IJ.openImage( file.getAbsolutePath() );
  final RandomAccessibleInterval< FloatType > img = ImageJFunctions.convertFloat( imp ).copy();
  
  raiMap.put( file, img );
}

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

double computeAccelerationFactor(RandomAccessibleInterval<T> yk_iterated) {
  // gk=StaticFunctions.Subtract(yk_iterated, yk_prediction);
  Subtract(yk_iterated, yk_prediction, gk);
  if (gkm1 != null) {
    double numerator = DotProduct(gk, gkm1);
    double denominator = DotProduct(gkm1, gkm1);
    gkm1 = gk.copy();
    return numerator / denominator;
  }
  gkm1 = gk.copy();
  return 0.0;
}

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

@SuppressWarnings({ "rawtypes", "unchecked" })
  private static final <R extends NumericType<R>> Img<R> process(final IterableInterval<R> img) {
    if (img instanceof Img) {
      return ((Img<R>)img).copy();
    }

    if (img.firstElement() instanceof NativeType<?>) {
      return copyAsArrayImg((IterableInterval)img);
    }
    
    throw new IllegalArgumentException("Could not duplicate image of class " + img.getClass() + " with type " + img.firstElement().getClass());
  }
}

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

@Override
public RandomAccessibleInterval<FloatType> getFloatImage( final ViewId view, boolean normalize )
{
  if ( normalize )
  {
    return normalize( sb.getImgs().get( view.getViewSetupId() ).copy() );
  }
  else
  {
    return sb.getImgs().get( view.getViewSetupId() ).copy();
  }
}

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

public static double[] computeCenter( final Img< FloatType > i, final double threshold ) throws IncompatibleTypeException
{
  final Img<FloatType> copy = i.copy();
  Gauss3.gauss( 2, Views.extendMirrorSingle( copy ), copy );
  
  return centerofmass( copy, threshold );
}

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

@Override
public HyperSliceImgPlus<T> copy() {
  return new HyperSliceImgPlus<T>(new ImgPlus<T>(getImg().copy(), this),
      targetDimension, dimensionPosition);
}

代码示例来源:origin: io.scif/scifio

@Override
public SCIFIOImgPlus<T> copy() {
  final SCIFIOImgPlus<T> copy = new SCIFIOImgPlus<>(getImg().copy(), this);
  copy.setMetadata(getMetadata());
  return copy;
}

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

@Override
public HyperSliceImgPlus<T> copy() {
  return new HyperSliceImgPlus<T>(new ImgPlus<T>(getImg().copy(), this),
      targetDimension, dimensionPosition);
}

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

@Test
  public void pixelWiseTestThreadedMapperInplace() {
    ops.run(MapIIInplaceParallel.class, in.copy(),
      addConstantInplace);
  }
}

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

public static void main( final String[] args )
  {
    new ImageJ();
    
    ImagePlus imp = new ImagePlus( "/Users/preibischs/workspace/TestLucyRichardson/src/resources/dros-1.tif" );
    
    Img< FloatType > img = ImageJFunctions.convertFloat( imp );

    ImageJFunctions.show( img.copy() );
    ImageJFunctions.show( computeLazyMinFilter( img, 5 ) );
  }
}

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

public void testListErode() {
  final List<Shape> shapes = new ArrayList<>();
  shapes.add(new DiamondShape(1));
  shapes.add(new DiamondShape(1));
  shapes.add(new RectangleShape(1, false));
  shapes.add(new HorizontalLineShape(2, 1, false));
  final Img<ByteType> out2 = in.copy();
  Erosion.erode(Views.extendValue(in, new ByteType((byte) -128)), out2,
    shapes, 1);
  @SuppressWarnings("unchecked")
  final IterableInterval<ByteType> out1 = (IterableInterval<ByteType>) ops
    .run(ListErode.class, IterableInterval.class, in, shapes, false);
  assertIterationsEqual(out1, out2);
}

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

@Test
public void testIIInplaceParallel() {
  final Img<ByteType> arg = generateByteArrayTestImg(true, 10, 10);
  final Img<ByteType> argCopy = arg.copy();
  sub = Inplaces.unary(ops, Ops.Math.Subtract.class, ByteType.class,
    new ByteType((byte) 1));
  ops.run(MapIIInplaceParallel.class, argCopy, sub);
  assertImgSubOneEquals(arg, argCopy);
}

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

@Test
public void testIIInplaceParallelCellImg() {
  final Img<ByteType> arg = generateByteTestCellImg(true, 40, 20);
  final Img<ByteType> argCopy = arg.copy();
  sub = Inplaces.unary(ops, Ops.Math.Subtract.class, ByteType.class,
    new ByteType((byte) 1));
  ops.run(MapIIInplaceParallel.class, argCopy, sub);
  assertImgSubOneEquals(arg, argCopy);
}

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

@Test
public void testIterableInplace() {
  final Img<ByteType> arg = generateByteArrayTestImg(true, 10, 10);
  final Img<ByteType> argCopy = arg.copy();
  sub = Inplaces.unary(ops, Ops.Math.Subtract.class, ByteType.class,
    new ByteType((byte) 1));
  ops.run(MapIterableInplace.class, argCopy, sub);
  assertImgSubOneEquals(arg, argCopy);
}

相关文章