LayoutLoader
Namespace: UTILSLIB · Library: Utilities Library
#include <utils/layoutloader.h>
class UTILSLIB::LayoutLoader
Reads ANT .elc files, which contain the electrode positions of an EEG cap.
Reads ANT .elc electrode files into Qt/STL containers.
// ANT .elc electrode file: names, 3-D positions and their unit
QStringList capNames;
QList<QVector<float>> cap3D;
QList<QVector<float>> cap2D;
QString capUnit;
LayoutLoader::readAsaElcFile(capFile.fileName(), capNames, cap3D, cap2D, capUnit);
Static Methods
readAsaElcFile(path, channelNames, location3D, location2D, unit)
Reads the specified ANT elc-layout file.
Parameters:
-
path : const QString & holds the file path of the elc file which is to be read.
-
channelNames : QStringList & Receives the channel names.
-
location3D : QList< QVector< float > > & holds the vector to which the read 3D positions are stored.
-
location2D : QList< QVector< float > > & holds the vector to which the read 2D positions are stored.
-
unit : QString & Receives the unit of the positions.
Returns:
- bool — true if reading was successful, false otherwise.
readAsaElcFile(path, channelNames, location3D, location2D, unit)
Reads the specified ANT elc-layout file.
Parameters:
-
path : const std::string & holds the file path of the elc file which is to be read.
-
channelNames : std::vector< std::string > & Receives the channel names.
-
location3D : std::vector< std::vector< float > > & holds the vector to which the read 3D positions are stored.
-
location2D : std::vector< std::vector< float > > & holds the vector to which the read 2D positions are stored.
-
unit : std::string & Receives the unit of the positions.
Returns:
- bool — true if reading was successful, false otherwise.
Example
- Full source:
src/examples/ex_utils/main.cpp - Build target:
ex_utils(runs under CTest)
Used in examples
ex_utils
Utilities library: buffers, observers, logging, file formats, montages, layouts and reports.
QList<QVector<float>> cap3D;
QList<QVector<float>> cap2D;
QString capUnit;
LayoutLoader::readAsaElcFile(capFile.fileName(), capNames, cap3D, cap2D, capUnit);
ok &= expect(capNames == QStringList({"Fp1", "Cz"}) && capUnit == "mm" && cap3D.size() == 2 && cap3D[1] == QVector<float>({0.0f, 0.0f, 87.0f}),
"LayoutLoader reads the electrode names, positions and unit of an .elc file");
ex_make_layout
Builds example for making a 2D layout from 3D points.
LayoutLoader::readAsaElcFile(parser.value(inputOption), names, inputPoints, channel2DData, unit);
}
Authors of this file
- Lorenz Esch <lorenz.esch@tu-ilmenau.de>
- Christoph Dinh <christoph.dinh@mne-cpp.org>
- Juan GPC <jgarciaprieto@mgh.harvard.edu>
- Gabriel Motta <gabrielbenmotta@gmail.com>