Package net.imglib2.type.numeric.real

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


        }

        if ( optimizable )
        {
//          System.out.println( "interval = " + Util.printInterval( interval ) );
          final Interval sliceInterval = t.transform( new BoundingBox( interval ) ).getInterval();
//          System.out.println( "transformed interval = " + Util.printInterval( sliceInterval ) );
          if ( iterableSource.supportsOptimizedCursor( sliceInterval ) )
          {
            // check for FlatIterationOrder
            boolean flat = FlatIterationOrder.class.isInstance( iterableSource.subIntervalIterationOrder( sliceInterval ) );
View Full Code Here


      else
      {
        component[ e ] = e;
      }
    }
    final MixedTransform t = new MixedTransform( n, n );
    t.setComponentMapping( component );
    t.setComponentInversion( inv );
    return new MixedTransformView< T >( randomAccessible, t );
  }
View Full Code Here

    final int[] component = new int[ n ];
    for ( int e = 0; e < n; ++e )
      component[ e ] = e;
    component[ fromAxis ] = toAxis;
    component[ toAxis ] = fromAxis;
    final MixedTransform t = new MixedTransform( n, n );
    t.setComponentMapping( component );
    return new MixedTransformView< T >( randomAccessible, t );
  }
View Full Code Here

        if ( iterableSource.supportsOptimizedCursor( interval ) )
          return new SubInterval( iterableSource );
      }
      else if ( transforms.size() == 1 && SlicingTransform.class.isInstance( transforms.get( 0 ) ) )
      {
        final SlicingTransform t = ( SlicingTransform ) transforms.get( 0 );
        final int m = t.numTargetDimensions();
        final int n = t.numSourceDimensions();

        // Check whether the slicing can be potentially optimized.
        boolean optimizable = true;

        // 1.) Slice dimensions must be mapped to a contiguous range of
        // target dimensions starting with dimension 0.
        int firstZeroDim = 0;
        for ( ; firstZeroDim < m && !t.getComponentZero( firstZeroDim ); ++firstZeroDim );
        for ( int d = firstZeroDim + 1; d < m && optimizable; ++d )
          if ( !t.getComponentZero( d ) )
            optimizable = false;

        // 2.) All slice dimensions must be mapped to a target dimension
        final int[] sourceComponent = new int[ n ];
        if ( optimizable )
        {
          Arrays.fill( sourceComponent, -1 );
          for ( int d = 0; d < m; ++d )
            if ( !t.getComponentZero( d ) )
              sourceComponent[ t.getComponentMapping( d ) ] = d;
          for ( int d = 0; d < n && optimizable; ++d )
            if ( sourceComponent[ d ] < 0 )
              optimizable = false;
        }

        if ( optimizable )
        {
//          System.out.println( "interval = " + Util.printInterval( interval ) );
          final Interval sliceInterval = t.transform( new BoundingBox( interval ) ).getInterval();
//          System.out.println( "transformed interval = " + Util.printInterval( sliceInterval ) );
          if ( iterableSource.supportsOptimizedCursor( sliceInterval ) )
          {
            // check for FlatIterationOrder
            boolean flat = FlatIterationOrder.class.isInstance( iterableSource.subIntervalIterationOrder( sliceInterval ) );
View Full Code Here

   * array will update the {@link Image}.
   */
  public ARGBScreenImage( final int width, final int height, final int[] data )
  {
    super( new IntArray( data ), new long[]{ width, height }, new Fraction() );
    setLinkedType( new ARGBType( this ) );
    this.data = data;

    final SampleModel sampleModel = ARGB_COLOR_MODEL.createCompatibleWritableRaster( 1, 1 ).getSampleModel()
        .createCompatibleSampleModel( width, height );
    final DataBuffer dataBuffer = new DataBufferInt( data, width * height, 0 );
View Full Code Here

      mapSingle( sourceRandomAccess, currentConverters[ 0 ] );
      return;
    }

    final Cursor< ARGBType > targetCursor = target.localizingCursor();
    final ARGBType bi = new ARGBType();

    while ( targetCursor.hasNext() )
    {
      targetCursor.fwd();
      sourceRandomAccess.setPosition( targetCursor.getLongPosition( 0 ), 0 );
      sourceRandomAccess.setPosition( targetCursor.getLongPosition( 1 ), 1 );
      int aSum = 0, rSum = 0, gSum = 0, bSum = 0;
      for ( int i = 0; i < size; i++ )
      {
        sourceRandomAccess.setPosition( currentPositions[ i ], dimIndex );
        currentConverters[ i ].convert( sourceRandomAccess.get(), bi );

        // accumulate converted result
        final int value = bi.get();
        final int a = ARGBType.alpha( value );
        final int r = ARGBType.red( value );
        final int g = ARGBType.green( value );
        final int b = ARGBType.blue( value );
        aSum += a;
View Full Code Here

      sourceRandomAccess.setPosition( currentPositions[ 0 ], dimIndex );
      mapSingle( sourceRandomAccess, currentConverters[ 0 ] );
      return;
    }

    final ARGBType bi = new ARGBType();

    final RandomAccess< ARGBType > targetRandomAccess = target.randomAccess();

    targetRandomAccess.setPosition( min[ 1 ], 1 );
    while ( targetRandomAccess.getLongPosition( 1 ) <= max[ 1 ] )
    {
      sourceRandomAccess.setPosition( min[ 0 ], 0 );
      targetRandomAccess.setPosition( min[ 0 ], 0 );
      while ( targetRandomAccess.getLongPosition( 0 ) <= max[ 0 ] )
      {
        int aSum = 0, rSum = 0, gSum = 0, bSum = 0;
        for ( int i = 0; i < size; i++ )
        {
          sourceRandomAccess.setPosition( currentPositions[ i ], dimIndex );
          currentConverters[ i ].convert( sourceRandomAccess.get(), bi );

          // accumulate converted result
          final int value = bi.get();
          final int a = ARGBType.alpha( value );
          final int r = ARGBType.red( value );
          final int g = ARGBType.green( value );
          final int b = ARGBType.blue( value );
          aSum += a;
View Full Code Here

  {

    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() ) )
    {
View Full Code Here

    }

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

    if ( UnsignedIntType.class.isAssignableFrom( type.getClass() ) )
    {
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

TOP

Related Classes of net.imglib2.type.numeric.real.FloatType

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.