24#include <OpenMEEG_Export.h>
64 m_pointSensorIdx = std::vector<size_t>(
labels.size());
65 for (std::size_t
i=0;
i<
labels.size(); ++
i)
66 m_pointSensorIdx[
i] = getSensorIdx(m_names[
i]);
91 findInjectionTriangles();
104 findInjectionTriangles();
145 bool hasNames()
const {
return m_names.size()==m_nb; }
171 return std::find(m_names.begin(),m_names.end(),name)!=m_names.end();
175 const auto&
it = std::find(m_names.begin(),m_names.end(),name);
176 if (
it==m_names.end())
178 return std::distance(m_names.begin(),
it);
185 return m_triangles[
idx];
193 for(
size_t i=0;
i<getNumberOfPositions(); ++
i)
208 void findInjectionTriangles();
216 std::vector<Triangles> m_triangles;
218 std::vector<size_t> m_pointSensorIdx;
Geometry contains the electrophysiological model Vertices, meshes and domains are stored in this geom...
Matrix class Matrix class.
Sensors class for EEG and MEG sensors.
size_t getSensorIdx(const std::string &name) const
bool hasRadii() const
Return true if contains radii.
Sensors(const Geometry &g)
Default constructor with a geometry. Number of sensors = 0.
Sensors(const Strings &labels, const Matrix &positions, const Matrix &orientations, const Vector &weights, const Vector &radii)
Matrix & getPositions()
Return sensors positions.
Vector getPosition(const size_t idx) const
Return the position (3D point) of the integration point idx.
void save(const char *filename) const
bool isEmpty()
Return if the sensors object is empty. The sensors object is empty if its number of sensors is null.
Sensors()
Default constructor. Number of sensors = 0.
Vector getWeights() const
const Matrix & getOrientations() const
std::string getName(const size_t idx) const
Return the name of the idx_th sensor.
bool hasNames() const
Return true if contains all sensors names.
size_t getNumberOfPositions() const
Return the number of integration points.
Sensors(const Strings &labels, const Matrix &positions, const Matrix &orientations, const Vector &weights, const Vector &radii, const Geometry &g)
Vector getOrientation(const size_t idx) const
Return the orientations (3D point) of the integration point idx.
SparseMatrix getWeightsMatrix() const
void load(std::istream &in)
Load description file of sensors from stream.
const Matrix & getPositions() const
void save(const std::string &filename) const
void info() const
get info about sensors.
size_t getNumberOfSensors() const
Return the number of sensors.
Sensors(const Matrix &positions, const Geometry &g)
Strings & getNames()
Return sensors names.
Triangles getInjectionTriangles(const size_t idx) const
For EIT, get triangles under the current injection electrode.
void load(const char *filename, const char filetype='t')
Load sensors from file. Filetype is 't' for text file or 'b' for binary file.
bool hasSensor(const std::string &name) const
void setOrientation(const size_t idx, const Vector &orient)
Set the orientation (3D point) of the integration point i.
bool hasOrientations() const
Return true if contains orientations.
Sensors(const char *filename, const Geometry &g)
Construct from file and geometry (for EIT).
void setPosition(const size_t idx, const Vector &pos)
Set the position (3D point) of the integration point i.
void load(const std::string &filename, const char filetype='t')
Sensors(const char *filename)
Construct from text file.
Matrix & getOrientations()
Return sensors orientations.
std::vector< Triangle > Triangles
std::vector< std::string > Strings