由于标签、数据和体动都已完成对齐,因此删除了Artifact_Offset的使用。

This commit is contained in:
Yorusora 2025-01-14 19:57:59 +08:00
parent 6efa829dcf
commit bd026d1895

View File

@ -191,7 +191,6 @@ class MainWindow(QMainWindow, Ui_MainWindow):
self.BCG_Data_Path = self.dir_path / "BCG"
self.BCG_Label_Path = self.dir_path / "BCG_label"
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('*.*')
sampID_for_comboBox = []
@ -852,16 +851,14 @@ class MainWindow(QMainWindow, Ui_MainWindow):
self.textBrowser_update("提示:完成遍历心晓事件")
def read_artifact_label(self):
all_offset_length = read_excel(self.Artifact_Offset_Path)
offset_length = all_offset_length[all_offset_length['数据编号'] == self.sampNo]['from_code'].values[0]
artifact_label_path = self.Artifact_Label_Path / f"Artifact_{self.sampNo}.txt"
artifact_label = read_csv(artifact_label_path, header=None).to_numpy().reshape(-1, 4)
self.artifact_event_label = zeros(len(self.bcg_event_label) + self.extend_second * self.frequency)
for i, artifact_type, SP, EP in artifact_label:
SP = (int(SP) + offset_length) // (1000 // self.frequency)
EP = (int(EP) + offset_length) // (1000 // self.frequency)
SP = int(SP) // (1000 // self.frequency)
EP = int(EP) // (1000 // self.frequency)
artifact_type = int(artifact_type) + 5
SP = 0 if SP < 0 else SP