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> |
| using | UPtr = std::unique_ptr<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 () |
| bool | 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 () |
| int | writeToStream (FIFFLIB::FiffStream::SPtr &stream, bool selected_only) const |
| Public Member Functions inherited from MNELIB::MNESurfaceOrVolume | |
| MNESurfaceOrVolume () | |
| Constructs the MNE FsSurface or Volume. | |
| virtual | ~MNESurfaceOrVolume () |
| Destroys the MNE FsSurface 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 (bool do_normals, bool check_too_many_neighbors) |
| int | add_geometry_info (bool do_normals) |
| int | add_geometry_info2 (bool do_normals) |
| Eigen::VectorXi | nearestVertIdx () const |
| Eigen::VectorXd | nearestDistVec () const |
| void | setNearestData (const Eigen::VectorXi &nearestIdx, const Eigen::VectorXd &nearestDist) |
| Eigen::Map< const Eigen::Vector3f > | point (int k) const |
| Eigen::Map< Eigen::Vector3f > | point (int k) |
| Eigen::Map< const Eigen::Vector3f > | normal (int k) const |
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, bool add_geometry, bool 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 MNEHemisphere | icoDownsample (const MNEHemisphere &hemi, int icoGrade) |
| 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 64 of file mne_source_space.h.

| using MNELIB::MNESourceSpace::ConstSPtr = std::shared_ptr<const MNESourceSpace> |
Const shared pointer type for MNESourceSpace.
Definition at line 68 of file mne_source_space.h.
| using MNELIB::MNESourceSpace::SPtr = std::shared_ptr<MNESourceSpace> |
Shared pointer type for MNESourceSpace.
Definition at line 67 of file mne_source_space.h.
| using MNELIB::MNESourceSpace::UPtr = std::unique_ptr<MNESourceSpace> |
Unique pointer type for MNESourceSpace.
Definition at line 69 of file mne_source_space.h.
| MNESourceSpace::MNESourceSpace | ( | int | np = 0 | ) |
Constructs the MNE Source Space
Definition at line 764 of file mne_source_space.cpp.
|
override |
Destroys the MNE Source Space
Definition at line 813 of file mne_source_space.cpp.
| int MNESourceSpace::add_patch_stats | ( | ) |
Compute patch statistics (areas, normals, deviations).
Definition at line 941 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 819 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 1043 of file mne_source_space.cpp.
| void MNESourceSpace::enable_all_sources | ( | ) |
Enable all source points (set inuse to TRUE, nuse = np).
Definition at line 847 of file mne_source_space.cpp.
|
static |
Definition at line 1505 of file mne_source_space.cpp.
|
static |
Definition at line 1415 of file mne_source_space.cpp.
|
static |
Definition at line 1580 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 876 of file mne_source_space.cpp.
|
static |
Downsample a hemisphere source space to an icosahedral subdivision of the given grade.
For each vertex of the icosahedron at the requested grade, the nearest vertex in the hemisphere is found and marked as in-use.
| [in] | hemi | The hemisphere to downsample. |
| [in] | icoGrade | Icosahedral subdivision grade (0-7). |
Definition at line 2363 of file mne_source_space.cpp.
| bool 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 858 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 1090 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 1098 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 1178 of file mne_source_space.cpp.
|
static |
Definition at line 2059 of file mne_source_space.cpp.
|
static |
Definition at line 1663 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 1019 of file mne_source_space.cpp.
|
static |
Definition at line 1992 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 915 of file mne_source_space.cpp.
|
static |
Definition at line 1950 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 887 of file mne_source_space.cpp.
| int MNESourceSpace::writeToStream | ( | FIFFLIB::FiffStream::SPtr & | stream, |
| bool | selected_only ) const |
Write this source space to a FIFF stream.
| [in] | stream | The FIFF output stream. |
| [in] | selected_only | If true, write only the vertices that are in use. |
Definition at line 2198 of file mne_source_space.cpp.