neurosurf is an R package for reading, manipulating, and visualizing surface-based neuroimaging data represented as triangle meshes. It focuses on surface geometry, vertex-wise data, smoothing, geodesic neighborhoods, and both static and interactive rendering workflows.
The package is under active development.
Installation
Install the development version from GitHub with:
# install.packages("devtools")
devtools::install_github("bbuchsbaum/neurosurf")Development setup
neurosurf includes an interactive 3D visualization component powered by surfviewjs. The built UMD bundle is committed so devtools::install_github() works without Node; Node is only needed if you want to rebuild the JavaScript library locally.
Building surfviewjs
# Build the surfviewjs library and copy it into neurosurf
make surfview
# Check build status
make status
# Clean build artifacts
make clean-surfviewThe Makefile will:
- Install npm dependencies in
surfviewjsif needed - Build the library with Vite
- Copy the UMD bundle to
inst/htmlwidgets/lib/neurosurface/ - Synchronize the version number into
surfwidget.yaml
Albers theme
This package uses the albersdown theme. Existing vignette theme hooks are replaced so albers.css and local albers.js render consistently on CRAN and GitHub Pages. The defaults are configured via params$family and params$preset (family = ‘teal’, preset = ‘homage’). The pkgdown site uses template: { package: albersdown }.