37 #ifndef MNESURFACEORVOLUME_H
38 #define MNESURFACEORVOLUME_H
44 #include "../mne_global.h"
45 #include <mne/c/mne_types.h>
57 #include <QSharedPointer>
58 #include <QStringList>
63 #define FIFF_MNE_SOURCE_SPACE_NNEIGHBORS 3594
64 #define FIFF_MNE_SOURCE_SPACE_NEIGHBORS 3595
66 #define FIFFV_MNE_COORD_SURFACE_RAS FIFFV_COORD_MRI
70 #define TRIANGLE_FILE_MAGIC_NUMBER (0xfffffe)
71 #define NEW_QUAD_FILE_MAGIC_NUMBER (0xfffffd)
72 #define QUAD_FILE_MAGIC_NUMBER (0xffffff)
76 #define TAG_OLD_SURF_GEOM 20
83 class FiffDigitizerData;
101 class MneSourceSpaceOld;
103 class MneMshDisplaySurface;
105 class MneMghTagGroup;
116 typedef QSharedPointer<MneSurfaceOrVolume>
SPtr;
117 typedef QSharedPointer<const MneSurfaceOrVolume>
ConstSPtr;
142 static double solid_angle (
float *from,
162 static void *filter_source_space(
void *arg);
164 static int filter_source_spaces(
float limit,
201 bool check_too_many_neighbors);
205 static void mne_triangle_coords(
float *r,
212 static int nearest_triangle_point(
float *r,
226 static int mne_nearest_triangle_point(
float *r,
233 static int mne_project_to_surface(
MneSurfaceOld* s,
void *proj_data,
float *r,
int project_it,
float *distp);
240 static void mne_find_closest_on_surface_approx(
MneSurfaceOld* s,
float **r,
int np,
int *nearest,
float *dist,
int nstep);
249 static void activate_neighbors(
MneSurfaceOld* s,
int start,
int *act,
int nstep);
253 static int mne_read_source_spaces(
const QString& name,
264 static int mne_transform_source_spaces_to(
int coord_frame,
277 const QStringList& labels,
282 static int mne_find_sources_in_label(
char *label,
288 static int mne_read_label(
const QString& label,
293 static int mne_write_label(
char *label,
299 static int mne_label_area(
char *label,
309 static void mne_compute_cm(
float **rr,
int np,
float *cm);
317 static int add_geometry_info(
MneSourceSpaceOld* s,
int do_normals,
int *border,
int check_too_many_neighbors);
319 static int mne_source_space_add_geometry_info(
MneSourceSpaceOld* s,
int do_normals);
321 static int mne_source_space_add_geometry_info2(
MneSourceSpaceOld* s,
int do_normals);
343 int do_all,
int do_approx);
362 static char * mne_compose_surf_name(
const char *subj,
374 int check_too_many_neighbors);
376 static int mne_read_triangle_file(
char *fname,
383 static int mne_read_curvature_file(
char *fname,
387 static int check_quad(
float **rr);
389 static int check_vertex(
int no,
int maxno);
393 static MneVolGeom* mne_get_volume_geom_from_tag(
void *tagsp);
397 static int mne_read_mgh_tags(FILE *fp,
void **tagsp);
399 static int read_next_tag(FILE *fp,
int *tagp,
long long *lenp,
unsigned char **datap);
401 static int read_tag_data(FILE *fp,
int tag,
long long nbytes,
unsigned char **val,
long long *nbytesp);
409 static int mne_read_int3(FILE *in,
int *ival);
411 static int mne_read_int(FILE *in, qint32 *ival);
413 static int mne_read_int2(FILE *in,
int *ival);
415 static int mne_read_float(FILE *in,
float *fval);
417 static int mne_read_long(FILE *in,
long long *lval);
421 static char *mne_strdup(
const char *s);
487 mneUserFreeFunc user_data_free;
563 #endif // MNESURFACEORVOLUME_H