{"id":50720328,"url":"https://github.com/jdawg555/surgeon-sim","last_synced_at":"2026-06-09T23:03:38.866Z","repository":{"id":355688612,"uuid":"1229133798","full_name":"jdawg555/surgeon-sim","owner":"jdawg555","description":"Immersive spine-surgery overlay for Meta Quest 3. Passthrough AR, voice control, deterministic implant fit ranking ported from dragonfly. Mannequin demo only — no PHI.","archived":false,"fork":false,"pushed_at":"2026-05-08T02:31:37.000Z","size":103,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-08T03:29:07.249Z","etag":null,"topics":["ar","clinical-platform","dragonfly","meta-quest","passthrough-ar","spine-surgery","unity","xr"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jdawg555.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-04T18:27:14.000Z","updated_at":"2026-05-08T02:15:24.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/jdawg555/surgeon-sim","commit_stats":null,"previous_names":["rexxgames/surgeon-sim","jdawg555/surgeon-sim"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/jdawg555/surgeon-sim","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdawg555%2Fsurgeon-sim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdawg555%2Fsurgeon-sim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdawg555%2Fsurgeon-sim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdawg555%2Fsurgeon-sim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jdawg555","download_url":"https://codeload.github.com/jdawg555/surgeon-sim/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdawg555%2Fsurgeon-sim/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34129072,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ar","clinical-platform","dragonfly","meta-quest","passthrough-ar","spine-surgery","unity","xr"],"created_at":"2026-06-09T23:03:38.135Z","updated_at":"2026-06-09T23:03:38.860Z","avatar_url":"https://github.com/jdawg555.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# surgeon-sim\n\nImmersive spine-surgery simulator for Meta Quest 3.\n\nA deterministic spine-surgery core (implant fit ranking, pedicle screw +\nrod prediction, tray optimization) rendered as a passthrough-AR overlay\nlocked to a real mannequin or table. Voice-driven, step-paced, built to\ndemo well on stream.\n\n## Status\n\nDay-zero scaffold. The deterministic core (level taxonomy, implant catalog,\nfit ranking) lives in Python under `python/` and is mirrored to C# under\n`unity/Assets/Scripts/`. Both can be exercised in isolation: run the Python\nmodules from a REPL, or run the editor smoke test in Unity without putting\nthe headset on. The XR layer — anchoring, voice routing, step machine,\nstream overlay — is wired up but needs a Unity project, the Meta XR Core\nSDK, and a spine reference mesh imported before it runs on a Quest.\n\n## Stack\n\n- **Unity 6 LTS (6000.0)** with the **XR Interaction Toolkit 3.x** + **OpenXR**\n- **Meta XR All-in-One SDK v77** (UPM scoped registry, not the deprecated\n  Asset Store package) for passthrough, anchors, hands, controllers\n- **Meta Voice SDK** (Wit.ai backend) for on-device voice + intent\n- **TextMeshPro** for HUD text\n- Optional: **Spout / NDI** plugin for capturing the stream camera into OBS.\n\nPinned versions live in [`unity/Packages/manifest.json`](unity/Packages/manifest.json).\nSetup walkthrough: [`docs/QUEST_SETUP.md`](docs/QUEST_SETUP.md).\nCurated open-source stack (anatomy models, references): [`docs/OPEN_SOURCE_STACK.md`](docs/OPEN_SOURCE_STACK.md).\n\n## Repo layout\n\n```\nsurgeon-sim/\n├── README.md\n├── docs/\n│   ├── ARCHITECTURE.md       Subsystem map and data flow\n│   ├── DEMO_SCRIPT.md        Twitch run-of-show\n│   └── VOICE_COMMANDS.md     Surgeon-facing grammar\n├── python/                   Reference implementation (canonical)\n│   ├── core/                 Pedicle screw + rod prediction, tray + plan\n│   ├── spineoptimizer/       TDR fit engine (mirrored to C#)\n│   └── case_pipeline/        Case authoring: spec JSON -\u003e labelled volume -\u003e glTF + manifest\n├── unity/Assets/\n│   ├── Scripts/\n│   │   ├── Domain/           SpineLevel, ImplantSpec, DiscSpaceMeasurement, FitScore\n│   │   ├── Fitting/          FitEngine — C# port of the Python ranker\n│   │   ├── Catalog/          ImplantCatalog — loads JSON from Resources\n│   │   ├── Anchoring/        SpineAnchor — two-point lock to mannequin\n│   │   ├── Voice/            VoiceCommandRouter — keyword grammar\n│   │   ├── Step/             ProcedureStepMachine — linear sequencer\n│   │   ├── Stream/           StreamOverlay — HUD for the Twitch camera\n│   │   ├── Editor/           FitEngineSmokeTest editor menu\n│   │   └── DragonflySession  Top-level wire-up MonoBehaviour\n│   ├── Resources/\n│   │   └── implant_catalog.json\n│   └── Models/               (drop spine reference meshes here)\n└── tools/\n    └── port_catalog.py       Regenerate JSON from python/spineoptimizer\n```\n\n## Python ↔ C# parity\n\n| Python (`python/spineoptimizer/`) | C# (`unity/Assets/Scripts/`) |\n|---|---|\n| `core/models.py` | `Domain/SpineLevel.cs`, `ImplantSpec.cs`, `DiscSpaceMeasurement.cs` |\n| `core/catalog.py` | `Resources/implant_catalog.json` (regenerate via `tools/port_catalog.py`) |\n| `fitting/fit_engine.py` | `Fitting/FitEngine.cs` — same 0.40 / 0.35 / 0.25 weights |\n\n| Python (`python/core/`)  | C# (`unity/Assets/Scripts/`) |\n|---|---|\n| `implant_predictor.py`   | `Fusion/ImplantPredictor.cs` (pedicle screw + rod sizing, validation) |\n| `tray_optimizer.py`      | `Fusion/TrayOptimizer.cs` (per-case tray reduction) |\n| `plan_generator.py`      | not ported — ReportLab PDF, kept Python-only; Quest builds the in-headset HUD via `Stream/StreamOverlay.cs` |\n\nThe fusion-side Domain types live in `Domain/VertebraLevel.cs`,\n`Domain/ImplantPlan.cs`, `Domain/LandmarkSet.cs`, and\n`Domain/TrayConfiguration.cs`. Run the editor smoke test at\n**Tools \u003e Dragonfly \u003e Run Fusion Predictor Smoke Test** to exercise the\nfusion port without launching XR.\n\n## Case authoring\n\nPatient cases are built from JSON specs, not hand-authored. The\n`python/case_pipeline/` package turns a `CaseSpec` into a labelled CT-like\nvolume, runs marching cubes per anatomical structure, decimates, smooths,\nand emits one glTF per structure plus a `manifest.json`. Unity loads the\noutput via Addressables.\n\n```\ncd python\npython -m case_pipeline.cli case_pipeline/specs/literature_default.json out/cases/lit_default\npython -m case_pipeline.smoke_test  # end-to-end + determinism check\n```\n\nThis PR ships the parametric phantom volume source. A later PR will add a\n`segmented_ct` source backed by TotalSegmentator over a synthetic CT; the\ndownstream meshing + manifest stages don't change.\n\nSee [`python/case_pipeline/README.md`](python/case_pipeline/README.md) for\nthe pipeline diagram and dependency list.\n\n## Getting it running\n\nSee [`docs/QUEST_SETUP.md`](docs/QUEST_SETUP.md) for the full walkthrough.\nShort version:\n\n1. Clone, open `unity/` in **Unity 6 LTS**. UPM auto-resolves Meta XR v77\n   from the scoped registry pinned in `Packages/manifest.json`.\n2. Switch platform to Android, set the device to Quest 3, hit **Build \u0026\n   Run** with the headset attached over USB-C.\n3. Run **Tools \u003e Dragonfly \u003e Run Fit Engine Smoke Test** to confirm the\n   deterministic core works without the headset.\n4. In the headset, point the right controller at the mannequin and pull\n   the trigger twice (caudal then cranial) to anchor the spine model.\n\nTo exercise the Python core directly:\n\n```\npip install numpy reportlab\npython -c \"from python.spineoptimizer.fitting.fit_engine import best_fit; \\\n           from python.spineoptimizer.core.models import DiscSpaceMeasurement, SpineLevel; \\\n           print(best_fit(DiscSpaceMeasurement.from_literature(SpineLevel.L4_L5)))\"\n```\n\n## Streaming notes\n\n`docs/DEMO_SCRIPT.md` has the run-of-show. Quick version: cast the headset\nto OBS via Meta's mobile companion app or `adb scrcpy`, run a separate\nstream camera in Unity that renders the HUD only, composite the two in OBS.\n\n## Scope\n\nMannequin / phantom demo only. No PHI handling. No clinical-decision use.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdawg555%2Fsurgeon-sim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjdawg555%2Fsurgeon-sim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdawg555%2Fsurgeon-sim/lists"}