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//=============================================================================================================
56// MNELIB FORWARD DECLARATIONS
57//=============================================================================================================
58
59class MNEBemSurface;
60
61//=============================================================================================================
69
71{
72public:
73 typedef QSharedPointer<MNEProjectToSurface> SPtr;
74 typedef QSharedPointer<const MNEProjectToSurface> ConstSPtr;
75
76 //=========================================================================================================
81
82 //=========================================================================================================
88 MNEProjectToSurface(const MNELIB::MNEBemSurface& p_MNEBemSurf);
89
90 //=========================================================================================================
104 bool find_closest_on_surface(const Eigen::MatrixXf& r, const int np, Eigen::MatrixXf& rTri,
105 Eigen::VectorXi& nearest, Eigen::VectorXf& dist);
106
107protected:
108private:
109 //=========================================================================================================
122 bool project_to_surface(const Eigen::Vector3f& r, Eigen::Vector3f& rTri, int& bestTri, float& bestDist);
123
124 //=========================================================================================================
138 bool nearest_triangle_point(const Eigen::Vector3f& r, const int tri, float& p, float& q, float& dist);
139
140 //=========================================================================================================
153 bool project_to_triangle(Eigen::Vector3f& rTri, const float p, const float q, const int tri);
154
155 Eigen::MatrixX3f r1;
156 Eigen::MatrixX3f r12;
157 Eigen::MatrixX3f r13;
158 Eigen::MatrixX3f nn;
159 Eigen::VectorXf a;
160 Eigen::VectorXf b;
161 Eigen::VectorXf c;
162 Eigen::VectorXf det;
163};
164
165//=============================================================================================================
166// INLINE DEFINITIONS
167//=============================================================================================================
168} // namespace MNELIB
169
170#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...