<p><span style="padding: 3px 10px; border-radius: 5px; color: #ffffff; font-weight: bold; display: inline-block; background-color: #ff0000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;External Email - Use Caution&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></p><p></p><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><span style="color:rgb(33,33,33)">destination = </span></div><div><span style="font-family:Tahoma;font-size:13.3333px">&lt;Transform  |  MEG device-&gt;head&gt;</span></div><span style="font-family:Tahoma;font-size:13.3333px">[[ 0.71960711  0.63715118 -0.27605024 -0.07788484]</span><br style="font-family:Tahoma;font-size:13.3333px"><span style="font-family:Tahoma;font-size:13.3333px"> [-0.67182261  0.73935592 -0.04479922 -0.01268383]</span><br style="font-family:Tahoma;font-size:13.3333px"><span style="font-family:Tahoma;font-size:13.3333px"> [ 0.17555553  0.21769466  0.96009851  0.06360817]</span><br style="font-family:Tahoma;font-size:13.3333px"><span style="font-family:Tahoma;font-size:13.3333px"> [ 0.          0.          0.          1.        ]]</span></div></blockquote><div><br></div><div>This appears to have a large rotation and translation. To confirm, we can take a look at what this transformation would be like for the &quot;sample&quot; subject:</div><div></div><div class="gmail-markdown-here-wrapper"><pre style="font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px"><code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;background-color:rgb(248,248,248);white-space:pre;overflow:auto;border-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block">import mne
data_path = mne.datasets.sample.data_path()
raw = mne.io.read_raw_fif(data_path + &#39;/MEG/sample/sample_audvis_raw.fif&#39;)
<a href="http://raw.info">raw.info</a>[&#39;dev_head_t&#39;][&#39;trans&#39;] = np.array(
    [[ 0.71960711,  0.63715118, -0.27605024, -0.07788484],
     [-0.67182261,  0.73935592, -0.04479922, -0.01268383],
     [ 0.17555553,  0.21769466,  0.96009851,  0.06360817],
     [ 0.,          0.,          0.,          1.        ]])
trans = mne.read_trans(data_path + &#39;/MEG/sample/sample_audvis_raw-trans.fif&#39;)
mne.viz.plot_alignment(<a href="http://raw.info">raw.info</a>, trans=trans, subject=&#39;sample&#39;,
                       subjects_dir=data_path + &#39;/subjects&#39;,
                       coord_frame=&#39;meg&#39;, dig=True)
</code></pre><div title="MDH:PGRpdj5gYGA8L2Rpdj48ZGl2Pgo8cCBzdHlsZT0ibWFyZ2luOiAwcHg7IHdoaXRlLXNwYWNlOiBw
cmUtd3JhcDsiPmltcG9ydCBtbmU8L3A+CjxwIHN0eWxlPSJtYXJnaW46IDBweDsgd2hpdGUtc3Bh
Y2U6IHByZS13cmFwOyI+ZGF0YV9wYXRoID0gbW5lLmRhdGFzZXRzLnNhbXBsZS5kYXRhX3BhdGgo
KTwvcD4KPHAgc3R5bGU9Im1hcmdpbjogMHB4OyB3aGl0ZS1zcGFjZTogcHJlLXdyYXA7Ij5yYXcg
PSBtbmUuaW8ucmVhZF9yYXdfZmlmKGRhdGFfcGF0aCArICcvTUVHL3NhbXBsZS9zYW1wbGVfYXVk
dmlzX3Jhdy5maWYnKTwvcD4KPHAgc3R5bGU9Im1hcmdpbjogMHB4OyB3aGl0ZS1zcGFjZTogcHJl
LXdyYXA7Ij5yYXcuaW5mb1snZGV2X2hlYWRfdCddWyd0cmFucyddID0gbnAuYXJyYXkoPC9wPgo8
cCBzdHlsZT0ibWFyZ2luOiAwcHg7IHdoaXRlLXNwYWNlOiBwcmUtd3JhcDsiPiAgICBbWyAwLjcx
OTYwNzExLCAgMC42MzcxNTExOCwgLTAuMjc2MDUwMjQsIC0wLjA3Nzg4NDg0XSw8L3A+CjxwIHN0
eWxlPSJtYXJnaW46IDBweDsgd2hpdGUtc3BhY2U6IHByZS13cmFwOyI+ICAgICBbL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0em;padding:0px;margin:0px">​</div></div><div>This view from the front of the MEG helmet looks like:<br></div><div><br></div><div><img src="cid:ii_jg861o781_162e3dfdf14f97c6" style="margin-right: 0px;" width="224" height="210"><br><br></div><div>I recommend adapting this script to use your own data, as it will show the correct digitization (and correct head if you have an MRI, if not, omit the subject* and trans parameters, and set surfaces=[] in the plot_alignment call). Was this roughly the orientation and position of the subject during acquisition? If not, your dev_head_t is probably incorrect.<br></div><div><br></div><div>The actual origin used by Maxfilter will also depend on what you pass as the &quot;origin&quot; parameter. But in any case, it appears that it will be quite far from the device origin, and quite close to one side of the helmet (or maybe outside it). This is probably causing the conditioning problems. Assuming the dev_head_t is indeed correct, you should inspect the resulting transform to see if it has amplified some of the noise, which (I think) is a potential risk when the condition number gets too large.</div><div><br></div><div>Eric</div><div><br></div></div></div></div>