v2.0.0
Loading...
Searching...
No Matches
mne_msh_display_surface.h
Go to the documentation of this file.
1//=============================================================================================================
35
36#ifndef MNEMSHDISPLAYSURFACE_H
37#define MNEMSHDISPLAYSURFACE_H
38
39//=============================================================================================================
40// INCLUDES
41//=============================================================================================================
42
43#include "mne_global.h"
44#include "mne_types.h"
45#include "mne_surface.h"
46
47//=============================================================================================================
48// EIGEN INCLUDES
49//=============================================================================================================
50
51#include <Eigen/Core>
52
53//=============================================================================================================
54// QT INCLUDES
55//=============================================================================================================
56
57#include <QSharedPointer>
58#include <QString>
59
60//=============================================================================================================
61// STL INCLUDES
62//=============================================================================================================
63
64#include <memory>
65#include <vector>
66
67//=============================================================================================================
68// DEFINE NAMESPACE MNELIB
69//=============================================================================================================
70
71namespace MNELIB
72{
73
74//=============================================================================================================
75// FORWARD DECLARATIONS
76//=============================================================================================================
77
78class MNEMorphMap;
79class MNEMshPicked;
81
82} // NAMESPACE MNELIB
83
84namespace FIFFLIB { class FiffDigitizerData; }
85
86namespace MNELIB
87{
88
89//=============================================================================================================
96{
97public:
98 typedef QSharedPointer<MNEMshDisplaySurface> SPtr;
99 typedef QSharedPointer<const MNEMshDisplaySurface> ConstSPtr;
100
101 //=========================================================================================================
106
107 //=========================================================================================================
112
113public:
114 QString filename;
115 time_t time_loaded = 0;
116 QString subj;
117 QString surf_name;
118 Eigen::Vector3f eye{1.0f, 0.0f, 0.0f};
119 Eigen::Vector3f up{0.0f, 0.0f, 1.0f};
120 Eigen::Vector3f rot = Eigen::Vector3f::Zero();
121 Eigen::Vector3f move = Eigen::Vector3f::Zero();
122
123 float fov = 2.0f;
124 float fov_scale = 1.0f;
125 Eigen::Vector3f minv = Eigen::Vector3f::Constant(-1.0f);
126 Eigen::Vector3f maxv = Eigen::Vector3f::Constant(1.0f);
127 Eigen::Matrix4f trans = Eigen::Matrix4f::Identity();
128 int sketch = 0;
129
130 std::vector<std::unique_ptr<MNELIB::MNEMorphMap>> maps;
131
132 int overlay_type = 0;
133 Eigen::VectorXf overlay_values;
135 Eigen::VectorXf alt_overlay_values;
136 Eigen::VectorXf marker_values;
137
138 Eigen::VectorXf vertex_colors;
139 std::unique_ptr<MNELIB::MNEMshColorScaleDef> color_scale;
141 Eigen::Vector4f even_vertex_color = Eigen::Vector4f::Zero();
142
143 Eigen::VectorXf marker_colors;
145 Eigen::MatrixXi marker_tri;
146 Eigen::VectorXi marker_tri_no;
147 int nmarker_tri = 0;
148 Eigen::Vector4f marker_color = Eigen::Vector4f::Zero();
150
152 int transparent = 0;
153
155
156 std::vector<MNELIB::MNEMshPicked> picked;
157
158 void *user_data = nullptr;
160
161 //=========================================================================================================
162 // Alignment functions (moved from MNESurfaceOrVolume)
163 //=========================================================================================================
164
179 const FIFFLIB::FiffDigitizerData& mri_dig,
180 int niter,
181 int scale_head,
182 float omit_dist,
183 Eigen::Vector3f& scales);
184
189 const Eigen::Matrix<float, 3, 3, Eigen::RowMajor>& mri_fid,
190 Eigen::Vector3f& scales);
191
196 float maxdist) const;
197
202 int do_all, int do_approx) const;
203
208 int nasion_weight,
209 const std::optional<Eigen::Vector3f>& nasion_mri,
210 int last_step) const;
211
216
220 void scale(const Eigen::Vector3f& scales);
221
228 void decide_surface_extent(const QString& tag);
229
236 void decide_curv_display(const QString& name);
237
243
244// ### OLD STRUCT ###
245// typedef struct { /* Display surface properties */
246// char *filename; /* Where did this surface come from? */
247// time_t time_loaded; /* When was the surface loaded */
248// char *subj; /* The name of the subject in SUBJECTS_DIR */
249// char *surf_name; /* The name of the surface */
250// MNELIB::MNESurface* s; /* This is the surface */
251// float eye[3]; /* Eye position for viewing */
252// float up[3]; /* Up vector for viewing */
253// float rot[3]; /* Rotation angles of the MRI (in radians) */
254// float move[3]; /* Possibly move the origin, too */
255
256// float fov; /* Field of view (extent of the surface) */
257// float fov_scale; /* How much space to leave */
258// float minv[3]; /* Minimum values along the three coordinate axes */
259// float maxv[3]; /* Maximum values along the three coordinate axes */
260// float *trans; /* Extra transformation for this surface */
261// int sketch; /* Use sketch mode if decimated triangulation is available? */
262
263// morphMap *maps; /* Morphing maps from other surfaces to this */
264// int nmap; /* Normally just one */
265
266// int overlay_type; /* What are the overlay values? */
267// float *overlay_values; /* Overlay value array */
268// int alt_overlay_type; /* A second choice for overlay */
269// float *alt_overlay_values;
270// float *marker_values; /* Marker values (will be shown in shades of marker color) */
271
272// float *vertex_colors; /* Vertex color array */
273// mshColorScaleDef* color_scale; /* Color scale used to define these colors */
274// int nvertex_colors; /* How many components? */
275// float even_vertex_color[4]; /* This is going to be employed in case of uniform coloring */
276
277// float *marker_colors; /* Vertex color array (for the markers) */
278// int nmarker_colors; /* How many components? */
279// int **marker_tri; /* Triangles containing markers */
280// int *marker_tri_no; /* Numbers of the marker triangles */
281// int nmarker_tri; /* How many */
282// float marker_color[4]; /* Marker color */
283// int curvature_color_mode; /* How to show curvature */
284
285// int overlay_color_mode; /* How to show overlay data */
286// int transparent; /* Is this surface going to be transparent? */
287
288// int show_aux_data; /* Show auxilliary data related to this surface */
289
290// mshPicked* picked; /* Picked locations in world coordinates */
291// int npicked; /* How many */
292
293// void *user_data; /* Can be used to store whatever */
294// mneUserFreeFunc* user_data_free; /* Function to free the above */
295// } *mshDisplaySurface,mshDisplaySurfaceRec;
296};
297
298//=============================================================================================================
299// INLINE DEFINITIONS
300//=============================================================================================================
301} // NAMESPACE MNELIB
302
303#endif // MNEMSHDISPLAYSURFACE_H
mne library export/import macros.
#define MNESHARED_EXPORT
Definition mne_global.h:52
Legacy MNE-C constants and common typedefs.
MNESurface class declaration.
Core MNE data structures (source spaces, source estimates, hemispheres).
void(* mneUserFreeFunc)(void *)
Generic destructor callback for user-attached data.
Definition mne_types.h:91
FIFF file I/O and data structures (raw, epochs, evoked, covariance, forward).
Digitization points container and description.
Vertex-to-vertex mapping between two FreeSurfer surface meshes for morphing source estimates.
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 calculate_digitizer_distances(FIFFLIB::FiffDigitizerData &dig, int do_all, int do_approx) const
void scale(const Eigen::Vector3f &scales)
std::unique_ptr< MNELIB::MNEMshColorScaleDef > color_scale
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.