NiiVue wrappers put neuroimaging viewing inside VS Code, Jupyter, and notebooks

2026-09-13

NiiVue wrappers embed neuroimaging viewing in VS Code, Jupyter, and Python. About 22k VS Code users and 31k iPyNiiVue downloads as of January 2026.

What problem this solves

Neuroimaging QC still lives in desktop OpenGL apps: AFNI, FSLeyes, FreeSurfer, MRIcroGL. Those viewers do not embed in notebooks, cloud sessions, or VS Code remotes, so a typical check means exporting a file and leaving the place where the computation ran. Scriptable stacks such as nilearn and ggseg emit figures, but changing a window width means editing code and rerunning. Chopra and colleagues already showed that programmatic tools for R, Python, and MATLAB split volumes, surfaces, connectomes, and streamlines across language-specific packages.

NiiVue is a TypeScript renderer with WebGL 2.0 and WebGPU backends. This paper does not replace that core. It wraps the same engine into the environments people already use: editors, notebooks, desktops, and the web.

Method

Four wrapper families share the npm package @niivue/niivue. Parsing, drawing, and interaction run inside the host webview. No separate viewer process.

The core serializes a scene as NVDocument, a CBOR blob with volumes, meshes, camera, colormaps, thresholds, drawings, and annotations. Reload it in another wrapper and the view matches, so visualization can sit in version control. Native formats include NIfTI, GIfTI, TCK/TRK, plus FreeSurfer, MRtrix, and AFNI families; DICOM, MINC, and TIFF need plugins. Optional niimath, a compact fslmaths reimplementation compiled to WebAssembly, is wired only into the desktop app so far, for thresholding, smoothing, and masking.

Results

There is no head-to-head against FSLeyes or MRIcroGL. What is reported is test coverage and uptake as of January 2026.

ComponentAutomated testsAdoption
NiiVue coreunit + pixel regression + coverage2,200 npm downloads/week
VS Code extensionunit + coverage22,000 unique Marketplace users; 2,900 more Open VSX downloads
JupyterLab extensionbasic + coverageshares the Preact layer with VS Code
iPyNiiVuemulti-Python/OS unit tests; e2e on the gallery31,000 downloads
PWAunit + extensive e2eusage not reported
Electron desktopunit + regressionusage not reported
Native Apple appnone15,000 impressions, 700 installs
Niivue.jlunit onlyn/a
FreeBrowse, niivuernoneniivuer is used inside RAVE and YAEL

More than 30 external projects embed NiiVue. CI has two regression layers: parsed headers, intensities, transforms, and derived stats against stored values; and pixel-level comparison of headless-browser scenes against committed reference images.

Why it matters

For anyone running fMRI or DTI pipelines, the gain is one fewer export-and-open cycle. Coregistration can be checked in VS Code on a cluster. A mask edit in a notebook shows up immediately. A self-contained HTML file hands a reproducible scene to a collaborator. A format or renderer fix lands in every wrapper at once, unlike desktop tools that each maintain their own OpenGL stack.

This is integration work, not a new registration or segmentation method. The test is whether you still scp a NIfTI and launch FSLeyes.

Limitations

The authors flag the shared core as a single point of failure, which is why it carries the heaviest tests, with wrappers adding their own suites and users. The Apple app, FreeBrowse, and the R binding had no automated tests at writing time. PWA and Electron usage is unpublished. Wrappers were still migrating onto a newer core. There is no usability trial, so 22,000 VS Code users do not show that the viewer is faster or more accurate than FSLeyes. Clinical use is mentioned in passing, with no regulatory or diagnostic validation. Streamlit, MATLAB webviews, BIDS provenance, and broader niimath wiring are listed as plans, not results.

Terms

Source

What people are saying

All paper explainers