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

The MNE Msh Display Surface class holds information about a surface to be rendered. More...

#include <mne_msh_display_surface.h>

Public Types

typedef QSharedPointer< MNEMshDisplaySurfaceSPtr
typedef QSharedPointer< const MNEMshDisplaySurfaceConstSPtr
Public Types inherited from MNELIB::MNESurface
typedef std::shared_ptr< MNESurfaceSPtr
typedef std::shared_ptr< const MNESurfaceConstSPtr
Public Types inherited from MNELIB::MNESurfaceOrVolume
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

 MNEMshDisplaySurface ()
 ~MNEMshDisplaySurface ()
int align_fiducials (FIFFLIB::FiffDigitizerData &head_dig, const FIFFLIB::FiffDigitizerData &mri_dig, int niter, int scale_head, float omit_dist, Eigen::Vector3f &scales)
void get_head_scale (FIFFLIB::FiffDigitizerData &dig, const Eigen::Matrix< float, 3, 3, Eigen::RowMajor > &mri_fid, Eigen::Vector3f &scales)
int discard_outlier_digitizer_points (FIFFLIB::FiffDigitizerData &d, float maxdist) const
void calculate_digitizer_distances (FIFFLIB::FiffDigitizerData &dig, int do_all, int do_approx) const
int iterate_alignment_once (FIFFLIB::FiffDigitizerData &dig, int nasion_weight, const std::optional< Eigen::Vector3f > &nasion_mri, int last_step) const
float rms_digitizer_distance (FIFFLIB::FiffDigitizerData &dig) const
void scale (const Eigen::Vector3f &scales)
void decide_surface_extent (const QString &tag)
void decide_curv_display (const QString &name)
void setup_curvature_colors ()
Public Member Functions inherited from MNELIB::MNESurface
 MNESurface ()
 ~MNESurface ()
double sum_solids (const Eigen::Vector3f &from) const
void triangle_coords (const Eigen::Vector3f &r, int tri, float &x, float &y, float &z) const
int nearest_triangle_point (const Eigen::Vector3f &r, const MNEProjData *user, int tri, float &x, float &y, float &z) const
int nearest_triangle_point (const Eigen::Vector3f &r, int tri, float &x, float &y, float &z) const
Eigen::Vector3f project_to_triangle (int tri, float p, float q) const
Eigen::Vector3f project_to_triangle (int best, const Eigen::Vector3f &r) const
int project_to_surface (const MNEProjData *proj_data, const Eigen::Vector3f &r, float &distp) const
void find_closest_on_surface_approx (const PointsT &r, int np, Eigen::VectorXi &nearest_tri, Eigen::VectorXf &dist, int nstep) const
void decide_search_restriction (MNEProjData &p, int approx_best, int nstep, const Eigen::Vector3f &r) const
void activate_neighbors (int start, Eigen::VectorXi &act, int nstep) const
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
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)

Public Attributes

QString filename
time_t time_loaded = 0
QString subj
QString surf_name
Eigen::Vector3f eye {1.0f, 0.0f, 0.0f}
Eigen::Vector3f up {0.0f, 0.0f, 1.0f}
Eigen::Vector3f rot = Eigen::Vector3f::Zero()
Eigen::Vector3f move = Eigen::Vector3f::Zero()
float fov = 2.0f
float fov_scale = 1.0f
Eigen::Vector3f minv = Eigen::Vector3f::Constant(-1.0f)
Eigen::Vector3f maxv = Eigen::Vector3f::Constant(1.0f)
Eigen::Matrix4f trans = Eigen::Matrix4f::Identity()
int sketch = 0
std::vector< std::unique_ptr< MNELIB::MNEMorphMap > > maps
int overlay_type = 0
Eigen::VectorXf overlay_values
int alt_overlay_type = 0
Eigen::VectorXf alt_overlay_values
Eigen::VectorXf marker_values
Eigen::VectorXf vertex_colors
std::unique_ptr< MNELIB::MNEMshColorScaleDefcolor_scale
int nvertex_colors = 3
Eigen::Vector4f even_vertex_color = Eigen::Vector4f::Zero()
Eigen::VectorXf marker_colors
int nmarker_colors = 3
Eigen::MatrixXi marker_tri
Eigen::VectorXi marker_tri_no
int nmarker_tri = 0
Eigen::Vector4f marker_color = Eigen::Vector4f::Zero()
int curvature_color_mode = 0
int overlay_color_mode = 0
int transparent = 0
int show_aux_data = 0
std::vector< MNELIB::MNEMshPickedpicked
void * user_data = nullptr
mneUserFreeFunc user_data_free = nullptr
Public Attributes inherited from MNELIB::MNESurfaceOrVolume
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]

Additional Inherited Members

Static Public Member Functions inherited from MNELIB::MNESurface
static MNESurfaceread_bem_surface (const QString &name, int which, int add_geometry, float *sigmap)
static MNESurfaceread_bem_surface2 (const QString &name, int which, int add_geometry, float *sigmap)
static MNESurfaceread_bem_surface (const QString &name, int which, int add_geometry, float *sigmap, bool check_too_many_neighbors)
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])

Detailed Description

The MNE Msh Display Surface class holds information about a surface to be rendered.

Replaces *mshDisplaySurface, mshDisplaySurfaceRec struct (analyze_types.c).

Definition at line 95 of file mne_msh_display_surface.h.

Inheritance diagram for MNELIB::MNEMshDisplaySurface:
Inheritance graph

Member Typedef Documentation

◆ ConstSPtr

Const shared pointer type for MNEMshDisplaySurface.

Definition at line 99 of file mne_msh_display_surface.h.

◆ SPtr

Shared pointer type for MNEMshDisplaySurface.

Definition at line 98 of file mne_msh_display_surface.h.

Constructor & Destructor Documentation

◆ MNEMshDisplaySurface()

MNEMshDisplaySurface::MNEMshDisplaySurface ( )
default

Constructs the MNEMshDisplaySurface.

◆ ~MNEMshDisplaySurface()

MNEMshDisplaySurface::~MNEMshDisplaySurface ( )

Destroys the MNEMshDisplaySurface.

Definition at line 173 of file mne_msh_display_surface.cpp.

Member Function Documentation

◆ align_fiducials()

int MNEMshDisplaySurface::align_fiducials ( FIFFLIB::FiffDigitizerData & head_dig,
const FIFFLIB::FiffDigitizerData & mri_dig,
int niter,
int scale_head,
float omit_dist,
Eigen::Vector3f & scales )

Align MEG and MRI coordinate systems using fiducial points and ICP.

Parameters
[in,out]head_digMEG digitizer data (transformed in-place).
[in]mri_digMRI digitizer data with fiducial locations.
[in]head_surfThe scalp surface used for ICP.
[in]niterNumber of ICP iterations.
[in]scale_headIf non-zero, scale the head surface to match digitizer.
[in]omit_distDiscard digitizer points farther than this from the surface (m).
[out]scalesIf non-null, receives the per-axis scale factors applied.
Returns
OK on success, FAIL on error.

Definition at line 183 of file mne_msh_display_surface.cpp.

◆ calculate_digitizer_distances()

void MNEMshDisplaySurface::calculate_digitizer_distances ( FIFFLIB::FiffDigitizerData & dig,
int do_all,
int do_approx ) const

Compute the distance from each active digitizer point to the head surface.

Definition at line 376 of file mne_msh_display_surface.cpp.

◆ decide_curv_display()

void MNEMshDisplaySurface::decide_curv_display ( const QString & name)

Set the curvature display mode based on a surface type name. Inflated, sphere, and white surfaces use overlay mode; others use none.

Parameters
[in]nameSurface type name.

Definition at line 612 of file mne_msh_display_surface.cpp.

◆ decide_surface_extent()

void MNEMshDisplaySurface::decide_surface_extent ( const QString & tag)

Compute and store the axis-aligned bounding box and field-of-view radius by iterating all vertex positions.

Parameters
[in]tagSurface name tag (used for debug logging).

Definition at line 585 of file mne_msh_display_surface.cpp.

◆ discard_outlier_digitizer_points()

int MNEMshDisplaySurface::discard_outlier_digitizer_points ( FIFFLIB::FiffDigitizerData & d,
float maxdist ) const

Mark digitizer points whose distance to the head surface exceeds maxdist.

Definition at line 346 of file mne_msh_display_surface.cpp.

◆ get_head_scale()

void MNEMshDisplaySurface::get_head_scale ( FIFFLIB::FiffDigitizerData & dig,
const Eigen::Matrix< float, 3, 3, Eigen::RowMajor > & mri_fid,
Eigen::Vector3f & scales )

Compute a uniform head scale factor by fitting spheres.

Definition at line 284 of file mne_msh_display_surface.cpp.

◆ iterate_alignment_once()

int MNEMshDisplaySurface::iterate_alignment_once ( FIFFLIB::FiffDigitizerData & dig,
int nasion_weight,
const std::optional< Eigen::Vector3f > & nasion_mri,
int last_step ) const

Perform one iteration of ICP-like alignment.

Definition at line 461 of file mne_msh_display_surface.cpp.

◆ rms_digitizer_distance()

float MNEMshDisplaySurface::rms_digitizer_distance ( FIFFLIB::FiffDigitizerData & dig) const

Compute the RMS distance from active digitizer points to the head surface.

Definition at line 547 of file mne_msh_display_surface.cpp.

◆ scale()

void MNEMshDisplaySurface::scale ( const Eigen::Vector3f & scales)

Scale a display surface's bounding box and all vertex positions.

Definition at line 566 of file mne_msh_display_surface.cpp.

◆ setup_curvature_colors()

void MNEMshDisplaySurface::setup_curvature_colors ( )

Allocate and fill per-vertex color arrays using positive/negative curvature colors (if curvature overlay mode is on) or uniform gray.

Definition at line 623 of file mne_msh_display_surface.cpp.

Member Data Documentation

◆ alt_overlay_type

int MNELIB::MNEMshDisplaySurface::alt_overlay_type = 0

Alternative overlay type identifier.

Definition at line 134 of file mne_msh_display_surface.h.

◆ alt_overlay_values

Eigen::VectorXf MNELIB::MNEMshDisplaySurface::alt_overlay_values

Per-vertex alternative overlay values.

Definition at line 135 of file mne_msh_display_surface.h.

◆ color_scale

std::unique_ptr<MNELIB::MNEMshColorScaleDef> MNELIB::MNEMshDisplaySurface::color_scale

Color scale used to compute vertex colors.

Definition at line 139 of file mne_msh_display_surface.h.

◆ curvature_color_mode

int MNELIB::MNEMshDisplaySurface::curvature_color_mode = 0

How curvature is visualized.

Definition at line 149 of file mne_msh_display_surface.h.

◆ even_vertex_color

Eigen::Vector4f MNELIB::MNEMshDisplaySurface::even_vertex_color = Eigen::Vector4f::Zero()

Uniform RGBA color for non-data-driven coloring.

Definition at line 141 of file mne_msh_display_surface.h.

◆ eye

Eigen::Vector3f MNELIB::MNEMshDisplaySurface::eye {1.0f, 0.0f, 0.0f}

Eye position for 3D viewing.

Definition at line 118 of file mne_msh_display_surface.h.

◆ filename

QString MNELIB::MNEMshDisplaySurface::filename

Path to the file this surface was loaded from.

Definition at line 114 of file mne_msh_display_surface.h.

◆ fov

float MNELIB::MNEMshDisplaySurface::fov = 2.0f

Field of view (extent of the surface).

Definition at line 123 of file mne_msh_display_surface.h.

◆ fov_scale

float MNELIB::MNEMshDisplaySurface::fov_scale = 1.0f

Scale factor for extra space around FOV.

Definition at line 124 of file mne_msh_display_surface.h.

◆ maps

std::vector<std::unique_ptr<MNELIB::MNEMorphMap> > MNELIB::MNEMshDisplaySurface::maps

Morphing maps from other surfaces to this one.

Definition at line 130 of file mne_msh_display_surface.h.

◆ marker_color

Eigen::Vector4f MNELIB::MNEMshDisplaySurface::marker_color = Eigen::Vector4f::Zero()

RGBA color for markers.

Definition at line 148 of file mne_msh_display_surface.h.

◆ marker_colors

Eigen::VectorXf MNELIB::MNEMshDisplaySurface::marker_colors

Per-vertex marker color array.

Definition at line 143 of file mne_msh_display_surface.h.

◆ marker_tri

Eigen::MatrixXi MNELIB::MNEMshDisplaySurface::marker_tri

Array of triangles containing markers.

Definition at line 145 of file mne_msh_display_surface.h.

◆ marker_tri_no

Eigen::VectorXi MNELIB::MNEMshDisplaySurface::marker_tri_no

Triangle indices of the marker triangles.

Definition at line 146 of file mne_msh_display_surface.h.

◆ marker_values

Eigen::VectorXf MNELIB::MNEMshDisplaySurface::marker_values

Per-vertex marker values (shown in shades of marker color).

Definition at line 136 of file mne_msh_display_surface.h.

◆ maxv

Eigen::Vector3f MNELIB::MNEMshDisplaySurface::maxv = Eigen::Vector3f::Constant(1.0f)

Maximum values along the three coordinate axes.

Definition at line 126 of file mne_msh_display_surface.h.

◆ minv

Eigen::Vector3f MNELIB::MNEMshDisplaySurface::minv = Eigen::Vector3f::Constant(-1.0f)

Minimum values along the three coordinate axes.

Definition at line 125 of file mne_msh_display_surface.h.

◆ move

Eigen::Vector3f MNELIB::MNEMshDisplaySurface::move = Eigen::Vector3f::Zero()

Translation offset for the origin.

Definition at line 121 of file mne_msh_display_surface.h.

◆ nmarker_colors

int MNELIB::MNEMshDisplaySurface::nmarker_colors = 3

Number of color components per marker vertex.

Definition at line 144 of file mne_msh_display_surface.h.

◆ nmarker_tri

int MNELIB::MNEMshDisplaySurface::nmarker_tri = 0

Number of marker triangles.

Definition at line 147 of file mne_msh_display_surface.h.

◆ nvertex_colors

int MNELIB::MNEMshDisplaySurface::nvertex_colors = 3

Number of color components per vertex.

Definition at line 140 of file mne_msh_display_surface.h.

◆ overlay_color_mode

int MNELIB::MNEMshDisplaySurface::overlay_color_mode = 0

How overlay data affects coloring.

Definition at line 151 of file mne_msh_display_surface.h.

◆ overlay_type

int MNELIB::MNEMshDisplaySurface::overlay_type = 0

Type identifier for the overlay values.

Definition at line 132 of file mne_msh_display_surface.h.

◆ overlay_values

Eigen::VectorXf MNELIB::MNEMshDisplaySurface::overlay_values

Per-vertex overlay value array.

Definition at line 133 of file mne_msh_display_surface.h.

◆ picked

std::vector<MNELIB::MNEMshPicked> MNELIB::MNEMshDisplaySurface::picked

Picked locations in world coordinates.

Definition at line 156 of file mne_msh_display_surface.h.

◆ rot

Eigen::Vector3f MNELIB::MNEMshDisplaySurface::rot = Eigen::Vector3f::Zero()

Rotation angles of the MRI (in radians).

Definition at line 120 of file mne_msh_display_surface.h.

◆ show_aux_data

int MNELIB::MNEMshDisplaySurface::show_aux_data = 0

Non-zero to show auxiliary data related to this surface.

Definition at line 154 of file mne_msh_display_surface.h.

◆ sketch

int MNELIB::MNEMshDisplaySurface::sketch = 0

Non-zero to use sketch mode with decimated triangulation.

Definition at line 128 of file mne_msh_display_surface.h.

◆ subj

QString MNELIB::MNEMshDisplaySurface::subj

Subject name in SUBJECTS_DIR.

Definition at line 116 of file mne_msh_display_surface.h.

◆ surf_name

QString MNELIB::MNEMshDisplaySurface::surf_name

Name of the surface (e.g., "inflated", "white").

Definition at line 117 of file mne_msh_display_surface.h.

◆ time_loaded

time_t MNELIB::MNEMshDisplaySurface::time_loaded = 0

Timestamp when the surface was loaded.

Definition at line 115 of file mne_msh_display_surface.h.

◆ trans

Eigen::Matrix4f MNELIB::MNEMshDisplaySurface::trans = Eigen::Matrix4f::Identity()

Extra 4x4 transformation matrix for this surface.

Definition at line 127 of file mne_msh_display_surface.h.

◆ transparent

int MNELIB::MNEMshDisplaySurface::transparent = 0

Non-zero if this surface is rendered transparently.

Definition at line 152 of file mne_msh_display_surface.h.

◆ up

Eigen::Vector3f MNELIB::MNEMshDisplaySurface::up {0.0f, 0.0f, 1.0f}

Up vector for 3D viewing.

Definition at line 119 of file mne_msh_display_surface.h.

◆ user_data

void* MNELIB::MNEMshDisplaySurface::user_data = nullptr

Arbitrary user-defined data pointer.

Definition at line 158 of file mne_msh_display_surface.h.

◆ user_data_free

mneUserFreeFunc MNELIB::MNEMshDisplaySurface::user_data_free = nullptr

Function to free user_data.

Definition at line 159 of file mne_msh_display_surface.h.

◆ vertex_colors

Eigen::VectorXf MNELIB::MNEMshDisplaySurface::vertex_colors

Per-vertex RGBA color array.

Definition at line 138 of file mne_msh_display_surface.h.


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