This defines a source space. More...
#include <mne_source_space.h>
Public Types | |
| using | SPtr = std::shared_ptr<MNESourceSpace> |
| using | ConstSPtr = std::shared_ptr<const MNESourceSpace> |
| 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 | |
| MNESourceSpace (int np=0) | |
| ~MNESourceSpace () override | |
| virtual MNESourceSpace::SPtr | clone () const |
| void | enable_all_sources () |
| int | is_left_hemi () const |
| qint32 | find_source_space_hemi () const |
| void | update_inuse (Eigen::VectorXi new_inuse) |
| int | transform_source_space (const FIFFLIB::FiffCoordTrans &t) |
| int | add_patch_stats () |
| void | rearrange_source_space () |
| 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 std::unique_ptr< MNESourceSpace > | create_source_space (int np) |
| static std::unique_ptr< MNESourceSpace > | load_surface (const QString &surf_file, const QString &curv_file) |
| static std::unique_ptr< MNESourceSpace > | load_surface_geom (const QString &surf_file, const QString &curv_file, int add_geometry, int check_too_many_neighbors) |
| static MNESourceSpace * | make_volume_source_space (const MNESurface &surf, float grid, float exclude, float mindist) |
| static int | filter_source_spaces (const MNESurface &surf, float limit, const FIFFLIB::FiffCoordTrans &mri_head_t, std::vector< std::unique_ptr< MNESourceSpace > > &spaces, QTextStream *filtered) |
| static void | filter_source_space (FilterThreadArg *arg) |
| static int | filter_source_spaces (float limit, const QString &bemfile, const FIFFLIB::FiffCoordTrans &mri_head_t, std::vector< std::unique_ptr< MNESourceSpace > > &spaces, QTextStream *filtered, bool use_threads) |
| static int | read_source_spaces (const QString &name, std::vector< std::unique_ptr< MNESourceSpace > > &spaces) |
| static int | transform_source_spaces_to (int coord_frame, const FIFFLIB::FiffCoordTrans &t, std::vector< std::unique_ptr< MNESourceSpace > > &spaces) |
| static int | restrict_sources_to_labels (std::vector< std::unique_ptr< MNESourceSpace > > &spaces, const QStringList &labels, int nlabel) |
| static int | read_label (const QString &label, Eigen::VectorXi &sel) |
| 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 source space.
Implements the MNE Source Space (Replaces typedef mneSurfaceOrVolume mneSourceSpace; struct of MNE-C mne_types.h).
Definition at line 76 of file mne_source_space.h.

| using MNELIB::MNESourceSpace::ConstSPtr = std::shared_ptr<const MNESourceSpace> |
Const shared pointer type for MNESourceSpace.
Definition at line 80 of file mne_source_space.h.
| using MNELIB::MNESourceSpace::SPtr = std::shared_ptr<MNESourceSpace> |
Shared pointer type for MNESourceSpace.
Definition at line 79 of file mne_source_space.h.
| MNESourceSpace::MNESourceSpace | ( | int | np = 0 | ) |
Constructs the MNE Source Space
Definition at line 889 of file mne_source_space.cpp.
|
override |
Destroys the MNE Source Space
Definition at line 938 of file mne_source_space.cpp.
| int MNESourceSpace::add_patch_stats | ( | ) |
Compute patch statistics (areas, normals, deviations).
Definition at line 1066 of file mne_source_space.cpp.
|
virtual |
Creates a deep copy of this source space, preserving the actual derived type.
Reimplemented in MNELIB::MNEHemisphere.
Definition at line 944 of file mne_source_space.cpp.
|
static |
Create a new source space with np vertices and all associated data initialized to defaults.
| [in] | np | Number of vertices. |
Definition at line 1168 of file mne_source_space.cpp.
| void MNESourceSpace::enable_all_sources | ( | ) |
Enable all source points (set inuse to TRUE, nuse = np).
Definition at line 972 of file mne_source_space.cpp.
|
static |
Definition at line 1676 of file mne_source_space.cpp.
|
static |
Definition at line 1585 of file mne_source_space.cpp.
|
static |
Definition at line 1752 of file mne_source_space.cpp.
| qint32 MNESourceSpace::find_source_space_hemi | ( | ) | const |
Returns the hemisphere id (FIFFV_MNE_SURF_LEFT_HEMI or FIFFV_MNE_SURF_RIGHT_HEMI) for this source space, based on the average x-coordinate of all vertices.
Definition at line 1001 of file mne_source_space.cpp.
| int MNESourceSpace::is_left_hemi | ( | ) | const |
Determine whether this source space is on the left hemisphere based on the average x-coordinate of all vertices.
Definition at line 983 of file mne_source_space.cpp.
|
static |
Load a FreeSurfer surface from disk, adding full geometry information.
| [in] | surf_file | Path to the FreeSurfer surface file. |
| [in] | curv_file | Path to the curvature file (may be empty). |
Definition at line 1215 of file mne_source_space.cpp.
|
static |
Load a FreeSurfer surface from disk, optionally adding geometry information.
| [in] | surf_file | Path to the FreeSurfer surface file. |
| [in] | curv_file | Path to the curvature file (may be empty). |
| [in] | add_geometry | Whether to compute full geometry info. |
| [in] | check_too_many_neighbors | Whether to error on excess neighbors. |
Definition at line 1223 of file mne_source_space.cpp.
|
static |
Create a volumetric source space by laying out a 3D grid of points within the bounding box of a surface, filtering out points that lie outside the surface or closer than mindist to the surface, and establishing 26-neighbor connectivity.
| [in] | surf | The bounding surface (e.g. inner skull). |
| [in] | grid | Grid spacing in meters. |
| [in] | exclude | Exclusion radius from the center of mass (m). |
| [in] | mindist | Minimum distance from the surface (m). |
Definition at line 1320 of file mne_source_space.cpp.
|
static |
Definition at line 2250 of file mne_source_space.cpp.
|
static |
Definition at line 1838 of file mne_source_space.cpp.
| void MNESourceSpace::rearrange_source_space | ( | ) |
Rearrange source space after filtering: recount nuse, rebuild vertno, and recompute patch statistics if nearest info is available.
Definition at line 1144 of file mne_source_space.cpp.
|
static |
Definition at line 2179 of file mne_source_space.cpp.
| int MNESourceSpace::transform_source_space | ( | const FIFFLIB::FiffCoordTrans & | t | ) |
Transform this source space into another coordinate frame.
| [in] | t | The coordinate transformation to apply. |
Definition at line 1040 of file mne_source_space.cpp.
|
static |
Definition at line 2137 of file mne_source_space.cpp.
| void MNESourceSpace::update_inuse | ( | Eigen::VectorXi | new_inuse | ) |
Update the active vertex (inuse) vector and recompute vertno.
| [in] | new_inuse | New in-use vector (size np). |
Definition at line 1012 of file mne_source_space.cpp.