private ConvolverNativeType( final double[] kernel, final RandomAccess< T > in, final RandomAccess< T > out, final int d, final long lineLength, final T type ) { this.kernel = kernel; this.in = in; this.out = out; this.d = d; k = kernel.length; k1 = k - 1; k1k1 = k1 + k1; linelen = lineLength; final int buflen = 2 * k - 1; final ArrayImg< T, ? > buf = new ArrayImgFactory< T >().create( new long[] { buflen }, type ); b1 = buf.randomAccess().get(); b2 = buf.randomAccess().get(); tmp = type.createVariable(); }
private ConvolverNativeType( final double[] kernel, final RandomAccess< T > in, final RandomAccess< T > out, final int d, final long lineLength, final T type ) { this.kernel = kernel; this.in = in; this.out = out; this.d = d; k = kernel.length; k1 = k - 1; k1k1 = k1 + k1; linelen = lineLength; final int buflen = 2 * k - 1; final ArrayImg< T, ? > buf = new ArrayImgFactory<>( type ).create( buflen ); b1 = buf.randomAccess().get(); b2 = buf.randomAccess().get(); tmp = type.createVariable(); }
private ConvolverNativeTypeBuffered( final double[] kernel, final RandomAccess< T > in, final RandomAccess< T > out, final int d, final long lineLength, final T type ) { this.kernel = kernel; this.in = in; this.out = out; this.d = d; k = kernel.length; k1 = k - 1; k1k1 = k1 + k1; buflen = ( int ) lineLength + 2 * k1k1; final ArrayImg< T, ? > buf = new ArrayImgFactory<>( type ).create( buflen ); b1 = buf.randomAccess().get(); tmp = type.createVariable(); }
private ConvolverNativeTypeBuffered( final double[] kernel, final RandomAccess< T > in, final RandomAccess< T > out, final int d, final long lineLength, final T type ) { this.kernel = kernel; this.in = in; this.out = out; this.d = d; k = kernel.length; k1 = k - 1; k1k1 = k1 + k1; buflen = ( int ) lineLength + 2 * k1k1; final ArrayImg< T, ? > buf = new ArrayImgFactory< T >().create( new long[] { buflen }, type ); b1 = buf.randomAccess().get(); tmp = type.createVariable(); }
public ConvolverNativeType( final Kernel1D kernel, final RandomAccess< ? extends T > in, final RandomAccess< ? extends T > out, final int d, final long lineLength ) { // NB: This constructor is used in ConvolverFactories. It needs to be public and have this exact signature. this.in = in; this.out = out; this.d = d; this.kernel = kernel.fullKernel().clone(); k1k = this.kernel.length; k1k1 = k1k - 1; linelen = lineLength; final T type = out.get(); final ArrayImg< T, ? > buf = new ArrayImgFactory<>( type ).create( k1k + 1 ); b1 = buf.randomAccess().get(); b2 = buf.randomAccess().get(); b1.updateIndex( k1k ); b1.setZero(); }
randomAccess.setPosition( offset[ 0 ] + cursor.getLongPosition( 0 ), 0 ); randomAccess.setPosition( offset[ 1 ] + cursor.getLongPosition( 1 ), 1 ); randomAccess.get().set( cursor.get() );
ra.get().set( 5000 );
ra.get().set( 5000 );
ra.get().set( 5000 );
ra.get().set( 5000 );
ra.get().set( 5000 );
ra.get().set( 5000 );
ra.get().set( 5000 );
public static void testEquality( final ArrayImg< ? extends RealType< ? >, ? > img, final float[] array ) { Assert.assertEquals( array.length, Intervals.numElements( img ) ); final ArrayRandomAccess< ? extends RealType< ? > > access = img.randomAccess(); for ( int i = 0; i < array.length; ++i ) { IntervalIndexer.indexToPosition( i, img, access ); Assert.assertEquals( array[ i ], access.get().getRealDouble(), 0.0 ); } }
ra.get().set( 5000 );
public static void testEquality( final ArrayImg< ? extends RealType< ? >, ? > img, final double[] array ) { Assert.assertEquals( array.length, Intervals.numElements( img ) ); final ArrayRandomAccess< ? extends RealType< ? > > access = img.randomAccess(); for ( int i = 0; i < array.length; ++i ) { IntervalIndexer.indexToPosition( i, img, access ); Assert.assertEquals( array[ i ], access.get().getRealDouble(), 0.0 ); } }
randomAccessLeft.get().add( copy ); tmp.mul( kernel[ i - o ] ); randomAccessLeft.get().add( tmp ); tmp.mul( kernel[ k ] ); randomAccessLeft.get().add( tmp ); randomAccessRight.get().add( tmp ); tmp.mul( kernel[ kernelSizeHalfMinus1 ] ); randomAccessLeft.get().add( tmp ); randomAccessRight.get().add( tmp ); tmp.mul( kernel[ kernelSizeHalf ] ); randomAccessLeft.get().add( tmp ); randomAccessLeft.get().add( tmp ); randomAccessLeft.get().add( copy ); randomAccessLeft.get().add( tmp ); randomAccessLeft.get().add( tmp );
final ArrayRandomAccess< BitType > randomAccess = img.randomAccess(); randomAccess.setPosition( Util.getArrayFromValue( 0, dimensions.length ) ); randomAccess.get().set( true ); neighborhood = Dilation.dilateFull( img, shape, 1 );