Skip to main content

用于读取 CZI 文件并通过 python-bioformats 解析元数据的 Python 实用程序

项目描述

https://github.com/yfukai/pycziutils/actions/workflows/python-test.yml/badge.svg https://img.shields.io/pypi/v/pycziutils.svg 文件状态

用于读取(平铺)CZI 文件并通过 python-bioformats 解析元数据的 Python 实用程序

  • 免费软件:BSD许可证

  • 文档:https ://pycziutils.readthedocs.io 。

安装

$ pip install pycziutils

特征

一个微型实用程序模块,用于通过 python-bioformats 在 Python 中解析 Zeiss CZI 文件。解析平铺图像,将平面组织到 pandas.DataFrame 中,并解析一些难以获取的元数据。

例子

import pycziutils


@pycziutils.with_javabridge
def main():
    czi_file_path="path/to/czi/file.czi"
    tiled_czi_ome_xml=pycziutils.get_tiled_omexml_metadata(czi_file_path)
    tiled_properties_dataframe=pycziutils.parse_planes(tiled_czi_ome_xml)

    print(tiled_properties_dataframe.columns)
    #Index(['index', 'X', 'Y', 'Z', 'T', 'C', 'C_index', 'T_index', 'Z_index', 'image',
    #       'plane', 'image_acquisition_T', 'absolute_T'],
    #        dtype='object')

    print(tiled_properties_dataframe.iloc[0])
    #index                                                 0
    #X                                             -1165.624
    #Y                                               122.694
    #Z                                                 0.001
    #T                                                 1.027
    #C                                                 Phase
    #C_index                                               0
    #T_index                                               0
    #Z_index                                               0
    #image                                                 0
    #plane                                                 0
    #image_acquisition_T    2021-04-12 02:12:21.340000+00:00
    #absolute_T             2021-04-12 02:12:22.367000+00:00
    #Name: 0, dtype: object

    #returns bioformats reader for tiled images
    reader=pycziutils.get_tiled_reader(czi_file_path)
    for i, row in tiled_properties_dataframe.iterrows():
        image = reader.read(
            series=row["image"],
            t=row["T_index"],
            z=row["Z_index"],
            c=row["C_index"],
        )

if __name__=="__main__":
    main()

学分

这个包使用python-bioformats将 CZI 文件连接到 Python。

这个包是用Cookiecutterwboxx1/cookiecutter-pypackage-poetry项目模板创建的。

这个包使用pysen进行 linting 和格式化。

项目详情


下载文件

下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。

源分布

pycziutils-0.3.2.tar.gz (8.8 kB 查看哈希

已上传 source

内置分布

pycziutils-0.3.2-py3-none-any.whl (8.6 kB 查看哈希

已上传 py3