Package net.imglib2.type.numeric.integer

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


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


    final List< UnsignedByteType > list = new ArrayList< UnsignedByteType >();
    list.add( null );
    list.add( null );

    list.set( 0, new UnsignedByteType( 5 ) );
    list.set( 1, new UnsignedByteType( 4 ) );
    assertEquals( 1, hist.frequency( list ) );

    list.set( 0, new UnsignedByteType( 3 ) );
    list.set( 1, new UnsignedByteType( 4 ) );
    assertEquals( 1, hist.frequency( list ) );

    list.set( 0, new UnsignedByteType( 5 ) );
    list.set( 1, new UnsignedByteType( 7 ) );
    assertEquals( 1, hist.frequency( list ) );

    list.set( 0, new UnsignedByteType( 9 ) );
    list.set( 1, new UnsignedByteType( 7 ) );
    assertEquals( 1, hist.frequency( list ) );

    list.set( 0, new UnsignedByteType( 10 ) );
    list.set( 1, new UnsignedByteType( 1 ) );
    assertEquals( 1, hist.frequency( list ) );

    list.set( 0, new UnsignedByteType( 7 ) );
    list.set( 1, new UnsignedByteType( 1 ) );
    assertEquals( 1, hist.frequency( list ) );

    list.set( 0, new UnsignedByteType( 10 ) );
    list.set( 1, new UnsignedByteType( 9 ) );
    assertEquals( 2, hist.frequency( list ) );

    list.set( 0, new UnsignedByteType( 9 ) );
    list.set( 1, new UnsignedByteType( 12 ) );
    assertEquals( 2, hist.frequency( list ) );

    list.set( 0, new UnsignedByteType( 5 ) );
    list.set( 1, new UnsignedByteType( 0 ) );
    assertEquals( 1, hist.frequency( list ) );
  }
View Full Code Here

    assertEquals( 5, hist.upperTailCount() );
    assertEquals( 3, hist.upperTailCount( 0 ) );
    assertEquals( 2, hist.upperTailCount( 1 ) );
    assertEquals( 0, hist.ignoredCount() );

    list.set( 0, new UnsignedByteType( 5 ) );
    list.set( 1, new UnsignedByteType( 4 ) );
    assertEquals( 1, hist.frequency( list ) );

    list.set( 0, new UnsignedByteType( 3 ) );
    list.set( 1, new UnsignedByteType( 4 ) );
    assertEquals( 1, hist.frequency( list ) );

    list.set( 0, new UnsignedByteType( 5 ) );
    list.set( 1, new UnsignedByteType( 7 ) );
    assertEquals( 1, hist.frequency( list ) );

    list.set( 0, new UnsignedByteType( 9 ) );
    list.set( 1, new UnsignedByteType( 7 ) );
    assertEquals( 1, hist.frequency( list ) );

    list.set( 0, new UnsignedByteType( 10 ) );
    list.set( 1, new UnsignedByteType( 1 ) );
    assertEquals( 1, hist.frequency( list ) );

    list.set( 0, new UnsignedByteType( 7 ) );
    list.set( 1, new UnsignedByteType( 1 ) );
    assertEquals( 1, hist.frequency( list ) );

    list.set( 0, new UnsignedByteType( 10 ) );
    list.set( 1, new UnsignedByteType( 9 ) );
    assertEquals( 2, hist.frequency( list ) );

    list.set( 0, new UnsignedByteType( 9 ) );
    list.set( 1, new UnsignedByteType( 12 ) );
    assertEquals( 2, hist.frequency( list ) );

    list.set( 0, new UnsignedByteType( 5 ) );
    list.set( 1, new UnsignedByteType( 0 ) );
    assertEquals( 1, hist.frequency( list ) );
  }
View Full Code Here

    assertEquals( 0, hist.upperTailCount() );
    assertEquals( 0, hist.upperTailCount( 0 ) );
    assertEquals( 0, hist.upperTailCount( 1 ) );
    assertEquals( 9, hist.ignoredCount() );

    list.set( 0, new UnsignedByteType( 5 ) );
    list.set( 1, new UnsignedByteType( 4 ) );
    assertEquals( 0, hist.frequency( list ) );

    list.set( 0, new UnsignedByteType( 3 ) );
    list.set( 1, new UnsignedByteType( 4 ) );
    assertEquals( 0, hist.frequency( list ) );

    list.set( 0, new UnsignedByteType( 5 ) );
    list.set( 1, new UnsignedByteType( 7 ) );
    assertEquals( 1, hist.frequency( list ) );

    list.set( 0, new UnsignedByteType( 9 ) );
    list.set( 1, new UnsignedByteType( 7 ) );
    assertEquals( 1, hist.frequency( list ) );

    list.set( 0, new UnsignedByteType( 10 ) );
    list.set( 1, new UnsignedByteType( 1 ) );
    assertEquals( 0, hist.frequency( list ) );

    list.set( 0, new UnsignedByteType( 7 ) );
    list.set( 1, new UnsignedByteType( 1 ) );
    assertEquals( 0, hist.frequency( list ) );

    list.set( 0, new UnsignedByteType( 10 ) );
    list.set( 1, new UnsignedByteType( 9 ) );
    assertEquals( 0, hist.frequency( list ) );

    list.set( 0, new UnsignedByteType( 9 ) );
    list.set( 1, new UnsignedByteType( 12 ) );
    assertEquals( 0, hist.frequency( list ) );

    list.set( 0, new UnsignedByteType( 5 ) );
    list.set( 1, new UnsignedByteType( 0 ) );
    assertEquals( 0, hist.frequency( list ) );
  }
View Full Code Here

  }

  private List< UnsignedByteType > getData1()
  {
    final List< UnsignedByteType > data = new ArrayList< UnsignedByteType >();
    data.add( new UnsignedByteType( 5 ) );
    data.add( new UnsignedByteType( 3 ) );
    data.add( new UnsignedByteType( 5 ) );
    data.add( new UnsignedByteType( 9 ) );
    data.add( new UnsignedByteType( 10 ) );
    data.add( new UnsignedByteType( 7 ) );
    data.add( new UnsignedByteType( 10 ) );
    data.add( new UnsignedByteType( 10 ) );
    data.add( new UnsignedByteType( 9 ) );
    data.add( new UnsignedByteType( 9 ) );
    data.add( new UnsignedByteType( 5 ) );
    return data;
  }
View Full Code Here

  }

  private List< UnsignedByteType > getData2()
  {
    final List< UnsignedByteType > data = new ArrayList< UnsignedByteType >();
    data.add( new UnsignedByteType( 4 ) );
    data.add( new UnsignedByteType( 4 ) );
    data.add( new UnsignedByteType( 7 ) );
    data.add( new UnsignedByteType( 7 ) );
    data.add( new UnsignedByteType( 1 ) );
    data.add( new UnsignedByteType( 1 ) );
    data.add( new UnsignedByteType( 9 ) );
    data.add( new UnsignedByteType( 9 ) );
    data.add( new UnsignedByteType( 12 ) );
    data.add( new UnsignedByteType( 12 ) );
    data.add( new UnsignedByteType( 0 ) );
    return data;
  }
View Full Code Here

  @Before
  public void setUp()
  {
    final long[] dimension = new long[] { 100, 60, 10, 30, 50 };
    img = new ArrayImgFactory< UnsignedByteType >().create( dimension, new UnsignedByteType() );
  }
View Full Code Here

    assertEquals( 5, hist.firstDataValue().get() );

    assertEquals( 256, hist.getBinCount() );
    assertEquals( 11, hist.totalCount() );
    assertEquals( 1, hist.frequency( new UnsignedByteType( 3 ) ) );
    assertEquals( 3, hist.frequency( new UnsignedByteType( 5 ) ) );
    assertEquals( 1, hist.frequency( new UnsignedByteType( 7 ) ) );
    assertEquals( 3, hist.frequency( new UnsignedByteType( 9 ) ) );
    assertEquals( 3, hist.frequency( new UnsignedByteType( 10 ) ) );
    assertEquals( 0, hist.lowerTailCount() );
    assertEquals( 0, hist.upperTailCount() );

    binMapper = new Integer1dBinMapper< UnsignedByteType >( 4, 8, true );

    hist = new Histogram1d< UnsignedByteType >( data, binMapper );

    assertEquals( 8, hist.getBinCount() );
    assertEquals( 11, hist.distributionCount() );
    assertEquals( 1, hist.frequency( new UnsignedByteType( 3 ) ) );
    assertEquals( 3, hist.frequency( new UnsignedByteType( 5 ) ) );
    assertEquals( 1, hist.frequency( new UnsignedByteType( 7 ) ) );
    assertEquals( 3, hist.frequency( new UnsignedByteType( 9 ) ) );
    assertEquals( 3, hist.frequency( new UnsignedByteType( 10 ) ) );
    assertEquals( 1, hist.lowerTailCount() );
    assertEquals( 3, hist.upperTailCount() );

    binMapper = new Integer1dBinMapper< UnsignedByteType >( 5, 5, false );

    hist = new Histogram1d< UnsignedByteType >( data, binMapper );

    assertEquals( 5, hist.getBinCount() );
    assertEquals( 7, hist.distributionCount() );
    assertEquals( 0, hist.frequency( new UnsignedByteType( 3 ) ) );
    assertEquals( 3, hist.frequency( new UnsignedByteType( 5 ) ) );
    assertEquals( 1, hist.frequency( new UnsignedByteType( 7 ) ) );
    assertEquals( 3, hist.frequency( new UnsignedByteType( 9 ) ) );
    assertEquals( 0, hist.frequency( new UnsignedByteType( 10 ) ) );
    assertEquals( 0, hist.lowerTailCount() );
    assertEquals( 0, hist.upperTailCount() );
  }
View Full Code Here

  }

  private List< UnsignedByteType > getData1()
  {
    final List< UnsignedByteType > data = new ArrayList< UnsignedByteType >();
    data.add( new UnsignedByteType( 5 ) );
    data.add( new UnsignedByteType( 3 ) );
    data.add( new UnsignedByteType( 5 ) );
    data.add( new UnsignedByteType( 9 ) );
    data.add( new UnsignedByteType( 10 ) );
    data.add( new UnsignedByteType( 7 ) );
    data.add( new UnsignedByteType( 10 ) );
    data.add( new UnsignedByteType( 10 ) );
    data.add( new UnsignedByteType( 9 ) );
    data.add( new UnsignedByteType( 9 ) );
    data.add( new UnsignedByteType( 5 ) );
    return data;
  }
View Full Code Here

  public static void main( final String[] args )
  {
    System.out.println( "== UNSIGNED 8-BIT ==" );
    new HistogramPerformanceTest< UnsignedByteType >().run(
        new UnsignedByteType(), 256 );
    System.out.println( "== UNSIGNED 16-BIT ==" );
    new HistogramPerformanceTest< UnsignedShortType >().run(
        new UnsignedShortType(), 65536 );
  }
View Full Code Here

TOP

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

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.