From 5a165cb69e47d0262be2a2603f79c1037f65bdce Mon Sep 17 00:00:00 2001 From: hhj <2023025086@m.scnu.edu.cn> Date: Sun, 12 Jan 2025 13:14:26 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E4=BF=AE=E6=94=B9=E4=BA=86=E4=B9=8B?= =?UTF-8?q?=E5=89=8D=E5=9B=A0=E5=B0=86os.path=E6=9B=B4=E6=8D=A2=E6=88=90Pa?= =?UTF-8?q?th=E5=90=8E=E4=BA=A7=E7=94=9F=E7=9A=84bug=202=E3=80=81=E7=94=B1?= =?UTF-8?q?=E4=BA=8Etdqm=E5=BA=93=E4=BC=9A=E5=AF=B9exe=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E7=9A=84=E8=BF=90=E8=A1=8C=E4=BA=A7=E7=94=9F=E5=B4=A9=E6=BA=83?= =?UTF-8?q?=E5=BD=B1=E5=93=8D=EF=BC=8C=E5=9B=A0=E6=AD=A4=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E4=BA=86tqdm=E5=BA=93=203=E3=80=81=E4=BF=AE=E6=94=B9=E4=B9=90r?= =?UTF-8?q?equirements.txt=E7=9A=84=E9=83=A8=E5=88=86=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Main_Quality_Relabel_GUI.py | 9 ++++----- PSG_label_2_BCG_label.py | 2 +- requirements.txt | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) 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