OpenMEEG
Loading...
Searching...
No Matches
Public Member Functions | List of all members
OpenMEEG::Sensors Class Reference

Sensors class for EEG and MEG sensors. More...

#include <sensors.h>

Public Member Functions

 Sensors ()
 Default constructor. Number of sensors = 0.
 
 Sensors (const Geometry &g)
 Default constructor with a geometry. Number of sensors = 0.
 
 Sensors (const char *filename)
 Construct from text file.
 
 Sensors (const char *filename, const Geometry &g)
 Construct from file and geometry (for EIT).
 
 Sensors (const Matrix &positions, const Geometry &g)
 
 Sensors (const Strings &labels, const Matrix &positions, const Matrix &orientations, const Vector &weights, const Vector &radii)
 
 Sensors (const Strings &labels, const Matrix &positions, const Matrix &orientations, const Vector &weights, const Vector &radii, const Geometry &g)
 
void load (const char *filename, const char filetype='t')
 Load sensors from file. Filetype is 't' for text file or 'b' for binary file.
 
void load (const std::string &filename, const char filetype='t')
 
void load (std::istream &in)
 Load description file of sensors from stream.
 
void save (const char *filename) const
 
void save (const std::string &filename) const
 
size_t getNumberOfSensors () const
 Return the number of sensors.
 
size_t getNumberOfPositions () const
 Return the number of integration points.
 
MatrixgetPositions ()
 Return sensors positions.
 
const MatrixgetPositions () const
 
MatrixgetOrientations ()
 Return sensors orientations.
 
const MatrixgetOrientations () const
 
StringsgetNames ()
 Return sensors names.
 
Strings getNames () const
 
bool hasRadii () const
 Return true if contains radii.
 
bool hasOrientations () const
 Return true if contains orientations.
 
bool hasNames () const
 Return true if contains all sensors names.
 
Vector getPosition (const size_t idx) const
 Return the position (3D point) of the integration point idx.
 
Vector getOrientation (const size_t idx) const
 Return the orientations (3D point) of the integration point idx.
 
std::string getName (const size_t idx) const
 Return the name of the idx_th sensor.
 
void setPosition (const size_t idx, const Vector &pos)
 Set the position (3D point) of the integration point i.
 
void setOrientation (const size_t idx, const Vector &orient)
 Set the orientation (3D point) of the integration point i.
 
bool hasSensor (const std::string &name) const
 
size_t getSensorIdx (const std::string &name) const
 
Triangles getInjectionTriangles (const size_t idx) const
 For EIT, get triangles under the current injection electrode.
 
Vector getRadii () const
 
Vector getWeights () const
 
SparseMatrix getWeightsMatrix () const
 
bool isEmpty ()
 Return if the sensors object is empty. The sensors object is empty if its number of sensors is null.
 
void info () const
 get info about sensors.
 

Detailed Description

Sensors class for EEG and MEG sensors.

This class is made for reading sensors description file. This description file is a file text. Sensors may have names (labels) in the first column of the file (it has to contains at least one character to be considered as label) the file can have the shape of (neglecting if present the first, label column):

Definition at line 61 of file sensors.h.

Constructor & Destructor Documentation

◆ Sensors() [1/7]

OpenMEEG::Sensors::Sensors ( )
inline

Default constructor. Number of sensors = 0.

Definition at line 73 of file sensors.h.

◆ Sensors() [2/7]

OpenMEEG::Sensors::Sensors ( const Geometry g)
inline

Default constructor with a geometry. Number of sensors = 0.

Definition at line 77 of file sensors.h.

◆ Sensors() [3/7]

OpenMEEG::Sensors::Sensors ( const char *  filename)
inline

Construct from text file.

Definition at line 81 of file sensors.h.

◆ Sensors() [4/7]

OpenMEEG::Sensors::Sensors ( const char *  filename,
const Geometry g 
)
inline

Construct from file and geometry (for EIT).

Definition at line 85 of file sensors.h.

◆ Sensors() [5/7]

OpenMEEG::Sensors::Sensors ( const Matrix positions,
const Geometry g 
)
inline

Definition at line 87 of file sensors.h.

◆ Sensors() [6/7]

OpenMEEG::Sensors::Sensors ( const Strings labels,
const Matrix positions,
const Matrix orientations,
const Vector weights,
const Vector radii 
)
inline

Definition at line 94 of file sensors.h.

◆ Sensors() [7/7]

OpenMEEG::Sensors::Sensors ( const Strings labels,
const Matrix positions,
const Matrix orientations,
const Vector weights,
const Vector radii,
const Geometry g 
)
inline

Definition at line 100 of file sensors.h.

Member Function Documentation

◆ load() [1/3]

void OpenMEEG::Sensors::load ( const char *  filename,
const char  filetype = 't' 
)

Load sensors from file. Filetype is 't' for text file or 'b' for binary file.

◆ load() [2/3]

void OpenMEEG::Sensors::load ( const std::string &  filename,
const char  filetype = 't' 
)
inline

Definition at line 111 of file sensors.h.

◆ load() [3/3]

void OpenMEEG::Sensors::load ( std::istream &  in)

Load description file of sensors from stream.

◆ save() [1/2]

void OpenMEEG::Sensors::save ( const char *  filename) const

◆ save() [2/2]

void OpenMEEG::Sensors::save ( const std::string &  filename) const
inline

Definition at line 118 of file sensors.h.

◆ getNumberOfSensors()

size_t OpenMEEG::Sensors::getNumberOfSensors ( ) const
inline

Return the number of sensors.

Definition at line 122 of file sensors.h.

◆ getNumberOfPositions()

size_t OpenMEEG::Sensors::getNumberOfPositions ( ) const
inline

Return the number of integration points.

Definition at line 126 of file sensors.h.

◆ getPositions() [1/2]

Matrix & OpenMEEG::Sensors::getPositions ( )
inline

Return sensors positions.

Definition at line 130 of file sensors.h.

◆ getPositions() [2/2]

const Matrix & OpenMEEG::Sensors::getPositions ( ) const
inline

Definition at line 131 of file sensors.h.

◆ getOrientations() [1/2]

Matrix & OpenMEEG::Sensors::getOrientations ( )
inline

Return sensors orientations.

Definition at line 135 of file sensors.h.

◆ getOrientations() [2/2]

const Matrix & OpenMEEG::Sensors::getOrientations ( ) const
inline

Definition at line 136 of file sensors.h.

◆ getNames() [1/2]

Strings & OpenMEEG::Sensors::getNames ( )
inline

Return sensors names.

Definition at line 140 of file sensors.h.

◆ getNames() [2/2]

Strings OpenMEEG::Sensors::getNames ( ) const
inline

Definition at line 141 of file sensors.h.

◆ hasRadii()

bool OpenMEEG::Sensors::hasRadii ( ) const
inline

Return true if contains radii.

Definition at line 143 of file sensors.h.

◆ hasOrientations()

bool OpenMEEG::Sensors::hasOrientations ( ) const
inline

Return true if contains orientations.

Definition at line 144 of file sensors.h.

◆ hasNames()

bool OpenMEEG::Sensors::hasNames ( ) const
inline

Return true if contains all sensors names.

Definition at line 145 of file sensors.h.

◆ getPosition()

Vector OpenMEEG::Sensors::getPosition ( const size_t  idx) const
inline

Return the position (3D point) of the integration point idx.

Definition at line 149 of file sensors.h.

◆ getOrientation()

Vector OpenMEEG::Sensors::getOrientation ( const size_t  idx) const
inline

Return the orientations (3D point) of the integration point idx.

Definition at line 153 of file sensors.h.

◆ getName()

std::string OpenMEEG::Sensors::getName ( const size_t  idx) const
inline

Return the name of the idx_th sensor.

Definition at line 157 of file sensors.h.

◆ setPosition()

void OpenMEEG::Sensors::setPosition ( const size_t  idx,
const Vector pos 
)
inline

Set the position (3D point) of the integration point i.

Definition at line 164 of file sensors.h.

◆ setOrientation()

void OpenMEEG::Sensors::setOrientation ( const size_t  idx,
const Vector orient 
)
inline

Set the orientation (3D point) of the integration point i.

Definition at line 168 of file sensors.h.

◆ hasSensor()

bool OpenMEEG::Sensors::hasSensor ( const std::string &  name) const
inline

Definition at line 170 of file sensors.h.

◆ getSensorIdx()

size_t OpenMEEG::Sensors::getSensorIdx ( const std::string &  name) const
inline

Definition at line 174 of file sensors.h.

◆ getInjectionTriangles()

Triangles OpenMEEG::Sensors::getInjectionTriangles ( const size_t  idx) const
inline

For EIT, get triangles under the current injection electrode.

Definition at line 183 of file sensors.h.

◆ getRadii()

Vector OpenMEEG::Sensors::getRadii ( ) const
inline

Definition at line 188 of file sensors.h.

◆ getWeights()

Vector OpenMEEG::Sensors::getWeights ( ) const
inline

Definition at line 189 of file sensors.h.

◆ getWeightsMatrix()

SparseMatrix OpenMEEG::Sensors::getWeightsMatrix ( ) const
inline

Definition at line 191 of file sensors.h.

◆ isEmpty()

bool OpenMEEG::Sensors::isEmpty ( )
inline

Return if the sensors object is empty. The sensors object is empty if its number of sensors is null.

Definition at line 200 of file sensors.h.

◆ info()

void OpenMEEG::Sensors::info ( ) const

get info about sensors.


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