v2.0.0
Loading...
Searching...
No Matches
mne_project_to_surface.h
Go to the documentation of this file.
1//=============================================================================================================
22
23#ifndef MNELIB_MNEPROJECTTOSURFACE_H
24#define MNELIB_MNEPROJECTTOSURFACE_H
25
26//=============================================================================================================
27// INCLUDES
28//=============================================================================================================
29
30#include "mne_global.h"
31
32//=============================================================================================================
33// QT INCLUDES
34//=============================================================================================================
35
36#include <QSharedPointer>
37
38//=============================================================================================================
39// EIGEN INCLUDES
40//=============================================================================================================
41
42#include <Eigen/Core>
43
44//=============================================================================================================
45// FORWARD DECLARATIONS
46//=============================================================================================================
47
48//=============================================================================================================
49// DEFINE NAMESPACE MNELIB
50//=============================================================================================================
51
52namespace MNELIB {
53
54//=============================================================================================================
55// MNELIB FORWARD DECLARATIONS
56//=============================================================================================================
57
58class MNEBemSurface;
59
60//=============================================================================================================
66
68{
69
70public:
71 typedef QSharedPointer<MNEProjectToSurface> SPtr;
72 typedef QSharedPointer<const MNEProjectToSurface> ConstSPtr;
73
74 //=========================================================================================================
79
80 //=========================================================================================================
86 MNEProjectToSurface(const MNELIB::MNEBemSurface &p_MNEBemSurf);
87
88 //=========================================================================================================
102 bool find_closest_on_surface(const Eigen::MatrixXf &r, const int np, Eigen::MatrixXf &rTri,
103 Eigen::VectorXi &nearest, Eigen::VectorXf &dist);
104
105protected:
106
107private:
108 //=========================================================================================================
121 bool project_to_surface(const Eigen::Vector3f &r, Eigen::Vector3f &rTri, int &bestTri, float &bestDist);
122
123 //=========================================================================================================
137 bool nearest_triangle_point(const Eigen::Vector3f &r, const int tri, float &p, float &q, float &dist);
138
139 //=========================================================================================================
152 bool project_to_triangle(Eigen::Vector3f &rTri, const float p, const float q, const int tri);
153
154 Eigen::MatrixX3f r1;
155 Eigen::MatrixX3f r12;
156 Eigen::MatrixX3f r13;
157 Eigen::MatrixX3f nn;
158 Eigen::VectorXf a;
159 Eigen::VectorXf b;
160 Eigen::VectorXf c;
161 Eigen::VectorXf det;
162};
163
164//=============================================================================================================
165// INLINE DEFINITIONS
166//=============================================================================================================
167} // namespace MNELIB
168
169#endif // MNELIB_MNEPROJECTTOSURFACE_H
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).
BEM surface provides geometry information.
QSharedPointer< const MNEProjectToSurface > ConstSPtr
QSharedPointer< MNEProjectToSurface > SPtr
bool find_closest_on_surface(const Eigen::MatrixXf &r, const int np, Eigen::MatrixXf &rTri, Eigen::VectorXi &nearest, Eigen::VectorXf &dist)
Project a set of points onto the surface and return the nearest triangle and signed distance per poin...