[Mne_analysis] Pick a channel from the epoch data?
Denis-Alexander Engemann
denis.engemann at gmail.com
Mon Oct 27 11:47:33 EDT 2014
Hi, Maria,
what do you get if you type:
'MEG0242' in epochs_condition_1.ch_names
-Denis
2014-10-27 16:44 GMT+01:00 Maria Hakonen <maria.hakonen at gmail.com>:
> I think that the space is not the problem because at least in the case of
> evoked data 'MEG 0242' works. I also tried condition_1.pick_channels(['MEG0242'])
> but got an error:
>
> ----> 1 epochs_condition_1.pick_channels(['MEG0242'])
>
> /home/mhhakone/Downloads/mne-python/mne/channels.pyc in
> pick_channels(self, ch_names, copy)
> 148
> 149 idx = [inst.ch_names.index(c) for c in ch_names if c in
> inst.ch_names]
> --> 150 inst._pick_drop_channels(idx)
> 151
> 152 return inst
>
> /home/mhhakone/Downloads/mne-python/mne/channels.pyc in
> _pick_drop_channels(self, idx)
> 192 self.cals = self.cals[idx]
> 193
> --> 194 self.info = pick_info(self.info, idx, copy=False)
> 195
> 196 if inst_has('_projector'):
>
> /home/mhhakone/Downloads/mne-python/mne/io/pick.pyc in pick_info(info,
> sel, copy)
> 285
> 286 if len(sel) == 0:
> --> 287 raise ValueError('Warning : No channels match the
> selection.')
> 288
> 289 info['chs'] = [info['chs'][k] for k in sel]
>
> ValueError: Warning : No channels match the selection.
>
> -Maria
>
> 2014-10-27 17:32 GMT+02:00 Laetitia Grabot <laetitia.grabot at gmail.com>:
>
>> You should try without the space between MEG and 0242, like this:
>> epochs_condition_1.pick_channels(['MEG0242'])
>> Normally it works!
>>
>> 2014-10-27 16:22 GMT+01:00 Maria Hakonen <maria.hakonen at gmail.com>:
>>
>>> Hi,
>>>
>>> I tried that as:
>>> epochs_condition_1.pick_channels(['MEG 0242'])
>>>
>>> but got an error:
>>>
>>> ----> 1 epochs_condition_1.pick_channels(['MEG 0242'])
>>>
>>> /home/mhhakone/Downloads/mne-python/mne/channels.pyc in
>>> pick_channels(self, ch_names, copy)
>>> 148
>>> 149 idx = [inst.ch_names.index(c) for c in ch_names if c in
>>> inst.ch_names]
>>> --> 150 inst._pick_drop_channels(idx)
>>> 151
>>> 152 return inst
>>>
>>> /home/mhhakone/Downloads/mne-python/mne/channels.pyc in
>>> _pick_drop_channels(self, idx)
>>> 187
>>> 188 if inst_has('picks'):
>>> --> 189 self.picks = self.picks[idx]
>>> 190
>>> 191 if inst_has('cals'):
>>>
>>> IndexError: index 22 out of bounds 0<=index<0
>>>
>>> Could someone please let me know what I am doing wrong?
>>>
>>> epochs_condition_1 is:
>>>
>>> epochs_condition_1
>>> Out[40]: <Epochs | n_events : 160 (all good), tmin : -0.0999936018905
>>> (s), tmax : 0.999936018905 (s), baseline : (-0.09999360144138336, 0.0)>
>>>
>>> Thanks,
>>> Maria
>>>
>>> 2014-10-27 17:02 GMT+02:00 Laetitia Grabot <laetitia.grabot at gmail.com>:
>>>
>>>> Hi,
>>>> There is a method that you can apply to your epochs object to select a
>>>> channel:
>>>> epochs.pick_channels()
>>>>
>>>> Laetitia
>>>>
>>>> 2014-10-27 15:52 GMT+01:00 Maria Hakonen <maria.hakonen at gmail.com>:
>>>>
>>>>> Hi,
>>>>>
>>>>> I have loaded epochs with mne.read_epochs and would need to pick a
>>>>> channel from the epoch data. I wonder if there is any function to do this?
>>>>> mne.pick_channels_evoked seems to work for evoked data, but I haven't found
>>>>> the corresponding function for epochs.
>>>>>
>>>>> Thanks,
>>>>> Maria
>>>>>
>>>>> _______________________________________________
>>>>> Mne_analysis mailing list
>>>>> Mne_analysis at nmr.mgh.harvard.edu
>>>>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>>>>>
>>>>>
>>>>> The information in this e-mail is intended only for the person to whom
>>>>> it is
>>>>> addressed. If you believe this e-mail was sent to you in error and the
>>>>> e-mail
>>>>> contains patient information, please contact the Partners Compliance
>>>>> HelpLine at
>>>>> http://www.partners.org/complianceline . If the e-mail was sent to
>>>>> you in error
>>>>> but does not contain patient information, please contact the sender
>>>>> and properly
>>>>> dispose of the e-mail.
>>>>>
>>>>>
>>>>
>>>> _______________________________________________
>>>> Mne_analysis mailing list
>>>> Mne_analysis at nmr.mgh.harvard.edu
>>>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>>>>
>>>>
>>>> The information in this e-mail is intended only for the person to whom
>>>> it is
>>>> addressed. If you believe this e-mail was sent to you in error and the
>>>> e-mail
>>>> contains patient information, please contact the Partners Compliance
>>>> HelpLine at
>>>> http://www.partners.org/complianceline . If the e-mail was sent to you
>>>> in error
>>>> but does not contain patient information, please contact the sender and
>>>> properly
>>>> dispose of the e-mail.
>>>>
>>>>
>>>
>>> _______________________________________________
>>> Mne_analysis mailing list
>>> Mne_analysis at nmr.mgh.harvard.edu
>>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>>>
>>>
>>> The information in this e-mail is intended only for the person to whom
>>> it is
>>> addressed. If you believe this e-mail was sent to you in error and the
>>> e-mail
>>> contains patient information, please contact the Partners Compliance
>>> HelpLine at
>>> http://www.partners.org/complianceline . If the e-mail was sent to you
>>> in error
>>> but does not contain patient information, please contact the sender and
>>> properly
>>> dispose of the e-mail.
>>>
>>>
>>
>> _______________________________________________
>> Mne_analysis mailing list
>> Mne_analysis at nmr.mgh.harvard.edu
>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>>
>>
>> The information in this e-mail is intended only for the person to whom it
>> is
>> addressed. If you believe this e-mail was sent to you in error and the
>> e-mail
>> contains patient information, please contact the Partners Compliance
>> HelpLine at
>> http://www.partners.org/complianceline . If the e-mail was sent to you
>> in error
>> but does not contain patient information, please contact the sender and
>> properly
>> dispose of the e-mail.
>>
>>
>
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>
>
> The information in this e-mail is intended only for the person to whom it
> is
> addressed. If you believe this e-mail was sent to you in error and the
> e-mail
> contains patient information, please contact the Partners Compliance
> HelpLine at
> http://www.partners.org/complianceline . If the e-mail was sent to you in
> error
> but does not contain patient information, please contact the sender and
> properly
> dispose of the e-mail.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20141027/fd10e5e4/attachment.html
More information about the Mne_analysis
mailing list