本文整理汇总了Python中mne.fiff.Raw.to_nitime方法的典型用法代码示例。如果您正苦于以下问题:Python Raw.to_nitime方法的具体用法?Python Raw.to_nitime怎么用?Python Raw.to_nitime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mne.fiff.Raw
的用法示例。
在下文中一共展示了Raw.to_nitime方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_raw_to_nitime
# 需要导入模块: from mne.fiff import Raw [as 别名]
# 或者: from mne.fiff.Raw import to_nitime [as 别名]
def test_raw_to_nitime():
""" Test nitime export """
raw = Raw(fif_fname, preload=True)
picks_meg = pick_types(raw.info, meg=True, exclude='bads')
picks = picks_meg[:4]
raw_ts = raw.to_nitime(picks=picks)
assert_true(raw_ts.data.shape[0] == len(picks))
raw = Raw(fif_fname, preload=False)
picks_meg = pick_types(raw.info, meg=True, exclude='bads')
picks = picks_meg[:4]
raw_ts = raw.to_nitime(picks=picks)
assert_true(raw_ts.data.shape[0] == len(picks))
raw = Raw(fif_fname, preload=True)
picks_meg = pick_types(raw.info, meg=True, exclude='bads')
picks = picks_meg[:4]
raw_ts = raw.to_nitime(picks=picks, copy=False)
assert_true(raw_ts.data.shape[0] == len(picks))
raw = Raw(fif_fname, preload=False)
picks_meg = pick_types(raw.info, meg=True, exclude='bads')
picks = picks_meg[:4]
raw_ts = raw.to_nitime(picks=picks, copy=False)
assert_true(raw_ts.data.shape[0] == len(picks))
示例2: Raw
# 需要导入模块: from mne.fiff import Raw [as 别名]
# 或者: from mne.fiff.Raw import to_nitime [as 别名]
data_path = sample.data_path()
raw_fname = data_path + '/MEG/sample/sample_audvis_filt-0-40_raw.fif'
###############################################################################
# get raw data
raw = Raw(raw_fname)
# set picks
picks = mne.fiff.pick_types(raw.info, meg=True, eeg=False, eog=False,
stim=False, exclude='bads')
# pick times relative to the onset of the MEG measurement.
start, stop = raw.time_as_index([100, 115], use_first_samp=False)
# export to nitime using a copy of the data
raw_ts = raw.to_nitime(start=start, stop=stop, picks=picks, copy=True)
###############################################################################
# explore some nitime timeseries features
# get start
print raw_ts.t0
# get duration
print raw_ts.duration
# get sample duration (sampling interval)
print raw_ts.sampling_interval
# get exported raw infor
print raw_ts.metadata.keys()