TiffFrame¶
- class tifffile.TiffFrame(parent, /, index, *, offset=None, keyframe=None, dataoffsets=None, databytecounts=None)¶
Lightweight TIFF image file directory (IFD).
The purpose of TiffFrame is to reduce resource usage and speed up reading image data from file compared to TiffPage. Properties other than offset, index, dataoffsets, databytecounts, subifds, and jpegtables are assumed to be identical with a specified TiffPage instance, the keyframe. TiffFrame instances have no tags property. Virtual frames just reference the image data in the file. They may not have an IFD structure in the file.
TiffFrame instances are not thread-safe. All attributes are read-only.
- Parameters:
parent (TiffFile) – TiffFile instance to read frame from. The file handle position must be at an offset to an IFD structure. Only a limited number of tag values are read from file.
index (int | Sequence[int]) – Index of frame in IFD tree.
offset (int) – Position of frame in file.
keyframe (TiffPage | None) – TiffPage instance with same hash as frame.
dataoffsets (tuple[int, ...]) – Data offsets of “virtual frame”.
databytecounts (tuple[int, ...]) – Data bytecounts of “virtual frame”.
- asarray(*args, **kwargs)¶
Return image from frame as NumPy array.
- Parameters:
**kwargs (Any) – Arguments passed to
TiffPage.asarray()
.args (Any)
**kwargs
- Return type:
NDArray[Any]
- aszarr(**kwargs)¶
Return image from frame as Zarr 2 store.
- Parameters:
**kwarg – Arguments passed to
ZarrTiffStore
.kwargs (Any)
- Return type:
- property index: int¶
Index of frame in IFD chain.
- property is_subifd: bool¶
Frame is SubIFD of another page.
- property is_virtual: bool¶
Frame does not have IFD structure in file.
- property treeindex: tuple[int, ...]¶
Index of frame in IFD tree.