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
digitization = read_dig_montage(hsp=positions.copy(),
elp=positions.copy(), point_names=labels, unit='mm')
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
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() :
https://drive.google.com/open?id=0B0p7WZ2wlTFSazJWbENnN0JnMkU
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)
raw.set_montage(digitization)
It works, but I'm not sure if this is the correct way to do it.
*Is it ok to use electrodes as head points?*
*Is it not enough to use the fiducials alone?*
Perhaps I should open a new thread less specific about eximia, since my
question is more generic:* how can I align electrodes to individual MRIs
just having the fiducials from the digitization process in a text file?*
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)
https://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/2016-June/003414.html
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,
http://www.slideshare.net/mne-python/mnepython-coregistration)
However, for some reason all the electrodes are quite far from the scalp,
even though the fiducials were aligned:
https://drive.google.com/open?id=0B0p7WZ2wlTFSNklmcTlPakJERXc
https://drive.google.com/open?id=0B0p7WZ2wlTFScXF4NGMtNXBiZ2M
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)
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.
*Does anybody have another idea why this could be happening?*
*Or how could I fix that?*
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?
Thank you for any help,
Leonardo
2016-09-09 8:07 GMT-05:00 Alexandre Gramfort <alexandre.gramfort at telecom-
paristech.fr>:
Hi Leonardo,
> I'm following this tutorial
>
> http://martinos.org/mne/stable/auto_tutorials/plot_forward.html
>
> and trying to compute the forward model using individual anatomical
> information.
>
> So far I got the skull/skin surfaces using mne watershed_bem, and now I'm
> trying to use the mne.gui.coregistration the generate the -trans file.
>
> However, the digitization information is an eximia .nbe file. I found a
> thread about converting it to FIF
>
> https://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/2013
-March/001465.html
>
> but it suggests using the mne_eximia2fif, and my eeg data is not acquired
> with the eximia system, only the digitization.
>
> The digitization consists of 3D positions for each electrodes + fiducial,
> which I have imported into python as numpy.array.
>
> Should I use mne.channels.read_dig_montage and update info['dig']
manually?
yes that's the entry point.
see the structure of a DigMontage object and maybe see if you can create
one
directly.
let us know if it works
Alex
> I tried
>
> import mne.channels.read_dig_montage
> digitization = read_dig_montage(elp=my_data[:, 1:],
point_names=ch_names)
>
> where my_data[:, 1:] are the coordinates of the electrodes in mm, and the
> first 3 lines are ['nasion', 'lpa', 'rpa'] (ch_names has the strings with
> the fiducial and electrodes names)
>
> However I get this error:
>
> ===========================================
>
> In [48]: read_dig_montage(elp=my_data[:, 1:],
point_names=montage.ch_names)
> ------------------------------------------------------------
---------------
> TypeError Traceback (most recent call
last)
> <ipython-input-48-c58c337206f3> in <module>()
> ----> 1 read_dig_montage(hsp=None, elp=my_data[:, 1:],
> point_names=montage.ch_names)
>
> /home/leonardo/projects/mne-python/mne/channels/montage.pyc in
> read_dig_montage(hsp, hpi, elp, point_names, unit, fif, transform,
> dev_head_t)
> 608 fids = apply_trans(neuromag_trans, [nasion, lpa,
rpa])
> 609 elp = apply_trans(neuromag_trans, elp)
> --> 610 hsp = apply_trans(neuromag_trans, hsp)
> 611 else:
> 612 fids = [None] * 3
>
> /home/leonardo/projects/mne-python/mne/transforms.pyc in
apply_trans(trans,
> pts, move)
> 172
> 173 # apply rotation & scale
> --> 174 out_pts = np.dot(pts, trans[:3, :3].T)
> 175 # apply translation
> 176 if move is True:
>
> TypeError: unsupported operand type(s) for *: 'NoneType' and 'float'
>
> ===========================================
>
> Looks like hsp is mandatory, but I don't have the Polhemus information...
>
> Is there an easier way to create the -trans file and calculate the
forward
> model using individual electrodes positions from the eximia system (or
> np.array with the electrodes coordinates for that matter)?
>
> Thank you very much in advance for any help,
>
> Leonardo
>
>
>
>
>
>
>
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>
>
> The information in this e-mail is intended only for the person to whom
it is
> addressed. If you believe this e-mail was sent to you in error and the
> e-mail
> contains patient information, please contact the Partners Compliance
> HelpLine at
> http://www.partners.org/complianceline . If the e-mail was sent to you
in
> error
> but does not contain patient information, please contact the sender and
> properly
> dispose of the e-mail.
>
_______________________________________________
Mne_analysis mailing list
Mne_analysis at nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20161026/6727e387/attachment.html