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

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

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

Img.numDimensions介绍

暂无

代码示例

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

  1. @Override
  2. public int numDimensions()
  3. {
  4. return counts.numDimensions();
  5. }

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

  1. /**
  2. * Instantiate a 2D gaussian peak fitter that will operate on the given image.
  3. * It is important that the image has a 0 background for this class to
  4. * operate properly.
  5. */
  6. public GaussianPeakFitterND(final Img<T> image) {
  7. this.image = image;
  8. this.ndims = image.numDimensions();
  9. }

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

  1. @Override
  2. public int numDimensions()
  3. {
  4. return counts.numDimensions();
  5. }

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

  1. public PickImagePeaks(final Img<T> inputImage) {
  2. image = inputImage;
  3. pTime = 0;
  4. peakLocList = new ArrayList<long[]>();
  5. peakImage = null;
  6. suppressAxis = new double[inputImage.numDimensions()];
  7. Arrays.fill(suppressAxis, 0);
  8. suppressSum = 0;
  9. }

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

  1. public FloydSteinbergDithering( final Img<T> img, final float ditheringThreshold )
  2. {
  3. this.img = img;
  4. this.dim = Util.intervalDimensions(img);
  5. this.tmp1 = new long[img.numDimensions()];
  6. this.tmp2 = new long[img.numDimensions()];
  7. this.errorDiffusionKernel = createErrorDiffusionKernel( img.numDimensions() );
  8. this.ditheringThreshold = ditheringThreshold;
  9. }

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

  1. public void setDownSamplingFactor( final float factor )
  2. {
  3. newSize = new long[ input.numDimensions() ];
  4. scaling = new float[ input.numDimensions() ];
  5. for ( int d = 0; d < input.numDimensions(); ++d )
  6. {
  7. newSize[ d ] = Util.round( input.dimension(d) * factor );
  8. scaling[ d ] = 1.0f / factor;
  9. }
  10. }
  11. public void setNewSize( final long[] newSize ) { this.newSize = newSize.clone(); }

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

  1. protected static int[] getMaxDim( final Img<?> image1, final Img<?> image2 )
  2. {
  3. final int[] maxDim = new int[ image1.numDimensions() ];
  4. for ( int d = 0; d < image1.numDimensions(); ++d )
  5. maxDim[ d ] = (int) Math.max( image1.dimension( d ), image2.dimension( d ) );
  6. return maxDim;
  7. }

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

  1. /** Calls the DifferenceOfGaussianOld constructor with the given sigmas copied into double[] arrays,
  2. * one entry per {@param img} dimension. */
  3. public DifferenceOfGaussianOld( final Img<A> img, final ImgFactory<FloatType> factory,
  4. final OutOfBoundsFactory<FloatType, RandomAccessibleInterval<FloatType>> outOfBoundsFactory,
  5. final double sigma1, final double sigma2, final double minPeakValue, final double normalizationFactor )
  6. {
  7. this( img, factory, outOfBoundsFactory, asArray(img.numDimensions(), sigma1),
  8. asArray(img.numDimensions(), sigma2), minPeakValue, normalizationFactor );
  9. }

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

  1. /**
  2. * @param image - The {@link Img} to mirror
  3. * @param dimension - The axis to mirror (e.g. 0->x-Axis->horizontally, 1->y-axis->vertically)
  4. */
  5. public MirrorImage( final Img<T> image, final int dimension )
  6. {
  7. this.image = image;
  8. this.dimension = dimension;
  9. this.numDimensions = image.numDimensions();
  10. setNumThreads();
  11. }

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

  1. static private final long[] asDimArray(final Img<?> img, final Number scale) {
  2. final long[] dim = new long[img.numDimensions()];
  3. final double s = scale.doubleValue();
  4. for (int i=0; i<dim.length; i++) {
  5. dim[i] = (int)((img.dimension(i) * s) + 0.5);
  6. }
  7. return dim;
  8. }

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

  1. static private final long[] dimensions(final Img<?> img) {
  2. final long[] ds = new long[img.numDimensions()];
  3. for (int d=0; d<ds.length; ++d) {
  4. ds[d] = img.dimension(d) + 1;
  5. }
  6. return ds;
  7. }

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

  1. /** Calls the DifferenceOfGaussian constructor with the given sigmas copied into double[] arrays,
  2. * one entry per {@param img} dimension. */
  3. public DifferenceOfGaussian( final Img<A> img, final ImgFactory<A> factory,
  4. final OutOfBoundsFactory<A, RandomAccessibleInterval<A>> outOfBoundsFactory,
  5. final double sigma1, final double sigma2, final double minPeakValue, final double normalizationFactor )
  6. {
  7. this( img, factory, outOfBoundsFactory, asArray(img.numDimensions(), sigma1),
  8. asArray(img.numDimensions(), sigma2), minPeakValue, normalizationFactor );
  9. }

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

  1. public SubpixelLocalization( final Img<T> laPlacian, final List<DifferenceOfGaussianPeak<T>> peaks )
  2. {
  3. setNumThreads();
  4. this.laPlacian = laPlacian;
  5. this.peaks = peaks;
  6. this.allowedToMoveInDim = new boolean[ laPlacian.numDimensions() ];
  7. // principally one can move in any dimension
  8. for ( int d = 0; d < allowedToMoveInDim.length; ++d )
  9. allowedToMoveInDim[ d ] = true;
  10. this.doubleArrayFactory = new ArrayImgFactory<DoubleType>();
  11. }

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

  1. /** The dimensions of the integral image are always +1 from the integrated image. */
  2. protected static final boolean isIntegerDivision(Img<?> integralImg, Img<?> scaled) {
  3. for ( int d = 0; d < scaled.numDimensions(); ++d )
  4. if ( 0 != (integralImg.dimension( d ) -1) % scaled.dimension( d ) )
  5. return false;
  6. return true;
  7. }

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

  1. public Bandpass( final Img<T> img, final int beginRadius, final int endRadius )
  2. {
  3. this.img = img;
  4. this.inPlace = false;
  5. this.bandPass = true;
  6. this.beginRadius = beginRadius;
  7. this.endRadius = endRadius;
  8. this.origin = new long[ img.numDimensions() ];
  9. this.origin[ 0 ] = img.dimension( 0 ) - 1;
  10. for ( int d = 1; d < this.origin.length; ++d )
  11. origin[ d ] = img.dimension( d ) / 2;
  12. }

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

  1. public static < T extends RealType< T > > void removeMinProjections( final Img< T > psf )
  2. {
  3. for ( int d = 0; d < psf.numDimensions(); ++d )
  4. {
  5. final Img< T > minProjection = PSFCombination.computeProjection( psf, d, false );
  6. subtractProjection( psf, minProjection, d );
  7. }
  8. }

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

  1. /**
  2. * Calculate an image signature
  3. *
  4. * The image signature are 1st and 2nd order moments of the intensity and
  5. * the coordinates.
  6. */
  7. protected < T extends RealType< T >> float[] signature( final Img< T > image )
  8. {
  9. final float[] result = new float[ ( image.numDimensions() + 1 ) * 2 ];
  10. signature( image, result );
  11. return result;
  12. }

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

  1. public static < T extends RealType< T > > Img< T > computeMaxProjectionPSF( final Img< T > avg )
  2. {
  3. int minDim = -1;
  4. long minDimSize = Long.MAX_VALUE;
  5. for ( int d = 0; d < avg.numDimensions(); ++d )
  6. if ( avg.dimension( d ) < minDimSize )
  7. {
  8. minDimSize = avg.dimension( d );
  9. minDim = d;
  10. }
  11. return computeProjection( avg, minDim, true );
  12. }

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

  1. private void placeSphereInCenter(Img<FloatType> img) {
  2. final Point center = new Point(img.numDimensions());
  3. for (int d = 0; d < img.numDimensions(); d++)
  4. center.setPosition(img.dimension(d) / 2, d);
  5. HyperSphere<FloatType> hyperSphere = new HyperSphere<>(img, center, 2);
  6. for (final FloatType value : hyperSphere) {
  7. value.setReal(1);
  8. }
  9. }

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

  1. private ImgPlus<UnsignedByteType> splitColorChannels(ImgPlus<ARGBType> input) {
  2. Img<ARGBType> colored = input.getImg();
  3. RandomAccessibleInterval<UnsignedByteType> colorStack = Views.stack(
  4. Converters.argbChannel( colored, 1 ),
  5. Converters.argbChannel( colored, 2 ),
  6. Converters.argbChannel( colored, 3 ) );
  7. ImgPlus<UnsignedByteType> result = new ImgPlus<>(ImgView.wrap(colorStack, new PlanarImgFactory<>()), input.getName());
  8. int lastAxis = colored.numDimensions();
  9. for (int i = 0; i < lastAxis; i++) result.setAxis(input.axis(i).copy(), i);
  10. result.setAxis(new DefaultLinearAxis(Axes.CHANNEL), lastAxis);
  11. return ImgPlusViews.moveAxis(result, lastAxis, 2);
  12. }

相关文章