Loading the montage on mne-python

External Email - Use Caution

Hi, I'm running some tests with the EEGBCI
<https://physionet.org/content/eegmmidb/1.0.0/> dataset
<https://physionet.org/content/eegmmidb/1.0.0/>, the database format is EDF
and I'm using version 0.19.2 of mne-python.

I'm trying to make an ICA, the problem is that when I call the method:
ica.plot_properties(raw, picks=[0, 1])

I get this error back in the console:
WARNING:root:Did not find any electrode locations (in the info object),
will attempt to use digitization points instead. However, if digitization
points do not correspond to the EEG electrodes, this will lead to bad
results. Please verify that the sensor locations in the plot are accurate.

I probably have to load the montage. How do I do that? I tried to look
carefully at the documentation but I didn't reach a conclusion. Could
someone help me?
Thank you for your support,

Francesco Mattioli

I'm trying to work without distractions. If I do not respond immediately,
drink a cup of tea and be patient. Great ideas need deep work!
?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200319/5c8c0c66/attachment.html

External Email - Use Caution

hi,

if you go this page at the bottom you'll see all examples that use this
dataset:

https://mne.tools/stable/generated/mne.datasets.eegbci.load_data.html

you'll see that one example makes topographies.

https://mne.tools/stable/auto_examples/decoding/plot_decoding_csp_eeg.html#sphx-glr-auto-examples-decoding-plot-decoding-csp-eeg-py

at the bottom you'll see it uses a layout. Now if you switch to current code
version it will use set_montage.

https://mne.tools/dev/auto_examples/decoding/plot_decoding_csp_eeg.html#sphx-glr-auto-examples-decoding-plot-decoding-csp-eeg-py

HTH
Alex

External Email - Use Caution

I think he will have the same problem as me with sfp for montage.

External Email - Use Caution

Thank you for your help. The code you suggested is from another version of
mne-python (0.20.dev0), I'm using 0.19.2. Do you suggest to upgrade the
library to version 0.20.dev0?
Regards,
Francesco Mattioli

I'm trying to work without distractions. If I do not respond immediately,
drink a cup of tea and be patient. Great ideas need deep work!

?

External Email - Use Caution

hi,

I gave you 2 links. The first one:

https://mne.tools/stable/auto_examples/decoding/plot_
decoding_csp_eeg.html#sphx-glr-auto-examples-decoding-
plot-decoding-csp-eeg-py

uses the stable 0.19.2 code.

Alex

External Email - Use Caution

Thank you for your patience. In this code a layout is loaded i, on the
other hand, have to load a montage.
If I go to the third link you sent in the first email, the syntax used is
this one:

eegbci.standardize(raw) # set channel names
montage = make_standard_montage('standard_1020')
raw.set_montage(montage)

The output is:

File "<ipython-input-14-90c82492d6c4>", line 4, in <module>
    eegbci.standardize(raw) # set channel names
AttributeError: module 'mne.datasets.eegbci' has no attribute 'standardize'

Do you have any suggestion?

Francesco Mattioli

I'm trying to work without distractions. If I do not respond immediately,
drink a cup of tea and be patient. Great ideas need deep work!

?

External Email - Use Caution

Please copy code from this page :

https://mne.tools/stable/auto_examples/decoding/plot_decoding_csp_eeg.html#sphx-glr-auto-examples-decoding-plot-decoding-csp-eeg-py

if you use 0.19.2

eegbci.standardize(raw)

if from the dev version.

Alex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200321/6d61db4e/attachment.html

External Email - Use Caution

I have already tried, that does not solve my problem, I have to apply an
ICA and display the independent components on the scalp. With the function:

ica.plot_properties(raw, picks=[x,y])

But when i run I get this error back in the console:
WARNING:root:Did not find any electrode locations (in the info object),
will attempt to use digitization points instead. However, if digitization
points do not correspond to the EEG electrodes, this will lead to bad
results. Please verify that the sensor locations in the plot are accurate.

Francesco Mattioli

I'm trying to work without distractions. If I do not respond immediately,
drink a cup of tea and be patient. Great ideas need deep work!

?

External Email - Use Caution

I solved the problem! I leave the solution in case anyone needs it.

map = {
    'Fc5.': 'FC5', 'Fc3.': 'FC3', 'Fc1.': 'FC1', 'Fcz.': 'FCz', 'Fc2.': 'FC2',
    'Fc4.': 'FC4', 'Fc6.': 'FC6', 'C5..': 'C5', 'C3..': 'C3', 'C1..': 'C1',
    'Cz..': 'Cz', 'C2..': 'C2', 'C4..': 'C4', 'C6..': 'C6', 'Cp5.': 'CP5',
    'Cp3.': 'CP3', 'Cp1.': 'CP1', 'Cpz.': 'CPz', 'Cp2.': 'CP2', 'Cp4.': 'CP4',
    'Cp6.': 'CP6', 'Fp1.': 'Fp1', 'Fpz.': 'Fpz', 'Fp2.': 'Fp2', 'Af7.': 'AF7',
    'Af3.': 'AF3', 'Afz.': 'AFz', 'Af4.': 'AF4', 'Af8.': 'AF8', 'F7..': 'F7',
    'F5..': 'F5', 'F3..': 'F3', 'F1..': 'F1', 'Fz..': 'Fz', 'F2..': 'F2',
    'F4..': 'F4', 'F6..': 'F6', 'F8..': 'F8', 'Ft7.': 'FT7', 'Ft8.': 'FT8',
    'T7..': 'T7', 'T8..': 'T8', 'T9..': 'T9', 'T10.': 'T10', 'Tp7.': 'TP7',
    'Tp8.': 'TP8', 'P7..': 'P7', 'P5..': 'P5', 'P3..': 'P3', 'P1..': 'P1',
    'Pz..': 'Pz', 'P2..': 'P2', 'P4..': 'P4', 'P6..': 'P6', 'P8..': 'P8',
    'Po7.': 'PO7', 'Po3.': 'PO3', 'Poz.': 'POz', 'Po4.': 'PO4', 'Po8.': 'PO8',
    'O1..': 'O1', 'Oz..': 'Oz', 'O2..': 'O2', 'Iz..': 'Iz'}

raw.rename_channels(map)
raw.set_montage('standard_1005')

Thank you for your patience,

Francesco Mattioli

I'm trying to work without distractions. If I do not respond immediately,
drink a cup of tea and be patient. Great ideas need deep work!

?

1 Like