Skip to main content

FwdEegSphereLayer

Namespace: FWDLIB  ·  Library: Forward Library

#include <fwd/fwd_eeg_sphere_layer.h>

class FWDLIB::FwdEegSphereLayer

Implements FwdEegSphereLayer (replaces fwdEegSphereLayer / fwdEegSphereLayerRec from MNE-C fwd_types.h).

One concentric shell (outer radius rad, conductivity sigma and the derived ratios) of a multi-shell de Munck / Berg-Scherg EEG head model.

src/examples/ex_fwd_api/main.cpp
std::unique_ptr<FwdEegSphereModelSet> models(FwdEegSphereModelSet::fwd_add_default_eeg_sphere_model(nullptr));
std::unique_ptr<FwdEegSphereModel> sphere(models->fwd_select_eeg_sphere_model("Default")); // 4 layers: brain, CSF, skull, scalp
// Scalp radius 90 mm; 3 Berg-Scherg dipoles approximate the layered potentials
sphere->fwd_setup_eeg_sphere_model(0.09f, true, 3);
sphere->r0 = Vector3f(0.0f, 0.0f, 0.04f);
auto els = FwdCoilSet::create_eeg_els(eeg, eeg.size());
VectorXf V(els->ncoil());
FwdEegSphereModel::fwd_eeg_spherepot_coil(rd, Q, *els, V, sphere.get()); // V per A m

Public Methods​

FwdEegSphereLayer()​

Constructs the Electric Current Dipole.


~FwdEegSphereLayer()​

Destroys the Forward EEG Sphere Layer description.


Static Methods​

comp_layers(v1, v2)​

Compare two sphere layers by radius for sorting.

Parameters:

Returns:

  • bool — True if v1.rad < v2.rad.

Example​

Used in examples​

ex_fwd_api​

Forward library: coil definitions, BEM and sphere models, field maps and forward solutions.

src/examples/ex_fwd_api/main.cpp, line 151
// mne.make_sphere_model(r0=(0, 0, 0.04), head_radius=0.09): layers at 81, 82.8, 87.3, 90 mm; |V| = 452.86725
ok &= expect(sphere->nlayer() == 4 && near(sphere->layers[2].rel_rad, 0.97, 1e-6) && near(sphere->layers[2].sigma, 0.004, 1e-6) && near(V.norm(), 452.86725, 1e-3) && near(V[0], 12.079552, 1e-2),
"FwdEegSphereModel/FwdEegSphereModelSet/FwdEegSphereLayer: 4-layer sphere potentials match mne");

Authors of this file​