diff --git a/Main_Quality_Relabel_GUI.py b/Main_Quality_Relabel_GUI.py index 7076c90..10386d4 100644 --- a/Main_Quality_Relabel_GUI.py +++ b/Main_Quality_Relabel_GUI.py @@ -15,7 +15,6 @@ from matplotlib import pyplot as plt, gridspec from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg, NavigationToolbar2QT from pyedflib import EdfReader from datetime import datetime -from tqdm import tqdm from pathlib import Path from PyQt5.QtCore import QCoreApplication, QThread, pyqtSignal from PyQt5.QtWidgets import QFileDialog, QMainWindow, QMessageBox, QButtonGroup, QApplication @@ -194,10 +193,10 @@ class MainWindow(QMainWindow, Ui_MainWindow): self.Artifact_Label_Path = self.dir_path / "Artifact_label" self.Artifact_Offset_Path = self.dir_path / "Artifact_label" / "20220421Artifact_offset_value.xlsx" if self.PSG_Data_Path.exists() and self.BCG_Data_Path.exists() and self.BCG_Label_Path.exists() and self.Artifact_Label_Path.exists() and self.Artifact_Label_Path.exists(): - sampIDs = self.BCG_Data_Path.glob() + sampIDs = self.BCG_Data_Path.glob('*.*') sampID_for_comboBox = [] for sampID in sampIDs: - sampID = sampID.replace("samp.npy", "") + sampID = sampID.name.replace("samp.npy", "") sampID_for_comboBox.append(sampID) bcg_path = self.BCG_Data_Path / f"{sampID}samp.npy" ecg_path = self.PSG_Data_Path / f"A{str(sampID).rjust(7, '0')}.edf" @@ -236,7 +235,7 @@ class MainWindow(QMainWindow, Ui_MainWindow): self.pushButton_confirmLabel.setEnabled(True) self.pushButton_confirmLabel.setText("开始打标") MainWindow.setWindowTitle(self, QCoreApplication.translate("MainWindow", - "Main_Quality_Relabel_GUI - Data Path: " + self.dir_path)) + "Main_Quality_Relabel_GUI - Data Path: " + str(self.dir_path))) info("Successfully Loaded Data Path.") self.textBrowser_update("操作:数据路径选择成功") else: @@ -836,7 +835,7 @@ class MainWindow(QMainWindow, Ui_MainWindow): self.bcg_event_label_index_list = df2.index.tolist() info("Traversaling XinXiao events...") self.textBrowser_update("提示:正在遍历心晓事件") - for one_data in tqdm(df.index): + for one_data in df.index: one_data = df.loc[one_data] SP = one_data["Start"] * self.frequency EP = one_data["End"] * self.frequency diff --git a/PSG_label_2_BCG_label.py b/PSG_label_2_BCG_label.py index 3fdb4e4..14fa7f3 100644 --- a/PSG_label_2_BCG_label.py +++ b/PSG_label_2_BCG_label.py @@ -11,7 +11,7 @@ base_event = ["Hypopnea", "Central apnea", "Obstructive apnea", "Mixed apnea"] # 输入设置 sampID = 888 -dir_path = r"E:\data_annotation\6SleepApnea_annotation_GUI_demo\data" +dir_path = r"D:\code\SA_Label\data" # 数据路径设置 PSG_Data_Path = Path(os.path.join(dir_path, "PSG")) diff --git a/requirements.txt b/requirements.txt index c7022d6..69b8482 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,5 +9,5 @@ PyQt5_sip==12.16.1 PyYAML==6.0.1 scipy==1.15.1 six==1.17.0 -tqdm==4.66.4 +openpyxl==3.1.5