Measure colonies: size, shape, melanization and interaction metrics

measure_colonies(
  plate,
  edge_exclude_mm = 0.1,
  dark_L = NULL,
  n_boot = 200L,
  block_mm = 0.5,
  seed = 1L
)

Arguments

plate

A plate processed by segment_colonies().

edge_exclude_mm

Width of the colony margin excluded from colour statistics (mm).

dark_L

Optional \(L^*\) threshold for dark_fraction.

n_boot

Bootstrap replicates for confidence intervals.

block_mm

Side of the square spatial blocks for the bootstrap (mm).

seed

RNG seed for the bootstrap.

Value

Data frame with one row per expected colony.

Details

Melanization readouts

All colour statistics use unsmoothed, flat-field-corrected pixels of the colony interior: a rim of edge_exclude_mm is removed (mixed colony/agar pixels, "partial-volume" effect) and specular highlights (\(L^* > 97\) or a saturated channel) are excluded.

L_mean, L_median, L_sd, L_q05...L_q95

CIE lightness \(L^*\) (0 black - 100 white). The primary, perceptually uniform measure: a difference of 1 unit is the same visual darkening anywhere on the scale.

MI_mean, MI_median

Melanization index \(MI = 100 - L^*\). Higher = darker = more melanized. Linear in \(L^*\), so MI differences are comparable across the whole range.

MI_lo, MI_hi

95 % spatial block-bootstrap confidence interval of MI_mean (see colony_profiles()).

gray_imagej

Mean of (R + G + B) / 3 on the 0-255 scale, identical to ImageJ/Fiji's default RGB -> 8-bit conversion, for comparison with earlier Z. tritici melanization studies that report mean grey values.

a_mean, b_mean, chroma_mean, hue_deg

Chromatic components; DHN-melanin is dark brown-black, so strongly melanized colonies drift towards low \(L^*\) with slightly positive \(a^*, b^*\) (brown), whereas "grey" colonies are nearly neutral.

dark_fraction

Fraction of interior pixels with \(L^* <\) dark_L (only if dark_L is given). Choose dark_L from control plates, e.g. the 10th percentile of control colonies.

Interaction readouts

The interaction direction of a colony is the vector from its centroid to the centroid of the bacterial colony (confrontations), or to the dish centre (controls, so that the same metrics give the null expectation).

MI_facing, MI_away, delta_MI_facing

MI of the colony half facing the bacterium (angle < 90 deg to the interaction direction) and of the opposite half, and their difference. A localized melanization response to the bacterium gives delta_MI_facing > 0.

R_toward_mm, R_away_mm, growth_inhibition_pct

Colony radius from the centroid towards / away from the bacterium (maximum radius in a +/- 20 deg sector), and the percent inhibition of radial growth PIRG = 100 (R_away - R_toward) / R_away, the standard dual-culture antagonism index.

gap_bacteria_mm, gap_halo_mm

Shortest edge-to-edge distance from the colony to the bacterial colony and to the halo (0 = contact).

Examples

sim <- simulate_plate(width = 300, height = 400, seed = 7)
res <- analyze_plate(sim$image, verbose = FALSE)
res$colonies[, c("colony_id", "area_mm2", "L_mean", "MI_mean")]
#>    colony_id area_mm2   L_mean  MI_mean
#> x         TL 154.6602 52.29070 47.70930
#> x1        TR 155.3476 46.52899 53.47101
#> x2        BR 155.4621 41.44714 58.55286
#> x3        BL 155.2903 58.41531 41.58469