lucem_hist::session
The session: every step that changed the analysis, in order, with its parameters — what
was done, kept as JSON (session.json next to the project, and in each output’s
provenance), so the same analysis runs again without the app: lucem session run session.json <images…> on a server, image after image.
Only steps that change data are recorded (finding tissue or cells, training, scoring, classing pixels, exporting); views, panels and selections are not.
Session
Section titled “Session”pub struct SessionFields
lucem_session: u32steps: Vec<Step>
Methods
pub fn load(path: &Path) -> HistResult<Self>pub fn save(&self, path: &Path) -> HistResult<()>pub fn push(&mut self, image: &str, action: Action)Records a step on image now.
pub fn recipe(&self) -> Vec<&Action>The steps to run on another image: the last of each kind, in their order (a step done again replaces the earlier one: the session keeps what was settled on).
Implements Clone, Debug, Default, Deserialize, PartialEq, Serialize.
pub struct StepOne step: when (seconds since 1970), on which image (its name), and what.
Fields
at: u64image: Stringaction: Action
Implements Clone, Debug, Deserialize, PartialEq, Serialize.
RunResult
Section titled “RunResult”pub struct RunResultWhat a run gives for one image.
Fields
tissue: Vec<Polygon>cells: Vec<HistObject>tiles: Vec<HistObject>notes: Vec<String>: What each step did (one line each).
Implements Debug, Default.
Within
Section titled “Within”pub enum WithinWhere a step looks.
Variants
Image: The whole image.Tissue: The tissue found (atissuestep before it, or found then).Regions { outlines: Vec<Polygon> }: These regions (level-0 outlines); on another image, the tissue is used instead.
Implements Clone, Debug, Default, Deserialize, PartialEq, Serialize.
Action
Section titled “Action”pub enum ActionVariants
Tissue { settings: TissueSettings }: Regions of class Tissue.Cells { within: Within, staining: Staining, detection: CellDetection, auto_threshold: bool, model: Option<String> }: Cells found and measured (model: a nucleus model plugin, else the threshold).ClassifyObjects { classifier: ObjectClassifier, tiles: bool }: The cells (or tiles) classed by a trained classifier.Intensity { thresholds: IntensityThresholds }: Intensity classes (negative, 1+, 2+, 3+).PixelClasses { classifier: PixelClassifier, pixel_um: f64, within: Within }: Every pixel classed (insidewithin).Superpixels { within: Within, settings: SuperpixelSettings, pixel_um: f64 }: Superpixel tiles.Density { settings: DensitySettings }: A density map.Export: Everything written to the output store.
Methods
pub fn title(&self) -> &'static strImplements Clone, Debug, Deserialize, PartialEq, Serialize.
Functions
Section titled “Functions”pub fn run( client: &Client, p: &Pyramid, recipe: &[&Action], progress: &mut dyn FnMut(&str),) -> HistResult<RunResult>Runs recipe (see Session::recipe) on one image through the engine (the same steps
the app runs). Regions drawn on the image the session was recorded on become this image’s
tissue (Within::Tissue).
Constants
Section titled “Constants”SESSION_VERSION
Section titled “SESSION_VERSION”pub const SESSION_VERSION: u32 = 1;The format this crate reads and writes (lucem_session field).