public NeighborhoodsIterableInterval( final RandomAccessibleInterval< T > source, final long radius, final HyperSphereNeighborhoodFactory< T > factory ) { super( source ); this.source = source; this.radius = radius; this.factory = factory; long s = source.dimension( 0 ); for ( int d = 1; d < n; ++d ) s *= source.dimension( d ); size = s; }
public NeighborhoodsAccessible( final RandomAccessibleInterval< T > source, final Interval span, final RectangleNeighborhoodFactory< T > factory ) { super( source ); this.source = source; this.span = span; this.factory = factory; long s = source.dimension( 0 ); for ( int d = 1; d < n; ++d ) s *= source.dimension( d ); size = s; }
public NeighborhoodsIterableInterval( final RandomAccessibleInterval< T > source, final long span, final int[] increments, final PeriodicLineNeighborhoodFactory< T > factory ) { super( source ); this.source = source; this.span = span; this.increments = increments; this.factory = factory; long s = source.dimension( 0 ); for ( int d = 1; d < n; ++d ) s *= source.dimension( d ); size = s; }
public NeighborhoodsAccessible( final RandomAccessibleInterval< T > source, final long radius, final HyperSphereNeighborhoodFactory< T > factory ) { super( source ); this.source = source; this.radius = radius; this.factory = factory; long s = source.dimension( 0 ); for ( int d = 1; d < n; ++d ) s *= source.dimension( d ); size = s; }
public Phase2Runnable3DCal(final double[][][] tempValues, final double[][][] tempValues_new, final RandomAccessibleInterval<T> raOut, final int xPos, final int zPos, final double[] calibration) { this.tempValues = tempValues; this.tempValues_new = tempValues_new; this.xPos = xPos; this.zPos = zPos; this.height = (int) raOut.dimension(1); this.calibration = calibration; }
public Phase3Runnable3DCal(final double[][][] tempValues, final RandomAccessibleInterval<T> raOut, final int xPos, final int yPos, final double[] calibration) { this.tempValues = tempValues; this.raOut = raOut; this.xPos = xPos; this.yPos = yPos; this.deep = (int) raOut.dimension(2); this.calibration = calibration; }
public Phase1Runnable3D(final int[][][] tempValues, final RandomAccessibleInterval<B> raIn, final int yPos, final int zPos) { this.tempValues = tempValues; this.raIn = raIn.randomAccess(); this.y = yPos; this.z = zPos; this.infinite = (int) (raIn.dimension(0) + raIn.dimension(1)); this.width = (int) raIn.dimension(0); }
/** * The dimensions of the integral image are always +1 from the integrated * image. */ protected static final boolean isIntegerDivision( final RandomAccessibleInterval< ? > integralImg, final RandomAccessibleInterval< ? > scaled ) { for ( int d = 0; d < scaled.numDimensions(); ++d ) if ( 0 != ( integralImg.dimension( d ) - 1 ) % scaled.dimension( d ) ) return false; return true; }
public Bandpass( final RandomAccessibleInterval< T > input, final int beginRadius, final int endRadius, ImgFactory<T> imgFactory ) { this.input = input; this.inPlace = false; this.bandPass = true; this.beginRadius = beginRadius; this.endRadius = endRadius; this.origin = new long[ input.numDimensions() ]; this.origin[ 0 ] = input.dimension( 0 ) - 1; for ( int d = 1; d < this.origin.length; ++d ) origin[ d ] = input.dimension( d ) / 2; }
public SubsampleIntervalView( final RandomAccessibleInterval< T > source, final long step ) { super( Views.zeroMin( source ), step ); dimensions = new long[ steps.length ]; max = new long[ steps.length ]; for ( int d = 0; d < steps.length; ++d ) { steps[ d ] = step; dimensions[ d ] = ( int )Math.ceil( ( double )source.dimension( d ) / step ); max[ d ] = dimensions[ d ] - 1; } }
public SubsampleIntervalView( final RandomAccessibleInterval< T > source, final long... steps ) { super( Views.zeroMin( source ), steps ); dimensions = new long[ steps.length ]; max = new long[ steps.length ]; for ( int d = 0; d < steps.length; ++d ) { this.steps[ d ] = steps[ d ]; dimensions[ d ] = ( int )Math.ceil( ( double )source.dimension( d ) / steps[ d ]); max[ d ] = dimensions[ d ] - 1; } }
public SubsampleIntervalView( final RandomAccessibleInterval< T > source, final long step ) { super( Views.zeroMin( source ), step ); dimensions = new long[ steps.length ]; max = new long[ steps.length ]; for ( int d = 0; d < steps.length; ++d ) { steps[ d ] = step; dimensions[ d ] = ( int )Math.ceil( ( double )source.dimension( d ) / step ); max[ d ] = dimensions[ d ] - 1; } }
protected int[] getExtendedImageSize( final RandomAccessibleInterval<?> input, final int[] imageExtension ) { final int[] extendedSize = new int[ input.numDimensions() ]; for ( int d = 0; d < input.numDimensions(); ++d ) { // the new size includes the current image size extendedSize[ d ] = imageExtension[ d ] + (int)input.dimension( d ); } return extendedSize; }
protected int[] getExtendedImageSize( final RandomAccessibleInterval<?> input, final int[] imageExtension ) { final int[] extendedSize = new int[ input.numDimensions() ]; for ( int d = 0; d < input.numDimensions(); ++d ) { // the new size includes the current image size extendedSize[ d ] = imageExtension[ d ] + (int)input.dimension( d ); } return extendedSize; }
@Override public RandomAccessibleInterval<T> calculate(RandomAccessibleInterval<T> input) { final long[] newDims = Intervals.dimensionsAsLongArray(in()); for (int i = 0; i < Math.min(scaleFactors.length, in().numDimensions()); i++) { newDims[i] = Math.round(in().dimension(i) * scaleFactors[i]); } IntervalView<T> interval = Views.interval(Views.raster(RealViews.affineReal( Views.interpolate(Views.extendMirrorSingle(input), interpolator), new Scale(scaleFactors))), new FinalInterval(newDims)); return interval; }
private void generate2DImg(final RandomAccessibleInterval<BitType> in) { final RandomAccess<BitType> raIn = in.randomAccess(); final MersenneTwisterFast random = new MersenneTwisterFast(SEED); for (int x = 0; x < in.dimension(0); x++) { for (int y = 0; y < in.dimension(1); y++) { raIn.setPosition(new int[] { x, y }); raIn.get().set(random.nextBoolean()); } } }
@Test public void testKernelGauss() { final double sigma = 5.0; final double[] sigmas = {sigma, sigma}; final RandomAccessibleInterval<DoubleType> gaussianKernel = // ops.create().kernelGauss(sigma, sigmas.length); final RandomAccessibleInterval<DoubleType> gaussianKernel2 = // ops.create().kernelGauss(sigmas); assertEquals(gaussianKernel.dimension(1), 31); assertEquals(gaussianKernel2.dimension(1), 31); }