Skip to contents

Runs the complete FunMel pipeline: import, dish detection and scale, optional colour calibration, flat-field correction, colour/texture pixel classification, seeded colony separation, measurement and QC.

Usage

analyze_plate(
  path,
  layout = plate_layout(),
  id = NULL,
  dish_diameter_mm = 90,
  agar_fraction = 0.88,
  dish = NULL,
  mm_per_px = NULL,
  reference = NULL,
  reference_lab = c(50, 0, 0),
  max_dim = 2000,
  flat_field = TRUE,
  max_clipped_fraction = 0.02,
  classifier = NULL,
  min_delta_e = 3,
  min_area_mm2 = 0.5,
  min_core_mm = 0.4,
  morph_mm = 0.08,
  edge_criterion = 0.5,
  edge_exclude_mm = 0.1,
  dark_L = NULL,
  n_boot = 200L,
  block_mm = 0.5,
  ring_width_mm = 0.5,
  profile_mode = c("absolute", "relative"),
  n_rings = 10L,
  qc_file = NULL,
  keep_images = TRUE,
  verbose = TRUE,
  n_spots = NULL,
  spot_radius_mm = 0.5
)

Arguments

path

Image file or H x W x 3 sRGB array.

layout

A plate_layout(). Use plate_layout(centre = "none") for control plates without a central partner.

id

Plate identifier (default: file name).

dish_diameter_mm

Outer diameter of the dish (mm); sets the scale.

agar_fraction

Fraction of the dish radius that is analysed.

dish

Optional manual dish circle c(x, y, r) in working pixels.

mm_per_px

Optional known scale (mm per working-image pixel); overrides dish_diameter_mm.

reference

Optional exposure / white-balance reference: a grey-card region c(x, y, r) in relative image coordinates, or "agar"; see model_background().

reference_lab

Known CIELAB of the reference.

max_dim

Working resolution (longest side, px).

flat_field

Request illumination correction (recommended). It is applied only if the fitted correction passes the max_clipped_fraction check; plate_summary$flat_field_status records the outcome.

max_clipped_fraction

Largest fraction of dish pixels whose fitted flat-field gain may saturate before the correction is withheld as degenerate; see model_background(). Inf restores unconditional correction.

classifier

Optional supervised classifier (train_classifier()).

min_delta_e

Minimum colour difference from agar for objects.

min_area_mm2, min_core_mm, morph_mm, edge_criterion

Segmentation settings, see segment_colonies().

edge_exclude_mm, dark_L, n_boot, block_mm

Measurement settings, see measure_colonies().

ring_width_mm, profile_mode, n_rings

Profile settings, see colony_profiles().

qc_file

Optional path of a PNG quality-control figure.

keep_images

Keep image arrays in the result (needed for plot_qc() later; set FALSE in large batches to save memory).

verbose

Print progress.

n_spots

Optional spots per target colony; NULL keeps only whole-colony measurements.

spot_radius_mm

Circular spot radius (mm); see sample_colony_spots().

Value

An object of class funmel_result, a list with

colonies

One row per expected colony (measure_colonies()).

spots

Optional circular ROI measurements and locations; whole-colony MI stays unchanged.

profiles

Edge-to-centre profiles (colony_profiles()).

plate_summary

One row of plate-level measures and QC.

plate

The processed plate (images and masks) if keep_images = TRUE.

params, warnings

Settings used and QC warnings.

Examples

sim <- simulate_plate(width = 300, height = 400, seed = 10)
res <- analyze_plate(sim$image, id = "sim10", verbose = FALSE)
res
#> <funmel_result> plate "sim10"
#> • Scale: 0.2393 mm/px; agar L* = 22.2
#> • Colonies detected: 4 / 4; satellites: 1
#> • Central fungal/partner extent: equivalent r = 17.11 mm
#>  colony_id area_mm2 L_mean MI_mean MI_lo MI_hi delta_MI_facing
#>         TL      155   51.2    48.8  48.4  49.1            2.30
#>         TR      155   47.0    53.0  52.7  53.3            2.49
#>         BR      153   40.0    60.0  59.5  60.4            2.55
#>         BL      156   57.7    42.3  42.0  42.6           -2.57
#>  growth_inhibition_pct
#>                 3.5672
#>                 0.0496
#>                -0.3681
#>                -7.7772
res$colonies[, c("colony_id", "MI_mean", "delta_MI_facing")]
#>   colony_id  MI_mean delta_MI_facing
#> 1        TL 48.75959        2.299796
#> 2        TR 53.03797        2.491872
#> 3        BR 59.95116        2.551580
#> 4        BL 42.25989       -2.565176
if (FALSE) { # \dontrun{
res <- analyze_plate("plates/2026_05_26_20.JPG", layout = plate_layout())
plot_qc(res)
ctrl <- analyze_plate("plates/2026_05_26_37.JPG",
                      layout = plate_layout(centre = "none"))
} # }