Repository navigation
v0.0.2
The Python packages (lucem, with histology, the desktop app and the model plugins as extras;
built from the repository for now, on PyPI from a later release); InstanSeg's
nucleus models on Burn, and both model plugins 3–10× faster on a GPU; lucem autotune for the
whole machine; pairing codes kept out of logs; releases from a tag of main by trusted
publishing to crates.io and PyPI; brush size from the keyboard.
Release process
- Releases come from a
v*tag ofmain(.github/workflows/release.yml, as kitchen and
dsp-kitchen): the tag is checked against the workspace version and CHANGELOG.md, the crates are
packaged and checked by cargo-deny, the library crates go to crates.io by trusted publishing
(environmentcrates-io, approved by a maintainer; crates already at that version are skipped),
then the GitHub release takes this file's section as its notes. The app, the CLI and the MCP
server stay off crates.io until kitchen-agent is published. - The Python packages go to PyPI from the same tag once the repository variable
PUBLISH_PYPI
istrue(until then a tag publishes the crates and the GitHub release only), by trusted
publishing (approved by a maintainer):lucemandlucem-hist(abi3 wheels for CPython 3.12+ on Linux x86_64, glibc
2.34+, Windows x64 and macOS arm64, andlucem's sdist) in the environmentpypi; the app and
the model plugins (lucem-app,lucem-ml-stardist,lucem-ml-sam) each in its own
(pypi-app,pypi-ml-stardist,pypi-ml-sam), so a failure there holds up nothing else.
The extras' pins are checked against the workspace version. The "Private :: Do Not Upload"
classifier that blocked uploads is gone.
Added
- Python packages, as dsp-kitchen's (built from the repository,
pip install ./bindings/python,
until they are on PyPI):lucemgiveslucem.runtime,lucem.io
(images of any size read by block, plane or region; OME-Zarr written block by block),
lucem.ops(every operator of the catalog on NumPy arrays, and pipelines that stay on the
device),lucem.custom(your own functions over an image of any size, with halos and objects
joined across blocks) andlucem.ml(the model plugins: found, asked for their models, run on
an array). Extras:lucem[hist]addslucem.hist(stains and deconvolution, tissue, cells
found or grown from a model's nuclei, the app's steps built in Python or read from a
session.jsonand run through the app's engine, tables and GeoJSON);lucem[app]the desktop
app (lucem app);lucem[stardist],lucem[sam],lucem[instanseg]andlucem[ml]the model plugins
as programs, kept apart from lucem as before (their weights download on first use);lucem[all]
everything. Thelucem-histwheel is the whole extension built with histology, andlucem
loads it in place of its own when it is there: one device per runtime. The binding crates
(lucem-py-core,lucem-py-hist) register into the one extension,lucem-py. - InstanSeg on Burn: the
lucem-ml-instansegplugin runs InstanSeg's published brightfield
and single-channel nucleus models (Apache-2.0) on CUDA, wgpu or the CPU, as StarDist does
(models/instanseg). Each bioimage.io package is fetched and checked (SHA-256). Its
TorchScript archive is read in Rust, with no PyTorch: a small pickle reader and the zip, then
kept as safetensors with the model's thresholds. The postprocessing is ported from the
archive's own code: seeds, the pixel classifier, fragments and holes, overlaps joined. The
published test images give the published nuclei.pip install "lucem[instanseg]"(also in
lucem[ml]). The channel-invariant "nuclei and cells" model is not ported yet. lucem autotune, one tuning for the whole machine (as dsp-kitchen's): lucem's operators
over a grid of image sizes, then every model plugin found (<plugin> tune: each installed model
on every tile shape), on every usable runtime; the choices and compiled kernels are kept in the
user cache folder. Also File › Tune this device in the app andlucem.runtime.autotune().
The model plugins have abenchcommand (timings per phase, cold and warm).- Brush size from the keyboard: Ctrl+= and Ctrl+−
(the commands Brush bigger and Brush smaller, wherever the focus is), next to [ and
] on the image; the toolbar's stepper and the keys share one step.
Security
- Pairing codes exist only when asked for and are never written where a log could keep them:
lucem serveno longer makes one at every start (--pairasks for one, shown on the
terminal);lucem clients pairshows its code on the terminal itself (/dev/tty,CONOUT$),
not on standard output, so a redirect, a pipe or a service's log never holds it (a script
takes it from--out FILE, readable by its owner only).lucem clients codeslists the live codes without their secrets and
--cancel ID|allcancels them. Code scanning had flagged codes in cleartext logs.
Changed
-
The models are Burn modules: StarDist and InstanSeg are
#[derive(Module)]structs of
burn::nnlayers (InstanSeg's mirroring its PyTorch classes), loaded by name with Burn's
SafetensorsStore(InstanSeg's through its PyTorch adapter), instead of hand-written tensor
functions and readers. The published outputs are still met: InstanSeg exactly, StarDist to 1e-6
in single precision. -
The models are 3–10× faster on a GPU (RTX 2070, CUDA, warm):
Image InstanSeg before → now StarDist before → now 512² 1,179 → 111 ms 225 → 39 ms 1024² 4,136 → 503 ms 541 → 200 ms 2048² 21,666 → 2,790 ms 2,226 → 696 ms 4096² — → 11,106 ms 10,914 → 3,336 ms Half precision on the GPU, for the weights, the activations and the data to and from the
device (half the bytes moved); BatchNorm folded into InstanSeg's convolutions at load; the 3 × 3
layers of 64 channels and more as tensor-core matrix products, because Burn's own tensor-core
convolution asks more shared memory than a Turing GPU has for them and falls back to its direct
kernel (about 15× slower); when a matrix product cannot launch on a device, the direct
convolutions take over for the rest of the run. InstanSeg's postprocessing works in logits a
window row at a time (no exponential per pixel), compares only windows that touch, and fills
holes near each nucleus only (512²: 499 → 14 ms). InstanSeg in half precision still gives the
published nuclei exactly; StarDist's maps move by at most 1.8e-3 (probability) and 0.1 px
(distances), same nuclei.LUCEM_INSTANSEG_PRECISION/LUCEM_STARDIST_PRECISION=f32and
…_CONV=directchoose the single-precision, direct path (bit-faithful, slower). -
Channels open as the OME-Zarr file marks them (
omeroactive; shown when it does not say):
a 59-marker PhenoCycler image opens with its chosen few, the rest in the list. -
The workspace's data list (
.data/) holds only images and OME-Zarr containers: licences,
notes, archives and raw formats lucem does not open (.qptiff,.zip) are left out.
Fixed
- Model plugins run on the app's compute runtime: the app passes its own (CUDA, wgpu, CPU) to
every plugin it starts. A plugin left to its default could open a second runtime on the same
GPU (wgpu beside the app's CUDA), share its memory and run out of it. - Out of GPU memory in a model is reported as such, with what to do; it no longer switches the
models' fast convolutions off (only a matrix product the device cannot launch does). - CI runs green again: the app's device uses the CPU there (
LUCEM_RUNTIME=cpu; it opened
wgpu, whose device thread panics on a runner without a GPU, failing every app test after it),
and cargo-deny allows kitchen's repository as a git source (kitchen-agent is not on crates.io
yet). A test of the activity view found another test's Rulers entry in the shared log; the
Python test compares the version to the installed package's instead of a fixed0.1.0.
Documentation
- The README says what lucem is now (it described an empty skeleton), with the app's screenshot
(dark or light as the reader's theme), installing the library crates from crates.io, and every
crate; the docs site shows the screenshot on its front page and the App page. The sample image is
credited (© PerkinElmer / Akoya Biosciences, CC BY 4.0).
Install
The library crates from crates.io: cargo add lucem (core, io, ops, ml) and the others
(lucem-hist, lucem-pipeline, lucem-view, lucem-hub). The app and the lucem
command build from this tag: cargo install --git https://github.com/neuro-kitchen/lucem --tag <this tag> lucem-cli.