Problems with interpolation (newbie question)

External Email - Use Caution

Hi everybody,
I'm new to MNE analysis. I'm trying to interpolate bad channels in EEG
(BioSemi) data, but there seems to be an error.
The raw.info looks like this:

<Info | 16 non-empty fields
    bads : list | FC3
    ch_names : list | Fp1, AF7, AF3, F1, F3, F5, F7, FT7, FC5, ...
    chs : list | 73 items (EEG: 72, STIM: 1)
    comps : list | 0 items
    custom_ref_applied : bool | False
    dev_head_t : Transform | 3 items
    events : list | 0 items
    highpass : float | 0.0 Hz
    hpi_meas : list | 0 items
    hpi_results : list | 0 items
    lowpass : float | 104.0 Hz
    meas_date : tuple | 2015-09-01 13:51:14 GMT
    nchan : int | 73
    proc_history : list | 0 items
    projs : list | 0 items
    sfreq : float | 512.0 Hz
    acq_pars : NoneType
    acq_stim : NoneType
    ctf_head_t : NoneType
    description : NoneType
    dev_ctf_t : NoneType
    dig : NoneType
    experimenter : NoneType
    file_id : NoneType
    gantry_angle : NoneType
    hpi_subsystem : NoneType
    kit_system_id : NoneType
    line_freq : NoneType
    meas_id : NoneType
    proj_id : NoneType
    proj_name : NoneType
    subject_info : NoneType
    xplotter_layout : NoneType

And the error\warning when I write
"raw.copy().pick_types(eeg=True).interpolate_bads()" is this:

<ipython-input-21-28f155242753>:1: RuntimeWarning: No bad channels to
interpolate. Doing nothing...
  raw.copy().pick_types(eeg=True).interpolate_bads()

As can be seen from the raw.info, there is one bad channel, and I
can't figure out what the problem is.

Best regards,

Egor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20190822/a90e43fb/attachment.html

External Email - Use Caution

is FC3 present in the available data?
if not you need to add a channel with zero data to interpolate it.

Alex

External Email - Use Caution

The problem is your `raw.copy().pick_types(eeg=True)` call, the default
there is `exclude='bads'` which will have removed the channel you want to
fix. Change it to `raw.copy().pick_types(eeg=True, exclude=())` and you
should be good to go.

Eirc

External Email - Use Caution

Hi everybody,
Earlier I asked about a problem I was having with interpolation of EEG
channels and one of the answers fixed my problem (.pick_types(eeg=True,
exclude=())). However, there is apparently another problem with the same
thing.
The error is:

ValueError: Could not extract channel positions for 72 channels

Here is a simplified version of the code, which still gives the same error:

import mne
data = '...\\NPh1.bdf' #path to file
raw = mne.io.read_raw_bdf(data, preload=True)

Info = raw.info
Info['bads'] = ['FC3']

raw.copy().pick_types(eeg=True, exclude=()).interpolate_bads()

The raw.info can be seen in the forwarded message below.

??: ??? ??? <egor.sysoev2002 at gmail.com>

External Email - Use Caution

Hi ???,

You may need to set the electrode positions with raw.set_montage<https://martinos.org/mne/dev/generated/mne.io.Raw.html#mne.io.Raw.set_montage>(montage=montage)
You can use montage = mne.channels.read_montage<https://martinos.org/mne/dev/generated/mne.channels.read_montage.html> to load built-in montage or create your own one using the class Montage<https://martinos.org/mne/dev/generated/mne.channels.Montage.html#mne.channels.Montage>

Victor