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

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

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

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

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

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

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

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

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

  1. @Override
  2. public DiscreteFrequencyDistribution copy()
  3. {
  4. return new DiscreteFrequencyDistribution( counts.copy() );
  5. }

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

  1. @Override
  2. public DiscreteFrequencyDistribution copy()
  3. {
  4. return new DiscreteFrequencyDistribution( counts.copy() );
  5. }

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

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

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

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

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

  1. double computeAccelerationFactor(RandomAccessibleInterval<T> yk_iterated) {
  2. // gk=StaticFunctions.Subtract(yk_iterated, yk_prediction);
  3. Subtract(yk_iterated, yk_prediction, gk);
  4. if (gkm1 != null) {
  5. double numerator = DotProduct(gk, gkm1);
  6. double denominator = DotProduct(gkm1, gkm1);
  7. gkm1 = gk.copy();
  8. return numerator / denominator;
  9. }
  10. gkm1 = gk.copy();
  11. return 0.0;
  12. }

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

  1. @SuppressWarnings({ "rawtypes", "unchecked" })
  2. private static final <R extends NumericType<R>> Img<R> process(final IterableInterval<R> img) {
  3. if (img instanceof Img) {
  4. return ((Img<R>)img).copy();
  5. }
  6. if (img.firstElement() instanceof NativeType<?>) {
  7. return copyAsArrayImg((IterableInterval)img);
  8. }
  9. throw new IllegalArgumentException("Could not duplicate image of class " + img.getClass() + " with type " + img.firstElement().getClass());
  10. }
  11. }

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

  1. @Override
  2. public RandomAccessibleInterval<FloatType> getFloatImage( final ViewId view, boolean normalize )
  3. {
  4. if ( normalize )
  5. {
  6. return normalize( sb.getImgs().get( view.getViewSetupId() ).copy() );
  7. }
  8. else
  9. {
  10. return sb.getImgs().get( view.getViewSetupId() ).copy();
  11. }
  12. }

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

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

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

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

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

  1. @Override
  2. public SCIFIOImgPlus<T> copy() {
  3. final SCIFIOImgPlus<T> copy = new SCIFIOImgPlus<>(getImg().copy(), this);
  4. copy.setMetadata(getMetadata());
  5. return copy;
  6. }

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

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

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

  1. @Test
  2. public void pixelWiseTestThreadedMapperInplace() {
  3. ops.run(MapIIInplaceParallel.class, in.copy(),
  4. addConstantInplace);
  5. }
  6. }

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

  1. public static void main( final String[] args )
  2. {
  3. new ImageJ();
  4. ImagePlus imp = new ImagePlus( "/Users/preibischs/workspace/TestLucyRichardson/src/resources/dros-1.tif" );
  5. Img< FloatType > img = ImageJFunctions.convertFloat( imp );
  6. ImageJFunctions.show( img.copy() );
  7. ImageJFunctions.show( computeLazyMinFilter( img, 5 ) );
  8. }
  9. }

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

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

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

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

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

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

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

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

相关文章