dcnum.read.cache
Exceptions
Initialize self. See help(type(self)) for accurate signature. |
Classes
Helper class that provides a standard way to create an ABC using |
|
An HDF5 image cache |
|
Helper class that provides a standard way to create an ABC using |
Functions
|
Compute (partial) MD5 sum of a file |
Module Contents
- exception dcnum.read.cache.EmptyDatasetWarning[source]
Bases:
UserWarningInitialize self. See help(type(self)) for accurate signature.
- class dcnum.read.cache.BaseImageChunkCache(shape: tuple[int], chunk_size: int = 1000, cache_size: int = 2)[source]
Bases:
abc.ABCHelper class that provides a standard way to create an ABC using inheritance.
- shape
- _dtype = None
- _len
- cache
This is a FILO cache for the chunks
- image_shape
- chunk_shape
- chunk_size
- cache_size = 2
- num_chunks
- property dtype
data type of the image data
- class dcnum.read.cache.HDF5ImageCache(h5ds: dcnum.common.h5py.Dataset | dcnum.read.mapped.MappedHDF5Dataset, chunk_size: int = 1000, cache_size: int = 2, boolean: bool = False)[source]
Bases:
BaseImageChunkCacheAn HDF5 image cache
Deformability cytometry data files commonly contain image stacks that are chunked in various ways. Loading just a single image can be time-consuming, because an entire HDF5 chunk has to be loaded, decompressed and from that one image extracted. The HDF5ImageCache class caches the chunks from the HDF5 files into memory, making single-image-access very fast.
- h5ds
- boolean = False
- class dcnum.read.cache.ImageCorrCache(image: HDF5ImageCache, image_bg: HDF5ImageCache)[source]
Bases:
BaseImageChunkCacheHelper class that provides a standard way to create an ABC using inheritance.
- image
- image_bg
- dcnum.read.cache.md5sum(path, blocksize=65536, count=0)[source]
Compute (partial) MD5 sum of a file
- Parameters:
path (str or pathlib.Path) – path to the file
blocksize (int) – block size in bytes read from the file (set to 0 to hash the entire file)
count (int) – number of blocks read from the file