Package net.imglib2.transform.integer

Examples of net.imglib2.transform.integer.Mixed


      return ( ArrayImgAWTScreenImage ) container;
    }

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


  // this is the constructor if you want it to be a variable
  public GenericShortType( final short value )
  {
    img = null;
    dataAccess = new ShortArray( 1 );
    setValue( value );
  }
View Full Code Here

  }

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

  }

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

        }

        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

    for ( final ListIterator< Transform > i = transforms.listIterator(); i.hasNext(); )
    {
      final Transform t = i.next();
      if ( Mixed.class.isInstance( t ) )
      {
        final Mixed mixed = ( Mixed ) t;
        if ( isIdentity( mixed ) )
        {
          // found identity
          // remove from transforms list
          i.remove();
        }
        else if ( isTranslation( mixed ) )
        {
          // found pure translation
          // replace by a TranslationTransform
          final long[] translation = new long[ mixed.numTargetDimensions() ];
          mixed.getTranslation( translation );
          i.set( new TranslationTransform( translation ) );
        }
        // else if ( isComponentMapping( mixed ) )
//        {
//          // found pure component mapping
//          // replace by a ComponentMappingTransform
//          final int[] component = new int[ mixed.numTargetDimensions() ];
//          mixed.getComponentMapping( component );
//          i.set( new ComponentMappingTransform( component ) );
//        }
        else if ( isSlicing( mixed ) )
        {
          // found pure slicing
          // replace by a SlicingTransform
          final int m = mixed.numTargetDimensions();
          final long[] translation = new long[ m ];
          final boolean[] zero = new boolean[ m ];
          final int[] component = new int[ m ];
          mixed.getTranslation( translation );
          mixed.getComponentZero( zero );
          mixed.getComponentMapping( component );
          final SlicingTransform sl = new SlicingTransform( mixed.numSourceDimensions(), m );
          sl.setTranslation( translation );
          sl.setComponentZero( zero );
          sl.setComponentMapping( component );
          i.set( sl );
        }
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

   *            resulting view.
   */
  public static < T > MixedTransformView< T > translate( final RandomAccessible< T > randomAccessible, final long... translation )
  {
    final int n = randomAccessible.numDimensions();
    final MixedTransform t = new MixedTransform( n, n );
    t.setInverseTranslation( translation );
    return new MixedTransformView< T >( randomAccessible, t );
  }
View Full Code Here

   *            origin of resulting view.
   */
  public static < T > MixedTransformView< T > offset( final RandomAccessible< T > randomAccessible, final long... offset )
  {
    final int n = randomAccessible.numDimensions();
    final MixedTransform t = new MixedTransform( n, n );
    t.setTranslation( offset );
    return new MixedTransformView< T >( randomAccessible, t );
  }
View Full Code Here

TOP

Related Classes of net.imglib2.transform.integer.Mixed

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.