Skip to content
Snippets Groups Projects
Commit f9673781 authored by Tobias Pietzsch's avatar Tobias Pietzsch
Browse files

remove deprecated VolatileGlobalCellCache constructor

parent 4b8813b0
Branches
Tags
No related merge requests found
......@@ -104,12 +104,6 @@ public class VolatileGlobalCellCache implements CacheControl
protected final LoadingVolatileCache< Key, VolatileCell< ? > > volatileCache; // TODO rename
@Deprecated
public VolatileGlobalCellCache( final int maxNumTimepoints, final int maxNumSetups, final int maxNumLevels, final int numFetcherThreads )
{
this( maxNumLevels, numFetcherThreads );
}
/**
* @param maxNumLevels
* the highest occurring mipmap level plus 1.
......
......@@ -6,13 +6,13 @@
* %%
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
......@@ -121,7 +121,7 @@ public class CatmaidImageLoader extends AbstractViewerSetupImgLoader< ARGBType,
}
loader = new CatmaidVolatileIntArrayLoader( urlFormat, tileWidth, tileHeight, zScales );
cache = new VolatileGlobalCellCache( 1, 1, numScales, 10 );
cache = new VolatileGlobalCellCache( numScales, 10 );
}
public CatmaidImageLoader(
......@@ -246,7 +246,7 @@ public class CatmaidImageLoader extends AbstractViewerSetupImgLoader< ARGBType,
img.setLinkedType( linkedType );
return img;
}
@Override
public RandomAccessibleInterval< VolatileARGBType > getVolatileImage( final int timepointId, final int level, final ImgLoaderHint... hints )
{
......@@ -273,7 +273,7 @@ public class CatmaidImageLoader extends AbstractViewerSetupImgLoader< ARGBType,
{
return numScales;
}
public void setCache( final VolatileGlobalCellCache cache )
{
this.cache = cache;
......
......@@ -6,13 +6,13 @@
* %%
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
......@@ -40,6 +40,18 @@ import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import bdv.AbstractViewerSetupImgLoader;
import bdv.ViewerImgLoader;
import bdv.cache.CacheHints;
import bdv.cache.LoadingStrategy;
import bdv.img.cache.CachedCellImg;
import bdv.img.cache.VolatileGlobalCellCache;
import bdv.img.cache.VolatileImgCells;
import bdv.img.cache.VolatileImgCells.CellCache;
import bdv.util.ConstantRandomAccessible;
import bdv.util.MipmapTransforms;
import ch.systemsx.cisd.hdf5.HDF5Factory;
import ch.systemsx.cisd.hdf5.IHDF5Reader;
import mpicbg.spim.data.generic.sequence.AbstractSequenceDescription;
import mpicbg.spim.data.generic.sequence.BasicViewSetup;
import mpicbg.spim.data.generic.sequence.ImgLoaderHint;
......@@ -76,18 +88,6 @@ import net.imglib2.type.volatiles.VolatileUnsignedShortType;
import net.imglib2.util.Fraction;
import net.imglib2.util.Intervals;
import net.imglib2.view.Views;
import bdv.AbstractViewerSetupImgLoader;
import bdv.ViewerImgLoader;
import bdv.cache.CacheHints;
import bdv.cache.LoadingStrategy;
import bdv.img.cache.CachedCellImg;
import bdv.img.cache.VolatileGlobalCellCache;
import bdv.img.cache.VolatileImgCells;
import bdv.img.cache.VolatileImgCells.CellCache;
import bdv.util.ConstantRandomAccessible;
import bdv.util.MipmapTransforms;
import ch.systemsx.cisd.hdf5.HDF5Factory;
import ch.systemsx.cisd.hdf5.IHDF5Reader;
public class Hdf5ImageLoader implements ViewerImgLoader, MultiResolutionImgLoader
{
......@@ -200,8 +200,6 @@ public class Hdf5ImageLoader implements ViewerImgLoader, MultiResolutionImgLoade
cachedDimsAndExistence.clear();
final List< TimePoint > timepoints = sequenceDescription.getTimePoints().getTimePointsOrdered();
final int maxNumTimepoints = timepoints.get( timepoints.size() - 1 ).getId() + 1;
final int maxNumSetups = setups.get( setups.size() - 1 ).getId() + 1;
try
{
hdf5Access = new HDF5AccessHack( hdf5Reader );
......@@ -212,7 +210,7 @@ public class Hdf5ImageLoader implements ViewerImgLoader, MultiResolutionImgLoade
hdf5Access = new HDF5Access( hdf5Reader );
}
shortLoader = new Hdf5VolatileShortArrayLoader( hdf5Access );
cache = new VolatileGlobalCellCache( maxNumTimepoints, maxNumSetups, maxNumLevels, 1 );
cache = new VolatileGlobalCellCache( maxNumLevels, 1 );
}
}
}
......
......@@ -6,13 +6,13 @@
* %%
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
......@@ -32,20 +32,6 @@ import java.io.File;
import java.util.HashMap;
import java.util.List;
import mpicbg.spim.data.generic.sequence.AbstractSequenceDescription;
import mpicbg.spim.data.generic.sequence.BasicViewSetup;
import mpicbg.spim.data.generic.sequence.ImgLoaderHint;
import mpicbg.spim.data.sequence.TimePoint;
import net.imglib2.RandomAccessibleInterval;
import net.imglib2.Volatile;
import net.imglib2.img.NativeImg;
import net.imglib2.img.basictypeaccess.volatiles.VolatileAccess;
import net.imglib2.img.cell.CellImg;
import net.imglib2.realtransform.AffineTransform3D;
import net.imglib2.type.NativeType;
import net.imglib2.type.numeric.integer.UnsignedShortType;
import net.imglib2.type.volatiles.VolatileUnsignedShortType;
import net.imglib2.util.Fraction;
import bdv.AbstractViewerSetupImgLoader;
import bdv.ViewerImgLoader;
import bdv.cache.CacheControl;
......@@ -61,6 +47,19 @@ import bdv.img.hdf5.ViewLevelId;
import bdv.img.imaris.DataTypes.DataType;
import ch.systemsx.cisd.hdf5.HDF5Factory;
import ch.systemsx.cisd.hdf5.IHDF5Reader;
import mpicbg.spim.data.generic.sequence.AbstractSequenceDescription;
import mpicbg.spim.data.generic.sequence.BasicViewSetup;
import mpicbg.spim.data.generic.sequence.ImgLoaderHint;
import net.imglib2.RandomAccessibleInterval;
import net.imglib2.Volatile;
import net.imglib2.img.NativeImg;
import net.imglib2.img.basictypeaccess.volatiles.VolatileAccess;
import net.imglib2.img.cell.CellImg;
import net.imglib2.realtransform.AffineTransform3D;
import net.imglib2.type.NativeType;
import net.imglib2.type.numeric.integer.UnsignedShortType;
import net.imglib2.type.volatiles.VolatileUnsignedShortType;
import net.imglib2.util.Fraction;
public class ImarisImageLoader< T extends NativeType< T >, V extends Volatile< T > & NativeType< V > , A extends VolatileAccess > implements ViewerImgLoader
{
......@@ -111,11 +110,8 @@ public class ImarisImageLoader< T extends NativeType< T >, V extends Volatile< T
final IHDF5Reader hdf5Reader = HDF5Factory.openForReading( hdf5File );
final List< TimePoint > timepoints = sequenceDescription.getTimePoints().getTimePointsOrdered();
final List< ? extends BasicViewSetup > setups = sequenceDescription.getViewSetupsOrdered();
final int maxNumTimepoints = timepoints.get( timepoints.size() - 1 ).getId() + 1;
final int maxNumSetups = setups.get( setups.size() - 1 ).getId() + 1;
final int maxNumLevels = mipmapInfo.getNumLevels();
try
......@@ -127,7 +123,7 @@ public class ImarisImageLoader< T extends NativeType< T >, V extends Volatile< T
throw new RuntimeException( e );
}
loader = dataType.createArrayLoader( hdf5Access );
cache = new VolatileGlobalCellCache( maxNumTimepoints, maxNumSetups, maxNumLevels, 1 );
cache = new VolatileGlobalCellCache( maxNumLevels, 1 );
for ( final BasicViewSetup setup : setups )
{
......
......@@ -87,7 +87,7 @@ public class OpenConnectomeImageLoader extends AbstractViewerSetupImgLoader< Uns
blockDimensions = info.getLevelCellDimensions();
mipmapTransforms = info.getLevelTransforms( mode );
cache = new VolatileGlobalCellCache( 1, 1, numScales, 10 );
cache = new VolatileGlobalCellCache( numScales, 10 );
System.out.println( info.getOffsets( mode )[ 0 ][ 2 ] + " " + imageDimensions[ 0 ][ 2 ] );
loader = new OpenConnectomeVolatileArrayLoader(
......
......@@ -33,18 +33,8 @@ import java.io.InputStreamReader;
import java.net.URL;
import java.util.HashMap;
import mpicbg.spim.data.generic.sequence.ImgLoaderHint;
import net.imglib2.FinalInterval;
import net.imglib2.RandomAccessibleInterval;
import net.imglib2.img.NativeImg;
import net.imglib2.img.basictypeaccess.volatiles.array.VolatileShortArray;
import net.imglib2.realtransform.AffineTransform3D;
import net.imglib2.type.NativeType;
import net.imglib2.type.numeric.integer.UnsignedShortType;
import net.imglib2.type.volatiles.VolatileUnsignedShortType;
import net.imglib2.util.Fraction;
import net.imglib2.util.IntervalIndexer;
import net.imglib2.view.Views;
import com.google.gson.GsonBuilder;
import bdv.AbstractViewerSetupImgLoader;
import bdv.ViewerImgLoader;
import bdv.cache.CacheHints;
......@@ -57,8 +47,18 @@ import bdv.img.hdf5.DimsAndExistence;
import bdv.img.hdf5.MipmapInfo;
import bdv.img.hdf5.ViewLevelId;
import bdv.util.ConstantRandomAccessible;
import com.google.gson.GsonBuilder;
import mpicbg.spim.data.generic.sequence.ImgLoaderHint;
import net.imglib2.FinalInterval;
import net.imglib2.RandomAccessibleInterval;
import net.imglib2.img.NativeImg;
import net.imglib2.img.basictypeaccess.volatiles.array.VolatileShortArray;
import net.imglib2.realtransform.AffineTransform3D;
import net.imglib2.type.NativeType;
import net.imglib2.type.numeric.integer.UnsignedShortType;
import net.imglib2.type.volatiles.VolatileUnsignedShortType;
import net.imglib2.util.Fraction;
import net.imglib2.util.IntervalIndexer;
import net.imglib2.view.Views;
public class RemoteImageLoader implements ViewerImgLoader
{
......@@ -116,11 +116,7 @@ public class RemoteImageLoader implements ViewerImgLoader
new InputStreamReader( url.openStream() ),
RemoteImageLoaderMetaData.class );
shortLoader = new RemoteVolatileShortArrayLoader( this );
cache = new VolatileGlobalCellCache(
metadata.maxNumTimepoints,
metadata.maxNumSetups,
metadata.maxNumLevels,
10 );
cache = new VolatileGlobalCellCache( metadata.maxNumLevels, 10 );
cellsDimensions = metadata.createCellsDimensions();
for ( final int setupId : metadata.perSetupMipmapInfo.keySet() )
setupImgLoaders.put( setupId, new SetupImgLoader( setupId ) );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment