Picking a particular channel is currently relatively complex for new users.
It either involves pythonic tricks:
picks = [ii for ii, ch in enumerate(epochs.ch_names) if ch == 'mychan']
epochs.plot(picks=picks)
Or master of MNE's functions:
picks = mne.pick_channels(evoked.info. [`my_chan`])
epochs.plot(picks=picks)
Proposal 1
👍 0
Since picks is always referring to a list of int and ch_names is always a list of str, I propose that we accept picks ot be a list of str:
evoked.plot(picks=list(range(10)))
epochs.plot(picks=['my_chan'])
Proposal 2
👍 0
Accepting the parameter picks to be a list of int (for indexing), a list of str (to find channel names) or a dict (to quickly select channel types).
evoked.plot(picks=list(range(10)))
evoked.plot(picks=['MEG 1132', 'MEG 1022'])
evoked.plot(picks=dict(grad=True, eeg=False))
- advantage: no deprecation, simplification of channel picking
- disadvantage: keep clunky pick_type API
Proposal 3
👍 0
Same as proposal 2, but change pick_types to accept a types key that would accept list of str. This would allow
evoked.plot(picks=list(range(10)))
evoked.plot(picks=['MEG 1132', 'MEG 1022'])
evoked.plot(picks=dict(grad=True, eeg=False))
evoked.plot(picks=dict(types=('eeg', 'mag')))
mne.pick_types(info, types=('eeg', 'mag'))
- advantage: easier to loop across channel types, no deprecation
- disadvantage: more than one way to do pick_types
Proposal 4:
👍 4 (@larsoner, @kingjr, @nbara, @choldgraf)
Same as proposal 1, but automatically detect if str refer to ch_names of ch_types.
evoked.plot(picks=list(range(10)))
evoked.plot(picks=['MEG 1132', 'MEG 1022'])
evoked.plot(picks=('eeg', 'meg'))
- inconvenient: risk of conflict between channel names and channel types
- advantage: easier to loop across channel types
Picking a particular channel is currently relatively complex for new users.
It either involves pythonic tricks:
Or master of MNE's functions:
Proposal 1
👍 0
Since
picksis always referring to a list ofintandch_namesis always a list ofstr, I propose that we acceptpicksot be a list ofstr:Proposal 2
👍 0
Accepting the parameter
picksto be a list ofint(for indexing), a list ofstr(to find channel names) or adict(to quickly select channel types).Proposal 3
👍 0
Same as proposal 2, but change pick_types to accept a
typeskey that would accept list ofstr. This would allowProposal 4:
👍 4 (@larsoner, @kingjr, @nbara, @choldgraf)
Same as proposal 1, but automatically detect if str refer to
ch_namesofch_types.