Dipole to Scalp
Place and rotate current dipoles in a spherical head model and watch the scalp potential update live; then put the same dipole through two head models — one shell against four — and measure what the skull does.
3 claims on this page are unverified. TODO(confirm) marks a specific statement the author has not yet checked against a
primary source. Everything else on this page has been reviewed. Treat a marked claim as
provisional and go to the cited source rather than quoting the sentence.
Modes: intro · forward — the widget below runs in intro. Use Share state to put the exact view in the URL.
What it does
A conducting sphere with the 21 10-20 electrodes on its surface. You place one or two current dipoles (position, orientation, strength) and the widget computes the scalp potential analytically, draws it as an interpolated map in µV, and samples it at the electrodes.
intro is about intuition: radial versus tangential orientation, depth, the superposition of two sources, and a “match the maps” task that shuffles four stored dipole configurations and asks you to pair each with its map, reporting the score to the L0.1 exercise.
forward puts the same dipole through two head models side by side — the analytic homogeneous sphere the widget computes itself, and a stored model computed in Python — and measures the difference: the spatial correlation between the two maps, each map’s peak channel and the distance between them, the ratio of the maps’ magnitudes, and the conventional shape distance. It ships four presets, including the left temporal source L5.4’s exercise is built on.
The stored models are spheres, not a realistic head model
The specification for this mode asked for a boundary-element model beside the sphere. No boundary-element model ships, and the reason is a licence rather than an engineering limit. Both template anatomies that could have supplied one fail this site’s snippet policy: ds-fsaverage is governed by the FreeSurfer Software License Agreement v1.0, which permits derivative works only by propagating the whole agreement onto every copy, and ds-mne-sample’s licence is contested at source and is an open decision for this site’s author.
What ships instead is two concentric sphere models — a one-shell homogeneous sphere and a four-shell brain/CSF/skull/scalp sphere — declared is_bem: false in the data file, which also carries the block’s reason and this sentence for the widget to print verbatim:
These are spherical head models, not a realistic (BEM) head model. They show what the skull’s conductivity does to a scalp map; they show nothing about real head shape. The realistic model is not shipped because its template anatomy is not openly licensed.
Nothing on this page calls either model a BEM, and the loader still accepts the original data shape, so a genuine boundary-element model could drop in later with no code change.
One consequence to carry away, and one not to. The four-shell model shrinks and blurs the map relative to the one-shell model — that is the skull, and it is real. The peak channel never moves — and that is symmetry, not a fact about head models: both models are concentric spheres about a single centre, so adding shells cannot move the maximum. A head that is not a sphere can and does move it, and this comparison cannot show you that, so it understates what a realistic model would change.
Explore the forward mode
The widget above opens in intro. The comparison mode is embedded here so it is reachable in the page:
Controls
| Control | What it sets |
|---|---|
| Dipole 1 / Dipole 2 | Add or remove the second dipole (intro) |
| Position | Depth below the scalp as a fraction of the head radius, plus azimuth and elevation — or drag on the head |
| Orientation | Radial, tangential, or any angle between, with preset buttons; and the direction of the tangential component |
| Strength | Dipole moment in nA·m |
| Colour scale | Symmetric µV scale, auto or fixed; shared between the two panels in forward so a size difference is visible |
| Match the maps | (intro) Starts the four-item matching task; the score is reported when all four are placed |
| Position presets | (forward) Left temporal tangential, left temporal radial, vertex radial, and a deep midline source |
| Stored head model | (forward) Which stored model occupies the right-hand panel: four shells (brain, CSF, skull, scalp) or one shell, the latter being the same model the left panel computes analytically, so selecting it makes the two panels agree and is the widget checking itself |
| Show difference | (forward) A third panel with the stored map minus the analytic sphere map |
Four read-outs sit under the colour bar in forward: the spatial correlation r between the two maps across channels, each map’s peak channel and the arc between them in millimetres, MAG, the ratio of the two maps’ magnitudes, and RDM, the conventional shape distance — which, after average referencing, is exactly sqrt(2 − 2r), so the interface says so rather than presenting them as two independent facts.
Three things the interface always states, because each is a way the comparison could mislead: the snap distance to the nearest stored dipole (the stored model is precomputed on a grid of 1536 positions, and both panels are evaluated at that same stored position, deliberately, so that what you see is the head model and not the grid); a warning, with the depth in millimetres, when the dipole is outside the stored grid entirely; and how faithfully the spherical-spline drawing reproduces the left model’s exact analytic field, which is what a sparse montage costs before any head model is chosen.
What to look for
intro
- A radial dipole produces one focal peak directly above it. Tilt it toward tangential and the peak splits into a positive and a negative lobe on either side, with near-zero potential above the source: orientation, not only position, decides the pattern.
- At the same depth and strength, the radial orientation reaches a larger peak than the tangential one — one reason scalp EEG is dominated by radially oriented, synchronously active populations.
- Push the dipole deeper and the peak shrinks while the pattern spreads. A deep strong source and a shallow weak one can produce very similar maps.
- Two dipoles add point by point. A single map cannot tell you how many sources made it.
- Mind the colour bar: tens of nA·m give microvolts at the scalp, and the map is referenced to the mean over the sphere, so a different reference would shift every colour without changing the shape.
- This model has no skull. Real scalp maps are blurrier and weaker; how much so is what the
forwardmode measures.
forward
- Press Vertex, radial first and read the four numbers rather than trusting your eye.
rsays how much of the pattern the two models share;MAGhow much of the size. Two models can agree almost perfectly on the first and differ by a factor of two or more on the second, and it is the second that decides whether a source looks strong or weak at the scalp. - Now press Left temporal, tangential — the source L5.4’s exercise asks about — and compare it with the radial version at the same place and with the vertex. Depth, orientation and how much skull lies between the source and the electrodes all change the answer, and the widget reports each case separately so you can say which factor did what.
- Watch what does not change: the peak channel. Read the line under the maps that says why, and do not carry “the peak stays put” away as a general fact about head models.
- Read the nearest stored dipole line every time you move the source. Both panels are drawn for that stored position; when the line warns that the dipole is outside the grid, nothing was computed there at all.
- Switch the stored model to the one-shell version: it is the same model the left panel computes analytically, so the two panels should agree. The same line also reports how well the drawing reproduces the exact analytic field — at twenty-odd electrodes a deep source survives almost intact and a shallow focal one does not, which is L5.4’s “few channels” point before any head model is chosen.
Used in
- L0.1 What EEG measures (
intro; the lesson’s widget-graded exercise is the match-the-maps task, 4 of 4) - L5.4 Forward models (
forward)
Data provenance
No recorded data. Every asset here is synthetic, generated from analytic head models and a standard template montage, and carries generated_by, generated_at and license at the top level with synthetic: true, derived_from and modifications; all are listed in the asset manifest with SHA-256 and size, under the site’s own CC BY 4.0 terms.
| Asset | What it holds | Written by |
|---|---|---|
head.json | sphere radius 0.09 m, conductivity 0.33 S/m, the 21 electrode positions and a surface grid | data/scripts/make_dipole_fixtures.py |
fixtures.json | dipole configurations with MNE-computed potentials, used by the unit test | data/scripts/make_dipole_fixtures.py |
match.json | the four named configurations A–D for the L0.1 matching task | data/scripts/make_dipole_fixtures.py |
bem.json | the index for forward mode: the two stored models with their conductivities and the exact modelling calls, the dipole grid, the electrode set, the block’s reason and the disclosure the widget prints | data/scripts/make_forward_maps.py |
forward-homogeneous.bin, forward-layered.bin | the stored scalp maps, positions × orientations × channels | data/scripts/make_forward_maps.py |
The two stored models, in full: one shell is a homogeneous sphere of conductivity 0.33 S/m, identical to the model the widget implements analytically; four shells is the modelling library’s default concentric model, relative radii 0.90 / 0.92 / 0.97 / 1.00 with conductivities 0.33 / 1.00 / 0.004 / 0.33 S/m for brain, CSF, skull and scalp. The skull shell’s conductivity is about two orders of magnitude below the brain’s, and that single number is most of what the comparison shows. Grid: 8 shells at eccentricities 0.20 to 0.88, 192 deterministic Fibonacci-lattice directions per shell, 1536 positions, spanning 10.8 to 72.0 mm below the scalp; nothing is stored outside those depths. Orientations are the three Cartesian unit vectors — a complete basis, not a sampling, so the map for any moment is their exact linear combination and only position is interpolated. Computed with MNE 1.10.2.
The widget’s own analytic potential is checked against the MNE-computed fixtures on every test run. Two notes on how it draws:
- TODO(confirm): the spherical-spline interpolation is built in the browser rather than shipped as a precomputed matrix, which is a documented deviation from the site’s usual rule. It was taken deliberately — shipping an interpolation operator for a synthetic sphere montage that corresponds to no real recording would publish a product nothing else can use — and it costs about 60 ms once per grid and channel set.
- TODO(confirm):
RDMandMAGare the conventional names for these quantities in the forward-modelling literature but have not been checked here against a primary source, and neither has the spherical-spline attribution; a lesson or paper that attributes them must verify first.
Open the code
site/src/components/widgets/w-dipole-to-scalp/ — Widget.svelte, index.ts, meta.ts, the sphere physics, the interpolation and comparison modules, README.md, and the fixture-based unit tests. Repository link: TODO(confirm) (GitHub org/repo).