The Forward Solution
This page covers the definitions of different coordinate systems employed in MNE software and FreeSurfer, the details of the computation of the forward solutions, and the associated low-level utilities.
MEG/EEG and MRI Coordinate Systems
The coordinate systems used in MNE software (and FreeSurfer) and their relationships are described below. Except for the sensor coordinates, all of the coordinate systems are Cartesian and have the "RAS" (Right-Anterior-Superior) orientation, i.e., the axis points to the right, the axis to the front, and the axis up.
The following diagram shows the relationships between all coordinate systems and the transformations connecting them:
Figure: MEG/EEG and MRI coordinate systems and the transformations between them. (Device → Head) is determined during MEG acquisition via HPI coils. (Head → MRI) is established during coregistration. and are provided by FreeSurfer.
Coordinate Systems Related to MEG/EEG Data
Head coordinates
This is a coordinate system defined with help of the fiducial landmarks (nasion and the two auricular points). In FIFF files, EEG electrode locations are given in this coordinate system. In addition, the head digitization data acquired in the beginning of an MEG, MEG/EEG, or EEG acquisition are expressed in head coordinates.
Device coordinates
This is a coordinate system tied to the MEG device. The relationship of the Device and Head coordinates is determined during an MEG measurement by feeding current to three to five head-position indicator (HPI) coils and by determining their locations with respect to the MEG sensor array from the magnetic fields they generate.
Sensor coordinates
Each MEG sensor has a local coordinate system defining the orientation and location of the sensor. With help of this coordinate system, the numerical integration data needed for the computation of the magnetic field can be expressed conveniently. The channel information data in the FIFF files contain the information to specify the coordinate transformation between the coordinates of each sensor and the MEG device coordinates.
Coordinate Systems Related to MRI Data
Surface RAS coordinates
The FreeSurfer surface data are expressed in this coordinate system. The origin of this coordinate system is at the center of the conformed FreeSurfer MRI volumes (usually 256 × 256 × 256 isotropic 1-mm³ voxels) and the axes are oriented along the axes of this volume. The BEM surface and the locations of the sources in the source space are usually expressed in this coordinate system in the FIFF files. In this manual, the Surface RAS coordinates are usually referred to as MRI coordinates unless there is need to specifically discuss the different MRI-related coordinate systems.
RAS coordinates
This coordinate system has axes identical to the Surface RAS coordinates but the location of the origin is different and defined by the original MRI data, i.e., the origin is in a scanner-dependent location. There is hardly any need to refer to this coordinate system explicitly in the analysis with the MNE software. However, since the Talairach coordinates are defined with respect to RAS coordinates rather than the Surface RAS coordinates, the RAS coordinate system is implicitly involved in the transformation between Surface RAS coordinates and the two Talairach coordinate systems.
MNI Talairach coordinates
The MNI Talairach coordinate system provides a standard brain space. This transformation is determined during the FreeSurfer reconstruction process. These coordinates are in MNI305 space.
FreeSurfer Talairach coordinates
The problem with the MNI Talairach coordinates is that the linear MNI Talairach transform does not match the brains completely to the Talairach brain. This is because the Talairach atlas brain is a rather odd shape, and as a result, it is difficult to match a standard brain to the atlas brain using an affine transform. As a result, the MNI brains are slightly larger (in particular higher, deeper and longer) than the Talairach brain. The differences are larger as you get further from the middle of the brain, towards the outside. The FreeSurfer Talairach coordinates mitigate this problem by adding an additional transformation, defined separately for negative and positive MNI Talairach coordinates. These two transformations, denoted by and , are fixed as follows:
Coordinate Transformations
The different coordinate systems are related by coordinate transformations. Generally:
where , , and are the location coordinates in two coordinate systems, is the coordinate transformation from coordinate system "1" to "2", , , and is the location of the origin of coordinate system "1" in coordinate system "2", and are the elements of the rotation matrix relating the two coordinate systems.
The following table shows where coordinate transformations are stored:
| Transformation | FreeSurfer | MNE |
|---|---|---|
| (Device → Head) | Not present | Measurement data files, Forward solution files, Inverse operator files |
| (Sensor → Device) | Not present | Channel information in files containing |
| (Head → MRI) | Not present | MRI description files, -trans.fif files, Forward solution files, Inverse operator files |
| (MRI voxel → Surface RAS) | mri/*.mgz files | Internal reading |
| (Surface RAS → MNI Talairach) | mri/transforms/talairach.xfm | Internal reading |
| and | Hardcoded in software | Hardcoded in software |
In FreeSurfer, MNE, as well as in Neuromag software an integer voxel coordinate corresponds to the location of the center of a voxel.
The Head and Device Coordinate Systems
The MEG/EEG head coordinate system employed in the MNE software is a right-handed Cartesian coordinate system. The direction of the axis is from left to right, that of the axis to the front, and the axis thus points up.
The axis of the head coordinate system passes through the two periauricular or preauricular points digitized before acquiring the data with positive direction to the right. The axis passes through the nasion and is normal to the axis. The axis points up according to the right-hand rule and is normal to the plane.
The origin of the MEG device coordinate system is device dependent. Its origin is located approximately at the center of a sphere which fits the occipital section of the MEG helmet best with axis going from left to right and axis pointing front. The axis is normal to the plane with positive direction up.
The above definition is identical to that of the Neuromag MEG/EEG (head) coordinate system. However, in 4D Neuroimaging and CTF MEG systems the head coordinate frame definition is different. The origin of the coordinate system is at the midpoint of the left and right auricular points. The axis passes through the nasion and the origin with positive direction to the front. The axis is perpendicular to the axis and lies in the plane defined by the three fiducial landmarks, positive direction from right to left. The axis is normal to the plane of the landmarks, pointing up. Note that in this convention the auricular points are not necessarily located on the coordinate axis. The file conversion utilities take care of these idiosyncrasies and convert all coordinate information to the MNE software head coordinate frame.
Creating the Source Space
Surface-Based Source Space
The FIFF format source space files containing the dipole locations and orientations are created from the FreeSurfer surface reconstructions.
Volumetric or Discrete Source Space
In addition to source spaces confined to a surface, the MNE software provides support for three-dimensional source spaces bounded by a surface as well as source spaces comprised of discrete, arbitrarily located source points.
Creating the BEM Meshes
Topology Checks
The following topology checks are performed during the creation of BEM models:
-
Completeness: The total solid angle subtended by all triangles from a point inside the triangulation is calculated. The result should be very close to . If the result is instead, the ordering of the triangle vertices may be incorrect and the
--swapoption should be specified. -
Correct ordering: The surfaces are verified to be inside each other as expected by checking that the solid angles subtended by triangles of a surface at all vertices of another surface (which is supposed to be inside it) equals . Since the surface relations are transitive, it is enough to check that the outer skull surface is inside the skin surface and that the inner skull surface is inside the outer skull one.
-
Extent: If the extent of any triangulated volume is smaller than 50 mm, an error is reported. This may indicate that the vertex coordinates have been specified in meters instead of millimeters.
Coil Geometry Information
The Sensor Coordinate System
The sensor coordinate system is completely characterized by the location of its origin and the direction cosines of three orthogonal unit vectors pointing to the directions of the x, y, and z axis. The measurement FIFF files list these data in MEG device coordinates. Transformation to the MEG head coordinate frame can be accomplished by applying the device-to-head coordinate transformation matrix available in the data files.
If is a row vector for the origin of the local sensor coordinate system and , , and are the row vectors for the three orthogonal unit vectors, all given in device coordinates, a location of a point in sensor coordinates is transformed to device coordinates () by:
where
Calculation of the Magnetic Field
The forward calculation computes the signals detected by each MEG sensor for three orthogonal dipoles at each source space location. This requires specification of the conductor model, the location and orientation of the dipoles, and the location and orientation of each MEG sensor as well as its coil geometry.
The output of each SQUID sensor is a weighted sum of the magnetic fluxes threading the loops comprising the detection coil. The output of the -th MEG channel, , can be approximated by:
where are a set of integration points covering the pickup coil loops of the sensor, is the magnetic field due to the current sources calculated at , are the coil normal directions at these points, and are the weights associated to the integration points.
There are three accuracy levels for the numerical integration:
| Level | Description | Planar gradiometers | Magnetometers |
|---|---|---|---|
| Simple | Simplest description | — | — |
| Normal (default) | Recommended accuracy | 2 points | 4 points |
| Accurate | Highest accuracy | 8 points | 16 points |
Implemented Coil Geometries
The coil types fall in two general categories:
- Axial gradiometers and planar gradiometers
- Planar magnetometers
For axial sensors, the axis of the local coordinate system is parallel to the field component detected, i.e., normal to the coil plane. For planar sensors, the axis is likewise normal to the coil plane and the axis passes through the center points of the two coil loops.
Normal Coil Descriptions
| Id | Description | n | r/mm | w |
|---|---|---|---|---|
| 2 | Neuromag-122 planar gradiometer | 2 | (±8.1, 0, 0) | ±1/16.2mm |
| 2000 | A point magnetometer | 1 | (0, 0, 0) | 1 |
| 3012 | Vectorview type 1 planar gradiometer | 2 | (±8.4, 0, 0.3) | ±1/16.8mm |
| 3013 | Vectorview type 2 planar gradiometer | 2 | (±8.4, 0, 0.3) | ±1/16.8mm |
| 3022 | Vectorview type 1 magnetometer | 4 | (±6.45, ±6.45, 0.3) | 1/4 |
| 3023 | Vectorview type 2 magnetometer | 4 | (±6.45, ±6.45, 0.3) | 1/4 |
| 3024 | Vectorview type 3 magnetometer | 4 | (±5.25, ±5.25, 0.3) | 1/4 |
| 4001 | Magnes WH magnetometer | 4 | (±5.75, ±5.75, 0.0) | 1/4 |
| 4002 | Magnes WH 3600 axial gradiometer | 8 | (±4.5, ±4.5, 0.0) / (±4.5, ±4.5, 50.0) | 1/4 / -1/4 |
| 5001 | CTF 275 axial gradiometer | 8 | (±4.5, ±4.5, 0.0) / (±4.5, ±4.5, 50.0) | 1/4 / -1/4 |
If a plus-minus sign occurs in several coordinates, all possible combinations have to be included.
The Coil Definition File
The coil geometry information is stored in the text file coil_def.dat. In this file, any lines starting with the pound sign (#) are comments. A coil definition starts with a description line containing the following fields:
- class — A number indicating the class of this coil
- id — Coil ID value
- accuracy — The coil representation accuracy (1 = simple, 2 = normal, 3 = accurate)
- np — Number of integration points in this representation
- size/m — The size of the coil (diameter for circular, side length for square)
- baseline/m — The baseline of the coil (zero for magnetometers)
- description — Short description of this kind of coil
Each coil description line is followed by one or more integration point lines with seven numbers: weight, x/m, y/m, z/m, nx, ny, nz.
Computing the Forward Solution
The mne_forward_solution command computes the forward solution for MEG and EEG source localization. See the command-line reference for detailed usage.
Software Gradient Compensation
CTF and 4D Neuroimaging data may have been subjected to noise cancellation employing the data from the reference sensor array. Even though these sensors are rather far away from the brain sources, mne_forward_solution takes them into account in the computations. If the data file has software gradient compensation activated, it computes the field at the reference sensors in addition to the main MEG sensor array and computes a compensated forward solution.
The EEG Sphere Model
The default EEG sphere model has the following structure:
| Layer | Relative outer radius | σ (S/m) |
|---|---|---|
| Head | 1.0 | 0.33 |
| Skull | 0.97 | 0.04 |
| CSF | 0.92 | 1.0 |
| Brain | 0.90 | 0.33 |
When the sphere model is employed, the computation of the EEG solution can be substantially accelerated by using approximation methods described by Mosher, Zhang, and Berg. The forward solution approximates the solution with three dipoles in a homogeneous sphere whose locations and amplitudes are determined by minimizing the cost function:
where and are the locations and amplitudes of the approximating dipoles and and are the potential distributions given by the true and approximative formulas, respectively.
Averaging Forward Solutions
One possibility to make a grand average over several runs of an experiment is to average the data across runs and average the forward solutions accordingly. The averaging computes a weighted average of several forward solutions for both MEG and EEG. Usually the EEG forward solution is identical across runs because the electrode locations do not change.