This defines a surface. More...
#include <mne_surface.h>
Public Types | |
| typedef std::shared_ptr< MNESurface > | SPtr |
| typedef std::shared_ptr< const MNESurface > | ConstSPtr |
| Public Types inherited from MNELIB::MNESurfaceOrVolume | |
| typedef QSharedPointer< MNESurfaceOrVolume > | SPtr |
| typedef QSharedPointer< const MNESurfaceOrVolume > | ConstSPtr |
| typedef Eigen::Matrix< float, Eigen::Dynamic, 3, Eigen::RowMajor > | PointsT |
| typedef Eigen::Matrix< float, Eigen::Dynamic, 3, Eigen::RowMajor > | NormalsT |
| typedef Eigen::Matrix< int, Eigen::Dynamic, 3, Eigen::RowMajor > | TrianglesT |
Public Member Functions | |
| MNESurface () | |
| ~MNESurface () | |
| double | sum_solids (const Eigen::Vector3f &from) const |
| void | triangle_coords (const Eigen::Vector3f &r, int tri, float &x, float &y, float &z) const |
| int | nearest_triangle_point (const Eigen::Vector3f &r, const MNEProjData *user, int tri, float &x, float &y, float &z) const |
| int | nearest_triangle_point (const Eigen::Vector3f &r, int tri, float &x, float &y, float &z) const |
| Eigen::Vector3f | project_to_triangle (int tri, float p, float q) const |
| Eigen::Vector3f | project_to_triangle (int best, const Eigen::Vector3f &r) const |
| int | project_to_surface (const MNEProjData *proj_data, const Eigen::Vector3f &r, float &distp) const |
| void | find_closest_on_surface_approx (const PointsT &r, int np, Eigen::VectorXi &nearest_tri, Eigen::VectorXf &dist, int nstep) const |
| void | decide_search_restriction (MNEProjData &p, int approx_best, int nstep, const Eigen::Vector3f &r) const |
| void | activate_neighbors (int start, Eigen::VectorXi &act, int nstep) const |
| Public Member Functions inherited from MNELIB::MNESurfaceOrVolume | |
| MNESurfaceOrVolume () | |
| Constructs the MNE Surface or Volume. | |
| virtual | ~MNESurfaceOrVolume () |
| Destroys the MNE Surface or Volume description. | |
| MNESurfaceOrVolume (const MNESurfaceOrVolume &)=default | |
| MNESurfaceOrVolume & | operator= (const MNESurfaceOrVolume &)=default |
| MNESurfaceOrVolume (MNESurfaceOrVolume &&)=default | |
| MNESurfaceOrVolume & | operator= (MNESurfaceOrVolume &&)=default |
| void | add_uniform_curv () |
| void | add_triangle_data () |
| void | compute_surface_cm () |
| void | calculate_vertex_distances () |
| int | add_vertex_normals () |
| int | add_geometry_info (int do_normals, int check_too_many_neighbors) |
| int | add_geometry_info (int do_normals) |
| int | add_geometry_info2 (int do_normals) |
| Eigen::VectorXi | nearestVertIdx () const |
| Eigen::VectorXd | nearestDistVec () const |
| void | setNearestData (const Eigen::VectorXi &nearestIdx, const Eigen::VectorXd &nearestDist) |
Static Public Member Functions | |
| static MNESurface * | read_bem_surface (const QString &name, int which, int add_geometry, float *sigmap) |
| static MNESurface * | read_bem_surface2 (const QString &name, int which, int add_geometry, float *sigmap) |
| static MNESurface * | read_bem_surface (const QString &name, int which, int add_geometry, float *sigmap, bool check_too_many_neighbors) |
| Static Public Member Functions inherited from MNELIB::MNESurfaceOrVolume | |
| static double | solid_angle (const Eigen::Vector3f &from, const MNELIB::MNETriangle &tri) |
| static void | compute_cm (const PointsT &rr, int np, float(&cm)[3]) |
Additional Inherited Members | |
| Public Attributes inherited from MNELIB::MNESurfaceOrVolume | |
| int | type |
| QString | subject |
| int | id |
| int | coord_frame |
| std::optional< MNEVolGeom > | vol_geom |
| std::optional< MNEMghTagGroup > | mgh_tags |
| int | np |
| PointsT | rr |
| NormalsT | nn |
| float | cm [3] |
| Eigen::VectorXi | inuse |
| Eigen::VectorXi | vertno |
| int | nuse |
| std::vector< Eigen::VectorXi > | neighbor_vert |
| Eigen::VectorXi | nneighbor_vert |
| std::vector< Eigen::VectorXf > | vert_dist |
| float | sigma |
| int | ntri |
| std::vector< MNETriangle > | tris |
| TrianglesT | itris |
| float | tot_area |
| int | nuse_tri |
| std::vector< MNETriangle > | use_tris |
| TrianglesT | use_itris |
| std::vector< Eigen::VectorXi > | neighbor_tri |
| Eigen::VectorXi | nneighbor_tri |
| std::vector< MNENearest > | nearest |
| std::vector< std::optional< MNEPatchInfo > > | patches |
| FIFFLIB::FiffSparseMatrix | dist |
| float | dist_limit |
| Eigen::VectorXf | curv |
| Eigen::VectorXf | val |
| std::optional< FIFFLIB::FiffCoordTrans > | voxel_surf_RAS_t |
| int | vol_dims [3] |
| float | voxel_size [3] |
| std::optional< FIFFLIB::FiffSparseMatrix > | interpolator |
| QString | MRI_volume |
| std::optional< FIFFLIB::FiffCoordTrans > | MRI_voxel_surf_RAS_t |
| std::optional< FIFFLIB::FiffCoordTrans > | MRI_surf_RAS_RAS_t |
| int | MRI_vol_dims [3] |
This defines a surface.
Implements the MNE Surface (Replaces typedef mneSurfaceOrVolume mneSurface; struct of MNE-C mne_types.h).
Definition at line 78 of file mne_surface.h.

| typedef std::shared_ptr<const MNESurface> MNELIB::MNESurface::ConstSPtr |
Const shared pointer type for MNESurface.
Definition at line 82 of file mne_surface.h.
| typedef std::shared_ptr<MNESurface> MNELIB::MNESurface::SPtr |
Shared pointer type for MNESurface.
Definition at line 81 of file mne_surface.h.
| MNESurface::MNESurface | ( | ) |
Constructs the MNE Surface
Definition at line 103 of file mne_surface.cpp.
| MNESurface::~MNESurface | ( | ) |
Destroys the MNE Surface
Definition at line 109 of file mne_surface.cpp.
| void MNESurface::activate_neighbors | ( | int | start, |
| Eigen::VectorXi & | act, | ||
| int | nstep ) const |
Recursively mark neighboring triangles as active.
| [in] | start | Starting vertex index. |
| [in,out] | act | Triangle activation array. |
| [in] | nstep | Recursive expansion steps. |
Definition at line 388 of file mne_surface.cpp.
| void MNESurface::decide_search_restriction | ( | MNEProjData & | p, |
| int | approx_best, | ||
| int | nstep, | ||
| const Eigen::Vector3f & | r ) const |
Set up the triangle activation mask for a restricted surface search.
| [in,out] | p | The projection data whose mask is set. |
| [in] | approx_best | Approximate best triangle, or negative for brute-force. |
| [in] | nstep | Neighborhood expansion levels. |
| [in] | r | The query point. |
Definition at line 335 of file mne_surface.cpp.
| void MNESurface::find_closest_on_surface_approx | ( | const PointsT & | r, |
| int | np, | ||
| Eigen::VectorXi & | nearest_tri, | ||
| Eigen::VectorXf & | dist, | ||
| int | nstep ) const |
For each point, find the closest point on the surface using neighborhood-restricted search.
| [in] | r | Array of np point coordinates. |
| [in] | np | Number of points. |
| [in,out] | nearest_tri | Best triangle index for each point. |
| [out] | dist | Distance to the surface for each point. |
| [in] | nstep | Number of neighborhood expansion steps. |
Definition at line 308 of file mne_surface.cpp.
| int MNESurface::nearest_triangle_point | ( | const Eigen::Vector3f & | r, |
| const MNEProjData * | user, | ||
| int | tri, | ||
| float & | x, | ||
| float & | y, | ||
| float & | z ) const |
Find the nearest point on a triangle to a given point.
| [in] | r | The point. |
| [in] | user | Optional MNEProjData restricting active triangles (may be NULL). |
| [in] | tri | Triangle index. |
| [out] | x | Coordinate along first edge. |
| [out] | y | Coordinate along second edge. |
| [out] | z | Distance from the triangle. |
Definition at line 156 of file mne_surface.cpp.
| int MNESurface::nearest_triangle_point | ( | const Eigen::Vector3f & | r, |
| int | tri, | ||
| float & | x, | ||
| float & | y, | ||
| float & | z ) const |
Find the nearest point on a triangle (simplified, no projection data).
| [in] | r | The point. |
| [in] | tri | Triangle index. |
| [out] | x | Coordinate along first edge. |
| [out] | y | Coordinate along second edge. |
| [out] | z | Distance from the triangle. |
Definition at line 253 of file mne_surface.cpp.
| int MNESurface::project_to_surface | ( | const MNEProjData * | proj_data, |
| const Eigen::Vector3f & | r, | ||
| float & | distp ) const |
Project a point onto the nearest triangle of the surface.
| [in] | proj_data | Optional MNEProjData restricting active triangles (may be NULL). |
| [in] | r | The 3D point to project. |
| [out] | distp | Receives the signed distance to the surface. |
Definition at line 282 of file mne_surface.cpp.
| Eigen::Vector3f MNESurface::project_to_triangle | ( | int | best, |
| const Eigen::Vector3f & | r ) const |
Find the nearest point on a given triangle and return the projected 3D coordinates.
| [in] | best | Triangle index. |
| [in] | r | The source point. |
Definition at line 273 of file mne_surface.cpp.
| Eigen::Vector3f MNESurface::project_to_triangle | ( | int | tri, |
| float | p, | ||
| float | q ) const |
Compute 3D position on a triangle from barycentric coordinates.
| [in] | tri | Triangle index. |
| [in] | p | Barycentric coordinate along first edge. |
| [in] | q | Barycentric coordinate along second edge. |
Definition at line 260 of file mne_surface.cpp.
|
static |
Read a BEM surface from a FIFF file (excess-neighbor checking enabled).
| [in] | name | Path to the BEM FIFF file. |
| [in] | which | Surface ID to load (-1 loads the first found). |
| [in] | add_geometry | If non-zero, compute full geometry info. |
| [out] | sigmap | If non-null, receives the surface conductivity. |
Definition at line 405 of file mne_surface.cpp.
|
static |
Read a BEM surface from a FIFF file.
| [in] | name | Path to the BEM FIFF file. |
| [in] | which | Surface ID to load (-1 loads the first found). |
| [in] | add_geometry | If non-zero, compute full geometry info. |
| [out] | sigmap | If non-null, receives the surface conductivity. |
| [in] | check_too_many_neighbors | Fail on excess neighbor count. |
Definition at line 419 of file mne_surface.cpp.
|
static |
Read a BEM surface from a FIFF file (excess-neighbor checking disabled).
| [in] | name | Path to the BEM FIFF file. |
| [in] | which | Surface ID to load (-1 loads the first found). |
| [in] | add_geometry | If non-zero, compute full geometry info. |
| [out] | sigmap | If non-null, receives the surface conductivity. |
Definition at line 412 of file mne_surface.cpp.
| double MNESurface::sum_solids | ( | const Eigen::Vector3f & | from | ) | const |
Sum the solid angles of all triangles as seen from a given point. ~4pi if inside, ~0 if outside.
| [in] | from | The test point. |
Definition at line 117 of file mne_surface.cpp.
| void MNESurface::triangle_coords | ( | const Eigen::Vector3f & | r, |
| int | tri, | ||
| float & | x, | ||
| float & | y, | ||
| float & | z ) const |
Compute barycentric-like coordinates of a point relative to a triangle.
| [in] | r | The point. |
| [in] | tri | Triangle index. |
| [out] | x | Barycentric coordinate along first edge. |
| [out] | y | Barycentric coordinate along second edge. |
| [out] | z | Signed perpendicular distance from the plane. |
Definition at line 130 of file mne_surface.cpp.