task
Prefect task tabulating the metric caches, and eligibility, into a csv_report_df.
v2 differs from v1 in two inputs, both of which change what reaches the report rather than how it is built:
lesion_metrics, thelesion_calculationcache. Required, which is why this is a new version rather than a widened v1: a stored flow spec pinning v1 cannot suddenly need an input it never declared.evaluations, optional, fromcriteria_matching.csv_reportaccepts exactly onecsv_report_df, andtabulate_criteria_outcomesbuilds its frame from evaluations ALONE, so a template wanting biomarker columns and eligibility columns in one CSV has no way to get both. Merging the eligibility projection here is that way; the projection itself is stillevaluations_to_csv_report_df, so the two routes cannot drift.
Everything else mirrors v1: read each background step's per-file metrics from its
cache, assemble via assemble_scan_frame (GA as base, the rest left-merged on
the filename column with collision coalescing), derive the drusen and
segmentation-area columns, then apply the biomarker group/name filter. Column
names remain TECHNICAL — display renaming is csv_report's job. The one
exception is the eligibility failure-reason text, which is baked here and so
takes the display map from the config rather than waiting for csv_report's
header-only rename (which cannot reach cell text).
Module
Functions
biomarker_tabulation_task
def biomarker_tabulation_task( datasource: BaseSource, config: BiomarkerTabulationConfig, ga_metrics: CacheAccessor, fluid_metrics: CacheAccessor, cst_metrics: CacheAccessor, gcc_metrics: CacheAccessor, lesion_metrics: CacheAccessor, filenames: list[str], evaluations: list[CriteriaEvaluation] | None = None,) ‑> BiomarkerTabulationResult:Merge, derive and filter the five metric caches into a csv_report_df.
Arguments
datasource: The datasource. Used only to pick the eligibility grain; the cache rows are already keyed by the datasource filenames.config: Selection config (biomarker_groups/biomarker_names).ga_metrics: Cache accessor for the backgroundga_calculationstep.fluid_metrics: Cache accessor for the backgroundfluid_calculationstep.cst_metrics: Cache accessor for the backgroundcst_calculationstep.gcc_metrics: Cache accessor for the backgroundgcc_calculationstep.lesion_metrics: Cache accessor for the backgroundlesion_calculationstep.filenames: The selected filenames; every one is guaranteed a row (as an all-NA row when a calculation skipped/failed the file), mirroring the v8 protocol's_fill_missing_metricsbackfill.evaluations:criteria_matching's evaluations, orNonewhen the template has no criteria step. When given, the eligibility projection is left-merged on so one CSV carries both the biomarker columns and the verdict.
Returns
BiomarkerTabulationResult carrying the tabulated csv_report_df with
TECHNICAL column names plus the filename column.