Package net.imglib2.type.numeric.integer

Examples of net.imglib2.type.numeric.integer.IntType


  }

  @Test
  public void testCopyToCellContainerWithDestIteration()
  {
    final CellImg< IntType, ?, ? > cellImg = new CellImgFactory< IntType >( new int[] { 2, 7, 4 } ).create( dimensions, new IntType() );
    copyWithDestIteration( intImg, cellImg );
    assertArrayEquals( intData, getImgAsInts( cellImg ) );
  }
View Full Code Here


  }

  @Test
  public void testCopyArrayToArrayWithIterationBoth()
  {
    final ArrayImg< IntType, ? > array2 = new ArrayImgFactory< IntType >().create( dimensions, new IntType() );
    final ArrayImg< IntType, ? > array = new ArrayImgFactory< IntType >().create( dimensions, new IntType() );
    copyWithDestIteration( intImg, array2 );
    copyWithIterationBoth( array2, array );
    assertArrayEquals( intData, getImgAsInts( array ) );
  }
View Full Code Here

    {
      intData[ i ] = random.nextInt();
      intDataSum += intData[ i ];
    }

    intImg = new CellImgFactory< IntType >( 40 ).create( dimensions, new IntType() );
  }
View Full Code Here

        randomAccessBenchmark.fillImage();
      }
    } );
    randomAccessBenchmark.intData = null;

    randomAccessBenchmark.intImgCopy = new CellImgFactory< IntType >( 32 ).create( randomAccessBenchmark.dimensions, new IntType() );
    System.out.println( "benchmarking copy to smaller" );
    BenchmarkHelper.benchmarkAndPrint( 20, false, new Runnable()
    {
      @Override
      public void run()
      {
        randomAccessBenchmark.copyWithSourceIteration( randomAccessBenchmark.intImg, randomAccessBenchmark.intImgCopy );
      }
    } );
    randomAccessBenchmark.intImgCopy = null;

    randomAccessBenchmark.intImgCopy = new CellImgFactory< IntType >( 50 ).create( randomAccessBenchmark.dimensions, new IntType() );
    System.out.println( "benchmarking copy to larger" );
    BenchmarkHelper.benchmarkAndPrint( 20, false, new Runnable()
    {
      @Override
      public void run()
      {
        randomAccessBenchmark.copyWithSourceIteration( randomAccessBenchmark.intImg, randomAccessBenchmark.intImgCopy );
      }
    } );
    randomAccessBenchmark.intImgCopy = null;

    randomAccessBenchmark.intImgCopy = new CellImgFactory< IntType >( new int[] { 32, 64, 16 } ).create( randomAccessBenchmark.dimensions, new IntType() );
    System.out.println( "benchmarking copy to mixed" );
    BenchmarkHelper.benchmarkAndPrint( 20, false, new Runnable()
    {
      @Override
      public void run()
View Full Code Here

      if ( binCounts[ i ] <= 0 ) { throw new IllegalArgumentException( "invalid bin count (<= 0)" ); }
    }

    // then build object

    counts = new ArrayImgFactory< LongType >().create( binCounts, new LongType() );

    accessor = counts.randomAccess();

    totalValues = 0;
  }
View Full Code Here

    }

    if ( ShortType.class.isAssignableFrom( type.getClass() ) )
    {
      final ShortArray array = new ShortArray( numElements( dims ) );
      final ArrayImgAWTScreenImage< ShortType, ShortArray > container = new ShortAWTScreenImage( new ShortType( array ), array, dims );
      container.setLinkedType( new ShortType( container ) );
      return ( ArrayImgAWTScreenImage ) container;
    }

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

    }

    if ( UnsignedByteType.class.isAssignableFrom( type.getClass() ) )
    {
      final ByteArray array = new ByteArray( numElements( dims ) );
      final ArrayImgAWTScreenImage< UnsignedByteType, ByteArray > container = new UnsignedByteAWTScreenImage( new UnsignedByteType( array ), array, dims );
      container.setLinkedType( new UnsignedByteType( container ) );
      return ( ArrayImgAWTScreenImage ) container;
    }

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

    }

    if ( UnsignedIntType.class.isAssignableFrom( type.getClass() ) )
    {
      final IntArray array = new IntArray( numElements( dims ) );
      final ArrayImgAWTScreenImage< UnsignedIntType, IntArray > container = new UnsignedIntAWTScreenImage( new UnsignedIntType( array ), array, dims );
      container.setLinkedType( new UnsignedIntType( container ) );
      return ( ArrayImgAWTScreenImage ) container;
    }

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

    }

    if ( UnsignedShortType.class.isAssignableFrom( type.getClass() ) )
    {
      final ShortArray array = new ShortArray( numElements( dims ) );
      final ArrayImgAWTScreenImage< UnsignedShortType, ShortArray > container = new UnsignedShortAWTScreenImage( new UnsignedShortType( array ), array, dims );
      container.setLinkedType( new UnsignedShortType( container ) );
      return ( ArrayImgAWTScreenImage ) container;
    }

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

    }

    if ( DoubleType.class.isAssignableFrom( type.getClass() ) )
    {
      final DoubleArray array = new DoubleArray( numElements( dims ) );
      final ArrayImgAWTScreenImage< DoubleType, DoubleArray > container = new DoubleAWTScreenImage( new DoubleType( array ), array, dims );
      container.setLinkedType( new DoubleType( container ) );
      return ( ArrayImgAWTScreenImage ) container;
    }

    throw new IllegalArgumentException( "Can't find AWTScreenImage for type " + type.toString() + "!" );
  }
View Full Code Here

TOP

Related Classes of net.imglib2.type.numeric.integer.IntType

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.