SingleCellArrayImg( final int[] cellDims, final long[] cellMin, final A cellData, final Dirty dirtyFlag, final T type ) { this( cellDims, cellMin, cellData, dirtyFlag ); @SuppressWarnings( "unchecked" ) final NativeTypeFactory< T, ? super A > info = ( NativeTypeFactory< T, ? super A > ) type.getNativeTypeFactory(); setLinkedType( info.createLinkedType( this ) ); }
@SuppressWarnings( "unchecked" ) private T createType( final A access ) { T t = ( ( NativeTypeFactory< T, ? super A > ) type.getNativeTypeFactory() ).createLinkedType( new NoImg<>( access ) ); t.updateContainer( null ); return t; }
public LazyCellImg( final CellGrid grid, final T type, final Get< Cell< A > > get ) { super( grid, new LazyCells<>( grid.getGridDimensions(), get ), type.getEntitiesPerPixel() ); @SuppressWarnings( "unchecked" ) final NativeTypeFactory< T, ? super A > typeFactory = ( NativeTypeFactory< T, ? super A > ) type.getNativeTypeFactory(); setLinkedType( typeFactory.createLinkedType( this ) ); }
public LazyCellImg( final CellGrid grid, final T type, final Get< Cell< A > > get ) { super( grid, new LazyCells<>( grid.getGridDimensions(), get ), type.getEntitiesPerPixel() ); @SuppressWarnings( "unchecked" ) final NativeTypeFactory< T, ? super A > typeFactory = ( NativeTypeFactory< T, ? super A > ) type.getNativeTypeFactory(); setLinkedType( typeFactory.createLinkedType( this ) ); }
public VolatileCachedCellImg( final CellGrid grid, final T type, final CacheHints cacheHints, final Get< Cell< A > > get ) { super( grid, new VolatileCachedCells<>( grid.getGridDimensions(), get, cacheHints ), type.getEntitiesPerPixel() ); @SuppressWarnings( "unchecked" ) final NativeTypeFactory< T, ? super A > typeFactory = ( NativeTypeFactory< T, ? super A > ) type.getNativeTypeFactory(); setLinkedType( typeFactory.createLinkedType( this ) ); }
private < A > NtreeImg< T, ? > create( final long[] dimensions, final T type, final NativeTypeFactory< T, A > typeFactory ) { final Fraction entitiesPerPixel = type.getEntitiesPerPixel(); if ( entitiesPerPixel.getNumerator() != entitiesPerPixel.getDenominator() ) throw new RuntimeException( "not implemented" ); final long[] pos = new long[ dimensions.length ]; final NtreeImg< T, ? extends A > img = new NtreeImg<>( createNtreeAccess( typeFactory, dimensions ).createInstance( pos ), // calling createInstance(pos) is necessary here, because // otherwise javac will not infer the NtreeAccess type dimensions, entitiesPerPixel ); img.setLinkedType( typeFactory.createLinkedType( img ) ); return img; }
private < A > NtreeImg< T, ? > create( final long[] dimensions, final T type, final NativeTypeFactory< T, A > typeFactory ) { final Fraction entitiesPerPixel = type.getEntitiesPerPixel(); if ( entitiesPerPixel.getNumerator() != entitiesPerPixel.getDenominator() ) throw new RuntimeException( "not implemented" ); final long[] pos = new long[ dimensions.length ]; final NtreeImg< T, ? extends A > img = new NtreeImg<>( createNtreeAccess( typeFactory, dimensions ).createInstance( pos ), // calling createInstance(pos) is necessary here, because // otherwise javac will not infer the NtreeAccess type dimensions, entitiesPerPixel ); img.setLinkedType( typeFactory.createLinkedType( img ) ); return img; }
private < A extends ArrayDataAccess< A > > PlanarImg< T, ? > create( final long[] dimensions, final T type, final NativeTypeFactory< T, A > typeFactory ) { final Fraction entitiesPerPixel = type.getEntitiesPerPixel(); final PlanarImg< T, A > img = new PlanarImg<>( ArrayDataAccessFactory.get( typeFactory ), dimensions, entitiesPerPixel ); img.setLinkedType( typeFactory.createLinkedType( img ) ); return img; }
private < A extends ArrayDataAccess< A > > PlanarImg< T, ? > create( final long[] dimensions, final T type, final NativeTypeFactory< T, A > typeFactory ) { final Fraction entitiesPerPixel = type.getEntitiesPerPixel(); final PlanarImg< T, A > img = new PlanarImg<>( ArrayDataAccessFactory.get( typeFactory ), dimensions, entitiesPerPixel ); img.setLinkedType( typeFactory.createLinkedType( img ) ); return img; }
private < A extends ArrayDataAccess< A > > ArrayImg< T, A > create( final long[] dimensions, final T type, final NativeTypeFactory< T, A > typeFactory ) { final Fraction entitiesPerPixel = type.getEntitiesPerPixel(); final int numEntities = numEntitiesRangeCheck( dimensions, entitiesPerPixel ); final A data = ArrayDataAccessFactory.get( typeFactory ).createArray( numEntities ); final ArrayImg< T, A > img = new ArrayImg<>( data, dimensions, entitiesPerPixel ); img.setLinkedType( typeFactory.createLinkedType( img ) ); return img; }
private < A extends ArrayDataAccess< A > > ArrayImg< T, A > create( final long[] dimensions, final T type, final NativeTypeFactory< T, A > typeFactory ) { final Fraction entitiesPerPixel = type.getEntitiesPerPixel(); final int numEntities = numEntitiesRangeCheck( dimensions, entitiesPerPixel ); final A data = ArrayDataAccessFactory.get( typeFactory ).createArray( numEntities ); final ArrayImg< T, A > img = new ArrayImg<>( data, dimensions, entitiesPerPixel ); img.setLinkedType( typeFactory.createLinkedType( img ) ); return img; }
private < A extends ArrayDataAccess< A > > CellImg< T, A > create( final long[] dimensions, final T type, final NativeTypeFactory< T, A > typeFactory ) { verifyDimensions( dimensions ); final int n = dimensions.length; final Fraction entitiesPerPixel = type.getEntitiesPerPixel(); final int[] cellDimensions = getCellDimensions( defaultCellDimensions, n, entitiesPerPixel ); final CellGrid grid = new CellGrid( dimensions, cellDimensions ); final long[] gridDimensions = new long[ grid.numDimensions() ]; grid.gridDimensions( gridDimensions ); final Cell< A > cellType = new Cell<>( new int[] { 1 }, new long[] { 1 }, null ); final ListImg< Cell< A > > cells = new ListImg<>( gridDimensions, cellType ); final long[] cellGridPosition = new long[ n ]; final long[] cellMin = new long[ n ]; final int[] cellDims = new int[ n ]; final ListLocalizingCursor< Cell< A > > cellCursor = cells.localizingCursor(); while ( cellCursor.hasNext() ) { cellCursor.fwd(); cellCursor.localize( cellGridPosition ); grid.getCellDimensions( cellGridPosition, cellMin, cellDims ); final A data = ArrayDataAccessFactory.get( typeFactory ).createArray( ( int ) entitiesPerPixel.mulCeil( Intervals.numElements( cellDims ) ) ); cellCursor.set( new Cell<>( cellDims, cellMin, data ) ); } final CellImg< T, A > img = new CellImg<>( this, grid, cells, entitiesPerPixel ); img.setLinkedType( typeFactory.createLinkedType( img ) ); return img; }
private < A extends ArrayDataAccess< A > > CellImg< T, A > create( final long[] dimensions, final T type, final NativeTypeFactory< T, A > typeFactory ) { verifyDimensions( dimensions ); final int n = dimensions.length; final Fraction entitiesPerPixel = type.getEntitiesPerPixel(); final int[] cellDimensions = getCellDimensions( defaultCellDimensions, n, entitiesPerPixel ); final CellGrid grid = new CellGrid( dimensions, cellDimensions ); final long[] gridDimensions = new long[ grid.numDimensions() ]; grid.gridDimensions( gridDimensions ); final Cell< A > cellType = new Cell<>( new int[] { 1 }, new long[] { 1 }, null ); final ListImg< Cell< A > > cells = new ListImg<>( gridDimensions, cellType ); final long[] cellGridPosition = new long[ n ]; final long[] cellMin = new long[ n ]; final int[] cellDims = new int[ n ]; final ListLocalizingCursor< Cell< A > > cellCursor = cells.localizingCursor(); while ( cellCursor.hasNext() ) { cellCursor.fwd(); cellCursor.localize( cellGridPosition ); grid.getCellDimensions( cellGridPosition, cellMin, cellDims ); final A data = ArrayDataAccessFactory.get( typeFactory ).createArray( ( int ) entitiesPerPixel.mulCeil( Intervals.numElements( cellDims ) ) ); cellCursor.set( new Cell<>( cellDims, cellMin, data ) ); } final CellImg< T, A > img = new CellImg<>( this, grid, cells, entitiesPerPixel ); img.setLinkedType( typeFactory.createLinkedType( img ) ); return img; }
final SCIFIOCellImg<T, ? extends A> img = new SCIFIOCellImg<>(this, grid, entitiesPerPixel, cache, accessType); img.setLinkedType(typeFactory.createLinkedType(img)); return img;
final SCIFIOCellImg<T, ? extends A> img = new SCIFIOCellImg<>(this, grid, entitiesPerPixel, cache, accessType); img.setLinkedType(typeFactory.createLinkedType(img)); return img;
img.setLinkedType( typeFactory.createLinkedType( img ) ); return img;