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

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

Source distribution (sdist)

Source distribution for lucem 0.0.6
File Size Uploaded Provenance Actions
lucem-0.0.6.tar.gz 509.1 kB With provenance Details for lucem-0.0.6.tar.gz

Built distributions (wheels)

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

Total release size: 132.3 MB

Release files / lucem-0.0.6.tar.gz

Download URL lucem-0.0.6.tar.gz
Size 509.1 kB
Tags Source
SHA-256 checksum
How to use checksums
15d5e1caba159940407e6e98c42399cada8c0d7973fe1f2084aef283defbc249
BLAKE2b-256 checksum
How to use checksums
52c2e0c08992646080b01416466e52fa4a9c8715b74ce7b247357cb67f9e3250
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.6-cp312-abi3-win_amd64.whl

Download URL lucem-0.0.6-cp312-abi3-win_amd64.whl
Size 41.4 MB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
d0fef07497ac65078c71290c7e8a4576ccf54e93db57228b5d189506f1466ab3
BLAKE2b-256 checksum
How to use checksums
2845e010d68cfff76bfa0c692f9c73a018aaa5bcdcb52e073d3f558b74b7ef90
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.6-cp312-abi3-manylinux_2_34_x86_64.whl

Download URL lucem-0.0.6-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
52f846aa22affbb01b3db67fcce3dff9d9624b5ed34e1d08a52e185c9db5acac
BLAKE2b-256 checksum
How to use checksums
f7d17da3c247b072de6abb9d9e780bba7afa41e4190c162ad840daac455dbb6f
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.6-cp312-abi3-macosx_11_0_arm64.whl

Download URL lucem-0.0.6-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
8a54ba33a42685c956c03a23f457cb0c1161a58eebad848fc90d7d350528a6cb
BLAKE2b-256 checksum
How to use checksums
43b3c8d538e4b27c8b778763b89911abc0615ec1f7abf6a5e21cb2f92605e415
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.6

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 4 files in this release have been uploaded with provenance metadata.

Select from 4 files

Attestation for lucem-0.0.6.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 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.6 This release

4 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