v2.0.0
Loading...
Searching...
No Matches
mne_msh_display_surface.h
Go to the documentation of this file.
1//=============================================================================================================
18
19#ifndef MNEMSHDISPLAYSURFACE_H
20#define MNEMSHDISPLAYSURFACE_H
21
22//=============================================================================================================
23// INCLUDES
24//=============================================================================================================
25
26#include "mne_global.h"
27#include "mne_types.h"
28#include "mne_surface.h"
29
30//=============================================================================================================
31// EIGEN INCLUDES
32//=============================================================================================================
33
34#include <Eigen/Core>
35
36//=============================================================================================================
37// QT INCLUDES
38//=============================================================================================================
39
40#include <QSharedPointer>
41#include <QString>
42
43//=============================================================================================================
44// STL INCLUDES
45//=============================================================================================================
46
47#include <memory>
48#include <vector>
49
50//=============================================================================================================
51// DEFINE NAMESPACE MNELIB
52//=============================================================================================================
53
54namespace MNELIB
55{
56
57//=============================================================================================================
58// FORWARD DECLARATIONS
59//=============================================================================================================
60
61class MNEMorphMap;
62class MNEMshPicked;
64
65} // NAMESPACE MNELIB
66
67namespace FIFFLIB
68{
70}
71
72namespace MNELIB
73{
74
75//=============================================================================================================
84{
85public:
86 typedef QSharedPointer<MNEMshDisplaySurface> SPtr;
87 typedef QSharedPointer<const MNEMshDisplaySurface> ConstSPtr;
88
89 //=========================================================================================================
94
95 //=========================================================================================================
100
101public:
102 QString filename;
103 time_t time_loaded = 0;
104 QString subj;
105 QString surf_name;
106 Eigen::Vector3f eye{1.0f, 0.0f, 0.0f};
107 Eigen::Vector3f up{0.0f, 0.0f, 1.0f};
108 Eigen::Vector3f rot = Eigen::Vector3f::Zero();
109 Eigen::Vector3f move = Eigen::Vector3f::Zero();
110
111 float fov = 2.0f;
112 float fov_scale = 1.0f;
113 Eigen::Vector3f minv = Eigen::Vector3f::Constant(-1.0f);
114 Eigen::Vector3f maxv = Eigen::Vector3f::Constant(1.0f);
115 Eigen::Matrix4f trans = Eigen::Matrix4f::Identity();
116 bool sketch = false;
117
118 std::vector<std::unique_ptr<MNELIB::MNEMorphMap>> maps;
119
120 int overlay_type = 0;
121 Eigen::VectorXf overlay_values;
123 Eigen::VectorXf alt_overlay_values;
124 Eigen::VectorXf marker_values;
125
126 Eigen::VectorXf vertex_colors;
127 std::unique_ptr<MNELIB::MNEMshColorScaleDef> color_scale;
129 Eigen::Vector4f even_vertex_color = Eigen::Vector4f::Zero();
130
131 Eigen::VectorXf marker_colors;
133 Eigen::MatrixXi marker_tri;
134 Eigen::VectorXi marker_tri_no;
135 int nmarker_tri = 0;
136 Eigen::Vector4f marker_color = Eigen::Vector4f::Zero();
138
140 bool transparent = false;
141
142 bool show_aux_data = false;
143
144 std::vector<MNELIB::MNEMshPicked> picked;
145
146 void* user_data = nullptr;
148
149 //=========================================================================================================
150 // Alignment functions (moved from MNESurfaceOrVolume)
151 //=========================================================================================================
152
166 const FIFFLIB::FiffDigitizerData& mri_dig,
167 int niter,
168 int scale_head,
169 float omit_dist,
170 Eigen::Vector3f& scales);
171
180 const Eigen::Matrix<float, 3, 3, Eigen::RowMajor>& mri_fid,
181 Eigen::Vector3f& scales);
182
192 float maxdist) const;
193
202 bool do_all, bool do_approx) const;
203
215 int nasion_weight,
216 const std::optional<Eigen::Vector3f>& nasion_mri,
217 int last_step) const;
218
227
233 void scale(const Eigen::Vector3f& scales);
234
241 void decide_surface_extent(const QString& tag);
242
249 void decide_curv_display(const QString& name);
250
256
257 // ### OLD STRUCT ###
258 // typedef struct { /* Display surface properties */
259 // char *filename; /* Where did this surface come from? */
260 // time_t time_loaded; /* When was the surface loaded */
261 // char *subj; /* The name of the subject in SUBJECTS_DIR */
262 // char *surf_name; /* The name of the surface */
263 // MNELIB::MNESurface* s; /* This is the surface */
264 // float eye[3]; /* Eye position for viewing */
265 // float up[3]; /* Up vector for viewing */
266 // float rot[3]; /* Rotation angles of the MRI (in radians) */
267 // float move[3]; /* Possibly move the origin, too */
268
269 // float fov; /* Field of view (extent of the surface) */
270 // float fov_scale; /* How much space to leave */
271 // float minv[3]; /* Minimum values along the three coordinate axes */
272 // float maxv[3]; /* Maximum values along the three coordinate axes */
273 // float *trans; /* Extra transformation for this surface */
274 // int sketch; /* Use sketch mode if decimated triangulation is available? */
275
276 // morphMap *maps; /* Morphing maps from other surfaces to this */
277 // int nmap; /* Normally just one */
278
279 // int overlay_type; /* What are the overlay values? */
280 // float *overlay_values; /* Overlay value array */
281 // int alt_overlay_type; /* A second choice for overlay */
282 // float *alt_overlay_values;
283 // float *marker_values; /* Marker values (will be shown in shades of marker color) */
284
285 // float *vertex_colors; /* Vertex color array */
286 // mshColorScaleDef* color_scale; /* Color scale used to define these colors */
287 // int nvertex_colors; /* How many components? */
288 // float even_vertex_color[4]; /* This is going to be employed in case of uniform coloring */
289
290 // float *marker_colors; /* Vertex color array (for the markers) */
291 // int nmarker_colors; /* How many components? */
292 // int **marker_tri; /* Triangles containing markers */
293 // int *marker_tri_no; /* Numbers of the marker triangles */
294 // int nmarker_tri; /* How many */
295 // float marker_color[4]; /* Marker color */
296 // int curvature_color_mode; /* How to show curvature */
297
298 // int overlay_color_mode; /* How to show overlay data */
299 // int transparent; /* Is this surface going to be transparent? */
300
301 // int show_aux_data; /* Show auxilliary data related to this surface */
302
303 // mshPicked* picked; /* Picked locations in world coordinates */
304 // int npicked; /* How many */
305
306 // void *user_data; /* Can be used to store whatever */
307 // mneUserFreeFunc* user_data_free; /* Function to free the above */
308 // } *mshDisplaySurface,mshDisplaySurfaceRec;
309};
310
311//=============================================================================================================
312// INLINE DEFINITIONS
313//=============================================================================================================
314} // NAMESPACE MNELIB
315
316#endif // MNEMSHDISPLAYSURFACE_H
Legacy MNE-C constants and shared typedefs used across MNELIB structures.
Lightweight triangulated surface (vertices, triangles, normals) used by surface-based routines.
MNELIB shared-library export/import macros and library build metadata.
#define MNESHARED_EXPORT
Definition mne_global.h:40
Core MNE data structures (source spaces, source estimates, hemispheres).
void(* mneUserFreeFunc)(void *)
Generic destructor callback for user-attached data.
Definition mne_types.h:69
FIFF file I/O, in-memory data structures and high-level readers/writers.
Registration-ready digitization data: dig points, device→head transform and HPI fit metadata.
Morph map of one hemisphere from one subject to another.
Color scale definition with value range and color mapping for surface visualization.
void get_head_scale(FIFFLIB::FiffDigitizerData &dig, const Eigen::Matrix< float, 3, 3, Eigen::RowMajor > &mri_fid, Eigen::Vector3f &scales)
float rms_digitizer_distance(FIFFLIB::FiffDigitizerData &dig) const
void decide_surface_extent(const QString &tag)
void scale(const Eigen::Vector3f &scales)
std::unique_ptr< MNELIB::MNEMshColorScaleDef > color_scale
void calculate_digitizer_distances(FIFFLIB::FiffDigitizerData &dig, bool do_all, bool do_approx) const
std::vector< MNELIB::MNEMshPicked > picked
QSharedPointer< const MNEMshDisplaySurface > ConstSPtr
QSharedPointer< MNEMshDisplaySurface > SPtr
int align_fiducials(FIFFLIB::FiffDigitizerData &head_dig, const FIFFLIB::FiffDigitizerData &mri_dig, int niter, int scale_head, float omit_dist, Eigen::Vector3f &scales)
int discard_outlier_digitizer_points(FIFFLIB::FiffDigitizerData &d, float maxdist) const
std::vector< std::unique_ptr< MNELIB::MNEMorphMap > > maps
int iterate_alignment_once(FIFFLIB::FiffDigitizerData &dig, int nasion_weight, const std::optional< Eigen::Vector3f > &nasion_mri, int last_step) const
void decide_curv_display(const QString &name)
Picked point on a displayed surface storing vertex index, coordinates, and source value.