mne.channels.read_ch_adjacency#

mne.channels.read_ch_adjacency(fname, picks=None)[source]#

Parse FieldTrip neighbors .mat file.

More information on these neighbor definitions can be found on the related FieldTrip documentation pages.

Parameters
fnamestr

The file name. See “Notes” below for a list of valid arguments.

picksstr | list | slice | None

Channels to include. Slices and lists of integers will be interpreted as channel indices. In lists, channel type strings (e.g., ['meg', 'eeg']) will pick channels of those types, channel name strings (e.g., ['MEG0111', 'MEG2623'] will pick the given channels. Can also be the string values “all” to pick all channels, or “data” to pick data channels. None (default) will pick all channels. Note that channels in info['bads'] will be included if their names or indices are explicitly provided. Picks must match the template.

Returns
ch_adjacencyscipy.sparse.csr_matrix, shape (n_channels, n_channels)

The adjacency matrix.

ch_nameslist

The list of channel names present in adjacency matrix.

Notes

If you don’t know the correct fname for the neighbor definitions, of if the neighbor definition you need is not shipped by MNE-Python, you may use find_ch_adjacency() to compute the adjacency matrix based on your 2D sensor locations.

Note that depending on your use case, you may need to additionally use mne.stats.combine_adjacency() to prepare a final “adjacency” to pass to the eventual function.

Valid fname arguments are:

fname

biosemi16

biosemi32

biosemi64

bti148

bti248

bti248grad

ctf64

ctf151

ctf275

easycap32ch-avg

easycap64ch-avg

easycap128ch-avg

easycapM1

easycapM11

easycapM14

easycapM15

KIT-157

KIT-208

KIT-NYU-2019

KIT-UMD-1

KIT-UMD-2

KIT-UMD-3

KIT-UMD-4

neuromag306mag

neuromag306planar

Examples using mne.channels.read_ch_adjacency#

Statistical inference

Statistical inference

Statistical inference