OpenMEEG
Public Member Functions | Private Member Functions | Private Attributes | List of all members
OpenMEEG::Sensors Class Reference

#include <sensors.h>

Collaboration diagram for OpenMEEG::Sensors:
Collaboration graph
[legend]

Public Member Functions

 Sensors ()
 
 Sensors (const Geometry &g)
 
 Sensors (const char *filename)
 
 Sensors (const char *filename, const Geometry &g)
 
void load (const char *filename, char filetype='t')
 
void load (std::istream &in)
 
void save (const char *filename)
 
size_t getNumberOfSensors () const
 
size_t getNumberOfPositions () const
 
MatrixgetPositions ()
 
Matrix getPositions () const
 
MatrixgetOrientations ()
 
Matrix getOrientations () const
 
StringsgetNames ()
 
Strings getNames () const
 
bool hasRadii () const
 
bool hasOrientations () const
 
bool hasNames () const
 
Vector getPosition (size_t idx) const
 
Vector getOrientation (size_t idx) const
 
std::string getName (size_t idx) const
 
void setPosition (size_t idx, Vector &pos)
 
void setOrientation (size_t idx, Vector &orient)
 
bool hasSensor (std::string name)
 
size_t getSensorIdx (std::string name)
 
Triangles getInjectionTriangles (size_t idx) const
 
Vector getRadii () const
 
Vector getWeights () const
 
SparseMatrix getWeightsMatrix () const
 
bool isEmpty ()
 
void info () const
 get info about sensors. More...
 

Private Member Functions

void findInjectionTriangles ()
 

Private Attributes

size_t m_nb
 
Strings m_names
 
Matrix m_positions
 
Matrix m_orientations
 
Vector m_weights
 
Vector m_radii
 
std::vector< Trianglesm_triangles
 
const Geometrym_geo
 
std::vector< size_t > m_pointSensorIdx
 

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 92 of file sensors.h.

Constructor & Destructor Documentation

◆ Sensors() [1/4]

OpenMEEG::Sensors::Sensors ( )
inline

Default constructor. Number of sensors = 0.

Definition at line 95 of file sensors.h.

◆ Sensors() [2/4]

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

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

Definition at line 96 of file sensors.h.

◆ Sensors() [3/4]

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

Construct from file. Option 't' is for text file.

Definition at line 97 of file sensors.h.

◆ Sensors() [4/4]

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

Definition at line 98 of file sensors.h.

Member Function Documentation

◆ load() [1/2]

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

Construct from file and geometry (for EIT). Load sensors from file. Filetype is 't' for text file or 'b' for binary file.

◆ load() [2/2]

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

Load description file of sensors from stream.

◆ save()

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

◆ getNumberOfSensors()

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

Return the number of sensors.

Definition at line 104 of file sensors.h.

◆ getNumberOfPositions()

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

Return the number of integration points.

Definition at line 105 of file sensors.h.

◆ getPositions() [1/2]

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

Return a reference on sensors positions.

Definition at line 107 of file sensors.h.

◆ getPositions() [2/2]

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

Return a copy of sensors positions

Definition at line 108 of file sensors.h.

◆ getOrientations() [1/2]

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

Return a reference on sensors orientations.

Definition at line 110 of file sensors.h.

◆ getOrientations() [2/2]

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

Return a copy of sensors orientations.

Definition at line 111 of file sensors.h.

◆ getNames() [1/2]

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

Return a reference on sensors names.

Definition at line 113 of file sensors.h.

◆ getNames() [2/2]

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

Return a copy of sensors names.

Definition at line 114 of file sensors.h.

◆ hasRadii()

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

Return true if contains radii

Definition at line 116 of file sensors.h.

◆ hasOrientations()

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

Return true if contains orientations

Definition at line 117 of file sensors.h.

◆ hasNames()

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

Return true if contains all sensors names

Definition at line 118 of file sensors.h.

◆ getPosition()

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

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

Definition at line 150 of file sensors.h.

◆ getOrientation()

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

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

Definition at line 154 of file sensors.h.

◆ getName()

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

Return the name of the idx_th sensor

Definition at line 121 of file sensors.h.

◆ setPosition()

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

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

Definition at line 158 of file sensors.h.

◆ setOrientation()

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

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

Definition at line 162 of file sensors.h.

◆ hasSensor()

bool OpenMEEG::Sensors::hasSensor ( std::string  name)

◆ getSensorIdx()

size_t OpenMEEG::Sensors::getSensorIdx ( std::string  name)

◆ getInjectionTriangles()

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

For EIT, get triangles under the current injection electrode.

Definition at line 127 of file sensors.h.

◆ getRadii()

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

Definition at line 129 of file sensors.h.

◆ getWeights()

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

Definition at line 130 of file sensors.h.

◆ getWeightsMatrix()

SparseMatrix OpenMEEG::Sensors::getWeightsMatrix ( ) const

◆ 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 134 of file sensors.h.

◆ info()

void OpenMEEG::Sensors::info ( ) const

get info about sensors.

◆ findInjectionTriangles()

void OpenMEEG::Sensors::findInjectionTriangles ( )
private

Get the triangles under each EIT sensors

Member Data Documentation

◆ m_nb

size_t OpenMEEG::Sensors::m_nb
private

Number of sensors.

Definition at line 138 of file sensors.h.

◆ m_names

Strings OpenMEEG::Sensors::m_names
private

List of sensors names.

Definition at line 139 of file sensors.h.

◆ m_positions

Matrix OpenMEEG::Sensors::m_positions
private

Matrix of sensors positions. ex: positions(i,j) with j in {0,1,2} for sensor i

Definition at line 140 of file sensors.h.

◆ m_orientations

Matrix OpenMEEG::Sensors::m_orientations
private

Matrix of sensors orientations. ex: orientation(i,j) with j in {0,1,2} for sensor i

Definition at line 141 of file sensors.h.

◆ m_weights

Vector OpenMEEG::Sensors::m_weights
private

Weights of integration points

Definition at line 142 of file sensors.h.

◆ m_radii

Vector OpenMEEG::Sensors::m_radii
private

Areas of the EIT sensors

Definition at line 143 of file sensors.h.

◆ m_triangles

std::vector<Triangles> OpenMEEG::Sensors::m_triangles
private

Triangles under each EIT sensors

Definition at line 144 of file sensors.h.

◆ m_geo

const Geometry* OpenMEEG::Sensors::m_geo
private

Geometry on which are applied EIT sensors

Definition at line 145 of file sensors.h.

◆ m_pointSensorIdx

std::vector<size_t> OpenMEEG::Sensors::m_pointSensorIdx
private

Correspondance between point id and sensor id

Definition at line 146 of file sensors.h.


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