@Override public FloatArray createArray( final int numEntities ) { return new FloatArray( numEntities ); } }
@Override public FloatArray createArray( final int numEntities ) { return new FloatArray( numEntities ); } }
public class run { public static void main(String[] argv) { FloatArray arr = new FloatArray(100); test.foo(arr); } }
@Override public FloatArray emptyArray(final int entities) { return new FloatArray(entities); }
@Override public FloatArray emptyArray(final int entities) { return new FloatArray(entities); }
public ComplexFloatType( final float r, final float i ) { img = null; dataAccess = new FloatArray( 2 ); set( r, i ); }
public FloatType( final float value ) { img = null; dataAccess = new FloatArray( 1 ); set( value ); }
/** * Creates an {@link ArrayImg}<{@link FloatType}, {@link FloatArray}> * reusing a passed float[] array. */ final public static ArrayImg< ComplexFloatType, FloatArray > complexFloats( final float[] array, final long... dim ) { return complexFloats( new FloatArray( array ), dim ); }
public ComplexFloatType( final float r, final float i ) { img = null; dataAccess = new FloatArray( 2 ); set( r, i ); }
/** * Creates an {@link ArrayImg}<{@link FloatType}, {@link FloatArray}> * reusing a passed float[] array. */ final public static ArrayImg< ComplexFloatType, FloatArray > complexFloats( final float[] array, final long... dim ) { return complexFloats( new FloatArray( array ), dim ); }
/** * Creates an {@link ArrayImg}<{@link FloatType}, {@link FloatArray}> * reusing a passed float[] array. */ final public static ArrayImg< FloatType, FloatArray > floats( final float[] array, final long... dim ) { return floats( new FloatArray( array ), dim ); }
@Override public FloatArray wrap( final A access ) { return new FloatArray( ( float[] ) access.getCurrentStorageArray() ); }
@Override public FloatArray load( final ByteBuffer bytes, final int numElements ) { return new FloatArray( loadData( bytes, numElements ) ); } }
/** * Creates an {@link ArrayImg}<{@link FloatType}, {@link FloatArray}> * reusing a passed float[] array. */ final public static ArrayImg< FloatType, FloatArray > floats( final float[] array, final long... dim ) { return floats( new FloatArray( array ), dim ); }
public FloatType( final float value ) { img = null; dataAccess = new FloatArray( 1 ); set( value ); }
public static ImageStackImageLoader< FloatType, FloatArray > createFloatInstance( final ImagePlus imp ) { return new ImageStackImageLoader<>( new FloatType(), imp, array -> new FloatArray( ( float[] ) array ) ); }
public FloatImage(final long[] dim, final float[] pixels) { super(new FloatArray(pixels), dim, new Fraction()); setLinkedType(new FloatType(this)); } }
FloatArray levels = new FloatArray(); levels.add(5993); levels.add(5995); ... Preferences p = Gdx.app.getPreferences("SETTINGS"); Json json = new Json(); String levelsJson = json.toJson(FloatArray.class, levels); p.putString("levels", levelsJson);
@Test public void testLocalIndexCalculation() { final long[] min = new long[] { 0, 9876543210l, 222 }; final Cell< FloatArray > cell = new Cell<>( new int[] {20, 8, 10}, min, new FloatArray( 1 ) ); final long[][] position = { {3, 4, 5}, {12, 0, 3}, {3, 2, 0} }; final int[] expectedIndex = { 883, 492, 43 }; for ( int i = 0; i < position.length; ++i ) { for ( int d =0; d <min.length; ++d) position[ i ][ d ] += min[ d ]; assertTrue( cell.globalPositionToIndex( position[ i ] ) == expectedIndex[ i ] ); } }
public FloatImagePlus( final ImagePlus imp ) { super( imp.getWidth(), imp.getHeight(), imp.getNSlices(), imp.getNFrames(), imp.getNChannels(), 1 ); this.imp = imp; mirror.clear(); for ( int t = 0; t < frames; ++t ) for ( int z = 0; z < depth; ++z ) for ( int c = 0; c < channels; ++c ) mirror.add( new FloatArray( ( float[] )imp.getStack().getProcessor( imp.getStackIndex( c + 1, z + 1 , t + 1 ) ).getPixels() ) ); }