v2.0.0
Loading...
Searching...
No Matches
mne_project_to_surface.h
Go to the documentation of this file.
1//=============================================================================================================
35
36#ifndef MNELIB_MNEPROJECTTOSURFACE_H
37#define MNELIB_MNEPROJECTTOSURFACE_H
38
39//=============================================================================================================
40// INCLUDES
41//=============================================================================================================
42
43#include "mne_global.h"
44
45//=============================================================================================================
46// QT INCLUDES
47//=============================================================================================================
48
49#include <QSharedPointer>
50
51//=============================================================================================================
52// EIGEN INCLUDES
53//=============================================================================================================
54
55#include <Eigen/Core>
56
57//=============================================================================================================
58// FORWARD DECLARATIONS
59//=============================================================================================================
60
61//=============================================================================================================
62// DEFINE NAMESPACE MNELIB
63//=============================================================================================================
64
65namespace MNELIB {
66
67//=============================================================================================================
68// MNELIB FORWARD DECLARATIONS
69//=============================================================================================================
70
71class MNEBemSurface;
72
73//TODO this needs to be removed - this has to be a function not a class!!!
74
75//=============================================================================================================
81
83{
84
85public:
86 typedef QSharedPointer<MNEProjectToSurface> SPtr;
87 typedef QSharedPointer<const MNEProjectToSurface> ConstSPtr;
88
89 //=========================================================================================================
94
95 //=========================================================================================================
101 MNEProjectToSurface(const MNELIB::MNEBemSurface &p_MNEBemSurf);
102
103 //=========================================================================================================
117 bool find_closest_on_surface(const Eigen::MatrixXf &r, const int np, Eigen::MatrixXf &rTri,
118 Eigen::VectorXi &nearest, Eigen::VectorXf &dist);
119
120protected:
121
122private:
123 //=========================================================================================================
136 bool project_to_surface(const Eigen::Vector3f &r, Eigen::Vector3f &rTri, int &bestTri, float &bestDist);
137
138 //=========================================================================================================
152 bool nearest_triangle_point(const Eigen::Vector3f &r, const int tri, float &p, float &q, float &dist);
153
154 //=========================================================================================================
167 bool project_to_triangle(Eigen::Vector3f &rTri, const float p, const float q, const int tri);
168
169 Eigen::MatrixX3f r1;
170 Eigen::MatrixX3f r12;
171 Eigen::MatrixX3f r13;
172 Eigen::MatrixX3f nn;
173 Eigen::VectorXf a;
174 Eigen::VectorXf b;
175 Eigen::VectorXf c;
176 Eigen::VectorXf det;
177};
178
179//=============================================================================================================
180// INLINE DEFINITIONS
181//=============================================================================================================
182} // namespace MNELIB
183
184#endif // MNELIB_MNEPROJECTTOSURFACE_H
mne library export/import macros.
#define MNESHARED_EXPORT
Definition mne_global.h:52
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)
find_closest_on_surface