Skip to main content

openreadout_live/
lib.rs

1//! OpenReadout live: data that is still being acquired.
2//!
3//! - [`replay`] rewrites a finished file step by step in the order acquisition software
4//!   plausibly writes it (each pattern marked documented or assumed), so that reading growing
5//!   files can be tested without an instrument.
6//! - [`watch`] is a polling directory watcher: one [`watch::WatchEvent`] per new data set,
7//!   plane, scan or sweep, per completed or stalled data set, per QC finding and per error.
8//! - [`synth`] builds a small synthetic OME-TIFF for tests and demos.
9//! - [`qc`] computes live QC metrics (saturation, focus-drift proxy, dropped frames, TIC drop)
10//!   and evaluates declarative TOML rules over them.
11//!
12//! Whether a single file is still being written is decided in
13//! [`openreadout_core::live`] from the evidence each reader reports. See `book/src/guides/lab-shares.md`.
14//!
15//! # Example
16//!
17//! ```no_run
18//! use openreadout_core::Registry;
19//! use openreadout_live::watch::{WatchOptions, Watcher};
20//!
21//! // Register readers: `Registry::new().with(Box::new(openreadout_nd2::Nd2Reader))`.
22//! let registry = Registry::new();
23//! let mut options = WatchOptions::default();
24//! options.roots.push("/data/incoming".into());
25//! let mut watcher = Watcher::new(options);
26//! loop {
27//!     watcher.poll(&registry, &mut |event| {
28//!         println!("{}", serde_json::to_string(&event).unwrap());
29//!     });
30//!     std::thread::sleep(std::time::Duration::from_millis(250));
31//! }
32//! ```
33#![forbid(unsafe_code)]
34#![warn(missing_docs)]
35
36pub mod qc;
37pub mod replay;
38pub mod synth;
39pub mod watch;