Defines a source space or a surface. More...
#include <mne_surface_or_volume.h>
Public Types | |
| 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 | |
| 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 double | solid_angle (const Eigen::Vector3f &from, const MNELIB::MNETriangle &tri) |
| static void | compute_cm (const PointsT &rr, int np, float(&cm)[3]) |
Public Attributes | |
| 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] |
Defines a source space or a surface.
Holds vertex positions, normals, triangulation, patch statistics, neighborhood connectivity, and optional volume-grid metadata for MEG/EEG source-space analysis.
Definition at line 118 of file mne_surface_or_volume.h.

| typedef QSharedPointer<const MNESurfaceOrVolume> MNELIB::MNESurfaceOrVolume::ConstSPtr |
Const shared pointer type for MNESurfaceOrVolume.
Definition at line 122 of file mne_surface_or_volume.h.
| typedef Eigen::Matrix<float, Eigen::Dynamic, 3, Eigen::RowMajor> MNELIB::MNESurfaceOrVolume::NormalsT |
Type abbreviation for np x 3 normal data.
Definition at line 129 of file mne_surface_or_volume.h.
| typedef Eigen::Matrix<float, Eigen::Dynamic, 3, Eigen::RowMajor> MNELIB::MNESurfaceOrVolume::PointsT |
Type abbreviation for np x 3 point data.
Definition at line 128 of file mne_surface_or_volume.h.
| typedef QSharedPointer<MNESurfaceOrVolume> MNELIB::MNESurfaceOrVolume::SPtr |
Shared pointer type for MNESurfaceOrVolume.
Definition at line 121 of file mne_surface_or_volume.h.
| typedef Eigen::Matrix<int, Eigen::Dynamic, 3, Eigen::RowMajor> MNELIB::MNESurfaceOrVolume::TrianglesT |
Type abbreviation for ntri x 3 triangle indices.
Definition at line 130 of file mne_surface_or_volume.h.
| MNESurfaceOrVolume::MNESurfaceOrVolume | ( | ) |
Constructs the MNE Surface or Volume.
Definition at line 307 of file mne_surface_or_volume.cpp.
|
virtual |
Destroys the MNE Surface or Volume description.
Definition at line 322 of file mne_surface_or_volume.cpp.
|
default |
|
default |
| int MNESurfaceOrVolume::add_geometry_info | ( | int | do_normals | ) |
Convenience overload that adds geometry information with border detection disabled and excess-neighbor checking enabled.
| [in,out] | s | The source space to augment. |
| [in] | do_normals | If non-zero, compute vertex normals. |
Definition at line 753 of file mne_surface_or_volume.cpp.
| int MNESurfaceOrVolume::add_geometry_info | ( | int | do_normals, |
| int | check_too_many_neighbors ) |
Build complete geometry information for a source space: triangle data, vertex normals, neighbor-triangle lists, neighbor-vertex lists, vertex distances, and center of mass. Optionally checks for topological defects (excessive number of neighbors).
| [in,out] | s | The source space to augment. |
| [in] | do_normals | If non-zero, compute vertex normals. |
| [in] | check_too_many_neighbors | If non-zero, fail on excessive neighbor count. |
Definition at line 567 of file mne_surface_or_volume.cpp.
| int MNESurfaceOrVolume::add_geometry_info2 | ( | int | do_normals | ) |
Add geometry information with excess-neighbor checking disabled (warns instead of failing when a vertex has too many neighbors).
| [in,out] | s | The source space to augment. |
| [in] | do_normals | If non-zero, compute vertex normals. |
Definition at line 760 of file mne_surface_or_volume.cpp.
| void MNESurfaceOrVolume::add_triangle_data | ( | ) |
Populate the MNETriangle structures for both the full and in-use triangulations by computing edge vectors, normals, and areas. Accumulates the total surface area into tot_area.
| [in,out] | s | The source space whose triangle data is filled in. |
Definition at line 404 of file mne_surface_or_volume.cpp.
| void MNESurfaceOrVolume::add_uniform_curv | ( | ) |
Set all vertex curvature values to 1.0 (uniform curvature), if not already present.
Definition at line 313 of file mne_surface_or_volume.cpp.
| int MNESurfaceOrVolume::add_vertex_normals | ( | ) |
Compute vertex normals by area-weighted accumulation of triangle normals, then normalize to unit length. Also calls add_triangle_data() and compute_surface_cm().
| [in,out] | s | The source space to update. |
Definition at line 524 of file mne_surface_or_volume.cpp.
| void MNESurfaceOrVolume::calculate_vertex_distances | ( | ) |
Compute the Euclidean distances from each vertex to its topological neighbors and store them in the vert_dist array.
| [in,out] | s | The source space with neighbor_vert already set. |
Definition at line 492 of file mne_surface_or_volume.cpp.
|
static |
Compute the center of mass (mean position) of a set of points.
| [in] | rr | Array of 3D point coordinates. |
| [in] | np | Number of points. |
| [out] | cm | Receives the center of mass (3-element float array). |
Definition at line 459 of file mne_surface_or_volume.cpp.
| void MNESurfaceOrVolume::compute_surface_cm | ( | ) |
Compute and store the center of mass of a surface's vertices.
| [in,out] | s | The surface whose cm field is set. |
Definition at line 481 of file mne_surface_or_volume.cpp.
| Eigen::VectorXd MNESurfaceOrVolume::nearestDistVec | ( | ) | const |
Extract the nearest distances from the nearest vector as doubles. Equivalent to the old MNEHemisphere::nearest_dist (VectorXd).
Definition at line 353 of file mne_surface_or_volume.cpp.
| Eigen::VectorXi MNESurfaceOrVolume::nearestVertIdx | ( | ) | const |
Extract the nearest in-use vertex indices from the nearest vector. Equivalent to the old MNEHemisphere::nearest (VectorXi).
Definition at line 343 of file mne_surface_or_volume.cpp.
|
default |
|
default |
| void MNESurfaceOrVolume::setNearestData | ( | const Eigen::VectorXi & | nearestIdx, |
| const Eigen::VectorXd & | nearestDist ) |
Populate the nearest vector from separate index and distance arrays. Sets vert = i, patch = nullptr for each entry.
| [in] | nearestIdx | Nearest in-use vertex index for each vertex. |
| [in] | nearestDist | Distance to nearest in-use vertex for each vertex. |
Definition at line 363 of file mne_surface_or_volume.cpp.
|
static |
Compute the solid angle subtended by a triangle as seen from a given point using van Oosterom's formula (scalar triple product of the edge vectors).
| [in] | from | The observation point (3-element float array). |
| [in] | tri | The triangle whose solid angle is computed. |
Definition at line 377 of file mne_surface_or_volume.cpp.
| float MNELIB::MNESurfaceOrVolume::cm[3] |
Center of mass of the vertex cloud.
Definition at line 291 of file mne_surface_or_volume.h.
| int MNELIB::MNESurfaceOrVolume::coord_frame |
Which coordinate system the data are in now.
Definition at line 279 of file mne_surface_or_volume.h.
| Eigen::VectorXf MNELIB::MNESurfaceOrVolume::curv |
The FreeSurfer curvature values (np elements).
Definition at line 323 of file mne_surface_or_volume.h.
| FIFFLIB::FiffSparseMatrix MNELIB::MNESurfaceOrVolume::dist |
Distances between (used) vertices along the surface.
Definition at line 320 of file mne_surface_or_volume.h.
| float MNELIB::MNESurfaceOrVolume::dist_limit |
Distance limit: values above this were not computed. Negative means only used vertices were considered.
Definition at line 321 of file mne_surface_or_volume.h.
| int MNELIB::MNESurfaceOrVolume::id |
Surface id.
Definition at line 278 of file mne_surface_or_volume.h.
| std::optional<FIFFLIB::FiffSparseMatrix> MNELIB::MNESurfaceOrVolume::interpolator |
Sparse matrix to interpolate from source space into an MRI volume.
Definition at line 331 of file mne_surface_or_volume.h.
| Eigen::VectorXi MNELIB::MNESurfaceOrVolume::inuse |
Boolean array indicating whether each vertex is in use in the source space (np elements).
Definition at line 293 of file mne_surface_or_volume.h.
| TrianglesT MNELIB::MNESurfaceOrVolume::itris |
Triangle vertex indices (ntri x 3, row-major).
Definition at line 307 of file mne_surface_or_volume.h.
| std::optional<MNEMghTagGroup> MNELIB::MNESurfaceOrVolume::mgh_tags |
Tags listed in the file.
Definition at line 284 of file mne_surface_or_volume.h.
| std::optional<FIFFLIB::FiffCoordTrans> MNELIB::MNESurfaceOrVolume::MRI_surf_RAS_RAS_t |
Transform from surface RAS to scanner RAS in the associated MRI volume.
Definition at line 334 of file mne_surface_or_volume.h.
| int MNELIB::MNESurfaceOrVolume::MRI_vol_dims[3] |
Dimensions of the associated MRI volume (width x height x depth).
Definition at line 335 of file mne_surface_or_volume.h.
| QString MNELIB::MNESurfaceOrVolume::MRI_volume |
Path to the MRI volume file the interpolator is based on.
Definition at line 332 of file mne_surface_or_volume.h.
| std::optional<FIFFLIB::FiffCoordTrans> MNELIB::MNESurfaceOrVolume::MRI_voxel_surf_RAS_t |
Voxel-to-surface-RAS transform for the associated MRI volume.
Definition at line 333 of file mne_surface_or_volume.h.
| std::vector<MNENearest> MNELIB::MNESurfaceOrVolume::nearest |
Nearest in-use vertex info for each vertex (np elements).
Definition at line 317 of file mne_surface_or_volume.h.
| std::vector<Eigen::VectorXi> MNELIB::MNESurfaceOrVolume::neighbor_tri |
Neighboring triangles for each vertex (np entries, variable length).
Definition at line 314 of file mne_surface_or_volume.h.
| std::vector<Eigen::VectorXi> MNELIB::MNESurfaceOrVolume::neighbor_vert |
Vertices neighboring each vertex (np entries, variable length).
Definition at line 297 of file mne_surface_or_volume.h.
| NormalsT MNELIB::MNESurfaceOrVolume::nn |
Surface normals at these points (np x 3, row-major).
Definition at line 290 of file mne_surface_or_volume.h.
| Eigen::VectorXi MNELIB::MNESurfaceOrVolume::nneighbor_tri |
Number of neighboring triangles for each vertex (np elements).
Definition at line 315 of file mne_surface_or_volume.h.
| Eigen::VectorXi MNELIB::MNESurfaceOrVolume::nneighbor_vert |
Number of vertices neighboring each vertex (np elements).
Definition at line 298 of file mne_surface_or_volume.h.
| int MNELIB::MNESurfaceOrVolume::np |
Number of vertices.
Definition at line 288 of file mne_surface_or_volume.h.
| int MNELIB::MNESurfaceOrVolume::ntri |
Number of triangles in the surface.
Definition at line 305 of file mne_surface_or_volume.h.
| int MNELIB::MNESurfaceOrVolume::nuse |
Number of vertices in use.
Definition at line 295 of file mne_surface_or_volume.h.
| int MNELIB::MNESurfaceOrVolume::nuse_tri |
Number of triangles in the in-use triangulation.
Definition at line 310 of file mne_surface_or_volume.h.
| std::vector<std::optional<MNEPatchInfo> > MNELIB::MNESurfaceOrVolume::patches |
Patch information for each in-use vertex (nuse elements).
Definition at line 318 of file mne_surface_or_volume.h.
| PointsT MNELIB::MNESurfaceOrVolume::rr |
The vertex locations (np x 3, row-major).
Definition at line 289 of file mne_surface_or_volume.h.
| float MNELIB::MNESurfaceOrVolume::sigma |
Conductivity of a BEM compartment (-1 if not set).
Definition at line 303 of file mne_surface_or_volume.h.
| QString MNELIB::MNESurfaceOrVolume::subject |
Name (id) of the subject.
Definition at line 277 of file mne_surface_or_volume.h.
| float MNELIB::MNESurfaceOrVolume::tot_area |
Total area of the surface, computed from the triangles (m^2).
Definition at line 308 of file mne_surface_or_volume.h.
| std::vector<MNETriangle> MNELIB::MNESurfaceOrVolume::tris |
The full triangulation data (ntri elements).
Definition at line 306 of file mne_surface_or_volume.h.
| int MNELIB::MNESurfaceOrVolume::type |
Is this a volume or a surface.
Definition at line 276 of file mne_surface_or_volume.h.
| TrianglesT MNELIB::MNESurfaceOrVolume::use_itris |
Vertex indices for the in-use triangulation (row-major).
Definition at line 312 of file mne_surface_or_volume.h.
| std::vector<MNETriangle> MNELIB::MNESurfaceOrVolume::use_tris |
Triangulation data for the in-use vertices.
Definition at line 311 of file mne_surface_or_volume.h.
| Eigen::VectorXf MNELIB::MNESurfaceOrVolume::val |
Auxiliary values associated with the vertices (np elements).
Definition at line 324 of file mne_surface_or_volume.h.
| std::vector<Eigen::VectorXf> MNELIB::MNESurfaceOrVolume::vert_dist |
Euclidean distances between neighboring vertices (np entries, variable length).
Definition at line 299 of file mne_surface_or_volume.h.
| Eigen::VectorXi MNELIB::MNESurfaceOrVolume::vertno |
Vertex numbers of the used vertices in the full source space (nuse elements).
Definition at line 294 of file mne_surface_or_volume.h.
| int MNELIB::MNESurfaceOrVolume::vol_dims[3] |
Dimensions of the volume grid (width x height x depth). Present only for complete rectangular grids including unused vertices.
Definition at line 329 of file mne_surface_or_volume.h.
| std::optional<MNEVolGeom> MNELIB::MNESurfaceOrVolume::vol_geom |
MRI volume geometry information as FreeSurfer likes it.
Definition at line 283 of file mne_surface_or_volume.h.
| float MNELIB::MNESurfaceOrVolume::voxel_size[3] |
Voxel size in meters, derived from the voxel transform.
Definition at line 330 of file mne_surface_or_volume.h.
| std::optional<FIFFLIB::FiffCoordTrans> MNELIB::MNESurfaceOrVolume::voxel_surf_RAS_t |
Transform from voxel coordinates to surface RAS (MRI) coordinates.
Definition at line 328 of file mne_surface_or_volume.h.