pyjacket.filetools.image package
Submodules
pyjacket.filetools.image.image module
- class pyjacket.filetools.image.image.FileType[source]
Bases:
object- read_lazy(file_path, **kwargs) ImageHandle[source]
- seq_read_lazy(file_path, **kwargs) ImageHandle[source]
- class pyjacket.filetools.image.image.ImageHandle(file_path, unzip=1)[source]
Bases:
objectAccess image data lazily with numpy-like slicing
- property ndim
- operator: object
- property shape
The shape of a cropped variant of this data
- slices: list[slice]
- class pyjacket.filetools.image.image.Metadata(file_path)[source]
Bases:
object- property description
- property dtype
Data format, e.g. 8bit or 12bit
- property resolution
Pixels per um
- property shape
Size of each dimension (pixels)
- property shape_um
- pyjacket.filetools.image.image.iter_dir(dirpath: str, ext: str = None, nat=True, exclude: set = None)[source]
Obtain files/folders in the <root>/<rel_path>/<folder>
- ext: types of files to return
None: yield all file types
‘/’: yield directories only
‘.png’: yield only png.
- pyjacket.filetools.image.image.read_img(file_path: str, lazy=False, **kwargs)[source]
Read image data from file.
- Parameters:
filepath (str) – Location of the image file
lazy (bool, optional) – Read lazy to save memory. Defaults to False.
- Raises:
ValueError – _description_
NotImplementedError – _description_
- Returns:
pixel data
- Return type:
np.ndarray (default) or ImageHandle (if lazy)
- pyjacket.filetools.image.image.write_img(file_path: str, data: ndarray | ImageHandle, meta: Metadata = None, **kwargs)[source]
Write image data. Supports tif, nd2
pyjacket.filetools.image.models module
- class pyjacket.filetools.image.models.ImageHandle(file_path, unzip=1)[source]
Bases:
objectAccess image data lazily with numpy-like slicing
- property ndim
- operator: object
- property shape
The shape of a cropped variant of this data
- slices: list[slice]
- class pyjacket.filetools.image.models.ImageReader[source]
Bases:
object- read_lazy(file_path: str, **kwargs) ImageHandle[source]
- seq_read_lazy(file_path: str, **kwargs) ImageHandle[source]
- write_lazy(file_path: str, data: ImageHandle, meta: Metadata = None, **kwargs)[source]
Module contents
- class pyjacket.filetools.image.ImageHandle(file_path, unzip=1)[source]
Bases:
objectAccess image data lazily with numpy-like slicing
- property ndim
- operator: object
- property shape
The shape of a cropped variant of this data
- slices: list[slice]
- class pyjacket.filetools.image.Metadata(file_path)[source]
Bases:
object- property description
- property dtype
Data format, e.g. 8bit or 12bit
- property resolution
Pixels per um
- property shape
Size of each dimension (pixels)
- property shape_um
- pyjacket.filetools.image.read_img(file_path: str, lazy=False, **kwargs)[source]
Read image data from file.
- Parameters:
filepath (str) – Location of the image file
lazy (bool, optional) – Read lazy to save memory. Defaults to False.
- Raises:
ValueError – _description_
NotImplementedError – _description_
- Returns:
pixel data
- Return type:
np.ndarray (default) or ImageHandle (if lazy)
- pyjacket.filetools.image.write_img(file_path: str, data: ndarray | ImageHandle, meta: Metadata = None, **kwargs)[source]
Write image data. Supports tif, nd2