Skip to content

lucem_hist::objects

The objects of an analysis: annotations, detections, cells and tiles, with their measurements.

pub struct HistObject

Fields

  • id: u32
  • kind: ObjectKind
  • roi: Polygon: The outline (a cell’s whole cell).
  • nucleus: Option<Polygon>
  • centroid: Point
  • class: Option<String>: Its class (Tumor, CD3: CD8, …).
  • intensity: Option<IntensityClass>
  • measurements: Measurements

Methods

pub fn new(id: u32, kind: ObjectKind, roi: Polygon) -> Self

An object from its outline (centroid from the outline).

pub fn get(&self, name: &str) -> Option<f64>
pub fn full_class(&self) -> Option<String>

The class with its intensity, as shown: Tumor: 2+, Positive, Stroma.

pub fn has_class(&self, class: &str) -> bool

Whether its class is class or starts with it (CD3 matches CD3: CD8).

Implements Clone, Debug, Deserialize, PartialEq, Serialize.

pub enum ObjectKind

Variants

  • Annotation: A region drawn or found (tissue, a class region of a pixel classifier).
  • Detection: A detected object without a nucleus / cell split.
  • Cell: A cell: its outline is the cell, nucleus its nucleus.
  • Tile: A tile or superpixel.

Implements Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize.

pub enum IntensityClass

The intensity class of an object (staining strength of one measurement).

Variants

  • Negative
  • Positive: One threshold: above it.
  • OnePlus
  • TwoPlus
  • ThreePlus

Methods

pub fn name(self) -> &'static str
pub fn is_positive(self) -> bool

Implements Clone, Copy, Debug, Deserialize, Eq, Ord, PartialEq, PartialOrd, Serialize.

pub type Point = [f64; 2];

A point in level-0 pixels.

pub type Polygon = Vec<Point>;

A closed outline in level-0 pixels (the last point joins the first).

pub type Measurements = BTreeMap<String, f64>;

Measurements by name (Nucleus: Area µm^2, Cell: DAB OD mean, …).