[Mne_analysis] not understanding use of pick_types

Megan Schendel mschendel at mrn.org
Tue Oct 29 19:17:40 EDT 2019
Search archives:

        External Email - Use Caution        

Hi all,
I'm reading in some already created epoch objects for some further
processing.  If I try pick_types(meg=True), it works.  If I want to create
separate epoch objects for mag and grad channels, I get errors.  Trying
pick_types(meg='grad') or pick_types(meg='mag').  Weirdly, I get a
different error if I"m trying 'mag' or 'grad'.  Next step would be to use
get_data() on epochs to work with the different data types.

Using an older version of mne at the moment:
In [94]: mne.__version__
Out[94]: '0.15.2'

See below for lines and errors.  Thanks for any help!
Megan

These two lines work fine
    epochs = mne.read_epochs(fname_epochs, proj=True, preload=True)
    epochs =  epochs.pick_types(meg=True)
However, if I try:
    mag_epochs =  epochs.pick_types(meg='mag')
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-91-08585afe08b3> in <module>()
----> 1 mag_epochs =  epochs.pick_types(meg='mag')

/export/research/analysis/human/jstephen/shared/programs/python/anaconda3/lib/python3.5/site-packages/mne/channels/channels.py
in pick_types(self, meg, eeg, stim, eog, ecg, emg, ref_meg, misc, resp,
chpi, exci, ias, syst, seeg, dipole, gof, bio, ecog, fnirs, include,
exclude, selection)
    674             ecog=ecog, fnirs=fnirs, include=include,
exclude=exclude,
    675             selection=selection)
--> 676         self._pick_drop_channels(idx)
    677         return self
    678

/export/research/analysis/human/jstephen/shared/programs/python/anaconda3/lib/python3.5/site-packages/mne/channels/channels.py
in _pick_drop_channels(self, idx)
    753
    754         if getattr(self, 'picks', None) is not None:
--> 755             self.picks = self.picks[idx]
    756
    757         if hasattr(self, '_cals'):

IndexError: index 0 is out of bounds for axis 1 with size 0



    grad_epochs =  epochs.pick_types(meg='grad')
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-92-c744d6b0a4ad> in <module>()
----> 1 grad_epochs =  epochs.pick_types(meg='grad')

/export/research/analysis/human/jstephen/shared/programs/python/anaconda3/lib/python3.5/site-packages/mne/channels/channels.py
in pick_types(self, meg, eeg, stim, eog, ecg, emg, ref_meg, misc, resp,
chpi, exci, ias, syst, seeg, dipole, gof, bio, ecog, fnirs, include,
exclude, selection)
    674             ecog=ecog, fnirs=fnirs, include=include,
exclude=exclude,
    675             selection=selection)
--> 676         self._pick_drop_channels(idx)
    677         return self
    678

/export/research/analysis/human/jstephen/shared/programs/python/anaconda3/lib/python3.5/site-packages/mne/channels/channels.py
in _pick_drop_channels(self, idx)
    758             self._cals = self._cals[idx]
    759
--> 760         pick_info(self.info, idx, copy=False)
    761
    762         if getattr(self, '_projector', None) is not None:

/export/research/analysis/human/jstephen/shared/programs/python/anaconda3/lib/python3.5/site-packages/mne/io/pick.py
in pick_info(info, sel, copy)
    390         return info
    391     elif len(sel) == 0:
--> 392         raise ValueError('No channels match the selection.')
    393
    394     info['chs'] = [info['chs'][k] for k in sel]

ValueError: No channels match the selection.


MEG Technician
The Mind Research Network
1101 Yale Blvd. NE
Albuquerque, New Mexico 87106
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20191029/8b5a3a88/attachment-0001.html 


More information about the Mne_analysis mailing list