Skip to content

lucem_hist::intensity

Intensity classes: one measurement (a cell’s Nucleus: DAB OD mean, say) against one threshold (negative / positive) or three (negative, 1+, 2+, 3+), and what a region reports from them: Positive % (a labelling index such as Ki67’s) and the H-score (0–300).

pub struct IntensityThresholds

Fields

  • measurement: String
  • thresholds: Vec<f64>: One threshold, or three increasing ones.
  • filter: Option<String>: Only objects of this class (Tumor) get an intensity class.

Methods

pub fn class_of(&self, v: f64) -> IntensityClass

Implements Clone, Debug, Deserialize, PartialEq, Serialize.

pub struct IntensitySummary

Fields

  • total: usize: Objects with an intensity class.
  • negative: usize
  • positive: usize
  • one_plus: usize
  • two_plus: usize
  • three_plus: usize
  • positive_percent: f64
  • h_score: f64: 1 · %1+ + 2 · %2+ + 3 · %3+ (0–300). With one threshold there are no 1+ / 2+ / 3+ classes, so it stays 0.

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

pub fn classify(objects: &mut [HistObject], t: &IntensityThresholds) -> usize

Sets the intensity class of the objects it applies to (their main class stays); the others lose theirs. How many were classified.

pub fn summarize<'a>(objects: impl IntoIterator<Item = &'a HistObject>) -> IntensitySummary