v2.0.0
Loading...
Searching...
No Matches
MNELIB::MNESurfaceOrVolume Class Reference

Defines a source space or a surface. More...

#include <mne_surface_or_volume.h>

Public Types

typedef QSharedPointer< MNESurfaceOrVolumeSPtr
typedef QSharedPointer< const MNESurfaceOrVolumeConstSPtr
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
MNESurfaceOrVolumeoperator= (const MNESurfaceOrVolume &)=default
 MNESurfaceOrVolume (MNESurfaceOrVolume &&)=default
MNESurfaceOrVolumeoperator= (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< MNEVolGeomvol_geom
std::optional< MNEMghTagGroupmgh_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< MNETriangletris
TrianglesT itris
float tot_area
int nuse_tri
std::vector< MNETriangleuse_tris
TrianglesT use_itris
std::vector< Eigen::VectorXi > neighbor_tri
Eigen::VectorXi nneighbor_tri
std::vector< MNENearestnearest
std::vector< std::optional< MNEPatchInfo > > patches
FIFFLIB::FiffSparseMatrix dist
float dist_limit
Eigen::VectorXf curv
Eigen::VectorXf val
std::optional< FIFFLIB::FiffCoordTransvoxel_surf_RAS_t
int vol_dims [3]
float voxel_size [3]
std::optional< FIFFLIB::FiffSparseMatrixinterpolator
QString MRI_volume
std::optional< FIFFLIB::FiffCoordTransMRI_voxel_surf_RAS_t
std::optional< FIFFLIB::FiffCoordTransMRI_surf_RAS_RAS_t
int MRI_vol_dims [3]

Detailed Description

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.

Inheritance diagram for MNELIB::MNESurfaceOrVolume:
Inheritance graph

Member Typedef Documentation

◆ ConstSPtr

Const shared pointer type for MNESurfaceOrVolume.

Definition at line 122 of file mne_surface_or_volume.h.

◆ NormalsT

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.

◆ PointsT

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.

◆ SPtr

Shared pointer type for MNESurfaceOrVolume.

Definition at line 121 of file mne_surface_or_volume.h.

◆ TrianglesT

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.

Constructor & Destructor Documentation

◆ MNESurfaceOrVolume() [1/3]

MNESurfaceOrVolume::MNESurfaceOrVolume ( )

Constructs the MNE Surface or Volume.

Definition at line 307 of file mne_surface_or_volume.cpp.

◆ ~MNESurfaceOrVolume()

MNESurfaceOrVolume::~MNESurfaceOrVolume ( )
virtual

Destroys the MNE Surface or Volume description.

Definition at line 322 of file mne_surface_or_volume.cpp.

◆ MNESurfaceOrVolume() [2/3]

MNELIB::MNESurfaceOrVolume::MNESurfaceOrVolume ( const MNESurfaceOrVolume & )
default

◆ MNESurfaceOrVolume() [3/3]

MNELIB::MNESurfaceOrVolume::MNESurfaceOrVolume ( MNESurfaceOrVolume && )
default

Member Function Documentation

◆ add_geometry_info() [1/2]

int MNESurfaceOrVolume::add_geometry_info ( int do_normals)

Convenience overload that adds geometry information with border detection disabled and excess-neighbor checking enabled.

Parameters
[in,out]sThe source space to augment.
[in]do_normalsIf non-zero, compute vertex normals.
Returns
OK on success, FAIL on error.

Definition at line 753 of file mne_surface_or_volume.cpp.

◆ add_geometry_info() [2/2]

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).

Parameters
[in,out]sThe source space to augment.
[in]do_normalsIf non-zero, compute vertex normals.
[in]check_too_many_neighborsIf non-zero, fail on excessive neighbor count.
Returns
OK on success, FAIL on error.

Definition at line 567 of file mne_surface_or_volume.cpp.

◆ add_geometry_info2()

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).

Parameters
[in,out]sThe source space to augment.
[in]do_normalsIf non-zero, compute vertex normals.
Returns
OK on success, FAIL on error.

Definition at line 760 of file mne_surface_or_volume.cpp.

◆ add_triangle_data()

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.

Parameters
[in,out]sThe source space whose triangle data is filled in.

Definition at line 404 of file mne_surface_or_volume.cpp.

◆ add_uniform_curv()

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.

◆ add_vertex_normals()

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().

Parameters
[in,out]sThe source space to update.
Returns
OK on success, FAIL on error.

Definition at line 524 of file mne_surface_or_volume.cpp.

◆ calculate_vertex_distances()

void MNESurfaceOrVolume::calculate_vertex_distances ( )

Compute the Euclidean distances from each vertex to its topological neighbors and store them in the vert_dist array.

Parameters
[in,out]sThe source space with neighbor_vert already set.

Definition at line 492 of file mne_surface_or_volume.cpp.

◆ compute_cm()

void MNESurfaceOrVolume::compute_cm ( const PointsT & rr,
int np,
float(&) cm[3] )
static

Compute the center of mass (mean position) of a set of points.

Parameters
[in]rrArray of 3D point coordinates.
[in]npNumber of points.
[out]cmReceives the center of mass (3-element float array).

Definition at line 459 of file mne_surface_or_volume.cpp.

◆ compute_surface_cm()

void MNESurfaceOrVolume::compute_surface_cm ( )

Compute and store the center of mass of a surface's vertices.

Parameters
[in,out]sThe surface whose cm field is set.

Definition at line 481 of file mne_surface_or_volume.cpp.

◆ nearestDistVec()

Eigen::VectorXd MNESurfaceOrVolume::nearestDistVec ( ) const

Extract the nearest distances from the nearest vector as doubles. Equivalent to the old MNEHemisphere::nearest_dist (VectorXd).

Returns
VectorXd where element i = (double)nearest[i].dist.

Definition at line 353 of file mne_surface_or_volume.cpp.

◆ nearestVertIdx()

Eigen::VectorXi MNESurfaceOrVolume::nearestVertIdx ( ) const

Extract the nearest in-use vertex indices from the nearest vector. Equivalent to the old MNEHemisphere::nearest (VectorXi).

Returns
VectorXi where element i = nearest[i].nearest.

Definition at line 343 of file mne_surface_or_volume.cpp.

◆ operator=() [1/2]

MNESurfaceOrVolume & MNELIB::MNESurfaceOrVolume::operator= ( const MNESurfaceOrVolume & )
default

◆ operator=() [2/2]

MNESurfaceOrVolume & MNELIB::MNESurfaceOrVolume::operator= ( MNESurfaceOrVolume && )
default

◆ setNearestData()

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.

Parameters
[in]nearestIdxNearest in-use vertex index for each vertex.
[in]nearestDistDistance to nearest in-use vertex for each vertex.

Definition at line 363 of file mne_surface_or_volume.cpp.

◆ solid_angle()

double MNESurfaceOrVolume::solid_angle ( const Eigen::Vector3f & from,
const MNELIB::MNETriangle & tri )
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).

Parameters
[in]fromThe observation point (3-element float array).
[in]triThe triangle whose solid angle is computed.
Returns
The solid angle in steradians.

Definition at line 377 of file mne_surface_or_volume.cpp.

Member Data Documentation

◆ cm

float MNELIB::MNESurfaceOrVolume::cm[3]

Center of mass of the vertex cloud.

Definition at line 291 of file mne_surface_or_volume.h.

◆ coord_frame

int MNELIB::MNESurfaceOrVolume::coord_frame

Which coordinate system the data are in now.

Definition at line 279 of file mne_surface_or_volume.h.

◆ curv

Eigen::VectorXf MNELIB::MNESurfaceOrVolume::curv

The FreeSurfer curvature values (np elements).

Definition at line 323 of file mne_surface_or_volume.h.

◆ dist

FIFFLIB::FiffSparseMatrix MNELIB::MNESurfaceOrVolume::dist

Distances between (used) vertices along the surface.

Definition at line 320 of file mne_surface_or_volume.h.

◆ dist_limit

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.

◆ id

int MNELIB::MNESurfaceOrVolume::id

Surface id.

Definition at line 278 of file mne_surface_or_volume.h.

◆ interpolator

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.

◆ inuse

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.

◆ itris

TrianglesT MNELIB::MNESurfaceOrVolume::itris

Triangle vertex indices (ntri x 3, row-major).

Definition at line 307 of file mne_surface_or_volume.h.

◆ mgh_tags

std::optional<MNEMghTagGroup> MNELIB::MNESurfaceOrVolume::mgh_tags

Tags listed in the file.

Definition at line 284 of file mne_surface_or_volume.h.

◆ MRI_surf_RAS_RAS_t

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.

◆ MRI_vol_dims

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.

◆ MRI_volume

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.

◆ MRI_voxel_surf_RAS_t

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.

◆ nearest

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.

◆ neighbor_tri

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.

◆ neighbor_vert

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.

◆ nn

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.

◆ nneighbor_tri

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.

◆ nneighbor_vert

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.

◆ np

int MNELIB::MNESurfaceOrVolume::np

Number of vertices.

Definition at line 288 of file mne_surface_or_volume.h.

◆ ntri

int MNELIB::MNESurfaceOrVolume::ntri

Number of triangles in the surface.

Definition at line 305 of file mne_surface_or_volume.h.

◆ nuse

int MNELIB::MNESurfaceOrVolume::nuse

Number of vertices in use.

Definition at line 295 of file mne_surface_or_volume.h.

◆ nuse_tri

int MNELIB::MNESurfaceOrVolume::nuse_tri

Number of triangles in the in-use triangulation.

Definition at line 310 of file mne_surface_or_volume.h.

◆ patches

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.

◆ rr

PointsT MNELIB::MNESurfaceOrVolume::rr

The vertex locations (np x 3, row-major).

Definition at line 289 of file mne_surface_or_volume.h.

◆ sigma

float MNELIB::MNESurfaceOrVolume::sigma

Conductivity of a BEM compartment (-1 if not set).

Definition at line 303 of file mne_surface_or_volume.h.

◆ subject

QString MNELIB::MNESurfaceOrVolume::subject

Name (id) of the subject.

Definition at line 277 of file mne_surface_or_volume.h.

◆ tot_area

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.

◆ tris

std::vector<MNETriangle> MNELIB::MNESurfaceOrVolume::tris

The full triangulation data (ntri elements).

Definition at line 306 of file mne_surface_or_volume.h.

◆ type

int MNELIB::MNESurfaceOrVolume::type

Is this a volume or a surface.

Definition at line 276 of file mne_surface_or_volume.h.

◆ use_itris

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.

◆ use_tris

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.

◆ val

Eigen::VectorXf MNELIB::MNESurfaceOrVolume::val

Auxiliary values associated with the vertices (np elements).

Definition at line 324 of file mne_surface_or_volume.h.

◆ vert_dist

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.

◆ vertno

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.

◆ vol_dims

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.

◆ vol_geom

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.

◆ voxel_size

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.

◆ voxel_surf_RAS_t

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.


The documentation for this class was generated from the following files: