v2.0.0
Loading...
Searching...
No Matches
STSLIB::StatsAdjacency Class Reference

Builds the sparse spatial and spatio-temporal neighbourhood graphs that define cluster support for permutation tests. More...

#include <sts_adjacency.h>

Static Public Member Functions

static Eigen::SparseMatrix< int > fromChannelPositions (const FIFFLIB::FiffInfo &info, const QStringList &picks=QStringList())
static Eigen::SparseMatrix< int > fromSourceSpace (const Eigen::MatrixX3i &tris, int nVertices)
static Eigen::SparseMatrix< int > fromSourceSpaceTemporal (const Eigen::MatrixX3i &tris, int nVertices, int nTimes)
static Eigen::SparseMatrix< int > chain (int n)
static Eigen::SparseMatrix< int > combine (const QList< Eigen::SparseMatrix< int > > &dims)

Detailed Description

Builds the sparse spatial and spatio-temporal neighbourhood graphs that define cluster support for permutation tests.

Adjacency matrix construction for spatial clustering.

Definition at line 75 of file sts_adjacency.h.

Member Function Documentation

◆ chain()

SparseMatrix< int > StatsAdjacency::chain ( int n)
static

Adjacency of a regular 1-D grid of n points (each linked to its two neighbours), the meaning of an integer dimension in mne.stats.combine_adjacency.

Parameters
[in]nNumber of points.
Returns
Sparse adjacency matrix (n x n), no diagonal.

Definition at line 47 of file sts_adjacency.cpp.

◆ combine()

SparseMatrix< int > StatsAdjacency::combine ( const QList< Eigen::SparseMatrix< int > > & dims)
static

Combine the adjacency of several dimensions, as mne.stats.combine_adjacency: points are flattened in C order (the last dimension varies fastest), two points are adjacent when they differ in one dimension and are adjacent there, and every point is adjacent to itself.

Parameters
[in]dimsSquare 0/1 adjacency per dimension (diagonals are ignored).
Returns
Sparse adjacency matrix over the product of the dimensions.

Definition at line 62 of file sts_adjacency.cpp.

◆ fromChannelPositions()

SparseMatrix< int > StatsAdjacency::fromChannelPositions ( const FIFFLIB::FiffInfo & info,
const QStringList & picks = QStringList() )
static

Build a spatial adjacency matrix from channel positions in FiffInfo. Uses a distance threshold of 3x the median nearest-neighbor distance.

Parameters
[in]infoFiffInfo with channel positions.
[in]picksOptional list of channel names to include. If empty, all channels are used.
Returns
Sparse adjacency matrix (symmetric, nChannels x nChannels).

Definition at line 101 of file sts_adjacency.cpp.

◆ fromSourceSpace()

SparseMatrix< int > StatsAdjacency::fromSourceSpace ( const Eigen::MatrixX3i & tris,
int nVertices )
static

Build a spatial adjacency matrix from a triangulated source space.

Parameters
[in]trisTriangle definitions (nTris x 3, vertex indices).
[in]nVerticesTotal number of vertices.
Returns
Sparse adjacency matrix (symmetric, nVertices x nVertices).

Definition at line 177 of file sts_adjacency.cpp.

◆ fromSourceSpaceTemporal()

SparseMatrix< int > StatsAdjacency::fromSourceSpaceTemporal ( const Eigen::MatrixX3i & tris,
int nVertices,
int nTimes )
static

Build a spatio-temporal adjacency matrix from a triangulated source space.

Constructs a (nVertices*nTimes) x (nVertices*nTimes) adjacency matrix where spatial neighbors come from the triangle mesh and temporal neighbors connect each vertex to itself at t-1 and t+1. The linear index is vertex * nTimes + time.

Parameters
[in]trisTriangle definitions (nTris x 3, vertex indices).
[in]nVerticesTotal number of vertices.
[in]nTimesNumber of time points.
Returns
Sparse adjacency matrix (symmetric, nVertices*nTimes x nVertices*nTimes).
Since
2.2.0

Definition at line 202 of file sts_adjacency.cpp.


The documentation for this class was generated from the following files: