65#include <QSharedPointer>
68#define FWD_BEM_UNKNOWN -1
69#define FWD_BEM_CONSTANT_COLL 1
70#define FWD_BEM_LINEAR_COLL 2
72#define FWD_BEM_IP_APPROACH_LIMIT 0.1
74#define FWD_BEM_LIN_FIELD_SIMPLE 1
75#define FWD_BEM_LIN_FIELD_FERGUSON 2
76#define FWD_BEM_LIN_FIELD_URANKAR 3
87 class MNECTFCompDataSet;
116 typedef QSharedPointer<FwdBemModel>
SPtr;
205 static double calc_beta (
double *rk,
double *rk1);
324 static void calc_f (
double *xx,
339 double *T,
double *S1,
double *S2,
340 double *f0,
double *fx,
double *fy);
354 static double calc_gamma (
double *rk,
double *rk1);
380 #define MAG_FACTOR 1e-7
382 static void fwd_bem_lin_field_calc(
float *rd,
388 static void fwd_bem_field_calc(
float *rd,
394 static void fwd_bem_field_grad_calc(
float *rd,
402 static float fwd_bem_inf_field_der(
float *rd,
408 static float fwd_bem_inf_pot_der (
float *rd,
413 static void fwd_bem_lin_field_grad_calc(
float *rd,
421 static int fwd_bem_field(
float *rd,
427 static int fwd_bem_field_grad(
float *rd,
438 static void *meg_eeg_fwd_one_source_space(
void *arg);
441 static int compute_forward_meg( std::vector<std::unique_ptr<MNELIB::MNESourceSpace>>& spaces,
443 FwdCoilSet* comp_coils,
446 FwdBemModel* bem_model,
453 static int compute_forward_eeg( std::vector<std::unique_ptr<MNELIB::MNESourceSpace>>& spaces,
456 FwdBemModel* bem_model,
457 FwdEegSphereModel* m,
465 static int fwd_sphere_field(
float *rd,
471 static int fwd_sphere_field_vec(
float *rd,
476 static int fwd_sphere_field_grad(
float *rd,
490 static int fwd_mag_dipole_field(
float *rm,
496 static int fwd_mag_dipole_field_vec(
float *rm,
FiffTag class declaration, which provides fiff tag I/O and processing methods.
FiffNamedMatrix class declaration.
FiffDirNode class declaration, which provides fiff dir tree processing methods.
FiffCoordTrans class declaration.
forward library export/import macros.
FwdCoilSet class declaration.
Core MNE data structures (source spaces, source estimates, hemispheres).
FIFF file I/O and data structures (raw, epochs, evoked, covariance, forward).
Forward modelling (BEM, MEG/EEG lead fields).
Coordinate transformation description.
QSharedPointer< FiffDirNode > SPtr
QSharedPointer< FiffStream > SPtr
static float ** fwd_bem_field_coeff(FwdBemModel *m, FwdCoilSet *coils)
static FwdBemModel * fwd_bem_load_homog_surface(const QString &name)
static int get_int(FIFFLIB::FiffStream::SPtr &stream, const FIFFLIB::FiffDirNode::SPtr &node, int what, int *res)
static float ** fwd_bem_multi_solution(float **solids, float **gamma, int nsurf, int *ntri)
static double calc_beta(double *rk, double *rk1)
static void correct_auto_elements(MNELIB::MNESurface *surf, float **mat)
QSharedPointer< const FwdBemModel > ConstSPtr
static int fwd_bem_set_head_mri_t(FwdBemModel *m, const FIFFLIB::FiffCoordTrans &t)
static int fwd_bem_constant_collocation_solution(FwdBemModel *m)
static void fwd_bem_one_lin_field_coeff_uran(float *dest, float *dir, MNELIB::MNETriangle *tri, double *res)
static void fwd_bem_ip_modify_solution(float **solution, float **ip_solution, float ip_mult, int nsurf, int *ntri)
static double one_field_coeff(float *dest, float *normal, MNELIB::MNETriangle *tri)
static int fwd_bem_check_solids(float **angles, int ntri1, int ntri2, float desired)
static int fwd_bem_pot_grad_els(float *rd, float *Q, FwdCoilSet *els, float *pot, float *xgrad, float *ygrad, float *zgrad, void *client)
QSharedPointer< FwdBemModel > SPtr
static float ** fwd_bem_solid_angles(const QList< MNELIB::MNESurface * > &surfs)
static float ** fwd_bem_lin_pot_coeff(const QList< MNELIB::MNESurface * > &surfs)
static FwdBemModel * fwd_bem_load_surfaces(const QString &name, int *kinds, int nkind)
static int fwd_bem_load_solution(const QString &name, int bem_method, FwdBemModel *m)
static void calc_f(double *xx, double *yy, double *f0, double *fx, double *fy)
static QString fwd_bem_make_bem_sol_name(const QString &name)
static int fwd_bem_load_recompute_solution(const QString &name, int bem_method, int force_recompute, FwdBemModel *m)
static float ** fwd_bem_homog_solution(float **solids, int ntri)
static double calc_gamma(double *rk, double *rk1)
static void fwd_bem_pot_grad_calc(float *rd, float *Q, FwdBemModel *m, FwdCoilSet *els, int all_surfs, float *xgrad, float *ygrad, float *zgrad)
MNELIB::MNESurface * fwd_bem_find_surface(int kind)
static void field_integrals(float *from, MNELIB::MNETriangle *to, double *I1p, double *T, double *S1, double *S2, double *f0, double *fx, double *fy)
void fwd_bem_free_solution()
static float fwd_bem_inf_pot(float *rd, float *Q, float *rp)
static void lin_pot_coeff(float *from, MNELIB::MNETriangle *to, double omega[3])
static const QString & fwd_bem_explain_method(int method)
static float ** fwd_bem_lin_field_coeff(FwdBemModel *m, FwdCoilSet *coils, int method)
static int fwd_bem_linear_collocation_solution(FwdBemModel *m)
static int fwd_bem_specify_coils(FwdBemModel *m, FwdCoilSet *coils)
static const QString & fwd_bem_explain_surface(int kind)
static void fwd_bem_one_lin_field_coeff_simple(float *dest, float *normal, MNELIB::MNETriangle *source, double *res)
static void fwd_bem_pot_calc(float *rd, float *Q, FwdBemModel *m, FwdCoilSet *els, int all_surfs, float *pot)
void(* linFieldIntFunc)(float *dest, float *dir, MNELIB::MNETriangle *tri, double *res)
QList< MNELIB::MNESurface * > surfs
static void fwd_bem_lin_pot_grad_calc(float *rd, float *Q, FwdBemModel *m, FwdCoilSet *els, int all_surfs, float *xgrad, float *ygrad, float *zgrad)
static MNELIB::MNESurface * make_guesses(MNELIB::MNESurface *guess_surf, float guessrad, float *guess_r0, float grid, float exclude, float mindist)
static int fwd_bem_specify_els(FwdBemModel *m, FwdCoilSet *els)
static FwdBemModel * fwd_bem_load_three_layer_surfaces(const QString &name)
static void calc_magic(double u, double z, double A, double B, double *beta, double *D)
static int fwd_bem_pot_els(float *rd, float *Q, FwdCoilSet *els, float *pot, void *client)
static void fwd_bem_lin_pot_calc(float *rd, float *Q, FwdBemModel *m, FwdCoilSet *els, int all_surfs, float *pot)
static int fwd_bem_compute_solution(FwdBemModel *m, int bem_method)
FIFFLIB::FiffCoordTrans head_mri_t
static float fwd_bem_inf_field(float *rd, float *Q, float *rp, float *dir)
static void fwd_bem_one_lin_field_coeff_ferg(float *dest, float *dir, MNELIB::MNETriangle *tri, double *res)
Collection of FwdCoil objects representing a full MEG or EEG sensor array.
Multi-layer spherical head model for EEG forward computation.
Collection of CTF third-order gradient compensation operators.
Per-triangle geometric data for a cortical or BEM surface.