Skip to main content

Tools to simplify reading CZI (Carl Zeiss Image) meta and pixel data in Python and other things

Project description

czitools

PyPI PyPI - Downloads License Python Version Development Status

This repository provides a collection of tools to simplify reading CZI (Carl Zeiss Image) pixel and metadata in Python. In addition it also contains other useful utilities to visualize CZI images inside Napari (needs to be installed). It is also available as a Python Package on PyPi

Reading the metadata

Please check use_pylibczirw_metadata_class.py for some examples.

# get the metadata at once as one big class
mdata_sel = czimd.CziMetadata(filepath)

# get only specific metadata
czi_dimensions = czimd.CziDimensions(filepath)
print("SizeS: ", czi_dimensions.SizeS)
print("SizeT: ", czi_dimensions.SizeT)
print("SizeZ: ", czi_dimensions.SizeZ)
print("SizeC: ", czi_dimensions.SizeC)
print("SizeY: ", czi_dimensions.SizeY)
print("SizeX: ", czi_dimensions.SizeX)

# and get more info about various aspects of the CZI
czi_scaling = czimd.CziScaling(filepath)
czi_channels = czimd.CziChannelInfo(filepath)
czi_bbox = czimd.CziBoundingBox(filepath)
czi_info = czimd.CziInfo(filepath)
czi_objectives = czimd.CziObjectives(filepath)
czi_detectors = czimd.CziDetector(filepath)
czi_microscope = czimd.CziMicroscope(filepath)
czi_sample = czimd.CziSampleInfo(filepath)

Reading CZI pixeldata

While the pylibCZIrw is focussing on reading individual planes it is also helpful to read CZI pixel data as a STZCYX(A) stack. Please check use_pylibczirw_md_read.py for some examples.

# return a array with dimension order STZCYX(A)
array6d, mdata, dim_string6d = pylibczirw_tools.read_6darray(filepath,
                                                             output_order="STZCYX",
                                                             output_dask=False,
                                                             remove_Adim=True
                                                             )

# show array inside napari viewer
viewer = napari.Viewer()
layers = napari_tools.show(viewer, array6d, mdata,
                           dim_string=dim_string6d,
                           blending="additive",
                           contrast='napari_auto',
                           gamma=0.85,
                           add_mdtable=True,
                           name_sliders=True)

napari.run()

5D CZI inside Napari

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

czitools-0.0.15.tar.gz (43.0 kB view details)

Uploaded Source

Built Distribution

czitools-0.0.15-py3-none-any.whl (45.9 kB view details)

Uploaded Python 3

File details

Details for the file czitools-0.0.15.tar.gz.

File metadata

  • Download URL: czitools-0.0.15.tar.gz
  • Upload date:
  • Size: 43.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for czitools-0.0.15.tar.gz
Algorithm Hash digest
SHA256 5549d32e8916e014f7393c77c41680ffa6b5132043c9e21bc9b032528a4d86fe
MD5 3c97cce01b04bc9bc6579dcdc230530d
BLAKE2b-256 b061aec99cb3abc9ce02745803e7a75ea76838c440bb9a5a81915871ffb149e5

See more details on using hashes here.

File details

Details for the file czitools-0.0.15-py3-none-any.whl.

File metadata

  • Download URL: czitools-0.0.15-py3-none-any.whl
  • Upload date:
  • Size: 45.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for czitools-0.0.15-py3-none-any.whl
Algorithm Hash digest
SHA256 85d883df5b60c17edf03974ce52b17e5bb4799008c1843bdf73dc4f22370252d
MD5 95a5460cb3b564c56b86e96f9e9fafa0
BLAKE2b-256 32a4068f208c0e12265509f8c262c5ce5614f520485317e7971e9af703298c35

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page