Skip to main content

task

Prefect task for the GA metrics calculation step (without fovea).

Calls compute_ga_metrics_for_scan from steps.data_utils.ga_metrics to compute GA area, lesion counts, and image-centre distance for each scan, without requiring fovea model predictions.

Module

Functions

ga_calculation_without_fovea_task

def ga_calculation_without_fovea_task(    datasource: BaseSource,    config: GACalculationWithoutFoveaConfig,    ga_predictions: CacheAccessor,    filenames: list[str],    cache: CacheProtocol,    task_hash: str,    project_id: str | None = None,    run_id: str | None = None,)> GACalculationWithoutFoveaResult:

Compute GA metrics for each file (no fovea) and persist them to cache.

Runs in background mode: an in-memory result does not cross the phase boundary, so the per-file metrics are persisted to the ga_calculation_without_fovea cache table (keyed by (task_hash, file_id), project_id provenance-only) and a downstream step reads them via the .cache accessor.

Arguments

  • datasource: The datasource providing DICOM metadata (slice thickness, pixel spacing) for each file.
  • config: GA calculation without fovea configuration.
  • ga_predictions: Cache accessor for GA model inference results (background step ga_inference.cache).
  • filenames: List of file IDs to process.
  • cache: Cache instance to persist the GA metrics into.
  • task_hash: Partition key for the cache table (see GACalculationWithoutFovea for the key's composition).
  • project_id: Provenance only — the project that triggered this run. NOT part of the cache key.
  • run_id: Optional provenance run ID.

Returns GACalculationWithoutFoveaResult carrying the number of rows persisted and a CacheAccessor scoped to this task_hash.