scene
tit.server.routes.scene ¶
/api/scene/* โ the slim scene service the 3D panes read (plan ยง2).
Decision S1: this is a form control's data source, not a viewer's. It serves exactly four things โ two translucent surfaces, an EEG net's electrode positions, per-vertex atlas labels, and a label volume's legend โ so a user can choose electrodes (Simulator), a target (Optimizer) or an ROI (Analyzer). Volume slicing, colormaps, field overlays and screenshots are Tetravox's job on the Viewer page and are deliberately not here.
Decision S2 in three rules, each with the failure it prevents:
- The server extracts; the browser never sees the mesh.
ernie.mshis 184 MB. What crosses the wire is 1.4 MB of skin and 2.6 MB of grey matter. - Everything is cached under
.ti-toolbox/cache/scene/, keyed by a fingerprint of its source files (:mod:tit.scene.cache), so the second pane open is a file read.X-Scene-Build-Msreports what the artifact being served cost to build andX-Scene-Cache: hit|misssays whether this request paid it. - A cold request answers 202 +
Retry-After, it does not hold the connection. A build takes seconds; a held request looks like a hung app, and a proxy or a browser may drop it before it finishes. The build runs on a background thread under a per-subject lock, and the client polls. Callers that want one deterministic call (tests, smoke, curl) passwait=<seconds>and get an explicit, capped block instead.
Every path is jailed the way :mod:tit.server.routes.files jails its own:
nothing here takes a path from the client at all. The only client-supplied
strings are a subject id, a part name, a net file name and an atlas id, and
each is checked against what the project actually contains
(:func:tit.catalog.subject_ids, :data:tit.scene.build.PART_TAGS,
PathManager.list_eeg_caps, MeshAtlasManager.list_atlases) before it
reaches the filesystem. Scene source helpers also resolve symlinks and require
their targets inside the project; a listed filename alone cannot establish that.