62 #include <QSharedPointer>
65 #define FWD_BEM_UNKNOWN -1
66 #define FWD_BEM_CONSTANT_COLL 1
67 #define FWD_BEM_LINEAR_COLL 2
69 #define FWD_BEM_IP_APPROACH_LIMIT 0.1
71 #define FWD_BEM_LIN_FIELD_SIMPLE 1
72 #define FWD_BEM_LIN_FIELD_FERGUSON 2
73 #define FWD_BEM_LIN_FIELD_URANKAR 3
83 class MneSourceSpaceOld;
84 class MneCTFCompDataSet;
89 class FiffNamedMatrix;
102 class FwdEegSphereModel;
113 typedef QSharedPointer<FwdBemModel>
SPtr;
135 void fwd_bem_free_solution();
155 static QString fwd_bem_make_bem_sol_name(
const QString& name);
159 static const QString& fwd_bem_explain_surface(
int kind);
161 static const QString& fwd_bem_explain_method(
int method);
171 static FwdBemModel* fwd_bem_load_surfaces(
const QString& name,
175 static FwdBemModel* fwd_bem_load_homog_surface(
const QString& name);
177 static FwdBemModel* fwd_bem_load_three_layer_surfaces(
const QString& name);
179 static int fwd_bem_load_solution(
const QString& name,
int bem_method,
FwdBemModel* m);
202 static double calc_beta (
double *rk,
double *rk1);
204 static void lin_pot_coeff (
float *from,
211 static float **fwd_bem_lin_pot_coeff (
const QList<MNELIB::MneSurfaceOld*>& surfs);
213 static int fwd_bem_linear_collocation_solution(
FwdBemModel* m);
217 static float **fwd_bem_multi_solution (
float **solids,
222 static float **fwd_bem_homog_solution (
float **solids,
int ntri);
224 static void fwd_bem_ip_modify_solution(
float **solution,
232 static int fwd_bem_check_solids (
float **angles,
int ntri1,
int ntri2,
float desired);
234 static float **fwd_bem_solid_angles (
const QList<MNELIB::MneSurfaceOld*>& surfs);
236 static int fwd_bem_constant_collocation_solution(
FwdBemModel* m);
240 static int fwd_bem_compute_solution(
FwdBemModel* m,
243 static int fwd_bem_load_recompute_solution(
const QString& name,
250 static float fwd_bem_inf_field(
float *rd,
255 static float fwd_bem_inf_pot (
float *rd,
262 static void fwd_bem_pot_grad_calc (
float *rd,
271 static void fwd_bem_lin_pot_calc (
float *rd,
278 static void fwd_bem_lin_pot_grad_calc (
float *rd,
287 static void fwd_bem_pot_calc (
float *rd,
294 static int fwd_bem_pot_els (
float *rd,
300 static int fwd_bem_pot_grad_els (
float *rd,
321 static void calc_f (
double *xx,
327 static void calc_magic (
double u,
double z,
333 static void field_integrals (
float *from,
336 double *T,
double *S1,
double *S2,
337 double *f0,
double *fx,
double *fy);
339 static double one_field_coeff (
float *dest,
351 static double calc_gamma (
double *rk,
double *rk1);
353 static void fwd_bem_one_lin_field_coeff_ferg (
float *dest,
358 static void fwd_bem_one_lin_field_coeff_uran(
float *dest,
363 static void fwd_bem_one_lin_field_coeff_simple (
float *dest,
368 typedef void (* linFieldIntFunc)(
float *dest,
float *dir,
MNELIB::MneTriangle* tri,
double *res);
370 static float **fwd_bem_lin_field_coeff (
FwdBemModel* m,
377 #define MAG_FACTOR 1e-7
379 static void fwd_bem_lin_field_calc(
float *rd,
385 static void fwd_bem_field_calc(
float *rd,
391 static void fwd_bem_field_grad_calc(
float *rd,
399 static float fwd_bem_inf_field_der(
float *rd,
405 static float fwd_bem_inf_pot_der (
float *rd,
410 static void fwd_bem_lin_field_grad_calc(
float *rd,
418 static int fwd_bem_field(
float *rd,
424 static int fwd_bem_field_grad(
float *rd,
435 static void *meg_eeg_fwd_one_source_space(
void *arg);
464 static int fwd_sphere_field(
float *rd,
470 static int fwd_sphere_field_vec(
float *rd,
475 static int fwd_sphere_field_grad(
float *rd,
489 static int fwd_mag_dipole_field(
float *rm,
495 static int fwd_mag_dipole_field_vec(
float *rm,
502 QList<MNELIB::MneSurfaceOld*> surfs;
519 float ip_approach_limit;
520 bool use_ip_approach;
552 #endif // FWDBEMMODEL_H