This repository contains a lightweight toy implementation of RSQA. RSQA is a reference-based scanner quality assurance framework for comparing multiple digital scanners (institutes with different devices) using whole-slide images of pathological specimens.
The method uses an ideally error-free ground-truth scan of the same physical object as a reference. Each institute produces repeated scans of that object, and all assessment is image-based: color, structure, and texture are compared.
RSQA produces a global scalar quality score and a spatially resolved error map, so it can show where in the image individual error classes occur, such as blur, color deviation, artifacts, saturation loss, tissue folds, or striping.
This repo is a simplified example, not the full workflow. A short abstract of the method is available in the draft paper RSQA.pdf.
The toy workflow performs four simple steps:
- Load a ground-truth image and a set of test images from the mugs folder.
- Register each test image onto the reference domain using feature matching and a homography.
- Estimate local error maps for blur, color, structure, tone, illumination, and a lightweight semantic/OCR-like proxy.
- Aggregate those errors into per-picture quality scores and write the results to CSV files and heatmap images.
The output is meant to be illustrative rather than a full clinical or production-grade quality assessment system.
The reference image used in the example is the ground-truth mug picture:
python scripts/run_toy_example.pyThe script loads the sample photographs from mugs (or data/toy_example if you provide that structure), runs registration and per-class error estimation, writes metrics to outputs/toy_example/metrics.csv and outputs/toy_example/institute_summary.csv, and saves heatmap PNGs in outputs/toy_example/figures/.
A draft of the related paper is available as RSQA.pdf.
This toy example is illustrative only. It uses a single ground-truth reference and does not include a calibration set, tolerance thresholds, or acceptance decisions. Those aspects belong to the full RSQA workflow described in the formal specification.
