zetastitcher.io.zipwrapper module

This module provides ZipWrapper, a class for accessing a stack of images stored in a .zip file one frame per file. Files inside the .zip archive must will be accessed in alphabetical order.

For faster access when using compressed formats (such as JPEG2000), a cache can optionally be anabled using set_cache().

class zetastitcher.io.zipwrapper.ZipWrapper(file_path=None)

Bases: zetastitcher.io.inputfile_mixin.InputFileMixin

Attributes
array_size

Size in bytes of the whole virtual array

file_size
frame_size

Size in bytes of a single frame

shape

Shape of the whole image stack.

Methods

close

frame

open

zslice

frame(index, dtype=None, copy=None)
open(file_path=None)
zslice(arg1, arg2=None, step=None, dtype=None, copy=None)
zetastitcher.io.zipwrapper.get_typecodes()
zetastitcher.io.zipwrapper.imread_wrapper(fname, internal_fname, dtype=None)
zetastitcher.io.zipwrapper.set_cache(cache)

Set a cache for ZipWrapper.zslice.

Example:

import zetastitcher.io.zipwrapper as zw
from cachetools import LRUCache
zw.set_cache(LRUCache(maxsize=32))
Parameters
cachecachetools.Cache

The cache instance to use.