OpenMEEG
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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)
 
 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, 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) const
 
size_t getSensorIdx (std::string name) const
 
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

OpenMEEG::Sensors::Sensors ( )
inline

Default constructor. Number of sensors = 0.

Definition at line 95 of file sensors.h.

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

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

Definition at line 96 of file sensors.h.

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

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

Definition at line 97 of file sensors.h.

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

Definition at line 98 of file sensors.h.

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

Construct from file and geometry (for EIT).

Definition at line 169 of file sensors.h.

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

Member Function Documentation

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

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

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

Load description file of sensors from stream.

void OpenMEEG::Sensors::save ( const char *  filename)
size_t OpenMEEG::Sensors::getNumberOfSensors ( ) const
inline

Return the number of sensors.

Definition at line 107 of file sensors.h.

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

Return the number of integration points.

Definition at line 108 of file sensors.h.

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

Return a reference on sensors positions.

Definition at line 110 of file sensors.h.

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

Return a copy of sensors positions

Definition at line 111 of file sensors.h.

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

Return a reference on sensors orientations.

Definition at line 113 of file sensors.h.

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

Return a copy of sensors orientations.

Definition at line 114 of file sensors.h.

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

Return a reference on sensors names.

Definition at line 116 of file sensors.h.

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

Return a copy of sensors names.

Definition at line 117 of file sensors.h.

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

Return true if contains radii

Definition at line 119 of file sensors.h.

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

Return true if contains orientations

Definition at line 120 of file sensors.h.

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

Return true if contains all sensors names

Definition at line 121 of file sensors.h.

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

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

Definition at line 153 of file sensors.h.

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

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

Definition at line 157 of file sensors.h.

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

Return the name of the idx_th sensor

Definition at line 124 of file sensors.h.

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

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

Definition at line 161 of file sensors.h.

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

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

Definition at line 165 of file sensors.h.

bool OpenMEEG::Sensors::hasSensor ( std::string  name) const
size_t OpenMEEG::Sensors::getSensorIdx ( std::string  name) const
Triangles OpenMEEG::Sensors::getInjectionTriangles ( size_t  idx) const
inline

For EIT, get triangles under the current injection electrode.

Definition at line 130 of file sensors.h.

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

Definition at line 132 of file sensors.h.

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

Definition at line 133 of file sensors.h.

SparseMatrix OpenMEEG::Sensors::getWeightsMatrix ( ) const
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 137 of file sensors.h.

void OpenMEEG::Sensors::info ( ) const

get info about sensors.

void OpenMEEG::Sensors::findInjectionTriangles ( )
private

Get the triangles under each EIT sensors

Member Data Documentation

size_t OpenMEEG::Sensors::m_nb
private

Number of sensors.

Definition at line 141 of file sensors.h.

Strings OpenMEEG::Sensors::m_names
private

List of sensors names.

Definition at line 142 of file sensors.h.

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

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

Vector OpenMEEG::Sensors::m_weights
private

Weights of integration points

Definition at line 145 of file sensors.h.

Vector OpenMEEG::Sensors::m_radii
private

Areas of the EIT sensors

Definition at line 146 of file sensors.h.

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

Triangles under each EIT sensors

Definition at line 147 of file sensors.h.

const Geometry* OpenMEEG::Sensors::m_geo
private

Geometry on which are applied EIT sensors

Definition at line 148 of file sensors.h.

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

Correspondance between point id and sensor id

Definition at line 149 of file sensors.h.


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