Package net.imglib2

Examples of net.imglib2.RealPoint


    for ( int i = 0; i < numPoints; ++i )
    {
      for ( int d = 0; d < numDimensions; ++d )
        p[ d ] = rnd.nextFloat() * size + min;

      final RealPoint t = new RealPoint( p );
      points.add( t );
    }

    final double radius = rnd.nextDouble() * size / 10;

    long start = System.currentTimeMillis();
    final KDTree< RealPoint > kdTree = new KDTree< RealPoint >( points, points );
    final RadiusNeighborSearchOnKDTree< RealPoint > kd = new RadiusNeighborSearchOnKDTree< RealPoint >( kdTree );
    final long kdSetupTime = System.currentTimeMillis() - start;
    System.out.println( "kdtree setup took: " + ( kdSetupTime ) + " ms." );

    start = System.currentTimeMillis();
    final ArrayList< RealPoint > testpoints = new ArrayList< RealPoint >();
    for ( int i = 0; i < numTests; ++i )
    {
      for ( int d = 0; d < numDimensions; ++d )
        p[ d ] = rnd.nextFloat() * 2 * size + min - size / 2;

      final RealPoint t = new RealPoint( p );
      testpoints.add( t );
    }

    for ( final RealPoint t : testpoints )
    {
View Full Code Here


  @Override
  protected SignedByteDataBuffer createDataBuffer( final ByteArray data )
  {
    final byte[] sourceArray = data.getCurrentStorageArray();
    return new SignedByteDataBuffer( sourceArray, sourceArray.length );
  }
View Full Code Here

  @Override
  protected SignedShortDataBuffer createDataBuffer( final ShortArray data )
  {
    final short[] sourceArray = data.getCurrentStorageArray();
    return new SignedShortDataBuffer( sourceArray, sourceArray.length );
  }
View Full Code Here

  @Override
  protected UnsignedIntDataBuffer createDataBuffer( final IntArray data )
  {
    final int[] sourceArray = data.getCurrentStorageArray();
    return new UnsignedIntDataBuffer( sourceArray, sourceArray.length );
  }
View Full Code Here

  @Override
  public < S > ImgFactory< S > imgFactory( final S type ) throws IncompatibleTypeException
  {
    if ( NativeType.class.isInstance( type ) )
      return new CellImgFactory( defaultCellDimensions );
    throw new IncompatibleTypeException( this, type.getClass().getCanonicalName() + " does not implement NativeType." );
  }
View Full Code Here

  @Override
  public < S > ImgFactory< S > imgFactory( final S type ) throws IncompatibleTypeException
  {
    if ( NativeType.class.isInstance( type ) )
      return new PlanarImgFactory();
    throw new IncompatibleTypeException( this, type.getClass().getCanonicalName() + " does not implement NativeType." );
  }
View Full Code Here

  @Override
  public < S > ImgFactory< S > imgFactory( final S type ) throws IncompatibleTypeException
  {
    if ( NativeType.class.isInstance( type ) )
      return new NtreeImgFactory();
    throw new IncompatibleTypeException( this, type.getClass().getCanonicalName() + " does not implement NativeType." );
  }
View Full Code Here

  public static < T extends NativeType< T >> ArrayImgAWTScreenImage< T, ? > emptyScreenImage( final T type, final long[] dims )
  {

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

    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;
    }
View Full Code Here

  }

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

  }

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

TOP

Related Classes of net.imglib2.RealPoint

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.