本文整理汇总了Python中mne.io.RawArray._data[picks]方法的典型用法代码示例。如果您正苦于以下问题:Python RawArray._data[picks]方法的具体用法?Python RawArray._data[picks]怎么用?Python RawArray._data[picks]使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mne.io.RawArray
的用法示例。
在下文中一共展示了RawArray._data[picks]方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: extract_X_and_y
# 需要导入模块: from mne.io import RawArray [as 别名]
# 或者: from mne.io.RawArray import _data[picks] [as 别名]
def extract_X_and_y(raw_nparray, raw_info, opts, verbose=False):
# need to make a new RawArray, because once we apply filter, we mutate its internal _data
raw = RawArray(raw_nparray, raw_info, verbose=verbose)
picks = pick_types(raw.info, eeg=True)
picks = getChannelSubsetMotorBand()
# picks = getChannelSubsetFront()
# picks = getChannelSubsetBack()
# print picks
# Apply band-pass filter
raw._data[picks] = lfilter(opts.b, opts.a, raw._data[picks])
consecutive = True
train_events = mne.find_events(raw, shortest_event=0, consecutive=consecutive, verbose=verbose)
train_epochs = Epochs(
raw,
train_events,
opts.event_labels,
tmin=opts.epoch_full_tmin,
tmax=opts.epoch_full_tmax,
proj=True,
picks=picks,
baseline=None,
preload=True,
add_eeg_ref=False,
verbose=verbose,
)
epochs_trimmed = train_epochs.copy().crop(tmin=opts.epoch_trim_tmin, tmax=opts.epoch_trim_tmax)
if verbose:
print "train: epochs", epochs_trimmed
X = epochs_trimmed.get_data()
y = epochs_trimmed.events[:, -1] - 2
if verbose:
print "y", y.shape
return [X, y]