Package net.imglib2.img.basictypeaccess.array

Examples of net.imglib2.img.basictypeaccess.array.FloatArray


      return ( ArrayImgAWTScreenImage ) container;
    }

    if ( FloatType.class.isAssignableFrom( type.getClass() ) )
    {
      final FloatArray array = new FloatArray( numElements( dims ) );
      final ArrayImgAWTScreenImage< FloatType, FloatArray > container = new FloatAWTScreenImage( new FloatType( array ), array, dims );
      container.setLinkedType( new FloatType( container ) );
      return ( ArrayImgAWTScreenImage ) container;
    }
View Full Code Here


  }

  @Override
  public CellImg< T, FloatArray, DefaultCell< FloatArray > > createFloatInstance( final long[] dimensions, final Fraction entitiesPerPixel )
  {
    return createInstance( new FloatArray( 1 ), dimensions, entitiesPerPixel );
  }
View Full Code Here

  }

  @Override
  public NativeImg< T, FloatArray > createFloatInstance( final long[] dimensions, final Fraction entitiesPerPixel )
  {
    return new PlanarImg< T, FloatArray >( new FloatArray( 1 ), dimensions, entitiesPerPixel );
  }
View Full Code Here

  // this is the constructor if you want it to be a variable
  public ComplexFloatType( final float r, final float i )
  {
    img = null;
    dataAccess = new FloatArray( 2 );
    set( r, i );
  }
View Full Code Here

  // this is the constructor if you want it to be a variable
  public FloatType( final float value )
  {
    img = null;
    dataAccess = new FloatArray( 1 );
    set( value );
  }
View Full Code Here

  @Override
  public ArrayImg< T, FloatArray > createFloatInstance( final long[] dimensions, final Fraction entitiesPerPixel )
  {
    final int numEntities = numEntitiesRangeCheck( dimensions, entitiesPerPixel );

    return new ArrayImg< T, FloatArray >( new FloatArray( numEntities ), dimensions, entitiesPerPixel );
  }
View Full Code Here

   * 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 )
  {
    final FloatArray access = new FloatArray( array );
    final ArrayImg< FloatType, FloatArray > img = new ArrayImg< FloatType, FloatArray >( access, dim, new Fraction() );
    final FloatType t = new FloatType( img )
    img.setLinkedType( t );
    return img;
  }
View Full Code Here

   * 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 )
  {
    final FloatArray access = new FloatArray( array );
    final ArrayImg< ComplexFloatType, FloatArray > img = new ArrayImg< ComplexFloatType, FloatArray >( access, dim, new Fraction( 2, 1 ) );
    final ComplexFloatType t = new ComplexFloatType( img )
    img.setLinkedType( t );
    return img;
  }
View Full Code Here

  }

  @Test
  public void testFloatConstruction()
  {
    testConstruction( new FloatArray( 1 ) );
  }
View Full Code Here

  }

  @Test
  public void testLocalIndexCalculation()
  {
    final AbstractCell< FloatArray > cell = new DefaultCell< FloatArray >( new FloatArray( 1 ), new int[] {20, 8, 10}, new long[] { 0, 9876543210l, 222 } , new Fraction( 2, 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 )
    {
      assertTrue( cell.localPositionToIndex( position[ i ] ) == expectedIndex[ i ] );
View Full Code Here

TOP

Related Classes of net.imglib2.img.basictypeaccess.array.FloatArray

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.