v2.0.0
Loading...
Searching...
No Matches
mne_surface.h
Go to the documentation of this file.
1//=============================================================================================================
23
24#ifndef MNE_SURFACE_H
25#define MNE_SURFACE_H
26
27//=============================================================================================================
28// INCLUDES
29//=============================================================================================================
30
31#include "mne_global.h"
33
34//=============================================================================================================
35// EIGEN INCLUDES
36//=============================================================================================================
37
38#include <Eigen/Core>
39
40//=============================================================================================================
41// QT INCLUDES
42//=============================================================================================================
43
44#include <memory>
45
46//=============================================================================================================
47// DEFINE NAMESPACE MNELIB
48//=============================================================================================================
49
50namespace MNELIB
51{
52
53//=============================================================================================================
54// FORWARD DECLARATIONS
55//=============================================================================================================
56
57class MNEProjData;
58
59//=============================================================================================================
68{
69public:
70 typedef std::shared_ptr<MNESurface> SPtr;
71 typedef std::shared_ptr<const MNESurface> ConstSPtr;
72 typedef std::unique_ptr<MNESurface> UPtr;
73
74 //=========================================================================================================
78 MNESurface();
79
80 //=========================================================================================================
85
86 //=========================================================================================================
93 void writeToStream(FIFFLIB::FiffStream* p_pStream);
94
95 //=========================================================================================================
96 // FsSurface geometry const methods
97 //=========================================================================================================
98
106 double sum_solids(const Eigen::Vector3f& from) const;
107
117 void triangle_coords(const Eigen::Vector3f& r, int tri,
118 float& x, float& y, float& z) const;
119
131 int nearest_triangle_point(const Eigen::Vector3f& r,
132 const MNEProjData* user,
133 int tri,
134 float& x, float& y, float& z) const;
135
146 int nearest_triangle_point(const Eigen::Vector3f& r,
147 int tri,
148 float& x, float& y, float& z) const;
149
158 Eigen::Vector3f project_to_triangle(int tri, float p, float q) const;
159
167 Eigen::Vector3f project_to_triangle(int best, const Eigen::Vector3f& r) const;
168
177 int project_to_surface(const MNEProjData* proj_data,
178 const Eigen::Vector3f& r,
179 float& distp) const;
180
191 void find_closest_on_surface_approx(const PointsT& r, int np,
192 Eigen::VectorXi& nearest_tri,
193 Eigen::VectorXf& distances,
194 int nstep) const;
195
205 int approx_best,
206 int nstep,
207 const Eigen::Vector3f& r) const;
208
216 void activate_neighbors(int start, Eigen::VectorXi& act, int nstep) const;
217
218 //=========================================================================================================
219 // Non-const mutator
220 //=========================================================================================================
221
222 //=========================================================================================================
223 // Static factory methods
224 //=========================================================================================================
225
234 static std::unique_ptr<MNESurface> read_bem_surface(const QString& name, int which,
235 bool add_geometry);
236
246 static std::unique_ptr<MNESurface> read_bem_surface(const QString& name, int which,
247 bool add_geometry, float& sigma);
248
257 static std::unique_ptr<MNESurface> read_bem_surface2(const QString& name, int which,
258 bool add_geometry);
259
270 static std::unique_ptr<MNESurface> read_bem_surface(const QString& name, int which,
271 bool add_geometry, float& sigma,
272 bool check_too_many_neighbors);
273};
274
275//=============================================================================================================
276// INLINE DEFINITIONS
277//=============================================================================================================
278} // NAMESPACE MNELIB
279
280#endif // MNE_SURFACE_H
Discriminated geometry container that can represent either a triangulated surface or a discrete/volum...
MNELIB shared-library export/import macros and library build metadata.
#define MNESHARED_EXPORT
Definition mne_global.h:40
Core MNE data structures (source spaces, source estimates, hemispheres).
FIFF tag-stream reader/writer: wraps a QIODevice and exposes typed read_* / write_* methods for every...
Auxiliary projection data computed from MNEProjOp for efficient repeated application.
double sum_solids(const Eigen::Vector3f &from) const
std::unique_ptr< MNESurface > UPtr
Definition mne_surface.h:72
Eigen::Vector3f project_to_triangle(int tri, float p, float q) const
static std::unique_ptr< MNESurface > read_bem_surface2(const QString &name, int which, bool add_geometry)
void triangle_coords(const Eigen::Vector3f &r, int tri, float &x, float &y, float &z) const
std::shared_ptr< const MNESurface > ConstSPtr
Definition mne_surface.h:71
static std::unique_ptr< MNESurface > read_bem_surface(const QString &name, int which, bool add_geometry)
void find_closest_on_surface_approx(const PointsT &r, int np, Eigen::VectorXi &nearest_tri, Eigen::VectorXf &distances, int nstep) const
int project_to_surface(const MNEProjData *proj_data, const Eigen::Vector3f &r, float &distp) const
std::shared_ptr< MNESurface > SPtr
Definition mne_surface.h:70
void decide_search_restriction(MNEProjData &p, int approx_best, int nstep, const Eigen::Vector3f &r) const
void writeToStream(FIFFLIB::FiffStream *p_pStream)
int nearest_triangle_point(const Eigen::Vector3f &r, const MNEProjData *user, int tri, float &x, float &y, float &z) const
void activate_neighbors(int start, Eigen::VectorXi &act, int nstep) const
MNESurfaceOrVolume()
Constructs the MNE FsSurface or Volume.
Eigen::Matrix< float, Eigen::Dynamic, 3, Eigen::RowMajor > PointsT