Examples of FloatType


Examples of com.intel.hadoop.graphbuilder.types.FloatType

*/
public class FloatParser implements FieldParser<FloatType> {

  @Override
  public FloatType getValue(String text) {
    return new FloatType(Float.valueOf(text));
  }
View Full Code Here

Examples of liquibase.database.structure.type.FloatType

   * liquibase.database.typeconversion.core.AbstractTypeConverter#getFloatType
   * ()
   */
  @Override
  public FloatType getFloatType() {
    return new FloatType("DOUBLE");
  }
View Full Code Here

Examples of net.imglib2.type.numeric.real.FloatType

    }

    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;
    }

    if ( DoubleType.class.isAssignableFrom( type.getClass() ) )
    {
View Full Code Here

Examples of net.imglib2.type.numeric.real.FloatType

   * Create an {@link ArrayImg}<{@link FloatType}, {@link FloatArray}>.
   */
  @SuppressWarnings( "unchecked" )
  final static public ArrayImg< FloatType, FloatArray > floats( final long... dim )
  {
    return ( ArrayImg< FloatType, FloatArray > ) new ArrayImgFactory< FloatType >().create( dim, new FloatType() );
  }
View Full Code Here

Examples of net.imglib2.type.numeric.real.FloatType

   */
  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

Examples of net.imglib2.type.numeric.real.FloatType

   * Create an {@link PlanarImg}<{@link FloatType}, {@link FloatArray}>.
   */
  @SuppressWarnings( "unchecked" )
  final static public PlanarImg< FloatType, FloatArray > floats( final long... dim )
  {
    return ( PlanarImg< FloatType, FloatArray > ) new PlanarImgFactory< FloatType >().create( dim, new FloatType() );
  }
View Full Code Here

Examples of net.imglib2.type.numeric.real.FloatType

public final class RealFloatSamplerConverter< R extends RealType< R > > implements SamplerConverter< R, FloatType >
{
  @Override
  public FloatType convert( final Sampler< ? extends R > sampler )
  {
    return new FloatType( new RealConvertingFloatAccess< R >( sampler ) );
  }
View Full Code Here

Examples of net.imglib2.type.numeric.real.FloatType

  @Before
  public void setUp()
  {
    cellDimensions = new int[] { 8, 16, 5, 2 };
    dimensions = new long[] { 20, 37, 12, 33 };
    img = new CellImgFactory< FloatType >( cellDimensions ).create( dimensions, new FloatType() );
  }
View Full Code Here

Examples of net.imglib2.type.numeric.real.FloatType

  }

  @Test
  public void equalIterationOrder()
  {
    final Img< FloatType > img2 = new CellImgFactory< FloatType >( cellDimensions ).create( dimensions, new FloatType() );
    assertTrue( img2.iterationOrder().equals( img.iterationOrder() ) );
    assertTrue( img.iterationOrder().equals( img2.iterationOrder() ) );

    final Img< FloatType > img3 = new CellImgFactory< FloatType >( 9 ).create( dimensions, new FloatType() );
    assertFalse( img3.iterationOrder().equals( img.iterationOrder() ) );
    assertFalse( img.iterationOrder().equals( img3.iterationOrder() ) );

    final Img< FloatType > img4 = new ArrayImgFactory< FloatType >().create( dimensions, new FloatType() );
    assertFalse( img4.iterationOrder().equals( img.iterationOrder() ) );
    assertFalse( img.iterationOrder().equals( img4.iterationOrder() ) );
  }
View Full Code Here

Examples of net.imglib2.type.numeric.real.FloatType

  }

  public static boolean testImg( final long[] size, final ImgFactory< FloatType > factory1, final ImgFactory< FloatType > factory2 )
  {
    // create the image
    final Img< FloatType > img1 = factory1.create( size, new FloatType() );
    final Img< FloatType > img2 = factory2.create( size, new FloatType() );

    final int numDimensions = img1.numDimensions();

    // get a reference to compare to
    final float[] reference = createReference( img1 );

    // copy into a second image using simple cursors
    final Cursor< FloatType > cursor1 = img1.cursor();
    final Cursor< FloatType > cursor2 = img2.cursor();

    while ( cursor1.hasNext() )
    {
      cursor1.fwd();
      cursor2.fwd();

      cursor2.get().set( cursor1.get() );
    }

    cursor1.reset();
    cursor2.reset();

    // and copy right back
    while ( cursor2.hasNext() )
    {
      cursor1.fwd();
      cursor2.fwd();

      cursor1.get().set( cursor2.get() );
    }

    // copy back into a second image using localizable and positionable
    // cursors
    final Cursor< FloatType > localizableCursor1 = img1.localizingCursor();
    final RandomAccess< FloatType > positionable2 = img2.randomAccess();

    int i = 0;

    while ( localizableCursor1.hasNext() )
    {
      localizableCursor1.fwd();
      ++i;

      if ( i % 2 == 0 )
        positionable2.setPosition( localizableCursor1 );
      else
        positionable2.setPosition( localizableCursor1 );

      final FloatType t2 = positionable2.get();
      final FloatType t1 = localizableCursor1.get();
//      float f1 = t1.getRealFloat();
//      float f2 = t2.getRealFloat();
      t2.set( t1 );
//      positionable2.get().set( localizableCursor1.get() );
    }

    // copy again to the first image using a LocalizableByDimOutsideCursor
    // and a LocalizableByDimCursor
    final ExtendedRandomAccessibleInterval< FloatType, Img< FloatType > > extendedImg2 = new ExtendedRandomAccessibleInterval< FloatType, Img< FloatType > >( img2, new OutOfBoundsPeriodicFactory< FloatType, Img< FloatType > >() );
    final RandomAccess< FloatType > outsideCursor2 = extendedImg2.randomAccess();
    localizableCursor1.reset();

    final int[] pos = new int[ numDimensions ];
    i = 0;
    int direction = 1;

    try
    {
      while ( localizableCursor1.hasNext() )
      {
        localizableCursor1.fwd();
        localizableCursor1.localize( pos );
        ++i;

        // how many times far away from the original image do we grab
        // the pixel
        final int distance = i % 5;
        direction *= -1;

        pos[ i % numDimensions ] += img1.dimension( i % numDimensions ) * distance * direction;

        if ( i % 7 == 0 )
          outsideCursor2.setPosition( pos );
        else
          outsideCursor2.setPosition( pos );

        final FloatType t1 = localizableCursor1.get();
        final FloatType t2 = outsideCursor2.get();

//        final float f1 = t1.getRealFloat();
//        final float f2 = t2.getRealFloat();

        t1.set( t2 );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.