Skip to main content

IeegReference

Namespace: IEEGLIB  ·  Library: iEEG Library

Python equivalent

mne.set_bipolar_reference in MNE-Python.

#include <ieeg/ieeg_reference.h>

class IEEGLIB::IeegReference

Bipolar montages along sEEG / ECoG leads.

src/examples/ex_ieeg/main.cpp
const QVector<IeegBipolarPair> pairs = IeegReference::bipolarPairs(implantation); // LA1-LA2, LA2-LA3
Eigen::MatrixXd data(3, 1); // contacts x samples, file order
data << 30.0, 10.0, 15.0; // LA3, LA1, LA2
const Eigen::MatrixXd bipolar = IeegReference::bipolarMatrix(pairs, int(contacts.size())) * data;

Static Methods​

bipolarPairs(implantation)​

Pair each contact with its next neighbour on the same lead: along a depth lead or strip, and along the rows and then the columns of a grid with a known shape.

The contact earlier along the lead is the anode, so a depth lead gives LA1-LA2, LA2-LA3, …

Parameters:

Returns:


bipolarMatrix(pairs, contactCount)​

Montage matrix of the derivations: bipolar data = M * contact data.

Parameters:

  • pairs : const QVector< IeegBipolarPair > & Derivations.

  • contactCount : int Number of contacts, the columns of M.

Returns:

  • Eigen::SparseMatrix< double > — Sparse pairs x contacts matrix, +1 at the anode and -1 at the cathode of each row.

Example​

Used in examples​

ex_ieeg​

IEEG library: group sEEG contacts into a lead, derive a bipolar montage and paint contact values onto a surface.

src/examples/ex_ieeg/main.cpp, line 80
const QVector<IeegBipolarPair> pairs = IeegReference::bipolarPairs(implantation); // LA1-LA2, LA2-LA3
Eigen::MatrixXd data(3, 1); // contacts x samples, file order
data << 30.0, 10.0, 15.0; // LA3, LA1, LA2
const Eigen::MatrixXd bipolar = IeegReference::bipolarMatrix(pairs, int(contacts.size())) * data;
ok &= expect(pairs.size() == 2 && pairs[0].name == "LA1-LA2" && bipolar(0, 0) == -5.0 && bipolar(1, 0) == -15.0,
"IeegReference: LA1-LA2 = -5, LA2-LA3 = -15");

Authors of this file​