neurolang

@neurolang

PyConTW 2021 project

Public team

Community (0)
No community contribution yet

Joined on Sep 15, 2021

  • 從原始資料依照事件標記將原始訊號切成若干片段並輸出epochs物件。 translated from https://mne.tools/stable/generated/mne.Epochs.html translator: Tien, Hsin-Ping class mne.Epochs(raw, events, event_id=None, tmin=- 0.2, tmax=0.5, baseline=(None, 0), picks=None, preload=False, reject=None, flat=None, proj=True, decim=1, reject_tmin=None, reject_tmax=None, detrend=None, on_missing='raise', reject_by_annotation=True, metadata=None, event_repeated='error', verbose=None) 參數 raw: Raw物件 原始資料輸入
     Like  Bookmark
  • #translator: Yanni Wu 吳亞凝 利用樣本生理結構建立模擬原始數據 此範例闡述如何使用mne.simulation.SourceSimulator的類組以樣本生理結構進行來源估計以及模擬原始數據。 #內容已搬遷,此為連結網址:https://colab.research.google.com/drive/1O6tlh1ovigIpr52fdc8jO8vLgX8CYge1?usp=sharing #原文網址:https://mne.tools/stable/auto_examples/simulation/simulated_raw_data_using_subject_anatomy.html#sphx-glr-auto-examples-simulation-simulated-raw-data-using-subject-anatomy-py #Author: Ivana Kojcic ivana.kojcic@gmail.com
     Like  Bookmark
  • Cheong Tong Hou Raw 是資料來源 Raw: mne.io.Raw(fname, allow_maxshield=False, preload=False,on_split_missing='raise', verbose=None) raw data 有各式各樣的來源檔,較常見的是(.cnt、.ctf、.cdt、.edf),亦可以從csv檔中讀取數據 讀取各式各樣的檔案有各自對應的function Example:
     Like 1 Bookmark
  • test test
     Like  Bookmark
  • %matplotlib qt import mne import numpy as np import matplotlib.pyplot as plt from mne.io import read_raw_fif, concatenate_raws from mne.preprocessing import ICA fif_file = 'derivatives_meg_derivatives_sub-16_ses-meg_meg_sub-16_ses-meg_task-facerecognition_run-01_proc-sss_meg.fif'
     Like  Bookmark
  • %matplotlib qt import mne import numpy as np data_path = '/Users/kevinhsu/Documents/D/000_course/my2020_1082_EEGBasic/opendatasets' raw = mne.io.read_raw_eeglab(data_path + '/subject2_cold_frequent_letter_left_response.set') raw.plot() np.unique(raw.annotations.description)
     Like  Bookmark
  • # MNE Source Model (Part 2) In this example, we read a con file. And save these data in a epoch file and a evoked file. ```python %matplotlib qt ``` ```python data_path = '/Users/kevinhsu/Documents/D/000_experiment/project_cospro/PG_meg_data/001_temp' confile = data_path + '/de_EM.con' raw = mne.io.kit.read_raw_kit(confile, stim = [192, 193, 194], slope = '+') picks = mne.pick_types(raw.info, meg=True, eeg=False, stim=False) raw.load_data() raw.pick(picks) noise_cov = mne.compute_raw_covar
     Like  Bookmark
  • # 希爾伯特黃轉換(Hilbert Huang Transform) 這邊需要用到 `PyEMD` 套件,以及翻譯自黃院士的 matlab libary 的 `nspplota` 首先來設定一下執行整套 HHT 需要的計算資源 ```python import mne import matplotlib.pyplot as plt import pandas as pd import numpy as np from mne.time_frequency import tfr_stockwell # HHT tools from PyEMD import EEMD as py_eemd from scipy.signal import hilbert, medfilt #from eemd_faphi import * from nspplota import nspplota from scipy.ndimage import gaussian_filter, uniform_filter EEMD_class = py_eemd(trials = 40, noise_
     Like  Bookmark
  • # 從 MNE-Python 的 class 取得數據 從原始檔 'de00110.con' 進行前處理: ```python import mne import matplotlib.pyplot as plt import pandas as pd import numpy as np # 本機端儲存 de00110.con 檔案的目錄 data_path = '/folder1/folder2/doc' # 匯入 CON 檔 sid = 1 confile = data_path + '/de%.3d10.con' % sid # raw = mne.io.kit.read_raw_kit(confile, stim = [192, 193, 194], slope = '+') # MNE-Python 會將原本分散在各 trigger channel 的標記合併到 # 同一個 channel 上 (`STI 014`)。後面的分析就利用 STI 014 # 產生事件 onsets 的列表 events = mne.find_events(raw, stim_c
     Like  Bookmark
  • # Grand averaging and difference waves ```python %matplotlib qt ``` ```python import mne import matplotlib.pyplot as plt import pandas as pd import numpy as np ``` ```python evoked1, evoked2 = mne.read_evokeds('001-ave.fif') print(evoked1) print(evoked2) ``` Reading 001-ave.fif ... Isotrak not found Found the data of interest: t = -100.00 ... 700.00 ms (words) 0 CTF compensation matrices available nave = 144 - aspect type = 100
     Like  Bookmark
  • # Time Frequency Analysis (wavelet) ```python %matplotlib qt ``` ```python import mne import matplotlib.pyplot as plt import pandas as pd import numpy as np from mne.time_frequency import tfr_morlet, psd_multitaper data_path = '/Users/kevinhsu/Documents/D/000_experiment/compounding_VR/2013_megdata' sid = 1 epochs_file = data_path + '/%.3dnn_raw_epo.fif' % sid epochs = mne.read_epochs(epochs_file) epochs ``` Reading /Users/kevinhsu/Documents/D/000_experiment/compounding_VR/2013_megdata/
     Like  Bookmark
  • # import a CON file In this example, we read a con file. And save these data in a epoch file and a evoked file. ```python %matplotlib qt ``` ```python import mne import matplotlib.pyplot as plt import pandas as pd import numpy as np data_path = '/Users/kevinhsu/Documents/D/000_experiment/compounding_VR/2013_megdata' # import raw CON sid = 6 confile = data_path + '/de%.3dnn.con' % sid # # /Users/kevinhsu/Documents/D/000_experiment/compounding_VR/2013_megdata/de001nn.con raw = mne.io.
     Like  Bookmark
  • # ICA: EOG correction ```python %matplotlib qt ``` ```python import mne import matplotlib.pyplot as plt import pandas as pd import numpy as np from mne.preprocessing import ICA # for ICA data_path = '/Users/kevinhsu/Documents/D/000_experiment/compounding_VR/2013_megdata' sid = 2 # import raw CON confile = data_path + '/de%.3dnn.con' % sid # # /Users/kevinhsu/Documents/D/000_experiment/compounding_VR/2013_megdata/de001nn.con raw = mne.io.kit.read_raw_kit(confile, stim = [192, 193, 194]
     Like  Bookmark