import os
import numpy as np
import pandas as pd
import mne
import matplotlib.pyplot as plt
import xml.etree.ElementTree
from xml.etree.ElementTree import parse
#可交互
# %matplotlib qt
#自己构建一个蒙太奇模块
# xml = parse('D:\\notebook\\EEG\\MNE\\EEGprocessing-main\\mymontage.xml')
# root = xml.getroot()
# mydic = dict()
# for channel in root.findall('CHANNEL'):
# label = channel.find('LABEL')
# pos = channel.find('POSITION')
# if pos is None:
# continue
# lis = pos.text.split()
# a = np.array(lis).astype(np.float64)/1000
# a[0] = -a[0]
# a[1] = -a[1]
# mydic[label.text] = a
# mymontage = mne.channels.make_dig_montage(ch_pos=mydic,coord_frame='head')
#循环遍历
#for data in ['f008.set','f009.set'.......];
#将数据读进来
raw = mne.io.read_raw_eeglab('D:/notebook/EEG/MNE/EEGprocessing-main/da