hanslovsky

cached cell img

Jul 10th, 2017
312
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.89 KB | None | 0 0
  1. package net.imglib2.cache.img;
  2.  
  3. import net.imglib2.cache.CacheLoader;
  4. import net.imglib2.cache.ref.BoundedSoftRefLoaderCache;
  5. import net.imglib2.cache.util.LoaderCacheAsCacheAdapter;
  6. import net.imglib2.img.basictypeaccess.array.FloatArray;
  7. import net.imglib2.img.cell.Cell;
  8. import net.imglib2.img.cell.CellGrid;
  9. import net.imglib2.type.numeric.real.FloatType;
  10.  
  11. public class Dummy
  12. {
  13.  
  14.     public static void main( final String[] args )
  15.     {
  16.         final CacheLoader< Long, Cell< FloatArray > > loader = l -> {
  17.             return null;
  18.         };
  19.  
  20.         final BoundedSoftRefLoaderCache< Long, Cell< FloatArray > > cache = new BoundedSoftRefLoaderCache<>( 1 );
  21.         final LoaderCacheAsCacheAdapter< Long, Cell< FloatArray > > wrappedCache = new LoaderCacheAsCacheAdapter<>( cache, loader );
  22.  
  23.         new CachedCellImg<>( new CellGrid( new long[ 3 ], new int[ 3 ] ), new FloatType(), wrappedCache, new FloatArray( 1 ) );
  24.  
  25.     }
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment