Software

surfview

npm

Interactive cortical surface rendering in the browser, built on Three.js

Installnpm install surfview three

Lateral views of the left and right inflated fs_LR hemispheres on black, with a thresholded simulated statistic map: positive values in red, negative in blue, on grey sulcal shading

A simulated statistic map on the HCP fs_LR 32k inflated surfaces, rendered by surfview with the talk-dark preset: two exportPNG() exports side by side (in make-figures.mjs).

Classes NeuroSurfaceViewer · MultiLayerNeuroSurface · DataLayer · LabelLayer

Input GIFTI, FreeSurfer and ASCII PLY surfaces; scalar GIFTI maps

Layers Scalar, label, RGBA, outline, connectivity, volume-projection and temporal

Output PNG figures with colour keys, SVG atlas plates, portable report scenes

Try it

Still image of the viewer's starting view: the left inflated hemisphere from the side, with the simulated statistic map
View:

Both hemispheres of the HCP fs_LR 32k inflated surface (Van Essen et al., 2012; from TemplateFlow, Ciric et al., 2022), with the simulated map from 02 (|z| > 1.5 drawn, coolwarm from −3 to 3), in a NeuroSurfaceViewer with the talk-dark preset. It opens on the left hemisphere from the side; the buttons turn it to other views. The threshold slider calls viewer.updateLayer() on both hemispheres. The viewer is surfview 3.1.0’s browser build, surfview.embed.iife.js, which includes Three.js; nothing is fetched until the button is pressed.

Pressing the button fetches 3.2 MB: 1.3 MB of script and 1.9 MB of surface data.

Works with

Every figure on this page is rendered by surfview in headless Chromium by software/showcase/surfview/make-figures.mjs in the site’s source, and the code shown with each figure is the code that drew it.