OperSight Code Map
High-level guide to the main implementation areas in OperSight. It is intended to answer “where should I start looking?” rather than document every component. Scans enter through local upload or DICOMweb/PACS, are converted for vtk.js and stored in shared React state, and are then consumed by View and Plan for visualization and interaction. Plan contains much of the cutting, cropping, and surgical-planning functionality, with a significant amount of tool logic centered in Cursor3D.jsx.
| Area | Main place to look | Notes |
|---|---|---|
| App / Routing | src/App.jsxsrc/routes.jsxsrc/index.jsx | App entry point, routing, and top-level initialization. |
| Plan / 3D Tools | Cursor3D.jsx | Major hub for Plan interaction logic and many cutting/cropping tools. |
| Contour Cut | CutPathTool.jsx + related path-cut files | Path-based cutting with adjustable width and depth; most Contour Cut logic lives outside Cursor3D.jsx. |
| MPR / Image Slicing | ImageSlicing.jsx | Multiplanar slice views and related interaction. |
| DICOM / PACS | src/services/pacs/ | DICOMweb requests, metadata handling, multipart extraction, and PACS configuration. |
| Rendering | src/vtk/ + rendering-related components | vtk.js volume rendering, transfer functions, and mapper behavior. |
| Rendering Quality / Performance | renderQualityPresets.js | High Quality / Balanced / Performance presets and interaction-specific rendering settings. |
| Shared Scan State | DicomFilesContextDatasetsContext | Loaded DICOM and dataset state shared through the app. |
| Library / Upload | Upload.jsx + Library-related components | Scan loading and Library / Current Scan workflow. |
| Save Plan | planPersistence.js | Plan serialization, loading, and replay/persistence. |
| Surgical Pathway | SurgicalPathwayPanel.jsx | Main Surgical Pathway UI/orchestration. SurgicalPathwayOverlay.jsx handles the 3D overlay; surgicalPathwayState.jsx handles shared pathway state. |
| AI / MCP | AI (frontend)CopilotAppShell.jsx, AiAssistantDialog.jsx, AiAssistantContext.jsxAI (runtime) opersight-copilot-serverAI (agent) opersight-ai-fastapi (main.py, agent/) | CopilotKit chat in the frontend (CopilotAppShell, AiAssistantDialog, AiAssistantContext). Talks to opersight-copilot-server, which calls opersight-ai-fastapi (POST /agent) → OpenAI. Agent id must match (agent). MCP is optional and not required for basic chat. |
| Segmentation | External testing / development | Segmentation model work is currently external and has not yet been integrated into OperSight. |