Quickstart#
Your first analysis#
Every workflow follows the same three beats: load → decompose → describe (then analyze or render).
import spectralbrain as sb
# 1. Load — any supported format; the loader auto-detects it.
vertices, faces = sb.load_freesurfer_surface("lh.pial")
# 2. Decompose — solve the Laplace–Beltrami eigenproblem once.
mesh = sb.BrainMesh(vertices, faces)
decomp = mesh.decompose(k=300) # -> SpectralDecomposition
# 3. Describe — every descriptor reads the same decomposition.
shapedna = sb.compute_shapedna(decomp) # global fingerprint
hks = sb.compute_hks(decomp, t_values=[1, 10, 100]) # multiscale, per-vertex
wks = sb.compute_wks(decomp, n_energies=100) # band-pass, per-vertex
# 4. Render.
sb.plot_brain(data=hks[:, 0], atlas="schaefer_400")
The single SpectralDecomposition is the hub: compute it once, then derive as
many descriptors as you like from it without re-solving the eigenproblem.
Pick your path#
New to spectral geometry?
Start with the concepts. The Learn section explains the Laplace–Beltrami operator and what each descriptor measures, before you wire it into a study.
Already know the methods?
Jump to worked, end-to-end examples on real data, or straight to the function signatures.