Tools to simplify reading CZI (Carl Zeiss Image) meta and pixel data in Python and other things
Project description
czitools
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()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file czitools-0.1.3.tar.gz
.
File metadata
- Download URL: czitools-0.1.3.tar.gz
- Upload date:
- Size: 40.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59110a8c327ec0c254571f54ef4c00bfdfe0d1ec1d5ebdbb281972c795f278ef |
|
MD5 | 3c4787de6dadd8fdb287a17ca0aa5a00 |
|
BLAKE2b-256 | c8407a4e13967549940270ce683968d27dcc1b094adfe46b383ff7d5e7e1d8be |
File details
Details for the file czitools-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: czitools-0.1.3-py3-none-any.whl
- Upload date:
- Size: 44.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b637fa0e946359f12752fa1630587d2a2e16f83beaba3df29ed3781cd974d9cc |
|
MD5 | f11c13701f53c9386e29e03e2093454b |
|
BLAKE2b-256 | 0fbaa977f8881a48761614936aaf573bf7ccb942d1ad88069cf1b06c885fbbca |