# The Use of Lead Field Matrix

**URL:** <https://mne.discourse.group/t/the-use-of-lead-field-matrix/6776>\
**Category:** Support & Discussions\
**Created:** [April 22, 2023, 1:34pm UTC](https://mne.discourse.group/t/the-use-of-lead-field-matrix/6776 "2023-04-22T13:34:01Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![prodaking](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/prodaking/32/2305_2.png) [@prodaking](https://mne.discourse.group/u/prodaking)\
**Post date:** [April 22, 2023, 1:34pm UTC](https://mne.discourse.group/t/the-use-of-lead-field-matrix/6776/1 "2023-04-22T13:34:02Z")

</div>

Hi there,  
I specified a dipole source with an assumed position (containing only one specified direction) and used make\_forward\_solution generates the corresponding source space in order to obtain a 4 \* 1 conduction matrix. But in the case of four analog sensors, the lead field matrix is a conduction matrix with a dimension of 4 \* 3. It seems that it’s because of make\_forward\_solution. Is there any way to solve the problem where space defaults to “free orientations”?  
Additionally, what are the three directions of the dipole generated by this function (make\_forward\_solution)?

---

<div class="post-metadata">

**Author:** ![wmvanvliet](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/wmvanvliet/32/100_2.png) [@wmvanvliet](https://mne.discourse.group/u/wmvanvliet)\
**Post date:** [April 23, 2023, 5:53am UTC](https://mne.discourse.group/t/the-use-of-lead-field-matrix/6776/2 "2023-04-23T05:53:30Z")

</div>

The 3 columns in the Lead Field matrix are the XYZ components of the direction of your one dipole.

---

<div class="post-metadata">

**Author:** ![prodaking](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/prodaking/32/2305_2.png) [@prodaking](https://mne.discourse.group/u/prodaking)\
**Post date:** [April 23, 2023, 6:37am UTC](https://mne.discourse.group/t/the-use-of-lead-field-matrix/6776/3 "2023-04-23T06:37:15Z")

</div>

![image](https://global.discourse-cdn.com/free1/uploads/mne/original/2X/8/806fd4a0a34cf427c63a8f856eb9cde16f76e6a3.png)  
The dipole direction I define is (0, -1, 0)

---

<div class="post-metadata">

**Author:** ![prodaking](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/prodaking/32/2305_2.png) [@prodaking](https://mne.discourse.group/u/prodaking)\
**Post date:** [April 23, 2023, 6:41am UTC](https://mne.discourse.group/t/the-use-of-lead-field-matrix/6776/4 "2023-04-23T06:41:01Z")

</div>

fwd[‘sol’][‘data’] as shown in the figure.  
 ![image](https://global.discourse-cdn.com/free1/uploads/mne/original/2X/0/0d4cfae788adf462135a91cd9a95e97c58cc4bdb.png)

---

<div class="post-metadata">

**Author:** ![prodaking](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/prodaking/32/2305_2.png) [@prodaking](https://mne.discourse.group/u/prodaking)\
**Post date:** [April 23, 2023, 6:42am UTC](https://mne.discourse.group/t/the-use-of-lead-field-matrix/6776/5 "2023-04-23T06:42:56Z")

</div>

The dipole direction I defined follows the Y direction. Why is the lead field matrix corresponding to other X and Z directions not 0?

---

<div class="post-metadata">

**Author:** ![prodaking](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/prodaking/32/2305_2.png) [@prodaking](https://mne.discourse.group/u/prodaking)\
**Post date:** [April 23, 2023, 6:51am UTC](https://mne.discourse.group/t/the-use-of-lead-field-matrix/6776/6 "2023-04-23T06:51:18Z")

</div>

Additionally, I know that in my custom configuration of four MEG sensors, the simulated measurement signal is equal to this simulated source signal multiplied by the lead field matrix (4 × 1）。 But in the current lead field matrix (4 × 3) In this case, how to calculate the simulated measured magnetic signal through simulating the source signal?  
Looking forward to your help!

---

<div class="post-metadata">

**Author:** ![wmvanvliet](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/wmvanvliet/32/100_2.png) [@wmvanvliet](https://mne.discourse.group/u/wmvanvliet)\
**Post date:** [April 24, 2023, 6:43am UTC](https://mne.discourse.group/t/the-use-of-lead-field-matrix/6776/7 "2023-04-24T06:43:30Z")

</div>

Could you post your entire code somewhere? Then I can have a bit more context as to what you are trying to do exactly and what your current attempt looks like.

> The dipole direction I define is (0, -1, 0)

Technically, you are defining a source point and a vector pointing orthogonally to the cortical surface at that source point. `make_forward_solution` will make one dipole in the direction of the surface normal you’ve defined, but also creates two more dipoles to form a complete XYZ coordinate system at the source point. You can use the [`convert_forward_solution`](https://mne.tools/stable/generated/mne.convert_forward_solution.html) function with `force_fixed=True` to remove these other two dipoles, leaving only the dipole in the direction you have specified.

---

<div class="post-metadata">

**Author:** ![prodaking](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/prodaking/32/2305_2.png) [@prodaking](https://mne.discourse.group/u/prodaking)\
**Post date:** [April 24, 2023, 7:26am UTC](https://mne.discourse.group/t/the-use-of-lead-field-matrix/6776/8 "2023-04-24T07:26:18Z")

</div>

Thank you very much for your answer. I have just learned MNE-Python and would like to try using it to do some work on source localization of magnetocardiogram.  
I realized that I could use the function (convert\_forward\_solution) to make the lead field matrix conform to my custom dipole direction.  
Also, based on your answer, can I assume that the function (make\_forward\_solution) will generate two additional dipoles with directions orthogonal to the defined direction?  
In the case where I define the dipole direction as [0, -1,0], the fwd ['source\_nn '] generated by the function (make\_forward\_solution) is [[1,0,0], [0,1,0], [0,0,0,1]], which seems to automatically change my definition of the dipole direction as positive. Why is this?  
The relevant program is shown in the figure below. Thank you again for your help!  
 ![image](https://global.discourse-cdn.com/free1/uploads/mne/original/2X/b/b00fb7003e7084d7b668eeebdc7f35a46355f061.png)

 ![image](https://global.discourse-cdn.com/free1/uploads/mne/original/2X/7/70129f2c9235c0588b35b6ea52cea1ef883e0457.png)

---

<div class="post-metadata">

**Author:** ![wmvanvliet](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/wmvanvliet/32/100_2.png) [@wmvanvliet](https://mne.discourse.group/u/wmvanvliet)\
**Post date:** [April 24, 2023, 11:01am UTC](https://mne.discourse.group/t/the-use-of-lead-field-matrix/6776/9 "2023-04-24T11:01:06Z")

</div>

> [@prodaking](#):
>
> which seems to automatically change my definition of the dipole direction as positive. Why is this?

It could be that MNE tries to reorient the dipoles so they always point “away” from the cortical surface instead of “into” the cortical surface. In the end, positive/negative doesn’t matter for the source estimate though.
