v2.0.0
Loading...
Searching...
No Matches
sts_adjacency.cpp File Reference

Implementation of the sensor- and source-space adjacency builders declared in sts_adjacency.h. More...

#include "sts_adjacency.h"
#include <fiff/fiff_ch_info.h>
#include <algorithm>
#include <vector>
#include <cmath>
Include dependency graph for sts_adjacency.cpp:

Go to the source code of this file.

Detailed Description

Implementation of the sensor- and source-space adjacency builders declared in sts_adjacency.h.

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2026 MNE-CPP Authors

Author
Christoph Dinh chris.nosp@m.toph.nosp@m..dinh.nosp@m.@mne.nosp@m.-cpp..nosp@m.org
Since
2.2.0
Date
April 2026

The channel-position constructor extracts the r0 entries from FIFFLIB::FiffInfo, computes the per-channel nearest-neighbour distance and adds an edge whenever the pairwise Euclidean distance is within three times the median nearest-neighbour distance - the same heuristic MNE-Python uses for sensor-space cluster tests.

The source-space constructors walk the triangle list once, marking the three vertex pairs of each triangle as neighbours; the spatio-temporal variant additionally links every vertex to itself at t-1 and t+1 so cluster growth can span both cortex and time without the caller having to build a Kronecker product by hand.

Definition in file sts_adjacency.cpp.