本文整理汇总了Python中mne.fiff.Raw.filter方法的典型用法代码示例。如果您正苦于以下问题:Python Raw.filter方法的具体用法?Python Raw.filter怎么用?Python Raw.filter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mne.fiff.Raw
的用法示例。
在下文中一共展示了Raw.filter方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Raw
# 需要导入模块: from mne.fiff import Raw [as 别名]
# 或者: from mne.fiff.Raw import filter [as 别名]
import mne
from mne.fiff import Raw
from mne.preprocessing.ica import ICA
from mne.datasets import sample
from mne.filter import band_pass_filter
###############################################################################
# Setup paths and prepare raw data
data_path = sample.data_path()
raw_fname = data_path + '/MEG/sample/sample_audvis_filt-0-40_raw.fif'
raw = Raw(raw_fname, preload=True)
raw.filter(1, 45, n_jobs=2)
picks = mne.fiff.pick_types(raw.info, meg=True, eeg=False, eog=False,
stim=False, exclude='bads')
###############################################################################
# Setup ICA seed decompose data, then access and plot sources.
# Instead of the actual number of components here we pass a float value
# between 0 and 1 to select n_components based on the percentage of
# variance explained by the PCA components.
ica = ICA(n_components=0.90, n_pca_components=None, max_pca_components=None,
random_state=0)
# Also we decide to use all PCA components before mixing back to sensor space.
示例2: Raw
# 需要导入模块: from mne.fiff import Raw [as 别名]
# 或者: from mne.fiff.Raw import filter [as 别名]
from mne.fiff import Raw
from mne.datasets import spm_face
from mne.decoding import time_generalization
data_path = spm_face.data_path()
###############################################################################
# Load and filter data, set up epochs
raw_fname = data_path + '/MEG/spm/SPM_CTF_MEG_example_faces%d_3D_raw.fif'
raw = Raw(raw_fname % 1, preload=True) # Take first run
raw.append(Raw(raw_fname % 2, preload=True)) # Take second run too
picks = mne.fiff.pick_types(raw.info, meg=True, exclude='bads')
raw.filter(1, 45, method='iir')
events = mne.find_events(raw, stim_channel='UPPT001')
event_id = {"faces": 1, "scrambled": 2}
tmin, tmax = -0.1, 0.5
# Set up pick list
picks = fiff.pick_types(raw.info, meg=True, eeg=False, stim=True, eog=True,
ref_meg=False, exclude='bads')
# Read epochs
decim = 4 # decimate to make the example faster to run
epochs = mne.Epochs(raw, events, event_id, tmin, tmax, proj=True,
picks=picks, baseline=None, preload=True,
reject=dict(mag=1.5e-12), decim=decim)
示例3: ICA
# 需要导入模块: from mne.fiff import Raw [as 别名]
# 或者: from mne.fiff.Raw import filter [as 别名]
filter_type = 'butter'
filter_order = 4
n_jobs = 4
n_components=0.99
n_pca_components=1.0
max_pca_components=None
ecg_ch_name = 'ECG 001'
res_ch_name = 'STI 013'
sti_ch_name = 'STI 014'
eog_ch_name = 'EOG 002'
picks = mne.fiff.pick_types(raw.info, meg=True, exclude='bads')
#raw.filter(l_freq=1, h_freq=45, picks=picks, n_jobs=n_jobs)
raw.filter(flow, fhigh, picks=picks, n_jobs=n_jobs, method='iir',
iir_params={'ftype': filter_type, 'order': filter_order})
ica = ICA(n_components=n_components, n_pca_components=n_pca_components, max_pca_components=max_pca_components,
random_state=0)
ica.decompose_raw(raw, picks=picks, decim=3)
##################EOG 1st rejection####################################
eog_ch_idx = [raw.ch_names.index(eog_ch_name)]
raw.filter(picks=eog_ch_idx, l_freq=1, h_freq=10)
eog_scores = ica.find_sources_raw(raw, raw[eog_ch_idx][0])
eog_idx = np.where(np.abs(eog_scores) > 0.1)[0]
ica.exclude += list(eog_idx)