Computing the vector field B on the MEG sensors (forward problem)

Hello all,

I’m PhD student and new user of brainstorm,
my question is about the construction of the magnetic
field on the sensors of the MEG (ELEKTA Neuromag in my case)
with 306 MEG sensors, divided into 102 site,
in each there is two type of sensors, 1 manotometre and 2 gradiometres,
each sensor is composed with four coils, with a weight for each of them,

when the calculation is done, we get 306 value of the magnetique
field en each sensors, (in the case of the forward problem)

my question is, how we can diferentiate between th mesure of the
magnetometer and th gradiometre?

I think in the calculation, there is no differentiation, all of them calculate
the modul of the magntic intensity B in the direction of the coil without any
differentiation (magntometre or gradiometer) .

Thank you

Best regards

Takfarinas

Hi Takfarinas,

The gradiometers and magnetometers from the Elekta systems are not modeled in the same way.
Magnetometers have one coil and are recording a magnetic field, gradiometer have two coils and are recording a spatial derivative of a magnetic field.

The geometry of the sensors are described in the file: brainstorm3/toolbox/io/private/coil_def.dat
You can get the geometry and weights attributed to the different integration points in the channel file: right-click > edit channel file.

What type of information are you looking for exactly?
Is it related with the software or with the theory of electromagnetic modeling?

Cheers,
Francois

[QUOTE=Francois;5654]Hi Takfarinas,

The gradiometers and magnetometers from the Elekta systems are not modeled in the same way.
Magnetometers have one coil and are recording a magnetic field, gradiometer have two coils and are recording a spatial derivative of a magnetic field.

The geometry of the sensors are described in the file: brainstorm3/toolbox/io/private/coil_def.dat
You can get the geometry and weights attributed to the different integration points in the channel file: right-click > edit channel file.

What type of information are you looking for exactly?
Is it related with the software or with the theory of electromagnetic modeling?

Cheers,
Francois[/QUOTE]

Hi François,
Thank you for your quick answer,
I’m looking for the manner that I will use to calculate the magnetic field in each sensors,
I’m working on the forward problem, using the finit element method,
I understand that each sensor is defined by 4 coils, and there is two type of sensors,
I understand that the magnetometer mesure the intensity of the field, and the gradiometer its variation,
in my case,
I calculate in each coil the intensity of the magnetic field B, I get 4306 values, because of the number of coils=4number of the sensors (1224),

my questions are :
If I understand, in the brainstrom data, the value in the variable F in the file “data_Average” is the magnetic field intensity in each sensor? (B in Tesla) ,am I right?

Compare to the number of values (306 values) in the matrix of the field F in brainstorm data, I try to obtain the 306 values in my method, using these 1224
values of my caculation?

If I apply the weight of each coils, it’s will be ok for the magnetometers, but
I dont understand how I will do, and how I can explain that the value in the gradiometre is the value of the magnetic field in this position ?

it’s big help to me,
hope that I was clear in my questions :slight_smile:
Sorry for my english, it’s not very goood :frowning:

Thank you & best regards

Takfarinas

I understand that each sensor is defined by 4 coils

No: two coils for the gradiometers, one coil for the magnetometers.
But 4 integration points for both types of sensors, for a more accurate modeling.
Those 4 values are then grouped using the "Weight" field in the channel file.

The logic used in the Brainstorm software is the same as the one developed by Matti Hamalainen in the MNE software:
http://martinos.org/mne/manual/forward.html

If I understand, in the brainstrom data, the value in the variable F in the file "data_Average" is the magnetic field intensity in each sensor? (B in Tesla) ,am I right?

The values that are saved by the acquisition software.
Magnetometers are magnetic fields in Tesla, gradiometers are spatial derivatives of the magnetic fields. Check the Elekta documentation for more information.

Compare to the number of values (306 values) in the matrix of the field F in brainstorm data, I try to obtain the 306 values in my method, using these 1224
values of my caculation?

If you are developing your own forward model, you are supposed to know/define the way you want to model your sensors.
Maybe you should start by a simple case without those integration points, simplifying the coils geometry to a single point (magnetometer) or two points (gradiometers).
I suggest that you start by reading more about the physics of MEG and the forward modeling.

Francois

As Francois points out, if you are developing your own forward modeling using an FEM technique, you might first consider a simpler sensor model.

We can divide the Forward Model into two parts, the sensor and the head. In Brainstorm, we use “spherical”, “overlapping spherical”, “boundary element”, and for EEG, “3-shell spherical” for the head model. At http://neuroimage.usc.edu/neuro/Publications, see our publication

JC. Mosher, RM. Leahy, PS. Lewis, EEG and MEG: Forward Solutions For Inverse Methods, IEEE Trans. Biomedical Eng, 46, (3): 245-259 Mar 1999. http://dx.doi.org/10.1109/10.748978

which gives the basic theoretical concepts behind these head models.

For the sensor models, you might look in the coil_def.dat file Francois references, which covers most of the known sensor designs, and is a common data file shared by both Brainstorm and MNE. In your case, the Neuromag array comprises 102 tri-channel sites. At each site, one large magnetometer surrounds two embedded planar gradiometers oriented perpendicular to each other. After loading some “FIF” data directly into Brainstorm, then if you “edit channel file” from within Brainstorm, you’ll see that we have taken care of all of the translation and rotation issues for each site, yielding the final XYZ and cartesian orientation of each sensor in the subject’s coordinate system.

Now we could just model the magnetometer by computer the forward field at the center of the coil. But we felt that’s too approximate. Instead we evaluate the forward field at four points in the magnetometer coil, and weight each one by 1/4, to get an average of the flux passing through the relatively large coil. You see these as “weights” of 0.25 in the Channel editor.

The planar gradiometers are a little trickier. The gradiometer comprises two smaller coils counter wound. We could simply calculate the magnetic field in the center of the first coil, then subtract the magnetic field in the center of the second coil, to yield the gradiometer effect. Again, we instead chose to average the field in the first coil by picking TWO points in that coil and averaging them, then picking TWO points in the second coil, averaging them, then subtracting them from the first coil’s average. We did not pick four points in each coil, because these are smaller coils than the magnetometer. But because there are two coils, then we still have four points. Note in the weights, however, that two of the weights are negative, since they correspond to the second gradient coil.

But why are these gradiometer weights not simply “0.5 0.5 -0.5 -0.5”, instead of the stranger [29.76 29.76 -29.76 -29.76] values (in one type of Neuromag, there are other variations)? The Neuromag writes the magnetometer data in units of Tesla, but writes out the gradiometer data in units of Tesla/Meter, representing the distance between the gradient coils. The strange weights therefore also convert the magnetic field values so that the right units are obtained.

Thus you are correct that you will make 1,224 calculations of the magnetic field outside the head, but the way you combine these calculations is reflected in the Weights associated with each sensor. The resulting 306 data values are in units of either T or T/m, corresponding to the 306 channels of data you see in the “F” field of Brainstorm’s “data” structure.

– John

Hi François, Hi John,
Thank for your long answers, It's very helpful for me.
I read and check in different sources about the Elekta and the MNE modling principles.
If I'm right,
in the hardwear of Elekta Neuromag, magnetometre has one coils with only one Josephson boucle
and in the gradiometer two coils and only two josephson boucle.

But in the soft, we can use more than one point to calculate the magnetic field, for a more accurate modeling. ( it's not according to the construction of the sensor)
each point with a value of weight.

The values that are saved by the acquisition software.
Magnetometers are magnetic fields in Tesla, gradiometers are spatial derivatives of the magnetic fields. Check the Elekta documentation for more information.

I chek in the documentation, the result is dBn/dx and dBn/dy, it's the normal on the the coil thank you.

If you are developing your own forward model, you are supposed to know/define the way you want to model your sensors.

Actually, I'm working in the FE model, but to validate my results,
I need some real mesures, so I have to adapt my results in simulation into the result with the mesures in ordre to check and validate.
This is the reason why I need to understand the manner of modeling the sensors of the Neuromag in brainstorm.

About the reply of John, it's verry important, thank you very much.
I read all the tutoriel of Brainstorm, and try most of the examples.
About the head models, I read some articles and among them I find yours, very intersting, Thank you for your work.

For the sensor models,
actually I have only some results of thumb stimulation, from the MEG of Neuromag, and I don't have information about the "FIF" data.
I can saw the caracteristique of the sensors on brainstorm right-click > edit channel file, as Fracois explains.

Now we could just model the magnetometer by computer the forward field at the center of the coil. But we felt that's too approximate. Instead we evaluate the forward field at four points in the magnetometer coil, and weight each one by 1/4, to get an average of the flux passing through the relatively large coil. You see these as "weights" of 0.25 in the Channel editor

To confirm a confusion with my colleague, there is only one Josephson boucle in the magnetometre and not 4 ? The four points are only for the calculation and modeling.

an other question :

to get an average of the flux passing through the relatively large coil. You see these as "weights" of 0.25 in the Channel editor.

to calculate the flux passing through the coil, we need the surface of the coil, but I dont find it in the calculation ? or we don't use it ?

The planar gradiometers are a little trickier. The gradiometer comprises two smaller coils counter wound. We could simply calculate the magnetic field in the center of the first coil, then subtract the magnetic field in the center of the second coil, to yield the gradiometer effect. Again, we instead chose to average the field in the first coil by picking TWO points in that coil and averaging them, then picking TWO points in the second coil, averaging them, then subtracting them from the first coil's average. We did not pick four points in each coil, because these are smaller coils than the magnetometer. But because there are two coils, then we still have four points. Note in the weights, however, that two of the weights are negative, since they correspond to the second gradient coil.

great, very clarifying,and helpful, Thank you.

But why are these gradiometer weights not simply "0.5 0.5 -0.5 -0.5", instead of the stranger [29.76 29.76 -29.76 -29.76] values (in one type of Neuromag, there are other variations)?

The strange weights therefore also convert the magnetic field values so that the right units are obtained.

do you know how they had do to get these value? its very strange?

The Neuromag writes the magnetometer data in units of Tesla, but writes out the gradiometer data in units of Tesla/Meter

In brainstorm, in the variable F we find the field in Tesla for the Magnetometer, and the gradient of the field for the gradiometer in Tesla/meter.
but when we plot or visualize the MEG recording, "http://neuroimage.usc.edu/brainstorm/Tutorials/TutImportRecordings" and "http://neuroimage.usc.edu/brainstorm/Tutorials/TutExploreRecodings ",
the graphe is (Time (s) VS Amplitude (fT)) , which kind of data are we plotting on?

I understand that it is the value of the field in each sensor,
for the magnetometer (Tesla) it's OK, but how is the visualisation for the value of the magnetometer (Tesla/Meter).

Thus you are correct that you will make 1,224 calculations of the magnetic field outside the head, but the way you combine these calculations is reflected in the Weights associated with each sensor. The resulting 306 data values are in units of either T or T/m, corresponding to the 306 channels of data you see in the "F" field of Brainstorm's "data" structure.

Thank you for this explanation, it's very kind.

Best regards

Takfarinas

Note: Technical discussion on how the weights are calculated in the sensors for generating the forward model. Most of these details are automatically handled for the users. As noted in the other comments of this thread, the logic used in the Brainstorm software is the same as the one developed by Matti Hamalainen in the MNE software: http://martinos.org/mne/manual/forward.html

Regarding the “strange weights” in the planar gradiometer calculation. Let’s extract from brainstorm3/toolbox/io/private/coil_def.dat the data for one type of gradiometer:

3 3012 0 2 2.639e-02 1.680e-02 "Vectorview planar gradiometer T1 size = 26.39 mm base = 16.80 mm"
59.5238 8.400e-03 0.000e+00 3.000e-04 0.000 0.000 1.000
-59.5238 -8.400e-03 0.000e+00 3.000e-04 0.000 0.000 1.000

3 3012 1 4 2.639e-02 1.680e-02 "Vectorview planar gradiometer T1 size = 26.39 mm base = 16.80 mm"
29.7619 8.400e-03 6.713e-03 3.000e-04 0.000 0.000 1.000
29.7619 8.400e-03 -6.713e-03 3.000e-04 0.000 0.000 1.000
-29.7619 -8.400e-03 6.713e-03 3.000e-04 0.000 0.000 1.000
-29.7619 -8.400e-03 -6.713e-03 3.000e-04 0.000 0.000 1.000

3 3012 2 8 2.639e-02 1.680e-02 "Vectorview planar gradiometer T1 size = 26.39 mm base = 16.80 mm"
14.9858 1.079e-02 6.713e-03 3.000e-04 0.000 0.000 1.000
14.9858 5.891e-03 6.713e-03 3.000e-04 0.000 0.000 1.000
14.9858 5.891e-03 -6.713e-03 3.000e-04 0.000 0.000 1.000
14.9858 1.079e-02 -6.713e-03 3.000e-04 0.000 0.000 1.000
-14.9858 -1.079e-02 6.713e-03 3.000e-04 0.000 0.000 1.000
-14.9858 -5.891e-03 6.713e-03 3.000e-04 0.000 0.000 1.000
-14.9858 -5.891e-03 -6.713e-03 3.000e-04 0.000 0.000 1.000
-14.9858 -1.079e-02 -6.713e-03 3.000e-04 0.000 0.000 1.000

The format of this file is given in it’s header. Briefly, the first line says a type 3 (planar) Brainstorm/MNE database model number 3012 sensor, accuracy 0 (point approximation), evaluated at two points, for a coil of size 26.39 mm and a baseline separation of 16.8 mm between the two coils.

A physical coil measures the total flux passing through its surface. In this coil, that surface is locally oriented (in the local coordinates of the sensor, not the global coordinates of the subject) in the z-direction, 0,0,1, indicated in the subsequent line. Hence we know the surface of the coil.

The local origin of this coil is a point halfway between the two coils, and 300 microns below the surface of the planar coils. Every manufacturer has a different concept of where the origin of their coil will be.

In the point approximation (accuracy 0), we approximate the average flux through the coil by calculating the flux at a single point in the coil. The classic agreement for such an approximation is the center of the coil; see any book on how to numerically calculate integrals, but one classic is Abramowitz and Stegun: Handbook of Mathematical Functions. The center of the first coil is found at 8.400e-03 0.000e+00 3.000e-04, i.e. 1/2 of 16.8 mm in the positive x-direction, zero in the y-direction, and 0.3 mm in the z-direction. The center of the second coil is -8.4 mm in the x-direction. We subtract the second coil from the first coil to yield the net gradiometric recording of the sensor, so the weights are 1 and -1.

Weights of 1 and -1, calculating the field (Teslas) at each center, gives the difference in Teslas between the two centers. To yield units of gradient, we divide by the distance between the two coils, 16.8 mm. Thus 1.0 / 0.0168 = 59.5238, the final weight factors applied to the two points to yield an output calculation of T/m, the convention of the Neuromag.

Note: axial gradiometer manufacturers have not adopted this gradient convention in units, so their output remains in units of Tesla, nonetheless as the difference between their two coils, typically separated by a distance of 50 - 80 mm in the axial direction.

[B]Accuracy 1 is the next set in the above extraction, which approximates the integral of the flux in the coil with two points for each coil (our Brainstorm default), hence the average flux is found as 0.5 and 0.5 for these two points per coil, and thus we have weights of 0.5 * 59.5238= 29.7619: thus, the reason behind the “strange weights” I alluded to in the other comments.[/B]

Accuracy 2 is for those demanding greater precision in their forward model calculation (not part of normal Brainstorm operations), evaluating four points per coil, and hence net weights of 0.25 * 59.5238 = 14.9858.

For this and other coil shapes, the approximation points and weights follow numerical computing conventions for approximating integrals over surfaces. Some coils are slightly rectangular, some are circular, some are square.

Brainstorm and MNE automatically handle the rotation and translation of each of these local coordinates (within a sensor) to the subject’s global coordinates (position and orientation outside the head), calculates the field in Teslas at each of these approximation points, then sums them together using the weights to model the net total signal coming out of a single channel in the MEG, represented in the corresponding rows of the forward model matrix.

Hope this discussion helps those interested in the estimation of the sensor’s measurement of the magnetic field.

– John

PS, While I’ve always had a copy of Abramowitz and Stegun on my shelf, I was pleasantly surprised to find very nice electronic versions now available. See
http://www.cs.bham.ac.uk/~aps/research/projects/as/project.php
which notes that this classic handbook is copyright-free, as a product of the US National Bureau of Standards. The UK site provides high quality scans of the book, converted to PDF, such as this link: