Examples of MixedTransform


Examples of net.imglib2.transform.integer.MixedTransform

      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

Examples of net.imglib2.transform.integer.MixedTransform

    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

Examples of net.imglib2.transform.integer.MixedTransform

   *            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

Examples of net.imglib2.transform.integer.MixedTransform

   *            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

Examples of net.imglib2.transform.integer.MixedTransform

    final long[] offset = new long[ n ];
    interval.min( offset );
    interval.max( max );
    for ( int d = 0; d < n; ++d )
      max[ d ] -= offset[ d ];
    final MixedTransform t = new MixedTransform( n, n );
    t.setTranslation( offset );
    return interval( new MixedTransformView< T >( interval, t ), min, max );
  }
View Full Code Here

Examples of net.imglib2.transform.integer.MixedTransform

   */
  public static < T > MixedTransformView< T > hyperSlice( final RandomAccessible< T > view, final int d, final long pos )
  {
    final int m = view.numDimensions();
    final int n = m - 1;
    final MixedTransform t = new MixedTransform( n, m );
    final long[] translation = new long[ m ];
    translation[ d ] = pos;
    final boolean[] zero = new boolean[ m ];
    final int[] component = new int[ m ];
    for ( int e = 0; e < m; ++e )
    {
      if ( e < d )
      {
        zero[ e ] = false;
        component[ e ] = e;
      }
      else if ( e > d )
      {
        zero[ e ] = false;
        component[ e ] = e - 1;
      }
      else
      {
        zero[ e ] = true;
        component[ e ] = 0;
      }
    }
    t.setTranslation( translation );
    t.setComponentZero( zero );
    t.setComponentMapping( component );
    return new MixedTransformView< T >( view, t );
  }
View Full Code Here

Examples of net.imglib2.transform.integer.MixedTransform

   */
  public static < T > MixedTransformView< T > addDimension( final RandomAccessible< T > randomAccessible )
  {
    final int m = randomAccessible.numDimensions();
    final int n = m + 1;
    final MixedTransform t = new MixedTransform( n, m );
    return new MixedTransformView< T >( randomAccessible, t );
  }
View Full Code Here

Examples of net.imglib2.transform.integer.MixedTransform

  public static < T > MixedTransformView< T > invertAxis( final RandomAccessible< T > randomAccessible, final int d )
  {
    final int n = randomAccessible.numDimensions();
    final boolean[] inv = new boolean[ n ];
    inv[ d ] = true;
    final MixedTransform t = new MixedTransform( n, n );
    t.setComponentInversion( inv );
    return new MixedTransformView< T >( randomAccessible, t );
  }
View Full Code Here

Examples of net.imglib2.transform.integer.MixedTransform

    }
    else
    {
      this.source = source;
      final int sourceDim = this.source.numDimensions();
      this.transformToSource = new MixedTransform( n, sourceDim );
      this.transformToSource.set( transformToSource );
    }

    fullViewRandomAccessible = null;
  }
View Full Code Here

Examples of net.imglib2.transform.integer.MixedTransform

    {
      System.out.println( "incompatible dimensions" );
      return false;
    }

    final MixedTransform t1t2 = t1.concatenate( t2 );

    final Matrix mt1 = new Matrix( t1.getMatrix() );
    final Matrix mt2 = new Matrix( t2.getMatrix() );
    final Matrix mt1t2 = new Matrix( t1t2.getMatrix() );

    if ( mt1.times( mt2 ).minus( mt1t2 ).normF() > 0.1 )
    {
      System.out.println( "=======================" );
      System.out.println( "t1: " + t1.numSourceDimensions() + " -> " + t1.numTargetDimensions() + " (n -> m)" );
      System.out.println( "t2: " + t2.numSourceDimensions() + " -> " + t2.numTargetDimensions() + " (n -> m)" );
      System.out.println( "t1t2: " + t1t2.numSourceDimensions() + " -> " + t1t2.numTargetDimensions() + " (n -> m)" );

      System.out.print( "t1 = " );
      mt1.print( 1, 0 );
      System.out.print( "t2 = " );
      mt2.print( 1, 0 );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.