新增了<呼吸可用性及间期标注>的体动分类显示的功能
This commit is contained in:
@ -285,6 +285,12 @@ class MainWindow_resp_quality_label(QMainWindow):
|
||||
self.ui.pushButton_reset.clicked.connect(self.__slot_btn_label__)
|
||||
self.ui.lineEdit_filter_labeled.textChanged.connect(self.__slot_lineEdit_filter__)
|
||||
self.ui.lineEdit_filter_tobelabeled.textChanged.connect(self.__slot_lineEdit_filter__)
|
||||
self.ui.checkBox_allin.clicked.connect(self.__slot_checkBox__)
|
||||
self.ui.checkBox_type1.clicked.connect(self.__slot_checkBox__)
|
||||
self.ui.checkBox_type2.clicked.connect(self.__slot_checkBox__)
|
||||
self.ui.checkBox_type3.clicked.connect(self.__slot_checkBox__)
|
||||
self.ui.checkBox_type4.clicked.connect(self.__slot_checkBox__)
|
||||
self.ui.checkBox_type5.clicked.connect(self.__slot_checkBox__)
|
||||
self.ui.doubleSpinBox_quality_threshold1.valueChanged.connect(self.update_config)
|
||||
self.ui.doubleSpinBox_quality_threshold2.valueChanged.connect(self.update_config)
|
||||
self.ui.doubleSpinBox_findpeaks_min_interval.valueChanged.connect(self.update_config)
|
||||
@ -349,7 +355,13 @@ class MainWindow_resp_quality_label(QMainWindow):
|
||||
sender == self.ui.pushButton_prev or
|
||||
sender == self.ui.pushButton_next or
|
||||
sender == self.ui.tableWidget_labeled or
|
||||
sender == self.ui.tableWidget_tobelabeled):
|
||||
sender == self.ui.tableWidget_tobelabeled or
|
||||
sender == self.ui.checkBox_allin or
|
||||
sender == self.ui.checkBox_type1 or
|
||||
sender == self.ui.checkBox_type2 or
|
||||
sender == self.ui.checkBox_type3 or
|
||||
sender == self.ui.checkBox_type4 or
|
||||
sender == self.ui.checkBox_type5):
|
||||
try:
|
||||
if Config["CurrentPartNum"] != Config["DataPartNum"]:
|
||||
begin_OrgBCG = Config["CurrentOrgBCGIndex"]
|
||||
@ -385,15 +397,34 @@ class MainWindow_resp_quality_label(QMainWindow):
|
||||
[self.data.Tho_peak_y[x] for x in
|
||||
[index for index, value in enumerate(self.data.Tho_peak) if begin_Tho <= value <= end_Tho]], 'ro',
|
||||
label=Constants.RESP_QUALITY_LABEL_PLOT_LABEL_THO_PEAKS)
|
||||
|
||||
# 绘制体动
|
||||
artifact_type_seq = array([])
|
||||
artifact_type_seq = artifact_type_seq.astype(int64)
|
||||
if self.ui.checkBox_type1.isChecked():
|
||||
artifact_type_seq = append(artifact_type_seq, 1)
|
||||
if self.ui.checkBox_type2.isChecked():
|
||||
artifact_type_seq = append(artifact_type_seq, 2)
|
||||
if self.ui.checkBox_type3.isChecked():
|
||||
artifact_type_seq = append(artifact_type_seq, 3)
|
||||
if self.ui.checkBox_type4.isChecked():
|
||||
artifact_type_seq = append(artifact_type_seq, 4)
|
||||
if self.ui.checkBox_type5.isChecked():
|
||||
artifact_type_seq = append(artifact_type_seq, 5)
|
||||
length = Config["InputConfig"]["OrgBCGUseFreq"] * Params.RESP_QUALITY_LABEL_PARTS_TIME_SEC
|
||||
mask = array([arange(length), arange(length), arange(length), arange(length), arange(length), arange(length)])
|
||||
mask = mask.astype(float64)
|
||||
for i in artifact_type_seq:
|
||||
mask[i] = self.data.artifact_mask[begin_OrgBCG:end_OrgBCG] == i
|
||||
mask[i] = (BDR[begin_OrgBCG:end_OrgBCG] * mask[i]).astype(float64)
|
||||
place(mask[i], mask[i] == 0, nan)
|
||||
self.ax0.plot(arange(begin_OrgBCG, end_OrgBCG), mask[i],
|
||||
label=f"{Constants.RESP_QUALITY_LABEL_PLOT_LABEL_ARTIFACT}{i}", color=Constants.PLOT_COLOR_RED,
|
||||
linestyle="-")
|
||||
|
||||
self.ax0.legend(loc=Constants.PLOT_UPPER_RIGHT)
|
||||
self.ax1.legend(loc=Constants.PLOT_UPPER_RIGHT)
|
||||
# 绘制体动
|
||||
mask = self.data.artifact_mask[begin_OrgBCG: end_OrgBCG] == 1
|
||||
mask = (BDR * mask).astype(float64)
|
||||
place(mask, mask == 0, nan)
|
||||
self.ax0.plot(arange(begin_OrgBCG, end_OrgBCG), mask,
|
||||
label=f"{Constants.RESP_QUALITY_LABEL_PLOT_LABEL_ARTIFACT}",
|
||||
color=Constants.PLOT_COLOR_PINK, linestyle="-")
|
||||
|
||||
# 绘制频谱
|
||||
self.ax0_spectrum.plot(bcg_freq, bcg_spectrum,
|
||||
label=Constants.RESP_QUALITY_LABEL_SPECTRUM_ORGBCG_LABEL,
|
||||
@ -952,6 +983,40 @@ class MainWindow_resp_quality_label(QMainWindow):
|
||||
else:
|
||||
raise ValueError("发生信号不存在")
|
||||
|
||||
def __slot_checkBox__(self):
|
||||
sender = self.sender()
|
||||
|
||||
if sender == self.ui.checkBox_allin:
|
||||
if self.ui.checkBox_allin.isChecked():
|
||||
self.ui.checkBox_type1.setChecked(True)
|
||||
self.ui.checkBox_type2.setChecked(True)
|
||||
self.ui.checkBox_type3.setChecked(True)
|
||||
self.ui.checkBox_type4.setChecked(True)
|
||||
self.ui.checkBox_type5.setChecked(True)
|
||||
else:
|
||||
self.ui.checkBox_type1.setChecked(False)
|
||||
self.ui.checkBox_type2.setChecked(False)
|
||||
self.ui.checkBox_type3.setChecked(False)
|
||||
self.ui.checkBox_type4.setChecked(False)
|
||||
self.ui.checkBox_type5.setChecked(False)
|
||||
elif (sender == self.ui.checkBox_type1 or
|
||||
sender == self.ui.checkBox_type2 or
|
||||
sender == self.ui.checkBox_type3 or
|
||||
sender == self.ui.checkBox_type4 or
|
||||
sender == self.ui.checkBox_type5):
|
||||
if (self.ui.checkBox_type1.isChecked() and
|
||||
self.ui.checkBox_type2.isChecked() and
|
||||
self.ui.checkBox_type3.isChecked() and
|
||||
self.ui.checkBox_type4.isChecked() and
|
||||
self.ui.checkBox_type5.isChecked()):
|
||||
self.ui.checkBox_allin.setChecked(True)
|
||||
else:
|
||||
self.ui.checkBox_allin.setChecked(False)
|
||||
else:
|
||||
raise ValueError("发射信号不存在")
|
||||
|
||||
self.__plot__()
|
||||
|
||||
def reset_axes(self):
|
||||
if self.ax0 is not None:
|
||||
self.ax0.clear()
|
||||
@ -1372,7 +1437,16 @@ class Data():
|
||||
artifact_end = append(artifact_end, self.Artifact_a[i])
|
||||
self.artifact_mask = zeros(len(self.OrgBCG))
|
||||
for i in range(0, len(self.artifact_number)):
|
||||
self.artifact_mask[artifact_start[i]: artifact_end[i] + 1] = 1
|
||||
if self.artifact_type[i] == 1:
|
||||
self.artifact_mask[artifact_start[i]: artifact_end[i] + 1] = 1
|
||||
elif self.artifact_type[i] == 2:
|
||||
self.artifact_mask[artifact_start[i]: artifact_end[i] + 1] = 2
|
||||
elif self.artifact_type[i] == 3:
|
||||
self.artifact_mask[artifact_start[i]: artifact_end[i] + 1] = 3
|
||||
elif self.artifact_type[i] == 4:
|
||||
self.artifact_mask[artifact_start[i]: artifact_end[i] + 1] = 4
|
||||
elif self.artifact_type[i] == 5:
|
||||
self.artifact_mask[artifact_start[i]: artifact_end[i] + 1] = 5
|
||||
except Exception as e:
|
||||
return Result().failure(info=Constants.INPUT_FAILURE +
|
||||
Constants.FAILURE_REASON["Get_Artifact_Format_Exception"] + "\n" + format_exc())
|
||||
|
||||
Reference in New Issue
Block a user