Skip to main content

ga_trial_pdf_jade

Compatibility shim — implementation moved to bitfount.steps.pdf_report.pdf_render.

This module exists solely to avoid breaking legacy callers in bitfount.federated.algorithms.ophthalmology. New code should import directly from bitfount.steps.pdf_report.pdf_render.

Module

Functions

generate_pdf

def generate_pdf(    file_name: str | os.PathLike[str],    report_info: RecordInfo,    scans: ScanData | list[ScanData],    metrics: GAMetricsLike | list[GAMetricsLike],    task_id: str,    total_ga_area_lower_bound: float = 2.5,    total_ga_area_upper_bound: float = 17.5,)> None:

Generate and save a GA OCT PDF report.

Arguments

  • file_name: Destination path for the PDF.
  • report_info: Patient/record header information.
  • scans: One or more scans to include in the report.
  • metrics: GA metrics corresponding to each scan.
  • task_id: Task run ID (used to generate a Hub hyperlink).
  • total_ga_area_lower_bound: Lower bound for the GA area slider.
  • total_ga_area_upper_bound: Upper bound for the GA area slider.

Classes

AltrisRecordInfo

class AltrisRecordInfo(    text_fields: list[tuple[str, str]], heading: str | None = 'GA OCT REPORT',):

Patient/scan information for the report.

Arguments

  • text_fields: A list of (heading, value) tuples for the PDF header table.
  • heading: The heading for the PDF. Defaults to None.

Variables

  • static heading : str | None
  • static text_fields : list[tuple[str, str]]

AltrisScan

class AltrisScan(    bscan_image: str | os.PathLike[str] | PILImage,    bscan_idx: int,    bscan_total: int,    bscan_w_mask: str | os.PathLike[str] | PILImage,    legend2color: dict[str, tuple[int, int, int]],    laterality: str | None = None,):

Scan data for a single PDF report page.

Arguments

  • bscan_image: The raw B-scan image (path or PIL Image).
  • bscan_idx: Zero-based index of this B-scan within the volume.
  • bscan_total: Total number of B-scans in the volume.
  • bscan_w_mask: B-scan with segmentation mask overlay (path or PIL Image).
  • legend2color: Mapping of legend label to RGB colour tuple.
  • laterality: Eye laterality string (e.g. "left", "right"), optional.

Variables

  • static bscan_idx : int
  • static bscan_image : str | os.PathLike[str] | PIL.Image.Image
  • static bscan_total : int
  • static bscan_w_mask : str | os.PathLike[str] | PIL.Image.Image
  • static laterality : str | None
  • static legend2color : dict[str, tuple[int, int, int]]