<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='mm')<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['dig'] entry ( knowing that I already called this function before with a normal Montage, to set the electrodes positions, since info['ch_names'] 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'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['dig'] information (lpa, rpa and nasion) and use it to create the trans file using the mne.gui.coregistration (through "mne coreg" 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'm using individual MRIs with the co-registration, wouldn'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"><<a href="mailto:alexandre.gramfort@telecom-paristech.fr" target="_blank">alexandre.gramfort@telecom-<wbr>paristech.fr</a>></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>
> I'm following this tutorial<br>
><br>
> <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>
><br>
> and trying to compute the forward model using individual anatomical<br>
> information.<br>
><br>
> So far I got the skull/skin surfaces using mne watershed_bem, and now I'm<br>
> trying to use the mne.gui.coregistration the generate the -trans file.<br>
><br>
> However, the digitization information is an eximia .nbe file. I found a<br>
> thread about converting it to FIF<br>
><br>
> <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>
><br>
> but it suggests using the mne_eximia2fif, and my eeg data is not acquired<br>
> with the eximia system, only the digitization.<br>
><br>
> The digitization consists of 3D positions for each electrodes + fiducial,<br>
> which I have imported into python as numpy.array.<br>
><br>
> Should I use mne.channels.read_dig_montage and update info['dig'] manually?<br>
<br>
</span>yes that'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>
> I tried<br>
><br>
> import mne.channels.read_dig_montage<br>
> digitization = read_dig_montage(elp=my_data[:<wbr>, 1:], point_names=ch_names)<br>
><br>
> where my_data[:, 1:] are the coordinates of the electrodes in mm, and the<br>
> first 3 lines are ['nasion', 'lpa', 'rpa'] (ch_names has the strings with<br>
> the fiducial and electrodes names)<br>
><br>
> However I get this error:<br>
><br>
> ==============================<wbr>=============<br>
><br>
> In [48]: read_dig_montage(elp=my_data[:<wbr>, 1:], point_names=montage.ch_names)<br>
> ------------------------------<wbr>------------------------------<wbr>---------------<br>
> TypeError Traceback (most recent call last)<br>
> <ipython-input-48-c58c337206f3<wbr>> in <module>()<br>
> ----> 1 read_dig_montage(hsp=None, elp=my_data[:, 1:],<br>
> point_names=montage.ch_names)<br>
><br>
> /home/leonardo/projects/mne-py<wbr>thon/mne/channels/montage.pyc in<br>
> read_dig_montage(hsp, hpi, elp, point_names, unit, fif, transform,<br>
> dev_head_t)<br>
> 608 fids = apply_trans(neuromag_trans, [nasion, lpa, rpa])<br>
> 609 elp = apply_trans(neuromag_trans, elp)<br>
> --> 610 hsp = apply_trans(neuromag_trans, hsp)<br>
> 611 else:<br>
> 612 fids = [None] * 3<br>
><br>
> /home/leonardo/projects/mne-py<wbr>thon/mne/transforms.pyc in apply_trans(trans,<br>
> pts, move)<br>
> 172<br>
> 173 # apply rotation & scale<br>
> --> 174 out_pts = np.dot(pts, trans[:3, :3].T)<br>
> 175 # apply translation<br>
> 176 if move is True:<br>
><br>
> TypeError: unsupported operand type(s) for *: 'NoneType' and 'float'<br>
><br>
> ==============================<wbr>=============<br>
><br>
> Looks like hsp is mandatory, but I don't have the Polhemus information...<br>
><br>
> Is there an easier way to create the -trans file and calculate the forward<br>
> model using individual electrodes positions from the eximia system (or<br>
> np.array with the electrodes coordinates for that matter)?<br>
><br>
> Thank you very much in advance for any help,<br>
><br>
> Leonardo<br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
</div></div>> ______________________________<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>
><br>
><br>
> The information in this e-mail is intended only for the person to whom it is<br>
> addressed. If you believe this e-mail was sent to you in error and the<br>
> e-mail<br>
> contains patient information, please contact the Partners Compliance<br>
> HelpLine at<br>
> <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>
> error<br>
> but does not contain patient information, please contact the sender and<br>
> properly<br>
> dispose of the e-mail.<br>
><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>