Skip to main content

cztile - Python package to simplify the process of tiling arrays

This project provides simple-to-use tiling functionality for arrays. It is not linked directly to the CZI file format, but can be of use to process such images in an efficient and tile-wise manner, which is especially important when dealing with larger images.

Samples

The basic usage can be inferred from this sample notebook:
Open In Colab

System setup

The current version of this toolbox only requires a fresh Python >= 3.9 installation.

Supported Tiling Strategies

This package features the following tiling strategies:

AlmostEqualBorderFixedTotalAreaStrategy2D

This covers a total area with a minimal number of tiles of constant total area such that:

  • the image area is completely covered by tiles and is filled up with as few tiles as possible
  • the overlap/border between tiles is as small as possible, but it is ensured that at least a minimum border size is used
  • all interior tiles have the same size
  • a possible excess border is split among tiles and can lead to slightly different tile and border sizes at the edge
  • all interior tiles have at least a minimum border width/height on all sides
  • the edge tiles have zero border at the edge and at least the minimum border width on their inner sides.
  • The sizes of all non-zero borders differ at most by one pixel.

cztile - AlmostEqualBorderFixedTotalAreaStrategy2D

The core functionality is of course also available for 1D.

The AlmostEqualBorderFixedTotalAreaStrategy2D is based on the following algorithm:

Inputs

Image width: equation
Minimum interior border width (left or right): equation
Fixed total tile width: equation

Calculation of tile positions and borders

Case 1: equation
There is no solution. Fail!

Case 2: equation
Use a single tile with no borders.

Case 3: equation
Maximum inner tile width of edge tiles: equation
Maximum inner tile width of interior tiles: equation
Total interior tile width: equation
Number of tiles: equation
Excess border: equation
Total number of non-zero left and right borders: equation
Fractional excess border: equation
The first non-zero border has index equation, the last has index equation. Tile equation is surrounded by the borders with index equation and equation.
Cumulative excess border for all borders up to border equation: equation for equation
Cumulative border for all borders up to border equation: equation for equation
Tile boundaries: equation
Tile equation for equation:

  • Left-most pixel of inner tile: equation
  • Right-most pixel of inner tile: equation
  • Inner tile width: equation
  • Total border width: equation
  • Left border width: equation
  • Right border width: equation
  • Left-most border pixel: equation
  • Right-most-border pixel: equation

Disclaimer

The libary and the notebook are free to use for everybody. Carl Zeiss Microscopy GmbH undertakes no warranty concerning the use of those tools. Use them at your own risk.

By using any of those examples you agree to this disclaimer.

Version: 2025.05.20

Copyright (c) 2025 Carl Zeiss AG, Germany. All Rights Reserved.

Metadata

Release files for cztile 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cztile 2.0.0
File Size Uploaded
cztile-2.0.0.tar.gz 18.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cztile 2.0.0
File Interpreter ABI Platform
cztile-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 38.2 kB

Release files / cztile-2.0.0.tar.gz

Download URL cztile-2.0.0.tar.gz
Size 18.6 kB
Tags Source
SHA-256 checksum
How to use checksums
2fff333410c00dca23e40a506f770889c02a0cef86cfc4e31586c6cc95fe7168
BLAKE2b-256 checksum
How to use checksums
e7baf3dcda9b97b73434d1eb884c77414c7bf00a90a87f6d2a3b3f1d07bcfad2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.8

Release files / cztile-2.0.0-py3-none-any.whl

Download URL cztile-2.0.0-py3-none-any.whl
Size 19.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
038de20efce1a3aa6b0b565e301f5f029e3e3da879e21917efd14c6e3a66e568
BLAKE2b-256 checksum
How to use checksums
65aec9e73dc356aee90ea4e1406295644eb1cef51240941277fe7edf91c1fcb6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.8

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

1.0.0

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page