Skip to main content

lucem (Python)

GPU image processing for biology, written once in CubeCL: the same operators, histology steps and models as the lucem app, on NumPy arrays and on images of any size, on any GPU (wgpu, CUDA) or the CPU.

Install

The packages go to PyPI with a coming release; until then, from a clone of the repository: pip install ./bindings/python (the core, with histology built in for development). Once on PyPI:

pip install lucem                  # io, ops, custom walks, the model plugin client
pip install "lucem[hist]"          # + histology: stains, tissue, cells, the app's steps
pip install "lucem[app]"           # + the desktop app (`lucem app`)
pip install "lucem[stardist]"      # + the StarDist nucleus models (BSD-3-Clause)
pip install "lucem[instanseg]"     # + the InstanSeg nucleus models (Apache-2.0)
pip install "lucem[sam]"           # + Segment Anything (Apache-2.0)
pip install "lucem[ml]"            # + every model plugin
pip install "lucem[all]"           # everything

Wheels for CPython 3.12+ on Linux x86_64 (glibc 2.34+), Windows x64 and macOS arm64 (no CUDA there). Model weights (and SAM's ONNX Runtime) download and are checked against their SHA-256 the first time a model is used.

Use

import lucem
from lucem.ops import Pipeline, stage

image = lucem.io.open("slide.ome.zarr")             # nothing read yet
x = image.read_region(0, 0, 0, 0, 1024, 1024)        # level, channel, x, y, width, height
mask = Pipeline([stage.gaussian_blur(sigma=2), stage.threshold(value=0.2), stage.open(radius=2)])(x)

# Your own function over an image of any size, block by block
smooth = lucem.custom.transform(lambda b: lucem.ops.gaussian_blur(b, sigma=4.0), halo=16)
smooth.write(image, "smoothed.ome.zarr")

# Histology (lucem[hist]): the steps the app records, run from Python
from lucem.hist import steps
result = steps.run(image, [steps.tissue(), steps.cells(stains="h_dab", within="tissue")])
table = lucem.hist.export.table(result.cells, image.name, image.pixel_size_um)

# Models (lucem[stardist]): a plugin program, found by itself
with lucem.ml.Plugin("lucem-ml-stardist") as p:
    labels = p.instances("stardist-he", rgb, pixel_um=0.5)

The lucem command of the package opens the app (lucem app [path]) and lists the model plugins (lucem plugins). The full command line (operators, pipelines, histology batches, the server, MCP) is the Rust program: cargo install --git https://github.com/neuro-kitchen/lucem lucem-cli.

How it is built

The lucem-py crate is the one extension (lucem._native); lucem-py-core and lucem-py-hist register into it. The lucem wheel is built without histology, the lucem-hist wheel with it (wheels/lucem-hist), and only one is loaded: when lucem-hist is installed, lucem uses its extension, so there is one GPU device per runtime. wheels/lucem-app and wheels/lucem-ml-* put the app and the model plugins (programs, never linked) into wheels.

uv sync                                   # from the repository root: builds and installs lucem (editable, with hist)
uv run pytest -q bindings/python/tests

Metadata

Release files for lucem 0.0.5

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

Built distributions (wheels)

Table of built distributions (wheels) for lucem 0.0.5
File Interpreter ABI Platform Actions
lucem-0.0.5-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details for lucem-0.0.5-cp312-abi3-win_amd64.whl
lucem-0.0.5-cp312-abi3-manylinux_2_34_x86_64.whl CPython 3.12 abi3 Linux glibc 2.34+ x86-64 Details for lucem-0.0.5-cp312-abi3-manylinux_2_34_x86_64.whl
lucem-0.0.5-cp312-abi3-macosx_11_0_arm64.whl CPython 3.12 abi3 macOS 11.0+ ARM64 Details for lucem-0.0.5-cp312-abi3-macosx_11_0_arm64.whl

Total release size: 131.8 MB

Release files / lucem-0.0.5-cp312-abi3-win_amd64.whl

Download URL lucem-0.0.5-cp312-abi3-win_amd64.whl
Size 41.4 MB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
9a9e460e5e09412be8010b6b0d902067170ca37a2b9b03c4ebc93494f8f1be10
BLAKE2b-256 checksum
How to use checksums
6229598590fbb0dea2c8df9062e3977bac4834802cd7725123f6e1accb10e214
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 21, 2026.

Transparency log

Release files / lucem-0.0.5-cp312-abi3-manylinux_2_34_x86_64.whl

Download URL lucem-0.0.5-cp312-abi3-manylinux_2_34_x86_64.whl
Size 55.0 MB
Tags CPython 3.12 Linux glibc 2.34+ x86-64 abi3
SHA-256 checksum
How to use checksums
7a9ef43ed2da2bbaa91db8505be6f9c5f5480cd75b00edcf6604f075b9a513ca
BLAKE2b-256 checksum
How to use checksums
cd48575e8a43cdd5f362e627d0ab1e2b0a7e86d3790cb11ad5a2fa053057ced1
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 21, 2026.

Transparency log

Release files / lucem-0.0.5-cp312-abi3-macosx_11_0_arm64.whl

Download URL lucem-0.0.5-cp312-abi3-macosx_11_0_arm64.whl
Size 35.4 MB
Tags CPython 3.12 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
e266ac188b76d116b3a0559b9cf0202b7e7420b9d7ee34b59c039e1d58d65a9b
BLAKE2b-256 checksum
How to use checksums
95a5a869a47ebf494792593e6f5a8cdb2a24a074cb4f19d27431d04a3da38b93
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 21, 2026.

Transparency log

Security for lucem 0.0.5

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

All 3 files in this release have been uploaded with provenance metadata.

Select from 3 files

Attestation for lucem-0.0.5-cp312-abi3-win_amd64.whl

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 21, 2026.

Transparency log

A 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.

Release history Release notifications | RSS feed

This release

0.0.5 This release

3 release files Full provenance

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