Skip to content

Embed verified surgery atlas in local app builds - #4

Closed
KaiCao2003 wants to merge 2 commits into
mainfrom
codex/embed-surgery-atlas
Closed

Embed verified surgery atlas in local app builds#4
KaiCao2003 wants to merge 2 commits into
mainfrom
codex/embed-surgery-atlas

Conversation

@KaiCao2003

@KaiCao2003 KaiCao2003 commented Jul 26, 2026

Copy link
Copy Markdown
Owner

What changed

  • Preserve the selected historical atlas page at its full 792 x 612 MediaBox with no crop, duplicate translation, or page shrink.
  • Generate one self-contained SVG vector layer in memory with exactly one NP2003 shaft path or four NP2013 shaft paths plus one AP, ML, depth, angle, and layout row.
  • Keep exact registered path data; when paths coincide in a 2D projection, spread only the visible copies symmetrically and disclose that presentation in the coordinate row.
  • Remove visible DRAFT labels, the large provenance box, and machine-audit footers; retain audit identity in PDF metadata.
  • Verify the real 132-page atlas, nonzero MediaBox corners, path cardinality, AP/ML direction, visible four-color raster output, vector PDF output, and page assembly.
  • Keep the reviewed atlas available only to guarded lab-local builds; the public repository and release do not redistribute it.

Root cause

The historical page was translated twice even though PDFKit had already normalized its MediaBox origin, which cropped the artwork. The renderer also received no probe-plan geometry, so it could not create a real overlay. Four valid NP2013 paths could additionally overpaint into one visible line in a collapsed coronal projection. Finally, an opaque identity panel and per-page audit footer displaced the actual content.

User impact

The exported surgery packet now contains the complete atlas artwork, visible NP2003 or NP2013 vector shafts, and a readable coordinate row. Coronal and sagittal AP/ML direction conventions remain explicit. No temporary SVG sidecar or scattered atlas derivative is created.

Validation

  • Swift: 261 tests across 40 suites
  • Python: 698 passed, 2 expected skips
  • Ruff format and check plus mypy passed
  • All 132 real atlas pages resolved a page-specific coordinate map
  • Real four-page NP2013 export visually inspected at 300 dpi
  • Page 4 contains no raster image object; the SVG remains vector PDF content
  • Public and lab-local Apple Silicon release builders passed isolated bundled-bridge smoke tests
  • Public app contains no historical atlas; local app contains the exact pinned SHA-256 atlas

The commercial atlas PDF, extracted pages, generated apps, release archives, and QA surgery-plan PDFs remain excluded from this public PR.

@KaiCao2003

Copy link
Copy Markdown
Owner Author

Closing this draft because the public-repository cleanup removes licensed data and avoids repository-owned PDF embedding support. PR #5 supersedes the documentation and data-boundary work.

@KaiCao2003 KaiCao2003 closed this Jul 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant