public class N5ImageLoader extends Object implements ViewerImgLoader, mpicbg.spim.data.sequence.MultiResolutionImgLoader
| Modifier and Type | Class and Description |
|---|---|
class |
N5ImageLoader.SetupImgLoader<T extends net.imglib2.type.NativeType<T>,V extends net.imglib2.Volatile<T> & net.imglib2.type.NativeType<V>> |
| Constructor and Description |
|---|
N5ImageLoader(File n5File,
mpicbg.spim.data.generic.sequence.AbstractSequenceDescription<?,?,?> sequenceDescription) |
N5ImageLoader(org.janelia.saalfeldlab.n5.N5Reader n5Reader,
URI n5URI,
mpicbg.spim.data.generic.sequence.AbstractSequenceDescription<?,?,?> sequenceDescription) |
N5ImageLoader(URI n5URI,
mpicbg.spim.data.generic.sequence.AbstractSequenceDescription<?,?,?> sequenceDescription) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Clear the cache.
|
static SimpleCacheArrayLoader<?> |
createCacheArrayLoader(org.janelia.saalfeldlab.n5.N5Reader n5,
String pathName) |
protected N5Properties |
createN5PropertiesInstance()
Create a new N5Properties (provides metadata and resolves dataset paths).
|
CacheControl |
getCacheControl() |
File |
getN5File() |
URI |
getN5URI() |
N5ImageLoader.SetupImgLoader<?,?> |
getSetupImgLoader(int setupId) |
protected org.janelia.saalfeldlab.n5.N5Reader |
instantiateN5Reader()
Create a new N5Reader.
|
Future<Void> |
prefetch(int parallelism)
Touch all metadata in advance in parallel so the N5-API caches them.
|
protected <T extends net.imglib2.type.NativeType<T>> |
prepareCachedImage(String datasetPath,
int setupId,
int timepointId,
int level,
net.imglib2.cache.volatiles.CacheHints cacheHints,
T type)
Create a
CellImg backed by the cache. |
void |
setCreatedSharedQueue(SharedQueue createdSharedQueue)
Use the given
SharedQueue to asynchronously load blocks. |
void |
setNumFetcherThreads(int n)
Set the number of fetcher threads that will be created to asynchronously load
blocks.
|
public N5ImageLoader(URI n5URI, mpicbg.spim.data.generic.sequence.AbstractSequenceDescription<?,?,?> sequenceDescription)
public N5ImageLoader(File n5File, mpicbg.spim.data.generic.sequence.AbstractSequenceDescription<?,?,?> sequenceDescription)
public N5ImageLoader(org.janelia.saalfeldlab.n5.N5Reader n5Reader, URI n5URI, mpicbg.spim.data.generic.sequence.AbstractSequenceDescription<?,?,?> sequenceDescription)
public URI getN5URI()
public File getN5File()
protected org.janelia.saalfeldlab.n5.N5Reader instantiateN5Reader()
Can be overridden by subclasses (rather than only having the option to provide an instance at construction time).
protected N5Properties createN5PropertiesInstance()
Can be overridden by subclasses to adapt to different metadata schemes and storage layouts.
public Future<Void> prefetch(int parallelism)
prefetch() completes immediately. The prefetching is done
asynchronously in a new ForkJoinPool with the indicated parallelism level. The returned Future can be used to wait for
completion of the async prefetching.
parallelism - the parallelism levelpublic void setNumFetcherThreads(int n)
ViewerImgLoadern=0, but that means that the volatile
versions of images may not work correctly.
This is an optional operation, i.e., some ImgLoader implementations may just ignore it.
This method should be called before using the image loader, otherwise it might not have the desired effect.
setNumFetcherThreads in interface ViewerImgLoaderpublic void setCreatedSharedQueue(SharedQueue createdSharedQueue)
ViewerImgLoaderSharedQueue to asynchronously load blocks.
This is an optional operation, i.e., some ImgLoader implementations may just ignore it.
This method should be called before using the image loader, otherwise it might not have the desired effect.
setCreatedSharedQueue in interface ViewerImgLoaderpublic void close()
public N5ImageLoader.SetupImgLoader<?,?> getSetupImgLoader(int setupId)
getSetupImgLoader in interface ViewerImgLoadergetSetupImgLoader in interface mpicbg.spim.data.generic.sequence.BasicImgLoadergetSetupImgLoader in interface mpicbg.spim.data.generic.sequence.BasicMultiResolutionImgLoadergetSetupImgLoader in interface mpicbg.spim.data.sequence.ImgLoadergetSetupImgLoader in interface mpicbg.spim.data.sequence.MultiResolutionImgLoaderpublic CacheControl getCacheControl()
getCacheControl in interface ViewerImgLoaderprotected <T extends net.imglib2.type.NativeType<T>> net.imglib2.RandomAccessibleInterval<T> prepareCachedImage(String datasetPath, int setupId, int timepointId, int level, net.imglib2.cache.volatiles.CacheHints cacheHints, T type)
CellImg backed by the cache.public static SimpleCacheArrayLoader<?> createCacheArrayLoader(org.janelia.saalfeldlab.n5.N5Reader n5, String pathName) throws IOException
IOExceptionCopyright © 2012–2025 BigDataViewer. All rights reserved.