Error trying filter and plot data using EMG data

  • mne==0.20.8
  • operating system: Linux Mint (using Jupyter notebook)

I need a help about an error just i run epoch.filter(l_freq=20., h_freq=450.)
Error: ValueError: picks (NoneNone, treated as "data_or_ica") yielded no channels, consider passing picks explicitly

That error happen when I use epoch.plot_psd too…
I am working with sEMG data… Anyone known what is it?

A complete error is follow:

obj_filtered = epoch.filter(l_freq=20., h_freq=450.)
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-29-b3662d60ef07> in <module>
----> 1 obj_filtered = epoch.filter(l_freq=20., h_freq=450.)

<decorator-gen-111> in filter(self, l_freq, h_freq, picks, filter_length, l_trans_bandwidth, h_trans_bandwidth, n_jobs, method, iir_params, phase, fir_window, fir_design, skip_by_annotation, pad, verbose)

~/repo/lib/python3.8/site-packages/mne/filter.py in filter(self, l_freq, h_freq, picks, filter_length, l_trans_bandwidth, h_trans_bandwidth, n_jobs, method, iir_params, phase, fir_window, fir_design, skip_by_annotation, pad, verbose)
   1923         if pad is None and method != 'iir':
   1924             pad = 'edge'
-> 1925         update_info, picks = _filt_check_picks(self.info, picks,
   1926                                                l_freq, h_freq)
   1927         if isinstance(self, BaseRaw):

~/repo/lib/python3.8/site-packages/mne/filter.py in _filt_check_picks(info, picks, h_freq, l_freq)
   2232     update_info = False
   2233     # This will pick *all* data channels
-> 2234     picks = _picks_to_idx(info, picks, 'data_or_ica', exclude=())
   2235     if h_freq is not None or l_freq is not None:
   2236         data_picks = _picks_to_idx(info, None, 'data_or_ica', exclude=(),

~/repo/lib/python3.8/site-packages/mne/io/pick.py in _picks_to_idx(info, picks, none, exclude, allow_empty, with_ref_meg, return_kind)
    982         raise ValueError('picks must be 1D, got %sD' % (picks.ndim,))
    983     if picks.dtype.char in ('S', 'U'):
--> 984         picks = _picks_str_to_idx(info, picks, exclude, with_ref_meg,
    985                                   return_kind, extra_repr, allow_empty,
    986                                   orig_picks)

~/repo/lib/python3.8/site-packages/mne/io/pick.py in _picks_str_to_idx(info, picks, exclude, with_ref_meg, return_kind, extra_repr, allow_empty, orig_picks)
   1038             if len(picks_generic) == 0 and orig_picks is None and \
   1039                     not allow_empty:
-> 1040                 raise ValueError('picks (%s) yielded no channels, consider '
   1041                                  'passing picks explicitly'
   1042                                  % (repr(orig_picks) + extra_repr,))

ValueError: picks (NoneNone, treated as "data_or_ica") yielded no channels, consider passing picks explicitly

Hello, would it be possible for you to update to the latest stable version of MNE and see if the problem still occurs there?

Thanks!

Richard

Hello!

I updated to latest version (mne-0.22.1) and the problem continues…
I noticed that set the object info with eeg in ch_types parameter, the problem is solved. But I don’t know if eeg would change something about the signal internally …

it works => info = mne.create_info(ch_names=('1', '2'), sfreq=4000, ch_types='eeg')

The underlying problem here is that filtering by default only works with “data channels”, i.e. channels that typically contain brain activity. EMG is no data channel.

I think what should work is passing picks='emg' to filter() in order to enforce operation on the emg channel type. Can you give it a shot? :slight_smile:

1 Like

Yes, it works now!
In last version, passing the argument picks='emg' showed another error… Something like “data channel not found”.
Thank you!

1 Like

Yep, that’s a bug report I found on GitHub and figured it had been fixed in the meantime. Therefore I was asking you to update MNE :slight_smile: Great to hear it’s working for you now!! Have a good day!

1 Like