Skip to content

About

Extremely fast, accurate PDF layout analysis for mass data extraction from ZEISS IOLMaster PDF reports

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

title BioSCRIBE - Toronto IOLMaster Report Parser
emoji 👁️
sdk streamlit
sdk_version 1.58.0
app_file app.py
pinned false

BioSCRIBE - Toronto IOLMaster Report Parser

A parser for Carl Zeiss IOLMaster PDF reports.

Supported report types (driven by the PDF's title metadata):

  • IOL-Haigis
  • IOL-Holladay-1
  • IOL-SRK-T
  • MMT-Full (raw biometry)

Quick start

from toronto_report_parser import IOLMasterPDFParser

with IOLMasterPDFParser("Abboud 2.pdf") as parser:
    data = parser.get_pdf_data()
print(data["title"], data["od"]["AL"])

Batch-parse a directory to one Excel file:

python parse_pdf_reports.py "reports/*.pdf" -o parsed.xlsx

Accuracy evaluation

To compare parser output against the manual ground-truth in ../Manual_Extraction/*_Compare.xlsx:

python run_evaluation.py \
    --pdfs ../IOL_PDFs \
    --manual ../Manual_Extraction \
    --out evaluation_output

Outputs:

  • Console: per-report and overall accuracy + timing summary.
  • evaluation_output/diff_workbook.xlsx: side-by-side parser/truth values for every row, with mismatched cells highlighted in yellow.
  • evaluation_output/transcription_review.xlsx: focused list of only the mismatched cells, with a "likely cause" heuristic to help Abu/Ninglu triage.

Current baseline on the 498-PDF corpus: 99.91 % cell-level accuracy at ~6 ms/file mean parse time.

Tests

pytest tests/
  • test_normalize.py — fast unit tests for value parsers (no PDF needed).
  • test_parser.py — integration tests against specific PDFs.
  • test_accuracy.py — full-corpus accuracy + timing regression guards.

The latter two skip automatically if the IOL_PDFs/ and Manual_Extraction/ directories aren't mounted.

Module layout

  • toronto_report_parser/
    • __init__.py — IOLMasterPDFParser (public entry point)
    • regions.py — per-report-type pixel rectangles
    • spans.py — low-level PyMuPDF span helpers
    • normalize.py — flatten parsed dicts to the ground-truth schema
    • evaluate.py — accuracy + timing harness, diff workbook writer

History

Initial single-file parser by Bill Shi (2025-07-27). Refactored 2026-05 into the module layout above; original parsing logic preserved. Additions: footer-date extraction (Calibration/Print date), repeated WTW/Pup capture in MMT-Full, single-pass text-page extraction for ~40 % runtime improvement.

About

Extremely fast, accurate PDF layout analysis for mass data extraction from ZEISS IOLMaster PDF reports

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages