🩻pyaar-dicom
A local-first DICOM annotation station for crowdsourcing radiologist validation of medical imaging datasets. Pairs Apple's newly DICOM-approved Studio Display XDR with Kitware's open-source viewer — the public sandbox runs on FDA-released synthetic mammograms; the local install keeps real PHI on the radiologist's own machine.
The thesis
Apple's Studio Display XDR was approved for DICOM-grade diagnostic radiology in 2025 — the first time a consumer monitor has cleared that bar. Pair a $1.6K display with $0 of open-source software (Kitware's VolView, built on VTK + ITK) and you have a workstation. Pair that with crowdsourced specialists and you can validate medical-imaging datasets without enterprise tooling.
Medical AI has a quiet bottleneck: ground-truth annotation. Validation datasets need expert eyes, but expert eyes live inside hospital networks behind PACS systems and license fees. The result is brittle benchmarks and underexplored subgroups. pyaar-dicom is the smallest end-to-end loop that takes that bottleneck seriously.
What's live today
- Demo: https://pyaar-dicom.vercel.app
- Source: https://github.com/prahlaadr/pyaar-dicom (private — visibility flips when listed)
- Dataset: half-resolution synthetic digital breast tomosynthesis volumes from the FDA CDRH t-synth release (CC0)
- Cost: running on Vercel free tier; ~360 MB on Vercel Blob
How it's built
[Reader's browser]
├── pyaar-dicom (Next.js 16 on Vercel)
│ ├── / landing — the thesis
│ ├── /cases manifest-driven case list
│ ├── /cases/[id] case detail · Open-in-VolView · annotation form
│ └── /api/annotations POST/GET → Vercel Blob
│
├── volview.kitware.app (stock viewer; opens with ?urls=&names= params)
│
└── Vercel Blob (public storage for .mha volumes + annotation JSON)Stack: Next.js 16 App Router · React 19 · Tailwind v4 · TypeScript · Vercel Blob · stock VolView (linked, not forked).
Architectural decisions worth flagging:
- VolView is linked, not forked. Stock
volview.kitware.appalready accepts?urls=[…]&names=[…]query params and loads MHA / NIfTI / DICOM viaitk.wasm. Saved a week of fork-maintenance work. Forking only happens once we need an in-viewer "Submit annotation" button. .mhaover.mhd/.rawpairs. t-synth ships paired MetaImage files; we collapse to single-file.mhaduring prep so VolView gets one URL per volume.- Vercel Blob does double duty. Same store holds
cases/*.mha(the volumes) andannotations/<caseId>/<id>/{record.json, session-*.zip}(reader output). No KV / Postgres needed at MVP scale. - Half-resolution for the public sandbox. Native t-synth volumes are 965 MB each; we resample to ~120 MB with SimpleITK. 5 mm spiculated lesions are still clearly visible at half-res, and load times drop from a minute to seconds.
- Static rendering by default.
/cases/[id]is statically generated for every case at build time viagenerateStaticParams, so opening a case is a CDN hit, not a server roundtrip.
How it works (one read-and-annotate loop)
- Reader lands on
/cases, sees the manifest of synthetic studies. - Picks one. Detail page loads with a single button: Open in VolView →.
- VolView opens in a new tab, streams the volume from Vercel Blob (range-request friendly, so it scrolls before fully downloading), and lets the reader scroll, window/level, drop measurements, and segment.
File → Save Sessionin VolView produces a.volview.zipof the annotated state.- Reader returns to the case page, fills out findings + diagnosis, optionally attaches the session zip, hits Submit.
POST /api/annotationswrites the metadata JSON and the session blob to Vercel Blob underannotations/<caseId>/<uuid>/.GET /api/annotations?caseId=…lists every read for that case.
Because everything is keyed by case ID and indexed by submission time, multi-rater agreement falls out naturally — N readers reading the same case generate N records under the same prefix.
What can be achieved
The MVP already supports:
- Public, zero-friction reads. Anyone with a browser can pick up a case, annotate it, and submit. No account, no install. The synthetic data makes this defensible — there is no PHI to leak.
- Local install path. Same Next.js app, same VolView link, but pointed at a Blob-compatible local server (S3-compatible storage like MinIO, or just the filesystem). PHI never leaves the radiologist's machine. This is the actual product; the hosted version is the showcase.
- Multi-rater dataset validation. Once you have a case + ground truth + N reader annotations, you can compute Dice / IoU / Cohen's κ — the standard signals that tell you whether your annotation pipeline is reliable.
- Cost-honest scaling. Even the hosted version runs on Vercel's free tier today. A real deployment with hundreds of cases and dozens of readers fits in Blob's pay-as-you-go envelope at single-digit dollars per month.
The full vision
Four phases, only one shipped:
Phase 1 — Read, annotate, submit (✅ done).
The loop above. Synthetic data, public sandbox, no validation harness.
Phase 2 — Validation harness.
t-synth ships .loc files with ground-truth lesion centroids alongside every reconstruction. Compute distance + sensitivity per reader, aggregate into a per-case agreement report, surface inter-rater variance. The same harness ports to public datasets like LIDC-IDRI (lung nodules with multi-rater consensus already in the dataset) so the loop generalises beyond mammography.
Phase 3 — Fork VolView for in-viewer submission.
Replace the Save-Session-then-upload dance with a "Submit" button inside VolView itself, posting structured ROIs (DICOM SEG or NIfTI labelmaps) to our backend. Removes a step that's currently the highest UX friction.
Phase 4 — Local install + booking.
Docker Compose bundle for hospital deployment: PHI never leaves the host, but readers' annotations sync to a coordinator. A lightweight booking layer assigns specific cases to specific specialists with deadlines and review queues. This is when the project becomes a tool for actual research labs, not just a demo.
Why this matters
The medical-imaging AI ecosystem is gated by who can produce labeled data. Hospitals can, with friction. Research labs can, slowly. Startups mostly can't. If a radiologist with a $1.6K display, an internet connection, and an hour can produce validated annotations on a public dataset — and the tooling makes that workflow obvious — the bottleneck weakens.
Nothing here is novel infrastructure. VolView is a 15-year-old codebase. Vercel Blob is a CDN. The synthetic data was released by the FDA. The contribution is the assembly — proving the pieces compose into something a working clinician can actually use, and that the same artifact runs locally for real patient data.
Built end-to-end in one session. Code, deploy, blob storage, and dataset wiring in a single afternoon. Iteration notes and architectural decisions in CLAUDE.md / AGENTS.md.