private < T extends NativeType< T > > void testDefaultCellSize( final T type ) { final int defaultCellSize = 43; final int[] expectedCellDims = { 43, 43, 43, 43 }; final CellImgFactory< T > factory = new CellImgFactory<>( type, defaultCellSize ); final long[] dimension = { 100, 80, 4, 3 }; final CellImg< T, ? > img = factory.create( dimension ); final int[] cellDims = new int[ dimension.length ]; img.getCellGrid().cellDimensions( cellDims ); assertArrayEquals( expectedCellDims, cellDims ); }
private < T extends NativeType< T > > void testDefaultCellDimensions( final T type ) { final int[] defaultCellDims = { 6, 8, 5, 3 }; final int[] expectedCellDims = defaultCellDims.clone(); final CellImgFactory< T > factory = new CellImgFactory<>( type, defaultCellDims ); final long[] dimension = { 100, 80, 4, 3 }; final CellImg< T, ? > img = factory.create( dimension ); final int[] cellDims = new int[ dimension.length ]; img.getCellGrid().cellDimensions( cellDims ); assertArrayEquals( expectedCellDims, cellDims ); }
public CellRandomAccess( final AbstractCellImg< T, ?, C, ? > img ) { super( img.numDimensions() ); type = img.createLinkedType(); grid = img.getCellGrid(); randomAccessOnCells = img.getCells().randomAccess(); cellDims = new int[ n ]; dimensions = new long[ n ]; img.getCellGrid().cellDimensions( cellDims ); img.getCellGrid().imgDimensions( dimensions ); isOutOfBounds = false; oobCellMin = new long[ n ]; oobCellMax = new long[ n ]; for ( int d = 0; d < n; ++d ) { oobCellMin[ d ] = Long.MAX_VALUE; oobCellMax[ d ] = Long.MIN_VALUE; } img.getCellGrid().getCellPosition( position, randomAccessOnCells ); updatePosition( false ); }
public CellRandomAccess( final AbstractCellImg< T, ?, C, ? > img ) { super( img.numDimensions() ); type = img.createLinkedType(); grid = img.getCellGrid(); randomAccessOnCells = img.getCells().randomAccess(); cellDims = new int[ n ]; dimensions = new long[ n ]; img.getCellGrid().cellDimensions( cellDims ); img.getCellGrid().imgDimensions( dimensions ); isOutOfBounds = false; oobCellMin = new long[ n ]; oobCellMax = new long[ n ]; for ( int d = 0; d < n; ++d ) { oobCellMin[ d ] = Long.MAX_VALUE; oobCellMax[ d ] = Long.MIN_VALUE; } img.getCellGrid().getCellPosition( position, randomAccessOnCells ); updatePosition( false ); }
cellImg.getCellGrid().cellDimensions( cellDimensions ); final long[] dimensions = new long[ 3 ]; cellImg.dimensions( dimensions );