@Override public int numDimensions() { return ra.numDimensions(); }
public AbstractComposite( final RandomAccess< T > sourceAccess ) { this.sourceAccess = sourceAccess; this.d = sourceAccess.numDimensions() - 1; }
@Override public long size() { return sourceRandomAccess.numDimensions() * 2; }
@Override public int numDimensions() { return source.numDimensions(); }
public StructuringElementCursor( RandomAccess< T > access, long[][] structuringElement ) { super( access.numDimensions() ); m_access = access; m_center = new long[ access.numDimensions() ]; m_struc = structuringElement; m_numStrucDimensions = m_struc[ 0 ].length; }
public AbstractComposite( final RandomAccess< T > sourceAccess ) { this.sourceAccess = sourceAccess; this.d = sourceAccess.numDimensions() - 1; }
@Override public int numDimensions() { return source.numDimensions(); }
@Override public int numDimensions() { return ra.numDimensions(); }
public StructuringElementCursor( RandomAccess< T > access, long[][] structuringElement ) { super( access.numDimensions() ); m_access = access; m_center = new long[ access.numDimensions() ]; m_struc = structuringElement; m_numStrucDimensions = m_struc[ 0 ].length; }
public LocalNeighborhoodCursor2( final RandomAccess< T > source, final long[] center, final long span ) { super( source.numDimensions() ); this.source = source; this.center = center; max = new long[ n ]; min = new long[ n ]; this.span = span; maxCount = ( long ) Math.pow( span + 1 + span, n ); midCount = maxCount / 2 + 1; reset(); }
PairOfPointsNeighborhood( final long[] position, final long[] offset, final RandomAccess< T > sourceRandomAccess ) { super( position ); ra = sourceRandomAccess.copyRandomAccess(); this.offset = offset; this.ndims = sourceRandomAccess.numDimensions(); }
/** Gets this DrawingHelper's current drawing position. */ public void getPosition(final long[] position) { for (int i = 0; i < accessor.numDimensions(); i++) position[i] = accessor.getLongPosition(i); }
protected final void addToQueue( RandomAccess< V > ra ) { int[] pos = new int[ ra.numDimensions() ]; ra.localize( pos ); m_queue.add( pos ); }
/** Gets this DrawingHelper's current drawing position. */ public void getPosition(final long[] position) { for (int i = 0; i < accessor.numDimensions(); i++) position[i] = accessor.getLongPosition(i); }
public LocalNeighborhoodCursor2( final RandomAccess< T > source, final long[] center, final long span ) { super( source.numDimensions() ); this.source = source; this.center = center; max = new long[ n ]; min = new long[ n ]; this.span = span; maxCount = ( long ) Math.pow( span + 1 + span, n ); midCount = maxCount / 2 + 1; reset(); }
protected final void addToQueue( RandomAccess< V > ra ) { int[] pos = new int[ ra.numDimensions() ]; ra.localize( pos ); m_queue.add( pos ); }
TranslationRandomAccess( final RandomAccess< T > source, final Translation transformToSource ) { super( transformToSource.numSourceDimensions() ); assert source.numDimensions() == transformToSource.numTargetDimensions(); s = source; translation = new long[ n ]; transformToSource.getTranslation( translation ); tmp = new long[ n ]; }
TranslationRandomAccess( final RandomAccess< T > source, final Translation transformToSource ) { super( transformToSource.numSourceDimensions() ); assert source.numDimensions() == transformToSource.numTargetDimensions(); s = source; translation = new long[ n ]; transformToSource.getTranslation( translation ); tmp = new long[ n ]; }
/** * Returns the frequency count associated with a given bin. */ public long frequency( final long[] binPos ) { for ( int i = 0; i < accessor.numDimensions(); i++ ) { if ( binPos[ i ] < 0 || binPos[ i ] >= dimension( i ) ) return 0; } accessor.setPosition( binPos ); return accessor.get().get(); }
@Test public void testRandomAccessible() { long[] position = { 4, 2 }; int n = position.length; RandomAccessible< Localizable > randomAccessible = Localizables.randomAccessible( n ); RandomAccess< Localizable > randomAccess = randomAccessible.randomAccess(); assertEquals( n, randomAccessible.numDimensions() ); assertEquals( n, randomAccess.numDimensions() ); randomAccess.setPosition( position ); assertArrayEquals( position, Localizables.asLongArray( randomAccess.get() ) ); } }