<div dir="ltr">I know it has been a while, but I finally went back to this project and managed to create the DigMontage using the mne.channels.read_dig_montage<div><br></div><div>        digitization = read_dig_montage(hsp=<wbr>positions.copy(), elp=positions.copy(), point_names=labels, unit=&#39;mm&#39;)<br></div><div><br></div><div>positions is a ndarray (N,3) and labels is a list (N), where N is the number of entries in the digitization file: 257 electrodes + 3 fiducials</div><div>here is an example of .sfp file I get from the digitization process and used to generate the position and labels objects through csv.reader() :</div><div><br></div><div><a href="https://drive.google.com/open?id=0B0p7WZ2wlTFSazJWbENnN0JnMkU">https://drive.google.com/open?id=0B0p7WZ2wlTFSazJWbENnN0JnMkU</a><br></div><div><br></div><div>I then used set_montage to update the info[&#39;dig&#39;] entry ( knowing that I already called this function before with a normal Montage, to set the electrodes positions, since info[&#39;ch_names&#39;] is not updated by read_dig_montage)</div><div><br></div><div>        raw.set_montage(digitization)<br></div><div><br></div><div>It works, but I&#39;m not sure if this is the correct way to do it.</div><div><b>Is it ok to use electrodes as head points?</b></div><div><b>Is it not enough to use the fiducials alone?</b></div><div><br></div><div>Perhaps I should open a new thread less specific about eximia, since my question is more generic:<b> how can I align electrodes to individual MRIs just having the fiducials from the digitization process in a text file?</b></div><div><br></div><div>I found this thread, but no it is not quite the same since I do have the MRI, but the co-registration is not in any supported format (Polhemus, etc)</div><div><br></div><div><a href="https://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/2016-June/003414.html">https://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/2016-June/003414.html</a><br></div><div><br></div><div>In any case, now I can save the raw with the info[&#39;dig&#39;] information (lpa, rpa and nasion) and use it to create the trans file using the mne.gui.coregistration (through &quot;mne coreg&quot; in the command line, <a href="http://www.slideshare.net/mne-python/mnepython-coregistration" target="_blank">http://www.slideshare.net/mne-<wbr>python/mnepython-<wbr>coregistration</a>)<br></div><div><br></div><div>However, for some reason all the electrodes are quite far from the scalp, even though the fiducials were aligned:</div><div><br></div><div><a href="https://drive.google.com/open?id=0B0p7WZ2wlTFSNklmcTlPakJERXc" target="_blank">https://drive.google.com/open?<wbr>id=<wbr>0B0p7WZ2wlTFSNklmcTlPakJERXc</a><br></div><div><a href="https://drive.google.com/open?id=0B0p7WZ2wlTFScXF4NGMtNXBiZ2M" target="_blank">https://drive.google.com/open?<wbr>id=<wbr>0B0p7WZ2wlTFScXF4NGMtNXBiZ2M</a><br></div><div><br></div><div>since it happened with 5 subjects, and the error is always similar, I think it is unlikely to be a simple switch between subjects digitization (I double checked the origin of the files in any case)</div><div>it could be, however, a systematic error in the acquisition... But this system was successfully used with brainstorm, so I would not start with this hypothesis.</div><div><br></div><div><b>Does anybody have another idea why this could be happening?</b></div><div><b>Or how could I fix that?</b></div><div><b><br></b></div><div>I could morph the MRI if needed, but since I&#39;m using individual MRIs with the co-registration, wouldn&#39;t that be a waste and similar to using generic/fsaverage MRI?</div><div><br></div><div>Thank you for any help,</div><div>Leonardo</div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">2016-09-09 8:07 GMT-05:00 Alexandre Gramfort <span dir="ltr">&lt;<a href="mailto:alexandre.gramfort@telecom-paristech.fr" target="_blank">alexandre.gramfort@telecom-<wbr>paristech.fr</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Leonardo,<br>
<span><br>
&gt; I&#39;m following this tutorial<br>
&gt;<br>
&gt; <a href="http://martinos.org/mne/stable/auto_tutorials/plot_forward.html" rel="noreferrer" target="_blank">http://martinos.org/mne/stable<wbr>/auto_tutorials/plot_forward.<wbr>html</a><br>
&gt;<br>
&gt; and trying to compute the forward model using individual anatomical<br>
&gt; information.<br>
&gt;<br>
&gt; So far I got the skull/skin surfaces using mne watershed_bem, and now I&#39;m<br>
&gt; trying to use the mne.gui.coregistration the generate the -trans file.<br>
&gt;<br>
&gt; However, the digitization information is an eximia .nbe file. I found a<br>
&gt; thread about converting it to FIF<br>
&gt;<br>
&gt; <a href="https://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/2013-March/001465.html" rel="noreferrer" target="_blank">https://mail.nmr.mgh.harvard.e<wbr>du/pipermail/mne_analysis/2013<wbr>-March/001465.html</a><br>
&gt;<br>
&gt; but it suggests using the mne_eximia2fif, and my eeg data is not acquired<br>
&gt; with the eximia system, only the digitization.<br>
&gt;<br>
&gt; The digitization consists of 3D positions for each electrodes + fiducial,<br>
&gt; which I have imported into python as numpy.array.<br>
&gt;<br>
&gt; Should I use mne.channels.read_dig_montage and update info[&#39;dig&#39;] manually?<br>
<br>
</span>yes that&#39;s the entry point.<br>
<br>
see the structure of a DigMontage object and maybe see if you can create one<br>
directly.<br>
<br>
let us know if it works<br>
<br>
Alex<br>
<div><div class="gmail-m_4790232050779591587h5"><br>
&gt; I tried<br>
&gt;<br>
&gt; import mne.channels.read_dig_montage<br>
&gt; digitization = read_dig_montage(elp=my_data[:<wbr>, 1:], point_names=ch_names)<br>
&gt;<br>
&gt; where my_data[:, 1:] are the coordinates of the electrodes in mm, and the<br>
&gt; first 3 lines are [&#39;nasion&#39;, &#39;lpa&#39;, &#39;rpa&#39;] (ch_names has the strings with<br>
&gt; the fiducial and electrodes names)<br>
&gt;<br>
&gt; However I get this error:<br>
&gt;<br>
&gt; ==============================<wbr>=============<br>
&gt;<br>
&gt; In [48]: read_dig_montage(elp=my_data[:<wbr>, 1:], point_names=montage.ch_names)<br>
&gt; ------------------------------<wbr>------------------------------<wbr>---------------<br>
&gt; TypeError                                 Traceback (most recent call last)<br>
&gt; &lt;ipython-input-48-c58c337206f3<wbr>&gt; in &lt;module&gt;()<br>
&gt; ----&gt; 1 read_dig_montage(hsp=None, elp=my_data[:, 1:],<br>
&gt; point_names=montage.ch_names)<br>
&gt;<br>
&gt; /home/leonardo/projects/mne-py<wbr>thon/mne/channels/montage.pyc in<br>
&gt; read_dig_montage(hsp, hpi, elp, point_names, unit, fif, transform,<br>
&gt; dev_head_t)<br>
&gt;     608             fids = apply_trans(neuromag_trans, [nasion, lpa, rpa])<br>
&gt;     609             elp = apply_trans(neuromag_trans, elp)<br>
&gt; --&gt; 610             hsp = apply_trans(neuromag_trans, hsp)<br>
&gt;     611         else:<br>
&gt;     612             fids = [None] * 3<br>
&gt;<br>
&gt; /home/leonardo/projects/mne-py<wbr>thon/mne/transforms.pyc in apply_trans(trans,<br>
&gt; pts, move)<br>
&gt;     172<br>
&gt;     173     # apply rotation &amp; scale<br>
&gt; --&gt; 174     out_pts = np.dot(pts, trans[:3, :3].T)<br>
&gt;     175     # apply translation<br>
&gt;     176     if move is True:<br>
&gt;<br>
&gt; TypeError: unsupported operand type(s) for *: &#39;NoneType&#39; and &#39;float&#39;<br>
&gt;<br>
&gt; ==============================<wbr>=============<br>
&gt;<br>
&gt; Looks like hsp is mandatory, but I don&#39;t have the Polhemus information...<br>
&gt;<br>
&gt; Is there an easier way to create the -trans file and calculate the forward<br>
&gt; model using individual electrodes positions from the eximia system (or<br>
&gt; np.array with the electrodes coordinates for that matter)?<br>
&gt;<br>
&gt; Thank you very much in advance for any help,<br>
&gt;<br>
&gt; Leonardo<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
</div></div>&gt; ______________________________<wbr>_________________<br>
&gt; Mne_analysis mailing list<br>
&gt; <a href="mailto:Mne_analysis@nmr.mgh.harvard.edu" target="_blank">Mne_analysis@nmr.mgh.harvard.e<wbr>du</a><br>
&gt; <a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" rel="noreferrer" target="_blank">https://mail.nmr.mgh.harvard.e<wbr>du/mailman/listinfo/mne_analys<wbr>is</a><br>
&gt;<br>
&gt;<br>
&gt; The information in this e-mail is intended only for the person to whom it is<br>
&gt; addressed. If you believe this e-mail was sent to you in error and the<br>
&gt; e-mail<br>
&gt; contains patient information, please contact the Partners Compliance<br>
&gt; HelpLine at<br>
&gt; <a href="http://www.partners.org/complianceline" rel="noreferrer" target="_blank">http://www.partners.org/compli<wbr>anceline</a> . If the e-mail was sent to you in<br>
&gt; error<br>
&gt; but does not contain patient information, please contact the sender and<br>
&gt; properly<br>
&gt; dispose of the e-mail.<br>
&gt;<br>
______________________________<wbr>_________________<br>
Mne_analysis mailing list<br>
<a href="mailto:Mne_analysis@nmr.mgh.harvard.edu" target="_blank">Mne_analysis@nmr.mgh.harvard.e<wbr>du</a><br>
<a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" rel="noreferrer" target="_blank">https://mail.nmr.mgh.harvard.e<wbr>du/mailman/listinfo/mne_analys<wbr>is</a><br>
</blockquote></div><br></div></div>