Skip to main content

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.

AreaMain place to lookNotes
App / Routingsrc/App.jsx
src/routes.jsx
src/index.jsx
App entry point, routing, and top-level initialization.
Plan / 3D ToolsCursor3D.jsxMajor hub for Plan interaction logic and many cutting/cropping tools.
Contour CutCutPathTool.jsx + related path-cut filesPath-based cutting with adjustable width and depth; most Contour Cut logic lives outside Cursor3D.jsx.
MPR / Image SlicingImageSlicing.jsxMultiplanar slice views and related interaction.
DICOM / PACSsrc/services/pacs/DICOMweb requests, metadata handling, multipart extraction, and PACS configuration.
Renderingsrc/vtk/ + rendering-related componentsvtk.js volume rendering, transfer functions, and mapper behavior.
Rendering Quality / PerformancerenderQualityPresets.jsHigh Quality / Balanced / Performance presets and interaction-specific rendering settings.
Shared Scan StateDicomFilesContext
DatasetsContext
Loaded DICOM and dataset state shared through the app.
Library / UploadUpload.jsx + Library-related componentsScan loading and Library / Current Scan workflow.
Save PlanplanPersistence.jsPlan serialization, loading, and replay/persistence.
Surgical PathwaySurgicalPathwayPanel.jsxMain Surgical Pathway UI/orchestration. SurgicalPathwayOverlay.jsx handles the 3D overlay; surgicalPathwayState.jsx handles shared pathway state.
AI / MCPAI (frontend)
CopilotAppShell.jsx, AiAssistantDialog.jsx, AiAssistantContext.jsx
AI (runtime)
opersight-copilot-server
AI (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.
SegmentationExternal testing / developmentSegmentation model work is currently external and has not yet been integrated into OperSight.