- ZEN Python Workshop
Disclaimer: This content of this repository is free to use for everybody and purely experimental. The authors undertake no warranty concerning the use of the code examples, scripts and notebooks, especially not for the examples using 3rd-party Python modules.
Use them at your own risk!
By using any of those examples you agree to this disclaimer.
This repository contains scripts and notebooks showcasing several tools and scripts centered around ZEN, CZI image files, deep-learning models and related python packages.
- Download and install Miniconda if needed: Download Pixi
- Pixi Binaries can be found here: Pixi Binary Release
- check if installation was successful and check for updates:
pixi --version
pixi self-updatepixi installTo clone this repository:
- navigate to a folder of your choice
- open a terminal or command window
git clone https://github.com/sebi06/ZEN_Python_WorkshopImportant: If one wants to test the labeling & training directly on arivis Cloud or create a module it is required to have an account.
To use Colab one needs to have a Google account.
libCZI is an Open Source Cross-Platform C++ library to read and write CZI.
- Repo: https://github.com/ZEISS/libczi
- Docs: https://zeiss.github.io/libczi/
- License: LGPL v3
libCZI is a library intended for providing read and write access:
- reading subblock pixeldata
- works with tiled and pyramidal images
- composing multi-channel images with tinting and applying a gradation curves
- access metadata
- writing subblocks and metadata
- used by aicspylibczi and bioio-czi
pylibCZIrw (python wrapper for libCZI)
A simple and easy-to-use Python wrapper for libCZI - a cross-platform C++ library intended for providing read and write access to CZI documents.
- PyPi: https://pypi.org/project/pylibCZIrw/
- Repo: https://github.com/ZEISS/pylibczirw
- Docs: https://zeiss.github.io/pylibczirw/
- License: LGPL v3
Simple and easy-to-use Python wrapper for libCZI providing read and write access to CZI image documents
- reading any 2D plane and ROIs from any dimension
- On-the-fly interpolations
- access metadata
- writing 2D planes to any dimension
- Used by bioio-czi library
| Topic | Link |
|---|---|
| Use pylibCZIrw | |
| Segment with Voronoi-Otsu |
This repository provides a collection of tools to simplify reading CZI (Carl Zeiss Image) pixel and metadata in Python. It is available as a Python Package on PyPi.
Disclaimer: czitools is an experimental Python package and not officially supported by ZEISS. The authors undertake no warranty concerning its use.
PyPi: https://pypi.org/project/czitools/ Repo: https://github.com/sebi06/czitools Docs: https://sebi06.github.io/czitools/latest/ License: GPL v3
- read complete stacks or substacks of CZI as numpy or dask arrays incl. lazy-loading
- read complete or partial metadata in a structured format
- get the plantable from a CZI
- create OME-ZARR from CZI
| Topic | Link |
|---|---|
| Read CZI Metadata | |
| Read CZI Pixel Data | |
| Get CZI PlaneTable | |
| OME-ZARR from CZI |
Disclaimer: napari-czitools is an experimental Napari plugin and not officially supported by ZEISS. The authors undertake no warranty concerning its use.
In order to use such a model one needs a running python environment with Napari and the napari-czitools plugin installed.
For more detailed information about the plugin please go to: Napari Hub - napari-czitools
To start Napari including the plugin napari-czitools use:
pixi run start-napariCZI image files can be converted to OME-ZARR using various approaches.
- use NGFF-Converter powered by Glencoe Software
- using bioio-conversion
- reading CZI into an array-like structure using czitools, bioio-czi, aicspylibczi or czifile and then ...
Disclaimer: All tools and scripts related to CZI -> OME-ZARR conversion are not officially supported by ZEISS and are purely experimental. The authors undertake no warranty concerning its use.
Simple & experimental UI aiming to provide a playground to explore different option to convert CZI file to OME-ZARR files incl options for a HCS layout.
To start it use:
pixi run start-omeui| Topic | Link |
|---|---|
| OME-ZARR from CZI | |
| Analyze HCS OME_ZARR |
It is straightforward to train AI models for semantic and instance segmentation on arivis Cloud. The training is based on a zero-code approach and especially suited for beginners.
For the examples below the focus is on Semantic Segmentation only.
- login to arivis Cloud (requires account)
- create New Dataset
- upload the test images inside:
..\notebooks\nucleus_data\images\ - all images will be converted to CZIs automatically
- start labeling the data by pressing Annotate
- create labels manually or use the AI-assisted tool (SAM-based)
- label some nuclei "precisely"
- label background areas and edges
- embrace the idea of partial labeling
For more detailed information please visit: Docs - Partial Annotations
Once the training is finished one will get notified via mail and the model can be downloaded as an *.czann file, which is an ONNX model plus model metadata. For detail see: czmodel
Remark: The model file cyto2022_nuc2.czann can be found inside the repository and can be used directly for the examples.
Once the model (*.czann) is trained it can be downloaded directly to your hard disk and used to segment images in ZEN or arivis Pro or your own python code.
| Topic | Link |
|---|---|
| Run CZANN Model from arivis Cloud |
Train your own model and package (as *.czann) using the czmodel package
The czmodel package provides simple-to-use conversion tools to generate a CZANN file from a PyTorch or ONNX model that resides in memory or on disk to be usable in the ZEN, arivis Cloud, arivis Pro software platforms and in your own code.
For details and more information examples please go to: czmodel
| Topic | Link |
|---|---|
| Train Model and export as CZANN |
Disclaimer: napari-czann-segment is an experimental Napari plugin and not officially supported by ZEISS. The authors undertakes no warranty concerning its use.
For more detailed information about the plugin please go to: Napari Hub - napari-czann-segment
To start Napari including the plugin napari-czann-segment use:
pixi run start-napariCZICheck is a command-line application developed using libCZI, enabling users to assess the integrity and structural correctness of a CZI document.
Checking the validity of a CZI becomes more complex the closer one is to the application domain (e.g. application-specific metadata). So this console application is more of a utility to help users who are directly using libCZI, or its python wrapper pylibCZIrw & pylibCZIrw_github, than it is an official validation tool for any ZEISS-produced CZIs.
CZICheck runs a collection of checkers which evaluate a well defined rule. Each checker reports back findings of type Fatal, Warn, or Info.
Please check the tool's internal help by running CZICheck.exe --help and check additional documentation on the repository.
| Name/Description | Link | Name/Description | Link |
|---|---|---|---|
| Napari - Python-based image viewer | Napari | pip - Python Package Installer | PiP |
| PyPi - Python Package Index | PyPI | OME-ZARR Python Library | OME-ZARR |
| pylibCZIrw - Reading & Writing CZI files (Python) | pylibCZIrw | czmodel - Package for Pytorch & ONNX models | czmodel |
| cztile - Python Package for tiling arrays | cztile | arivis Cloud - DL Training Platform | arivis Cloud |
| napari-czann-segment - Napari Plugin for DL models | napari-czann-segment | napari-czitools - Plugin for CZI files | napari-czitools |
| CZI - Carl Zeiss Image Format | CZI Image Format | PyTorch - tensor library for deep learning using GPUs and CPUs. | PyTorch |
| ONNX - Open Neural Network Exchange | ONNX | libCZI - Reading & Writing CZI files (C++) | libCZI |
| czitools - Tools for CZI files | czitools | Colab - Cloud-based interactive Jupyter Notebooks | Colab |
| Docker Desktop | Docker Desktop | CZICompress - Shrink CZI files | CZICompress |
| CZIChecker - Check Integrity of CZI files | CZICheck | ome-zarr - Python Implementation of NGFF Specs | OME-ZARR |
| NGFF - Next-generation File Formats | NGFF-ZARR | ngff-zarr - Python Implementation of NGFF Specs | NGFF-ZARR |
| ome-zarr-models - minimal package for reading OME-Zarr | OME-ZARR_MODELS | ngio - intuitive interface for OME-Zarr files | NGIO |
| NGFF Converter - converter for bioimaging data | NGFF-Converter | bioio-conversion - BioIO conversion tool for going between image formats | bioio-conversion |
| Czifile is a pure Python library for reading CZI | czifile |






