# Setting up channel locations

**URL:** <https://mne.discourse.group/t/setting-up-channel-locations/1715>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [January 16, 2019, 2:33pm UTC](https://mne.discourse.group/t/setting-up-channel-locations/1715 "2019-01-16T14:33:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [January 16, 2019, 2:33pm UTC](https://mne.discourse.group/t/setting-up-channel-locations/1715/1 "2019-01-16T14:33:42Z")

</div>

External Email - Use Caution

Hi,

I am struggling to setting up channel locations...  
I'd like to know if there is a way to set up automatically standardize  
channel locations from the channel names since in my raw data file I only  
have the names. I am looking for a way which does not impply to set up a  
new montage (which I tried but it did not work as some channels resulted to  
be overlapped and I think is not the proper way to do it) or load the  
positions contained in a file.  
The result of the method I am looking for, I guess would add the locations  
to the 'dig' (digitization points) option in raw.info if I am right? This  
is the part which gives me error for all the functions I use (error:  
'digitization points not found')

Kind regards and thank you for the help,

Lidia.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [January 16, 2019, 3:21pm UTC](https://mne.discourse.group/t/setting-up-channel-locations/1715/2 "2019-01-16T15:21:47Z")

</div>

External Email - Use Caution

Hi!

Have you tried

raw.set\_montage("standard\_1020")

You can get all montages by

mne.channels.get\_builtin\_montages()

Use the montage that contains all (or at least most) of your channel names. If you have exotic names, maybe you can map them to names contained in one of the standard montages.

Clemens

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [January 17, 2019, 11:58am UTC](https://mne.discourse.group/t/setting-up-channel-locations/1715/3 "2019-01-17T11:58:32Z")

</div>

External Email - Use Caution

Thanks for your fast answer.

This I've already tried several times but I tried again in case, but still  
is not working...

when I want to do:

- ica.plot\_components() I get the following error: arrays used as indices  
must be of interger or (boolean) type.

and when trying:

- ica.plot\_properties(raw) I get that some electrodes have overlapping  
positions even though the montage fits only 24 channels out of 53 channels  
that are contained in raw.info['ch\_names'] and I listed in ['bads'] 28 out  
of the 53 that I do not want to use.

The ones displayed in the error as overlapped are EOGl, EOGr, EOGV, EMGChin  
from which EMGChin is the only one contained in 'bads'.

The code I am using is the following one:

rawB0939=mne.io.read\_raw\_edf('B0939.edf',preload='data\_preload')  
rawB0939\_copy=rawB0939.copy()

rawB0939.info['bads']=['AUX','ECG','Lage','Licht','Akku','Beweg.','EOGl:M1','EOGl:M2','EOGr:M1','C3:M2','C4:M1','Fz:M1','Oz:M1','EOGr:M2','F4:M1','O2:M1','F3:M2','O1:M2','Fz:M2','Oz:M2','Fp1:M1','Fp2:M1','T3:M1','T4:M1','P3:M1','P4:M1','F3:M1','STI  
014']  
rawB0939\_copy.info['bads']=['AUX','ECG','Lage','Licht','Akku','Beweg.','EOGl:M1','EOGl:M2','EOGr:M1','C3:M2','C4:M1','Fz:M1','Oz:M1','EOGr:M2','F4:M1','O2:M1','F3:M2','O1:M2','Fz:M2','Oz:M2','Fp1:M1','Fp2:M1','T3:M1','T4:M1','P3:M1','P4:M1','F3:M1','STI  
014']

rawB0939\_copy.crop(tmin=4936,tmax=5300)  
rawB0939\_copy.plot()

# DOWNSAMPLING AND FILTERING CROPPED DATA #  
rawB0939\_copy.resample(100) # downsampling to 100 Hz ( performs LPF  
followed by decimation)  
rawB0939\_copy.filter(l\_freq=49.0,h\_freq=3.0) # to perform ICA

# MONTAGE #  
rawB0939\_copy.set\_montage('standard\_1020') # 24 channels with positions  
established

# ICA #  
method='fastica'  
ica=ICA(method=method)  
print(ica)

ica.fit(rawB0939\_copy)  
print(ica)  
ica\_components=ica.get\_components()

ica.plot\_components(ica\_components)  
ica.plot\_properties(rawB0939\_copy)

Do you have some idea how to solve it? I am trying many things but I get  
errors through all the ways.

Thanks a lot!

El mi?., 16 ene. 2019 a las 16:22, Brunner, Clemens (  
clemens.brunner at uni-graz.at) (\<clemens.brunner at uni-graz.at\>) escribi?:

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [January 17, 2019, 12:00pm UTC](https://mne.discourse.group/t/setting-up-channel-locations/1715/4 "2019-01-17T12:00:35Z")

</div>

External Email - Use Caution

Ee

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;External Email - Use Caution

Thanks for your fast answer.

This I've already tried several times but I tried again in case, but still  
is not working...

when I want to do:

- ica.plot\_components() I get the following error: arrays used as indices  
must be of interger or (boolean) type.

and when trying:

- ica.plot\_properties(raw) I get that some electrodes have overlapping  
positions even though the montage fits only 24 channels out of 53 channels  
that are contained in raw.info['ch\_names'] and I listed in ['bads'] 28 out  
of the 53 that I do not want to use.

The ones displayed in the error as overlapped are EOGl, EOGr, EOGV, EMGChin  
from which EMGChin is the only one contained in 'bads'.

The code I am using is the following one:

rawB0939=mne.io.read\_raw\_edf('B0939.edf',preload='data\_preload')  
rawB0939\_copy=rawB0939.copy()

rawB0939.info['bads']=['AUX','ECG','Lage','Licht','Akku','Beweg.','EOGl:M1','EOGl:M2','EOGr:M1','C3:M2','C4:M1','Fz:M1','Oz:M1','EOGr:M2','F4:M1','O2:M1','F3:M2','O1:M2','Fz:M2','Oz:M2','Fp1:M1','Fp2:M1','T3:M1','T4:M1','P3:M1','P4:M1','F3:M1','STI  
014']  
rawB0939\_copy.info['bads']=['AUX','ECG','Lage','Licht','Akku','Beweg.','EOGl:M1','EOGl:M2','EOGr:M1','C3:M2','C4:M1','Fz:M1','Oz:M1','EOGr:M2','F4:M1','O2:M1','F3:M2','O1:M2','Fz:M2','Oz:M2','Fp1:M1','Fp2:M1','T3:M1','T4:M1','P3:M1','P4:M1','F3:M1','STI  
014']

rawB0939\_copy.crop(tmin=4936,tmax=5300)  
rawB0939\_copy.plot()

# DOWNSAMPLING AND FILTERING CROPPED DATA #  
rawB0939\_copy.resample(100) # downsampling to 100 Hz ( performs LPF  
followed by decimation)  
rawB0939\_copy.filter(l\_freq=49.0,h\_freq=3.0) # to perform ICA

# MONTAGE #  
rawB0939\_copy.set\_montage('standard\_1020') # 24 channels with positions  
established

# ICA #  
method='fastica'  
ica=ICA(method=method)  
print(ica)

ica.fit(rawB0939\_copy)  
print(ica)  
ica\_components=ica.get\_components()

ica.plot\_components(ica\_components)  
ica.plot\_properties(rawB0939\_copy)

Do you have some idea how to solve it? I am trying many things but I get  
errors through all the ways.

Thanks a lot!

El mi?., 16 ene. 2019 a las 16:22, Brunner, Clemens (  
clemens.brunner at uni-graz.at) (\<clemens.brunner at uni-graz.at\>) escribi?:

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [January 17, 2019, 2:20pm UTC](https://mne.discourse.group/t/setting-up-channel-locations/1715/5 "2019-01-17T14:20:12Z")

</div>

External Email - Use Caution

did you mark all channels that don't have a position as non EEG  
channels eg eog or misc?

see set\_channel\_types method.

HTH  
Alex

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [January 17, 2019, 5:42pm UTC](https://mne.discourse.group/t/setting-up-channel-locations/1715/6 "2019-01-17T17:42:15Z")

</div>

External Email - Use Caution

Thank you!! Already working!! 🙂

El jue., 17 ene. 2019 a las 15:21, Alexandre Gramfort (\<  
alexandre.gramfort at [inria.fr](http://inria.fr)\>) escribi?:
