{"id":19671204,"url":"https://github.com/cgohlke/czifile","last_synced_at":"2026-06-13T03:11:39.472Z","repository":{"id":62577522,"uuid":"259740655","full_name":"cgohlke/czifile","owner":"cgohlke","description":"Read Carl Zeiss image files (CZI).","archived":false,"fork":false,"pushed_at":"2026-04-11T20:06:18.000Z","size":390,"stargazers_count":36,"open_issues_count":0,"forks_count":9,"subscribers_count":5,"default_branch":"master","last_synced_at":"2026-04-11T22:06:26.824Z","etag":null,"topics":["format-reader","image","life-sciences-image","python","zeiss","zeiss-czi-files"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/czifile","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cgohlke.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-04-28T20:09:57.000Z","updated_at":"2026-04-11T20:06:25.000Z","dependencies_parsed_at":"2025-04-29T00:34:42.087Z","dependency_job_id":"cb41a1e1-1722-445b-8ef1-e3e75cb0e05a","html_url":"https://github.com/cgohlke/czifile","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/cgohlke/czifile","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgohlke%2Fczifile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgohlke%2Fczifile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgohlke%2Fczifile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgohlke%2Fczifile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cgohlke","download_url":"https://codeload.github.com/cgohlke/czifile/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgohlke%2Fczifile/sbom","scorecard":{"id":272511,"data":{"date":"2025-08-11","repo":{"name":"github.com/cgohlke/czifile","commit":"d143dc82211ef95104026f44258e965b5b41a378"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.7,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: BSD 3-Clause \"New\" or \"Revised\" License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v2019.7.2.1 not signed: https://api.github.com/repos/cgohlke/czifile/releases/203148837","Warn: release artifact v2019.7.2.1 does not have provenance: https://api.github.com/repos/cgohlke/czifile/releases/203148837"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-17T13:44:06.699Z","repository_id":62577522,"created_at":"2025-08-17T13:44:06.700Z","updated_at":"2025-08-17T13:44:06.700Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34270485,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-13T02:00:06.617Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["format-reader","image","life-sciences-image","python","zeiss","zeiss-czi-files"],"created_at":"2024-11-11T17:08:07.800Z","updated_at":"2026-06-13T03:11:39.467Z","avatar_url":"https://github.com/cgohlke.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"..\n  This file is generated by setup.py\n\nRead Carl Zeiss image files (CZI)\n=================================\n\nCzifile is a Python library for reading image data and metadata from\nCarl Zeiss Image (CZI) files, the native file format of ZEN by\nCarl Zeiss Microscopy GmbH.\n\nCzifile is a pure-Python library under the BSD-3-Clause license. It provides\nsingle-call array access to scenes and spatial ROIs, xarray DataArray output\nwith physical axis coordinates, multi-scene merging, per-dimension selection\nby integer, slice, or sequence, chunk-based iteration, and pyramid-level\naccess. It handles Fast Airyscan upsampling and PALM downsampling with\noptional stored-resolution output, and assembles FCS and line-scan files from\nT-chunked subblocks. It also supports Zstd and JPEG XR compression, pixel type\npromotion across channels, and direct access to all ZISRAW segments and\nfile-level attachments.\n\n:Author: `Christoph Gohlke \u003chttps://www.cgohlke.com\u003e`_\n:License: BSD-3-Clause\n:Version: 2026.6.12\n:DOI: `10.5281/zenodo.14948581 \u003chttps://doi.org/10.5281/zenodo.14948581\u003e`_\n\nQuickstart\n----------\n\nInstall the czifile package and all dependencies from the\n`Python Package Index \u003chttps://pypi.org/project/czifile/\u003e`_::\n\n    python -m pip install -U czifile[all]\n\nSee `Examples`_ for using the programming interface.\n\nSource code, examples, and support are available on\n`GitHub \u003chttps://github.com/cgohlke/czifile\u003e`_.\n\nRequirements\n------------\n\nThis revision was tested with the following requirements and dependencies\n(other versions may work):\n\n- `CPython \u003chttps://www.python.org\u003e`_ 3.12.10, 3.13.14, 3.14.6, 3.15.0b2 64-bit\n- `Numpy \u003chttps://pypi.org/project/numpy\u003e`_ 2.4.6\n- `Imagecodecs \u003chttps://pypi.org/project/imagecodecs\u003e`_ 2026.6.6\n- `Xarray \u003chttps://pypi.org/project/xarray\u003e`_ 2026.4.0 (recommended)\n- `Matplotlib \u003chttps://pypi.org/project/matplotlib/\u003e`_ 3.11.0 (optional)\n- `Tifffile \u003chttps://pypi.org/project/tifffile/\u003e`_ 2026.6.1 (optional)\n\nRevisions\n---------\n\n2026.6.12\n\n- Add CziDirectoryEntryDV.asimage convenience method.\n\n2026.6.6\n\n- Refactor segment, directory, and content file parsing (breaking).\n- Add memmap parameter to CziFile/imread for lock-free parallel subblock reads.\n- Add writable property to BinaryFile.\n- Change read_content functions to accept bytes or memoryview.\n- Remove read_array function.\n- Require imagecodecs \u003e= 2026.6.6 for zstd1 codec.\n- Support Python 3.15.\n\n2026.4.30\n\n- Omit axes from coords when no meaningful metadata is available (breaking).\n- Return coords['T'] as float seconds instead of datetime64 (breaking).\n- Replace pixel_series with coord_scales in CziImage.attrs (breaking).\n- Add coord_offsets, coord_scales, coord_units, and mpp properties to CziImage.\n- Add datetime property to CziImage returning acquisition start as datetime64.\n- Drop support for numpy 2.0 (SPEC0).\n\n2026.4.11\n\n- Fall back to parsing numeric channel names as float coords['C'].\n\n2026.3.17\n\n- Add cache for decoded subblock arrays.\n- Prefer imagecodecs' WIC over JPEGXR codec if available.\n- Import imagecodecs functions on demand.\n\n2026.3.15\n\n- Replace CziImagePlanes with CziImageChunks (breaking).\n- Add CziImage.chunks method for flexible chunk-based iteration.\n- Add CziFile.metadata_segment property.\n- Add offset properties to CziAttachmentEntryA1 and subblock entry classes.\n- Add CziSegmentId.packed property returning the 16-byte on-disk field.\n- Manage update_pending flag in CziFile context manager for writable handles.\n- Improve documentation.\n\n2026.3.14\n\n- Add option to return pixel data at stored resolution.\n- Allow sequence and slice of scene indices in imread and asarray/asxarray.\n- Interpret dimension slice selection as absolute coordinates.\n- Add command line options to select dimensions.\n\n2026.3.12\n\n- Rewrite with many breaking changes.\n- Support Zstd compression schemes.\n- Support reading subblock masks.\n- Add CziFile.scenes interface.\n- Add pyramid level access via CziImage.levels.\n- Add option to read subset of image data.\n- Add option to iterate over image planes in any dimension order.\n- Add xarray-style attributes.\n- Add asxarray method to return image as xarray DataArray with metadata.\n- Add fillvalue and maxworkers parameters to asarray.\n- Add option to specify pixel type.\n- Promote pixel type when channels have mixed types.\n- Remove Mosaic dimension from CziDirectoryEntryDV.dims; use mosaic_index.\n- Reduce caching of CziDirectoryEntryDV properties.\n- Remove resize and order parameters from asarray (breaking).\n- Remove czi2tif function and command line script.\n- Prefix public class names with Czi.\n- Raise CziFileError for issues with CZI file structure.\n- Use logging instead of warnings.\n- Improve representation of instances.\n- Add pytest-based unit tests.\n- Add type hints.\n- Convert docstrings to Google style with Sphinx directives.\n- Remove imagecodecs-lite fallback; require imagecodecs.\n- Remove scipy/ndimage dependency.\n- Make tifffile an optional dependency.\n- Drop support for Python \u003c 3.12 and numpy \u003c 2 (SPEC 0).\n\n2019.7.2.3\n\n- …\n\nRefer to the CHANGES file for older revisions.\n\nNotes\n-----\n\nThe API is not stable yet and might change between revisions.\n\n`Carl Zeiss AG \u003chttps://www.zeiss.com/\u003e`_ is a manufacturer of microscopes\nand scientific instruments.\nCZI is a proprietary file format written by Zeiss acquisition software\nsuch as ZEN to store microscopy images and metadata.\n\nCZI files are based on the ZISRAW (Zeiss Image Segment Raw) container\nspecification, which is confidential and does not permit writing CZI files:\n\n    | ZISRAW (CZI) File Format Design Specification Release Version 1.2.2.\n    | \"CZI 07-2016/CZI-DOC ZEN 2.3/DS_ZISRAW-FileFormat.pdf\"\n\nThe ZISRAW format organizes data into typed, length-prefixed segments:\na file header, image subblocks, XML metadata, and attachments. Each image\nsubblock carries pixels for one tile or Z-plane across up to ten logical\ndimensions (X, Y, Z, channel, time, scene, phase, illumination, rotation, and\nmosaic index). Pixel data may be stored uncompressed or compressed with JPEG,\nJPEG XR, or Zstd.\n\nOnly a subset of the 2016 specification is implemented. Specifically,\nmulti-file images and topography images are not supported.\nSome features are untested due to lack of sample files.\n\nCzifile relies on the `imagecodecs \u003chttps://pypi.org/project/imagecodecs/\u003e`__\npackage for decoding LZW, Zstd, JPEG, and JPEG XR compressed images.\n\nOther libraries for reading CZI files (all GPL or LGPL licensed):\n`libczi \u003chttps://github.com/ZEISS/libczi\u003e`__,\n`pylibCZIrw \u003chttps://pypi.org/project/pylibCZIrw\u003e`__,\n`bioio-czi \u003chttps://github.com/bioio-devs/bioio-czi\u003e`__,\n`bio-formats \u003chttps://github.com/ome/bioformats\u003e`_,\n`libCZI \u003chttps://github.com/zeiss-microscopy/libCZI\u003e`__ (deprecated), and\n`pylibczi \u003chttps://github.com/elhuhdron/pylibczi\u003e`__ (deprecated).\n\nExamples\n--------\n\nRead image data of the first scene from a CZI file as numpy array:\n\n.. code-block:: python\n\n    \u003e\u003e\u003e arr = imread('Example.czi')\n    \u003e\u003e\u003e assert arr.shape == (2, 2, 3, 486, 1178)\n    \u003e\u003e\u003e assert arr.dtype == 'uint16'\n\nAccess scenes, shape, and metadata:\n\n.. code-block:: python\n\n    \u003e\u003e\u003e with CziFile('Example.czi') as czi:\n    ...     assert len(czi.scenes) == 3\n    ...     img = czi.scenes[0]  # 0 is the absolute coordinate of the first scene\n    ...     assert img.shape == (2, 2, 3, 486, 1178)\n    ...     assert img.dims == ('T', 'C', 'Z', 'Y', 'X')\n    ...     assert img.dtype == 'uint16'\n    ...     assert img.compression.name == 'ZSTDHDR'\n    ...     assert list(img.channels) == ['DAPI', 'EGFP']\n    ...     assert czi.metadata().startswith('\u003cImageDocument\u003e')\n    ...\n\nSelect dimensions and read as numpy array:\n\n.. code-block:: python\n\n    \u003e\u003e\u003e with CziFile('Example.czi') as czi:\n    ...     img = czi.scenes[0]\n    ...     assert img.sizes == {'T': 2, 'C': 2, 'Z': 3, 'Y': 486, 'X': 1178}\n    ...\n    ...     # integer selection: fix T=0 and C=0; result has Z, but no T or C axis\n    ...     volume = img(T=0, C=0).asarray()\n    ...     assert volume.shape == (3, 486, 1178)\n    ...\n    ...     # None selection: keep all values but reorder dimensions\n    ...     # dims order follows the kwargs order, then spatial dims\n    ...     # T (unspecified) comes first, then C, Z (in kwargs order), then Y X\n    ...     tczyx = img(C=None, Z=None).asarray()\n    ...     assert tczyx.shape == (2, 2, 3, 486, 1178)\n    ...\n    ...     # read in C-outer, Z-inner, T-innermost order with parallelism\n    ...     arr = img(C=None, Z=None, T=None).asarray(maxworkers=8)\n    ...     assert arr.shape == (2, 3, 2, 486, 1178)  # 'C', 'Z', 'T', 'Y', 'X'\n    ...\n    ...     # img.bbox gives (x, y, width, height) in global CZI coordinates\n    ...     x0, y0, *_ = img.bbox\n    ...     plane_roi = img(T=0, C=0, roi=(x0, y0, 128, 128)).asarray()\n    ...     assert plane_roi.shape == (3, 128, 128)  # 'Z', 'Y', 'X'\n    ...\n    ...     # fill pixels outside subblock coverage with a specific value\n    ...     padded = img(C=0, roi=(0, 0, 2048, 2048)).asarray(fillvalue=0)\n    ...     assert padded.shape == (2, 3, 2048, 2048)  # 'T', 'Z', 'Y', 'X'\n    ...\n\nIterate image chunks:\n\n.. code-block:: python\n\n    \u003e\u003e\u003e with CziFile('Example.czi') as czi:\n    ...     img = czi.scenes[0]\n    ...\n    ...     # iterate individual Y/X planes as CziImage views\n    ...     # by default, all non-spatial dims are iterated one-at-a-time\n    ...     for chunk in img.chunks():\n    ...         assert isinstance(chunk, CziImage)\n    ...         assert chunk.asarray().shape == (486, 1178)\n    ...\n    ...     # keep C in each chunk: iterate T and Z only\n    ...     for chunk in img.chunks(C=None):\n    ...         assert chunk.asarray().shape == (2, 486, 1178)\n    ...\n    ...     # batch Z into groups of 3; last chunk may be smaller if Z indivisible\n    ...     for chunk in img.chunks(Z=3):\n    ...         assert chunk.sizes['Z'] \u003c= 3\n    ...\n    ...     # spatial tiling: iterate T x C x Z x grid\n    ...     for chunk in img.chunks(Y=256, X=256):\n    ...         assert chunk.shape[-2] \u003c= 256\n    ...         assert chunk.shape[-1] \u003c= 256\n    ...\n    ...     # keep C, tile spatially\n    ...     for chunk in img.chunks(C=None, Y=256, X=256):\n    ...         assert chunk.dims[0] == 'C'\n    ...\n\nRead image as xarray DataArray with physical coordinates and attributes:\n\n.. code-block:: python\n\n    \u003e\u003e\u003e with CziFile('Example.czi') as czi:\n    ...     xarr = czi.scenes[0].asxarray()\n    ...     assert xarr.name == 'Scene 0'\n    ...     assert xarr.sizes == {'T': 2, 'C': 2, 'Z': 3, 'Y': 486, 'X': 1178}\n    ...     assert xarr.coords['X'].size == 1178  # physical axis coordinates\n    ...\n\nAccess multiple scenes:\n\n.. code-block:: python\n\n    \u003e\u003e\u003e with CziFile('Example.czi') as czi:\n    ...     # iterate scenes individually and read as arrays\n    ...     for img in czi.scenes.values():\n    ...         arr = img.asarray()\n    ...\n    ...     # query which scenes (indices) are available\n    ...     assert list(czi.scenes.keys()) == [0, 1, 2]\n    ...\n    ...     # select the second scene\n    ...     assert czi.scenes[1].sizes == {\n    ...         'T': 2,\n    ...         'C': 2,\n    ...         'Z': 3,\n    ...         'Y': 256,\n    ...         'X': 256,\n    ...     }\n    ...\n    ...     # merge selected scenes into one\n    ...     img = czi.scenes(scene=[0, 1])  # first 2 scenes\n    ...     assert img.sizes == {'T': 2, 'C': 2, 'Z': 3, 'Y': 1109, 'X': 1760}\n    ...\n    ...     # merge all scenes into one\n    ...     img = czi.scenes()\n    ...     assert img.sizes == {'T': 2, 'C': 2, 'Z': 3, 'Y': 2055, 'X': 2581}\n    ...\n\nAccess pyramid levels:\n\n.. code-block:: python\n\n    \u003e\u003e\u003e with CziFile('Example.czi') as czi:\n    ...     img = czi.scenes[0]\n    ...     assert img.is_pyramid\n    ...     assert len(img.levels) == 2  # full resolution + 1 downsampled level\n    ...     assert img.levels[0] is img  # full resolution level is the same as img\n    ...     overview = img.levels[1]  # lowest-res level\n    ...     assert overview.sizes == {'T': 2, 'C': 2, 'Z': 3, 'Y': 243, 'X': 589}\n    ...\n\nIterate directory entries as CziImage views:\n\n.. code-block:: python\n\n    \u003e\u003e\u003e with CziFile('Example.czi') as czi:\n    ...     for entry in czi.scenes[0].directory_entries:\n    ...         chunk = entry.asimage(czi)\n    ...         arr = chunk.asarray()\n    ...         assert arr.shape == (256, 256)\n    ...\n\nAccess attachments:\n\n.. code-block:: python\n\n    \u003e\u003e\u003e with CziFile('Example.czi') as czi:\n    ...     for attachment in czi.attachments():\n    ...         name = attachment.attachment_entry.name\n    ...         data = attachment.data()  # decoded (ndarray, tuple, bytes...)\n    ...         raw = attachment.data(raw=True)  # bytes; may be written to file\n    ...\n    ...     # convenience shortcut for TimeStamps attachment data\n    ...     assert czi.timestamps.shape == (2,)\n    ...\n\nLow-level access to CZI file segments:\n\n.. code-block:: python\n\n    \u003e\u003e\u003e with CziFile('Example.czi') as czi:\n    ...     # file header: version, GUIDs, and segment offsets\n    ...     header = czi.header\n    ...     assert header.version == (1, 0)\n    ...     assert str(header.file_guid) == 'f8a61493-053e-c94e-bae0-bc7e96d18997'\n    ...     assert not header.update_pending\n    ...\n    ...     # iterate all subblock segments sequentially via the directory\n    ...     for segdata in czi.subblocks():\n    ...         entry = segdata.directory_entry\n    ...         assert entry.dims == ('H', 'T', 'C', 'Z', 'Y', 'X', 'S')\n    ...         assert entry.start == (0, 0, 0, 0, 0, 582, 0)\n    ...         assert entry.shape == (1, 1, 1, 1, 486, 1178, 1)\n    ...         assert entry.stored_shape == (1, 1, 1, 1, 243, 589, 1)\n    ...         assert entry.compression == CziCompressionType.ZSTDHDR\n    ...         assert segdata.data_offset == 661865  # offset of image data\n    ...         assert segdata.data_size == 183875  # size of compressed image data\n    ...         tile = segdata.data()  # decompressed image data as numpy array\n    ...         assert tile.shape == entry.stored_shape\n    ...         assert tile.dtype == entry.pixel_type.dtype\n    ...         assert isinstance(segdata.data(raw=True), bytes)  # compressed data\n    ...         assert segdata.metadata().startswith('\u003cMETADATA\u003e')\n    ...         break  # just the first subblock segment for demonstration\n    ...\n    ...     # iterate only image tiles in a selected image view\n    ...     img = czi.scenes[0](T=0, C=0, Z=0)\n    ...     for entry in img.directory_entries:\n    ...         segdata = entry.read_segment_data(czi)\n    ...         assert isinstance(segdata, CziSubBlockSegmentData)\n    ...         tile = segdata.data()\n    ...         assert tile.shape == entry.stored_shape\n    ...         break  # just the first filtered directory entry\n    ...\n    ...     # walk all file segments by type using their ZISRAW segment IDs\n    ...     for segdata in czi.segments(CziSegmentId.ZISRAWSUBBLOCK):\n    ...         assert isinstance(segdata, CziSubBlockSegmentData)\n    ...\n    ...     # direct low-level segment header at a known file offset\n    ...     seg = CziSegment(czi, czi.header.directory_position)\n    ...     assert seg.sid == CziSegmentId.ZISRAWDIRECTORY\n    ...     assert seg.used_size == 68768\n    ...     seg_data = seg.data()\n    ...     assert isinstance(seg_data, CziSubBlockDirectorySegmentData)\n    ...\n\nView the images and metadata in a CZI file from the console::\n\n    $ python -m czifile Example.czi\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcgohlke%2Fczifile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcgohlke%2Fczifile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcgohlke%2Fczifile/lists"}