39static void initStandardMontageResource()
41 Q_INIT_RESOURCE(standard_montage);
48const QList<ElectrodePosition>& standard1005Table()
50 static const QList<ElectrodePosition> table = [] {
51 initStandardMontageResource();
52 QList<ElectrodePosition> positions;
53 QFile file(QStringLiteral(
":/utils/montages/standard_1005.elc"));
54 if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
55 qWarning(
"[StandardMontage] the built-in standard_1005 table is missing");
58 QTextStream in(&file);
59 while (!in.atEnd() && in.readLine() != QLatin1String(
"Positions")) {
61 QList<Vector3d> coordinates;
62 for (QString line = in.readLine(); !in.atEnd() && line != QLatin1String(
"Labels"); line = in.readLine()) {
63 const QStringList fields = line.split(QLatin1Char(
' '), Qt::SkipEmptyParts);
64 if (fields.size() == 3)
65 coordinates.append(Vector3d(fields[0].toDouble(), fields[1].toDouble(), fields[2].toDouble()) / 1000.0);
67 for (
const Vector3d& r : coordinates) {
68 const QString name = in.readLine().trimmed();
71 positions.append({name, r});
79QList<ElectrodePosition> pick(
const QStringList& names)
81 QList<ElectrodePosition> positions;
82 for (
const QString& name : names) {
84 if (electrode.name == name) {
85 positions.append(electrode);
93const QStringList& names1020()
95 static const QStringList names{
"Fp1",
"Fp2",
"F7",
"F3",
"Fz",
"F4",
"F8",
"T7",
"C3",
"Cz",
"C4",
96 "T8",
"P7",
"P3",
"Pz",
"P4",
"P8",
"O1",
"O2",
"A1",
"A2"};
100const QStringList& names1010()
102 static const QStringList names = names1020() + QStringList{
"AF7",
"AF3",
"AFz",
"AF4",
"AF8",
"F5",
"F1",
"F2",
"F6",
"FT7",
"FC5",
"FC3",
"FC1",
"FCz",
"FC2",
"FC4",
"FC6",
"FT8",
"C5",
"C1",
"C2",
"C6",
"TP7",
"CP5",
"CP3",
"CP1",
"CPz",
"CP2",
"CP4",
"CP6",
"TP8",
"P5",
"P1",
"P2",
"P6",
"PO7",
"PO3",
"POz",
"PO4",
"PO8",
"Oz",
"FT9",
"FT10",
"TP9",
"TP10",
"Fpz",
"Iz",
"Nz",
"F9",
"F10",
"P9",
"P10"};
116 return pick(names1020());
118 return pick(names1010());
121 QList<ElectrodePosition> positions = standard1005Table();
123 return electrode.
name == QLatin1String(
"LPA") || electrode.
name == QLatin1String(
"RPA") || electrode.
name == QLatin1String(
"Nz");
146 for (
const auto& ep : standard1005Table()) {
147 if (ep.name.compare(name, Qt::CaseInsensitive) == 0) {
Standard 10-20 / 10-10 / 10-05 EEG electrode positions of MNE-Python's standard_1005 montage.
Shared utilities (I/O helpers, spectral analysis, layout management, warp algorithms).
Represents an electrode position in a montage.
static QList< ElectrodePosition > getMontage(System system)
Get a standard montage by system name.
System
Supported standard montage systems.
static bool findElectrode(const QString &name, Eigen::Vector3d &pos)
Look up a single electrode position by name.
static int electrodeCount(System system)
Get the number of electrodes in a montage.
static QStringList getElectrodeNames(System system)
Get electrode names for a standard montage.