API Reference#

Generated from the source docstrings. The reference is intentionally terse — the why lives in Learn, the how in Tutorials and the Gallery.

Everything below is importable from the top-level spectralbrain namespace (e.g. sb.compute_hks), with the full module paths shown for reference.

Subpackages#

spectralbrain.core

SpectralBrain core geometric objects — base ops, meshes, point clouds.

spectralbrain.io

SpectralBrain I/O — loaders, exporters, preprocessing, parcellation, and GPU pipeline.

spectralbrain.spectral

SpectralBrain spectral analysis — descriptors, distances, wavelets.

spectralbrain.statistics

SpectralBrain statistics — EDA, frequentist, Bayesian, normative, surrogates, clustering.

spectralbrain.viz

SpectralBrain visualization — 7 modules across 2D stats, 3D brain, geometry, and clustering.

spectralbrain.utils

SpectralBrain utilities — atlases, datasets, and helpers.

spectralbrain.backends

SpectralBrain compute backends — CPU (NumPy/SciPy) and GPU (CuPy/JAX).

spectralbrain.runtime

SpectralBrain runtime infrastructure.

Most-used entry points#

Geometry

BrainMesh(vertices, faces[, metadata])

Triangle surface mesh for brain structures.

BrainPointCloud(points[, metadata])

Unstructured 3D point cloud for brain structures.

SpectralDecomposition(eigenvalues, ...[, ...])

Eigenvalues and eigenvectors of a Laplace–Beltrami operator.

Spectral descriptors

compute_shapedna(decomp, *[, normalize, ...])

ShapeDNA — the LBO eigenvalue fingerprint.

compute_hks(decomp[, t_values, n_times, ...])

Heat Kernel Signature — multi-scale per-vertex descriptor.

compute_si_hks(decomp, *[, n_times, ...])

Scale-Invariant HKS — removes scale dependence from HKS.

compute_wks(decomp[, e_values, n_energies, ...])

Wave Kernel Signature — band-pass per-vertex descriptor.

compute_gps(decomp, *[, skip_zero])

Global Point Signature — spectral embedding of the surface.

compute_bates_signatures(decomp[, t_values, ...])

Symmetric polynomial signatures — sign/ordering invariant.

compute_bks(decomp)

Biharmonic Kernel Signature — parameter-free per-vertex scalar.

compute_ibks(decomp, *[, ...])

Improved BKS with curvature-aware neighbourhood aggregation.

sgw_transform(L, scales, *[, signal, ...])

Spectral Graph Wavelet Transform via Chebyshev approximation.

sgw_descriptor(decomp[, scales, n_scales, ...])

Spectral Graph Wavelet descriptor from precomputed eigenpairs.

compute_all_descriptors(decomp, *[, ...])

Compute all 8 spectral descriptors from one decomposition.

anisotropic_laplacian(vertices, faces, *[, ...])

Build an anisotropic Laplacian weighted by curvature direction.

Correspondence & distances

compute_functional_map(decomp_a, decomp_b, *)

Estimate a functional map C between two shapes.

shape_difference_operator(C, *[, type])

Compute a shape-difference operator from a functional map.

wesd(dna_a, dna_b, *[, p, normalize])

Weighted Spectral Distance between two ShapeDNA vectors.

wesd_matrix(dna_collection, *[, p, normalize])

Pairwise WESD matrix for a collection of ShapeDNA vectors.

shapedna_distance(dna_a, dna_b, *[, metric, ...])

Simple distance between two ShapeDNA vectors.

biharmonic_distance(decomp, *[, indices])

Biharmonic distance — parameter-free intrinsic metric.

commute_time_distance(decomp, *[, indices, ...])

Commute-time distance from random walk theory.

diffusion_distance(decomp, t, *[, indices])

Diffusion distance — multi-scale intrinsic metric.

descriptor_distance(desc_a, desc_b, *[, method])

Distance between two descriptor distributions.

build_geometric_connectome(parcel_descriptors, *)

Build a ROI × ROI geometric connectome from parcel descriptors.

I/O

load(path, *[, fmt])

Auto-detect format and load a neuroimaging / geometry file.

load_freesurfer_surface(path)

Load a FreeSurfer surface file.

load_gifti_surface(path)

Load a GIfTI surface file.

load_nifti(path)

Load a NIfTI or MGZ volume.

load_group(files, *[, mode, loader, n_jobs, ...])

Load and stack a cohort for group statistics.

parcellate(*[, subjects_dir, subject_id, ...])

Parcellate a cortical hemisphere into atlas-defined regions.

apply_parcellation(vertices, faces, labels, *)

Split a surface into sub-meshes according to a parcellation.