Architecture Overview
Design Goals
The runtime architecture is built around these constraints:
GUI-first operator workflow, with fully supported headless execution.
Canonical persisted store format is OME-Zarr v3 (
*.ome.zarr).Public image interoperability uses OME-Zarr HCS collections.
ClearEx internal analysis arrays keep canonical
(t, p, c, z, y, x)layout for execution kernels and workflow chaining.Metadata-only spatial calibration for Navigate multiposition placement.
Deterministic latest-output publication for image and non-image artifacts.
Append-only, FAIR-oriented provenance records.
Shared configuration model between GUI and headless paths.
Layered Runtime Model
ClearEx is intentionally split into layers that can evolve independently:
Interface layer: GUI in
clearex.gui.app, localhost dashboard relay inclearex.gui.dask_dashboard_proxy, and CLI parsing inclearex.io.cli.Configuration layer: typed runtime schema in
clearex.workflow.WorkflowConfig(plusDaskBackendConfig,ZarrSaveConfig, andSpatialCalibrationConfig).Orchestration layer: workflow entrypoint and execution coordinator in
clearex.main.Data and metadata layer: ingestion in
clearex.io.experiment, OME publication and migration inclearex.io.ome_store, and provenance persistence inclearex.io.provenance.Analysis layer: analysis routines (flatfield, deconvolution, shear transform, registration, fusion, display pyramid, particle detection, uSegment3D, visualization, render_movie, compile_movie, volume export, and MIP export) via
clearex.<analysis>.pipeline.
End-to-End Execution Flow
At runtime, control flows through one orchestrator path:
Build a
WorkflowConfigfrom CLI arguments and/or GUI state.Optionally launch GUI and let the operator finalize settings.
Resolve acquisition source data or target store.
Materialize or validate canonical OME-Zarr store state.
Resolve analysis sequence and per-operation logical inputs.
Run selected analyses against runtime-cache image components.
Publish public OME image outputs and append one provenance run record.
Operational Invariants
These contracts are stable and expected by multiple modules:
Canonical public source image collection is the root OME HCS layout:
A/1/<field>/<level>.Canonical internal source component is
clearex/runtime_cache/source/data.Canonical internal image shape is always six-dimensional in
(t, p, c, z, y, x)order.Internal multiscale source levels are stored under
clearex/runtime_cache/source/data_pyramid/level_<n>.Public image-producing analysis outputs are published under
results/<analysis>/latest.Internal image-producing analysis arrays live under
clearex/runtime_cache/results/<analysis>/latest.volume_exportis hybrid: OME-Zarr runs publishresults/volume_export/latest; OME-TIFF runs keep artifacts underclearex/results/volume_export/latest/files.Registration is metadata-only under
clearex/results/registration/latest. Affine arrays remain the compatibility contract, and optional deformable lattices are ClearEx-owned non-image artifacts consumed by fusion.ClearEx-owned metadata, provenance, GUI state, and non-image artifacts live under
clearex/....Store-level placement metadata is persisted in
clearex/metadata["spatial_calibration"].Provenance run history is append-only under
clearex/provenance/runs.Legacy root
data, rootdata_pyramid, andresults/<analysis>/latest/datalayouts are migration-only and are not the canonical public contract.
Analysis Composition Model
Selected operations are not hard-coded into one fixed pipeline. Composition is
driven by normalized per-operation parameters in analysis_parameters:
execution_ordercontrols relative ordering between selected operations.input_sourcecontrols which logical upstream image source an operation reads.force_rerunlets operators bypass provenance-based dedup logic.
This allows one run to execute only one step, or a custom chain of steps, without changing orchestration code.
GUI-triggered Dask dashboard access is intentionally mediated through the localhost relay layer instead of opening scheduler dashboard URLs directly. That keeps browser access scoped to ClearEx-managed clients and lets the GUI fail with a warning when the upstream dashboard is unreachable.