This defines a source space.
More...
#include <mne_source_space.h>
|
| 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 std::unique_ptr< 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 QList< Eigen::VectorXi > | gradeToVertices (const QString &subjectsDir, const QString &subject, int grade) |
| static double | solid_angle (const Eigen::Vector3f &from, const MNELIB::MNETriangle &tri) |
| static void | compute_cm (const PointsT &rr, int np, float(&cm)[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 68 of file mne_source_space.h.
◆ ConstSPtr
◆ SPtr
◆ UPtr
◆ MNESourceSpace()
| MNESourceSpace::MNESourceSpace |
( |
int | np = 0 | ) |
|
Constructs the MNE Source Space
- Parameters
-
| [in] | np | Number of vertices; positions, normals and in-use flags are zero-initialized to this size. |
Definition at line 780 of file mne_source_space.cpp.
◆ ~MNESourceSpace()
| MNESourceSpace::~MNESourceSpace |
( |
| ) |
|
|
override |
◆ add_patch_stats()
| int MNESourceSpace::add_patch_stats |
( |
| ) |
|
Compute patch statistics (areas, normals, deviations).
- Returns
- OK on success, FAIL on error.
Definition at line 956 of file mne_source_space.cpp.
◆ clone()
◆ create_source_space()
| std::unique_ptr< MNESourceSpace > MNESourceSpace::create_source_space |
( |
int | np | ) |
|
|
static |
Create a new source space with np vertices and all associated data initialized to defaults.
- Parameters
-
| [in] | np | Number of vertices. |
- Returns
- Unique pointer to the newly allocated source space.
Definition at line 1057 of file mne_source_space.cpp.
◆ enable_all_sources()
| void MNESourceSpace::enable_all_sources |
( |
| ) |
|
◆ filter_source_space()
◆ filter_source_spaces() [1/2]
◆ filter_source_spaces() [2/2]
| int MNESourceSpace::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 |
◆ find_source_space_hemi()
| 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.
- Returns
- the deduced hemisphere id.
Definition at line 892 of file mne_source_space.cpp.
◆ gradeToVertices()
| QList< Eigen::VectorXi > MNESourceSpace::gradeToVertices |
( |
const QString & | subjectsDir, |
|
|
const QString & | subject, |
|
|
int | grade ) |
|
static |
Vertices of a subject's surfaces nearest to an icosahedron of the given grade (mne.grade_to_vertices), found on surf/lh.sphere.reg and surf/rh.sphere.reg.
- Parameters
-
| [in] | subjectsDir | The FreeSurfer subjects directory. |
| [in] | subject | The subject. |
| [in] | grade | Icosahedral subdivision grade. |
- Returns
- Sorted vertex numbers for lh and rh, or an empty list if a sphere cannot be read or the grade maps two icosahedron vertices onto the same surface vertex.
Definition at line 2351 of file mne_source_space.cpp.
◆ icoDownsample()
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.
- Parameters
-
| [in] | hemi | The hemisphere to downsample. |
| [in] | icoGrade | Icosahedral subdivision grade (0-7). |
- Returns
- A new MNEHemisphere with the downsampled vertex selection.
- Since
- 2.2.0
Definition at line 2378 of file mne_source_space.cpp.
◆ is_left_hemi()
| 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.
- Returns
- true if left hemisphere, false otherwise.
Definition at line 874 of file mne_source_space.cpp.
◆ load_surface()
| std::unique_ptr< MNESourceSpace > MNESourceSpace::load_surface |
( |
const QString & | surf_file, |
|
|
const QString & | curv_file ) |
|
static |
Load a FreeSurfer surface from disk, adding full geometry information.
- Parameters
-
| [in] | surf_file | Path to the FreeSurfer surface file. |
| [in] | curv_file | Path to the curvature file (may be empty). |
- Returns
- Unique pointer to the loaded source space, or nullptr on error.
Definition at line 1104 of file mne_source_space.cpp.
◆ load_surface_geom()
| std::unique_ptr< MNESourceSpace > MNESourceSpace::load_surface_geom |
( |
const QString & | surf_file, |
|
|
const QString & | curv_file, |
|
|
bool | add_geometry, |
|
|
bool | check_too_many_neighbors ) |
|
static |
Load a FreeSurfer surface from disk, optionally adding geometry information.
- Parameters
-
| [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. |
- Returns
- Unique pointer to the loaded source space, or nullptr on error.
Definition at line 1112 of file mne_source_space.cpp.
◆ make_volume_source_space()
| std::unique_ptr< MNESourceSpace > MNESourceSpace::make_volume_source_space |
( |
const MNESurface & | surf, |
|
|
float | grid, |
|
|
float | exclude, |
|
|
float | mindist ) |
|
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.
- Parameters
-
| [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). |
- Returns
- A new volumetric source space, or nullptr on failure.
Definition at line 1188 of file mne_source_space.cpp.
◆ read_label()
| int MNESourceSpace::read_label |
( |
const QString & | label, |
|
|
Eigen::VectorXi & | sel ) |
|
static |
◆ read_source_spaces()
| int MNESourceSpace::read_source_spaces |
( |
const QString & | name, |
|
|
std::vector< std::unique_ptr< MNESourceSpace > > & | spaces ) |
|
static |
◆ rearrange_source_space()
| 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 1034 of file mne_source_space.cpp.
◆ restrict_sources_to_labels()
| int MNESourceSpace::restrict_sources_to_labels |
( |
std::vector< std::unique_ptr< MNESourceSpace > > & | spaces, |
|
|
const QStringList & | labels, |
|
|
int | nlabel ) |
|
static |
◆ transform_source_space()
Transform this source space into another coordinate frame.
- Parameters
-
| [in] | t | The coordinate transformation to apply. |
- Returns
- OK on success, FAIL on error.
Definition at line 930 of file mne_source_space.cpp.
◆ transform_source_spaces_to()
◆ update_inuse()
| void MNESourceSpace::update_inuse |
( |
Eigen::VectorXi | new_inuse | ) |
|
Update the active vertex (inuse) vector and recompute vertno.
- Parameters
-
| [in] | new_inuse | New in-use vector (size np). |
Definition at line 903 of file mne_source_space.cpp.
◆ writeToStream()
Write this source space to a FIFF stream.
- Parameters
-
| [in] | stream | The FIFF output stream. |
| [in] | selected_only | If true, write only the vertices that are in use. |
- Returns
- FIFF_OK on success, FIFF_FAIL on error.
Definition at line 2192 of file mne_source_space.cpp.
The documentation for this class was generated from the following files: