patchworks
Tiled processing of arbitrarily large images — any image, any function.
┌──────┬──────┬──────┐ fn(tile) → labels ┌──────┬──────┬──────┐
│ tile │ tile │ tile │ ─────────────────────► │ 1 │ 2 │ 3 │
├──────┼──────┼──────┤ ├──────┼──────┼──────┤
│ tile │ tile │ tile │ │ 4 │ 5 │ 6 │ globally
├──────┼──────┼──────┤ ├──────┼──────┼──────┤ consistent
│ tile │ tile │ tile │ │ 7 │ 8 │ 9 │ labels
└──────┴──────┴──────┘ └──────┴──────┴──────┘
patchworks splits an image too large for memory into tiles, runs any segmentation function on each tile, and stitches the results into one consistent label image — stored with the image in a single OME-Zarr, with a table of every object.
Install
pip install patchworks # core
pip install "patchworks[cellpose]" # + Cellpose
pip install "patchworks[bioio,imaris]" # + converting CZI/LIF/ND2/TIFF/.ims to OME-Zarr
pip install "patchworks[napari]" # + viewing and reviewing in napari
pip install "patchworks[all]" # everything above and more
GPU options of the DoG plugin need cupy matching your CUDA version
(pip install cupy-cuda12x). PlantSeg is on conda-forge only. See
Getting started for every
extra.
Three ways to use it
Python — any function from a tile to labels:
from patchworks import tile_process
from patchworks.plugins.cellpose import cellpose_fn
tile_process("scan.zarr", cellpose_fn("cyto3", gpu=True, diameter=30))
The labels go into scan.zarr/labels/labels, as a multiscale pyramid next
to the image.
Command line — the same building blocks, no script:
patchworks convert scan.czi scan.zarr
patchworks segment scan.zarr --method cellpose --model cyto3 --diameter 30 --gpu
patchworks view scan.zarr
On a cluster — a Snakemake workflow with a pixi environment: convert, segment tile batches as GPU jobs, merge, relate label images (which cell each nucleus is in), and bundle, from one YAML config per segmentation:
cd workflow
pixi run multi-slurm --config my_multi.yaml
What you get
- One OME-Zarr holding the image and every label image, readable by napari, Fiji and any OME-Zarr tool.
- Object tables — size, position, shape — and relations between label images (the cell of each nucleus, the position of each cilium in its cell), exported as spreadsheets.
- Review in napari:
patchworks review scan.zarrsteps through the objects most likely to be wrong; corrections flow into the tables. - Plugins for Cellpose, PlantSeg, a nuclei-seeded watershed, difference of Gaussians (cilia, spots) and Noise2Void denoising — or bring your own function.
Documentation
https://imcf.one/patchworks/ — getting started, the cluster workflow, guides, examples and the API reference.
License
GNU General Public License v3.0 (GPL-3.0). See LICENSE.
Metadata
Release files for patchworks 3.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| patchworks-3.5.0.tar.gz | 1.2 MB | With provenance | Details for patchworks-3.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| patchworks-3.5.0-py3-none-any.whl | Python 3 | none | any | Details for patchworks-3.5.0-py3-none-any.whl |
Total release size: 1.5 MB
Release files / patchworks-3.5.0.tar.gz
| Download URL | patchworks-3.5.0.tar.gz |
|---|---|
| Size | 1.2 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1f2ec4dff3791348bc0ad4f48a80a908315a9bd4e01a97ebce6d4108b3272666
|
|
BLAKE2b-256 checksum How to use checksums |
76ff71b28533d95c33b61df33272c25b8cb7d78aa77490f442628ba7940f2961
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.
Transparency logRelease files / patchworks-3.5.0-py3-none-any.whl
| Download URL | patchworks-3.5.0-py3-none-any.whl |
|---|---|
| Size | 270.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f24bb5f8c734c02eeef41140cde059db39c04e012ac0ba6d99a67398cf220e3a
|
|
BLAKE2b-256 checksum How to use checksums |
71a75bb853dd3548677e62303f7c4911f35436354966dbfed25479829c49f47b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.
Transparency logSecurity for patchworks 3.5.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for patchworks-3.5.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.