lucem_hist::output
Where an analysis is stored, and how: next to the pixels it was made from.
- Where: inside the image’s own OME-Zarr when it is one and can be written (labels
where other viewers look for them), else
<fallback>/<image>.lucem.zarr. - What:
labels/cells,labels/nuclei: label images (OME-Zarrlabels, multiscale,u32; each object its id), rasterised chunk by chunk in parallel;lucem/cells.parquet(andtiles.parquet): one row per object — id, kind, class, intensity class, region, position (px, µm), then every measurement — Arrow / Parquet, read by Polars, PyArrow, pandas, DuckDB;lucem/shapes.parquet: GeoParquet (WKB polygons with thegeometadata): the objects’ outlines and nuclei, and the regions;lucem/provenance.json: the session (every step and its parameters) and the versions.
RegionShape
Section titled “RegionShape”pub struct RegionShape<'a>A region of the image for the shapes table.
Fields
id: &'a strclass: &'a stroutline: &'a [[f64; 2]]
Functions
Section titled “Functions”store_for
Section titled “store_for”pub fn store_for(image: &Path, name: &str, fallback: &Path) -> PathBufThe store of an image: its own OME-Zarr when writable, else under fallback.
write_objects
Section titled “write_objects”pub fn write_objects( store: &Path, name: &str, objects: &[HistObject], region: &[Option<String>], pixel_um: f64,) -> HistResult<PathBuf>Writes lucem/<name>.parquet: the objects and their measurements (region: each object’s
region, None the image).
write_shapes
Section titled “write_shapes”pub fn write_shapes( store: &Path, objects: &[HistObject], regions: &[RegionShape<'_>],) -> HistResult<PathBuf>Writes lucem/shapes.parquet (GeoParquet 1.1, WKB, level-0 pixel coordinates): every
object’s outline (cell, tile) and nucleus, and the regions.
write_labels
Section titled “write_labels”pub fn write_labels( store: &Path, name: &str, objects: &[HistObject], nucleus: bool, (width, height): (usize, usize), pixel_um: Option<f64>,) -> HistResult<PathBuf>Writes labels/<name>: an OME-Zarr label image of the objects (nucleus: their nuclei,
else their outlines), width × height level-0 pixels, chunks of 1024 rasterised in parallel.
write_provenance
Section titled “write_provenance”pub fn write_provenance(store: &Path, provenance: &Value) -> HistResult<PathBuf>Writes lucem/provenance.json.
ensure_group
Section titled “ensure_group”pub fn ensure_group(store: &Path) -> HistResult<()>Creates the fallback store’s group when it is not the image’s own.