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.
Install the development version from GitHub with:
# install.packages("devtools")
devtools::install_github("bbuchsbaum/neurosurf")The pkgdown site includes a few good entry points:
- Introduction to NeuroSurf Data Structures
- Displaying Surfaces with RGL
- Interactive Surface Visualization with surfwidget
- Surfplot-style Figures with neurosurf
- Reference index
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.
- Node.js (v14 or higher)
- npm
# 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
# Before R CMD check
make r-check
# Install package
make r-install
# Watch for changes during development
make watch-surfview # Requires fswatchThe version number in surfwidget.yaml is synchronized with
surfviewjs/package.json when make surfview runs. To update it
manually:
make update-yaml
make show-versionThis 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 }.