Package: neurosurf 0.1.0

neurosurf: Data Structures and Visualization for Surface-Based Neuroimaging Data

A comprehensive toolkit for working with surface-based neuroimaging data represented as triangle meshes. The package provides classes and methods for creating, manipulating, and visualizing 3D surface geometries (e.g., cortical surfaces), with support for various file formats including FreeSurfer and GIFTI. Key features include: surface smoothing, curvature computation, neighborhood graph construction, geodesic distance calculations, searchlight analysis for surface-based machine learning, and interactive 3D visualization via HTMLWidgets. The package facilitates advanced surface-based analyses through specialized data structures for representing surface geometry and associated functional data.

Authors:Bradley R Buchsbaum [aut, cre, cph]

neurosurf_0.1.0.tar.gz
neurosurf_0.1.0.zip(r-4.7)neurosurf_0.1.0.zip(r-4.6)neurosurf_0.1.0.zip(r-4.5)
neurosurf_0.1.0.tgz(r-4.6-x86_64)neurosurf_0.1.0.tgz(r-4.6-arm64)neurosurf_0.1.0.tgz(r-4.5-x86_64)neurosurf_0.1.0.tgz(r-4.5-arm64)
neurosurf_0.1.0.tar.gz(r-4.7-arm64)neurosurf_0.1.0.tar.gz(r-4.7-x86_64)neurosurf_0.1.0.tar.gz(r-4.6-arm64)neurosurf_0.1.0.tar.gz(r-4.6-x86_64)
neurosurf_0.1.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
neurosurf/json (API)

# Install 'neurosurf' in R:
install.packages('neurosurf', repos = c('https://bbuchsbaum.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/bbuchsbaum/neurosurf/issues

Uses libs:
  • c++– GNU Standard C++ Library v3

On CRAN:

Conda:

cpp

5.39 score 1 stars 1 packages 34 scripts 104 exports 110 dependencies

Last updated from:1a15009020. Checks:13 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64OK317
linux-devel-x86_64OK360
source / vignettesOK483
linux-release-arm64OK317
linux-release-x86_64OK322
macos-release-arm64OK183
macos-release-x86_64OK440
macos-oldrel-arm64OK134
macos-oldrel-x86_64OK345
windows-develOK253
windows-releaseOK221
windows-oldrelOK223
wasm-releaseOK286

Exports:add_atlas_outlineadd_surface_layeradd_vector_layeradjacencyapply_surface_samplerArithasas.matrixclear_geodesic_cachecluster_thresholdColorMappedNeuroSurfaceCompareconn_compcoordscurv_colscurv_cols_smoothcurvaturedata_readerdebug_surfwidgetdraw_surface_plotexample_surface_geometryfacesfind_all_neighborsfind_nearest_vertexfind_roi_boundariesfindBoundariesgaussian_splatgaussian_splat_multigaussian_splat_vertexgeodesic_distance_matrixgeodesic_distancesgeometryget_surfacegraphindiceslaplacianleftload_dataload_fsaverageload_fsaverage_bundleload_fsaverage_std8loadFSSurfaceloadGIFTISurfacemap_valuesmeshToGraphneighbor_graphneurosurf_download_testdataNeuroSurfaceNeuroSurfaceSourceNeuroSurfaceVectornodesparcel_boundary_contactparcel_geodesic_centroidparcel_geodesic_distance_matrixplotplot_jsprojectCoordinatesRandomSurfaceSearchlightread_freesurfer_annotread_meta_inforead_surfread_surf_dataread_surf_data_seqread_surf_geometryremeshSurfacerender_surface_plotrenderSurfwidgetrightROISurfaceROISurfaceVectorsampler_to_tripletsseriesseries_roishowshow_surface_plotshow_surface_widgetsmoothsnapshot_surfacesurf_to_worldsurf_to_world<-surface_labelssurface_montagesurface_plotsurface_samplersurface_setSurfaceDiskSurfaceGeometrySurfaceSearchlightsurfwidgetsurfwidgetOutputupdateAlphaupdateColorMapupdateIRangeupdateRotationSpeedupdateThresholdupdateVertexColorsupdateZoomvaluesVertexColoredNeuroSurfaceverticesview_surfacevol_to_surfvol_to_surf_sdfwrite_surf_data

Dependencies:assertthatbase64encbigassertrbigparallelrbigstatsrbitbit64bitopsbslibcachemcaToolsclicliprcodetoolscolorplanecowplotcpp11crayondbscandeflistdigestdoParallelevaluatefarverfastmapffflockFNNfontawesomeforeachfsfuturefuture.applygenericsggplot2giftiglobalsgluegplotsgtablegtoolshighrhmshtmltoolshtmlwidgetsigraphisobanditeratorsjquerylibjsonliteKernSmoothknitrlabelinglatticelifecyclelistenvmagrittrMatrixmemoisemimemmapneuroim2parallellypatchworkpillarpkgconfigplyrpngprettyunitsprogresspspurrrR.methodsS3R.ooR.utilsR6rappdirsRColorBrewerRcppRcppArmadilloRcppEigenRcppParallelreadrrglRhpcBLASctlrlangrmarkdownrmioRNiftiRNiftyRegroptimRSpectraRvcgS7sassscalesstringistringrtibbletidyselecttinytextzdbutf8vctrsviridisLitevroomwithrxfunxml2yaml

Displaying Surfaces with RGL
Setup and Loading Data | Basic Surface Plotting | Coloring Based on Curvature | Overlaying Data Values | Thresholding Data Visualization | Direct Vertex Coloring | Controlling Transparency | Adjusting Lighting and Material | Snapshotting to an image (for knitr/CI) | Changing Viewpoints | Displaying Two Hemispheres | Adding Spheres to the Surface | Plotting Other NeuroSurface Objects | Showing an activation map overlaid on a surface mesh | Showing two hemispheres in same scene | Next Steps

Last update: 2026-05-31
Started: 2019-11-23

Interactive Surface Visualization with surfwidget
Introduction | Quick Start | Basic Surface Display | Data Visualization | Advanced Configuration | Vertex-Colored Surfaces | Interactive Controls | Troubleshooting | Advantages over Static Plots | Next Steps

Last update: 2026-05-31
Started: 2025-08-20

Introduction to NeuroSurf Data Structures
Setup | SurfaceGeometry: Representing the Mesh | Loading a SurfaceGeometry | Accessing Geometry Properties | NeuroSurface: Mapping Data to Geometry | Creating a NeuroSurface | Loading Data with read_surf (Optional Data File) | Accessing NeuroSurface Properties | NeuroSurfaceVector: Mapping Multiple Data Vectors | Creating a NeuroSurfaceVector | Accessing NeuroSurfaceVector Properties | Specialized NeuroSurface Classes | Next Steps

Last update: 2026-05-31
Started: 2025-05-28

Publication-quality surface figures
Load surfaces and an atlas | A continuous overlay with a colourbar | Adding atlas outlines | Next Steps

Last update: 2026-05-31
Started: 2026-05-31

Readme and manuals

Help Manual

Help pageTopics
Extract All Data from NeuroSurfaceVector[,NeuroSurfaceVector,missing,missing,ANY-method
Subset NeuroSurfaceVector by Column[,NeuroSurfaceVector,missing,numeric,ANY-method
Subset NeuroSurfaceVector by Row[,NeuroSurfaceVector,numeric,missing,ANY-method
Subset NeuroSurfaceVector[,NeuroSurfaceVector,numeric,numeric,ANY-method
Subset an ROISurface Object[,ROISurface,numeric,missing,ANY-method
Extract Data from NeuroSurfaceVector[[,NeuroSurfaceVector,numeric-method
Add an atlas outline layer to a surface plotadd_atlas_outline
Add a data layer to a surface plotadd_surface_layer
Add a vector field overlayadd_vector_layer
Get Adjacency Graphadjacency adjacency,SurfaceGeometry,character-method adjacency,SurfaceGeometry,missing-method adjacency,SurfaceGeometry,numeric-method
AFNISurfaceFileDescriptorAFNISurfaceFileDescriptor-class
Apply a precomputed surface sampler to a volumeapply_surface_sampler
Arithmetic Operations for NeuroSurface ObjectsArith,NeuroSurface,NeuroSurface-method Arith,NeuroSurface,NeuroSurfaceVector-method Arith,NeuroSurface,numeric-method Arith,numeric,NeuroSurface-method
Arithmetic Operations for NeuroSurfaceVector ObjectsArith,NeuroSurfaceVector,NeuroSurface-method Arith,NeuroSurfaceVector,NeuroSurfaceVector-method Arith,NeuroSurfaceVector,numeric-method Arith,numeric,NeuroSurfaceVector-method
Coercion Methods for NeuroSurface Objectsas
Convert Surface Data to Matrixas.matrix,BilatNeuroSurfaceVector-method as.matrix,NeuroSurfaceVector-method as.matrix,ROISurfaceVector-method
Convert Surface Data to Vectoras.vector,NeuroSurface-method
Bilateral NeuroSurface Vector ClassBilatNeuroSurfaceVector-class
Clear geodesic cacheclear_geodesic_cache
Apply Cluster-Extent Threshold to Surface Datacluster_threshold cluster_threshold,NeuroSurface-method cluster_threshold,NeuroSurfaceVector-method
ColorMappedNeuroSurfaceColorMappedNeuroSurface
ColorMappedNeuroSurfaceColorMappedNeuroSurface-class
Comparison Operations for NeuroSurface ObjectsCompare,NeuroSurface,NeuroSurface-method
Comparison Operations for NeuroSurface ObjectsCompare,NeuroSurface,numeric-method
Comparison Operations for NeuroSurfaceVector ObjectsCompare,NeuroSurfaceVector,NeuroSurfaceVector-method Compare,NeuroSurfaceVector,numeric-method Compare,numeric,NeuroSurfaceVector-method
Compute boundary hull points in world space (C++)compute_hull_world_cpp
Compute Connected Components on a Surfaceconn_comp,NeuroSurface-method conn_comp,NeuroSurfaceVector-method
Extract Vertex Coordinatescoords,igraph-method coords,NeuroSurface-method coords,NeuroSurfaceVector-method coords,ROISurface-method coords,SurfaceGeometry-method
Convert Curvature Values to Binary Colors for Visualizationcurv_cols
Convert Curvature Values to Smooth Gradient Colorscurv_cols_smooth
Compute Surface Curvature Vectorcurv curvature curvature,SurfaceGeometry-method
Create a Column Reader for Surface Datadata_reader,NIMLSurfaceDataMetaInfo-method data_reader,SurfaceGeometryMetaInfo-method
Debugging Helper for surfwidgetdebug_surfwidget
Draw a static multi-panel surface figuredraw_surface_plot
Extract Faces from a Surface Objectfaces faces,NeuroSurface-method faces,NeuroSurfaceVector-method faces,SurfaceGeometry-method
Find Node Neighbors in a Surface Meshfind_all_neighbors
Find the nearest surface vertex to a 3D pointfind_nearest_vertex
Find boundaries of ROIs on a surface meshfind_roi_boundaries
Find Boundaries Between Regions on a SurfacefindBoundaries findBoundaries,NeuroSurface-method
FresurferAsciiSurfaceFileDescriptorFreesurferAsciiSurfaceFileDescriptor-class
FresurferBinarySurfaceFileDescriptorFreesurferBinarySurfaceFileDescriptor-class
FreesurferSurfaceGeometryMetaInfo ClassFreesurferSurfaceGeometryMetaInfo-class
Gaussian splats on surface meshesgaussian_splat gaussian_splat_multi gaussian_splat_vertex
All-pairs geodesic distance matrix (chunked)geodesic_distance_matrix
Geodesic distances from sources to targetsgeodesic_distances
Extract Geometry from Surface Objectgeometry geometry,NeuroSurface-method geometry,NeuroSurfaceVector-method
Retrieve a geometry from a SurfaceSetget_surface
GIFTISurfaceDataMetaInfoGIFTISurfaceDataMetaInfo-class
GIFTISurfaceFileDescriptorGIFTISurfaceFileDescriptor-class
GIFTISurfaceGeometryMetaInfoGIFTISurfaceGeometryMetaInfo-class
extract 'igraph' objectgraph graph,NeuroSurface-method graph,NeuroSurfaceVector-method graph,SurfaceGeometry-method
Extract Vertex Indicesindices,NeuroSurface-method indices,NeuroSurfaceVector-method indices,ROISurface-method indices,ROISurfaceVector-method
LabeledNeuroSurface ClassLabeledNeuroSurface-class
Compute Graph Laplacianlaplacian laplacian,SurfaceGeometry,missing,missing-method laplacian,SurfaceGeometry,missing,numeric-method
Get Left Hemisphereleft left,BilatNeuroSurfaceVector-method
Get Length of Surface Objectlength,ROISurface-method
load_dataload_data,FreesurferSurfaceGeometryMetaInfo-method load_data,GIFTISurfaceGeometryMetaInfo-method load_data,NeuroSurfaceSource-method load_data,NeuroSurfaceVectorSource-method load_data,SurfaceGeometrySource-method
Fetch fsaverage surfacesload_fsaverage
Load a bundle of fsaverage surface variants as a SurfaceSetload_fsaverage_bundle
Load fsaverage std.8 surfaces packaged with neurosurfload_fsaverage_std8
load Freesurfer ascii surfaceloadFSSurface
Load GIFTI surface geometryloadGIFTISurface
Map Values for NeuroSurface with List Lookupmap_values,NeuroSurface,list-method
Map Values for NeuroSurface with Matrix Lookupmap_values,NeuroSurface,matrix-method
Construct a Graph from Mesh Vertices and FacesmeshToGraph
Construct Neighborhood Graph from Surface Meshneighbor_graph neighbor_graph,igraph,numeric,missing,missing-method neighbor_graph,SurfaceGeometry,numeric,missing,integer-method neighbor_graph,SurfaceGeometry,numeric,missing,missing-method neighbor_graph,SurfaceGeometry,numeric,numeric,integer-method neighbor_graph,SurfaceGeometry,numeric,numeric,missing-method
neurosurf: Data structures and IO for surface-based neuroimaging data.neurosurf-package neurosurf
Download optional test data for neurosurfneurosurf_download_testdata
Construct a NeuroSurface ObjectNeuroSurface
NeuroSurfaceNeuroSurface-class
NeuroSurfaceSource ClassNeuroSurfaceSource NeuroSurfaceSource-class
NeuroSurfaceVectorNeuroSurfaceVector
NeuroSurfaceVector ClassNeuroSurfaceVector-class
NeuroSurfaceVectorSourceNeuroSurfaceVectorSource-class
NIMLSurfaceDataMetaInfoNIMLSurfaceDataMetaInfo-class
NIMLSurfaceFileDescriptorNIMLSurfaceFileDescriptor-class
Extract Surface Node Numbersnodes nodes,NeuroSurface-method nodes,NeuroSurfaceVector-method nodes,SurfaceGeometry-method
Parcel boundary contact matrixparcel_boundary_contact
Parcel centroids using geodesic medoidsparcel_geodesic_centroid
Parcel-to-parcel geodesic distancesparcel_geodesic_distance_matrix
Plot Surface as an HTMLWidgetplot_js plot_js,SurfaceGeometry-method
Plot a Surfaceplot,ColorMappedNeuroSurface,missing-method plot,LabeledNeuroSurface,missing-method plot,NeuroSurface,missing-method plot,SurfaceGeometry,missing-method plot,VertexColoredNeuroSurface,missing-method
Plot method for neurosurf_plot objectsplot.neurosurf_plot
Plot method for SurfaceGeometry objectsplot.SurfaceGeometry
Plot method for SurfaceSet objectsplot.SurfaceSet
Print Method for Searchlight Iteratorprint.Searchlight
Project 3D Coordinates onto a Surface and Smooth the ValuesprojectCoordinates
Create a Random Searchlight iterator for surface meshRandomSurfaceSearchlight
Read Freesurfer Annotation Fileread_freesurfer_annot
Read Meta Informationread_meta_info read_meta_info,AFNISurfaceFileDescriptor-method read_meta_info,FreesurferAsciiSurfaceFileDescriptor-method read_meta_info,FreesurferBinarySurfaceFileDescriptor-method read_meta_info,GIFTISurfaceFileDescriptor-method read_meta_info,NIMLSurfaceFileDescriptor-method
Read Surface Data from a Fileread_surf
load surface data and link to 'SurfaceGeometry'read_surf_data
Read Surface Data Sequenceread_surf_data_seq
Read Surface Geometry from Fileread_surf_geometry
Remesh a SurfaceGeometry objectremeshSurface
Render a neurosurf plot using rglrender_surface_plot
Get Right Hemisphereright right,BilatNeuroSurfaceVector-method
Create an instance of class 'ROISurface'ROISurface
ROISurfaceROISurface-class
Create an instance of class 'ROISurfaceVector'ROISurfaceVector
ROISurfaceVectorROISurfaceVector-class
Extract sparse matrix triplets from a surface samplersampler_to_triplets
Extract ROI Time Series from Surface Vectorseries_roi,NeuroSurfaceVector,numeric-method series_roi,NeuroSurfaceVector,ROISurface-method
Extract Time Series from Surface Vectorseries,NeuroSurface,numeric-method series,NeuroSurfaceVector,integer-method series,NeuroSurfaceVector,numeric-method series,NeuroSurfaceVector,ROISurface-method
Show a surface plot in one stepshow_surface_plot
Show an interactive surface widgetshow_surface_widget
showshow,NeuroSurface-method show,NeuroSurfaceVector-method show,ROISurface-method show,SurfaceDataMetaInfo-method show,SurfaceGeometry-method show,SurfaceGeometryMetaInfo-method
Generic Function for Smoothing a Surface or Associated Datasmooth smooth,SurfaceGeometry-method
Smooth Data on a NeuroSurface Objectsmooth,NeuroSurface-method
Snapshot a surface to a PNGsnapshot_surface
Get Surface-to-World Transformsurf_to_world surf_to_world,SurfaceGeometry-method
Set Surface-to-World Transformsurf_to_world<- surf_to_world<-,SurfaceGeometry,matrix-method
List available surface labelssurface_labels
Arrange multiple surface views into a single montage figuresurface_montage
Create a surface plot specificationsurface_plot
Build a reusable surface sampler for multi-frame volumessurface_sampler
Construct a SurfaceSetsurface_set
SurfaceDataMetaInfoSurfaceDataMetaInfo-class
Create a Region on SurfaceSurfaceDisk
Create a SurfaceGeometry ObjectSurfaceGeometry
SurfaceGeometry ClassSurfaceGeometry-class
SurfaceGeometryMetaInfo ClassSurfaceGeometryMetaInfo-class
SurfaceGeometrySource ClassSurfaceGeometrySource-class
SurfaceSearchlightSurfaceSearchlight
SurfaceSet: bundle multiple surface variants for one hemispherecurvature,SurfaceSet-method faces,SurfaceSet-method geometry,SurfaceSet-method graph,SurfaceSet-method nodes,SurfaceSet-method SurfaceSet-class vertices,SurfaceSet-method
Create a Surface Widgetsurfwidget surfwidget,ColorMappedNeuroSurface-method surfwidget,NeuroSurface-method surfwidget,SurfaceGeometry-method surfwidget,VertexColoredNeuroSurface-method
Update Surface Color MapupdateColorMap
Extract Data Values from Surface Objectsvalues,NeuroSurface-method values,ROISurface-method values,ROISurfaceVector-method
VertexColoredNeuroSurfaceVertexColoredNeuroSurface
VertexColoredNeuroSurfaceVertexColoredNeuroSurface-class
VertexDataVertexData-class
Extract Vertices from a Surface Objectvertices vertices,NeuroSurface-method vertices,NeuroSurfaceVector-method vertices,SurfaceGeometry-method
Display a 3D Brain Surface using RGLview_surface
Map values from a 3D volume to a surface in the same coordinate spacevol_to_surf
Map a volume to surface after SDF-based rigid alignmentvol_to_surf_sdf
Write Surface Data to Filewrite_surf_data