Compare commits

...

2 Commits

Author SHA1 Message Date
c9202174fb 为<BCG的J峰算法定位>、<ECG的R峰算法定位>、<人工纠正>增加了不做滤波的选项 2025-06-28 20:35:10 +08:00
aa0d59f925 1、修复了<呼吸可用性及间期标注>中若THO峰值数据的历史存档为空,则无法正确打开数据文件的问题
2、修复了<呼吸可用性及间期标注>中点击标注后UI信息未更新的问题
2025-06-28 16:47:36 +08:00
12 changed files with 308 additions and 141 deletions

View File

@ -207,6 +207,8 @@ class MainWindow_detect_Jpeak(QMainWindow):
self.ui.spinBox_intervalHigh.editingFinished.connect(self.__update_config__)
self.ui.checkBox_useCPU.stateChanged.connect(self.__update_config__)
self.ui.comboBox_model.currentTextChanged.connect(self.__update_config__)
self.ui.radioButton_skip_process.toggled.connect(self.__update_config__)
self.ui.radioButton_bandpass_process.toggled.connect(self.__update_config__)
@overrides
def closeEvent(self, event):
@ -262,6 +264,7 @@ class MainWindow_detect_Jpeak(QMainWindow):
return Result().failure(info=Constants.DRAW_FAILURE)
def __update_config__(self):
sender = self.sender()
Config["Filter"]["BandPassLow"] = self.ui.doubleSpinBox_bandPassLow.value()
Config["Filter"]["BandPassHigh"] = self.ui.doubleSpinBox_bandPassHigh.value()
Config["PeaksValue"] = self.ui.spinBox_peaksValue.value()
@ -270,6 +273,10 @@ class MainWindow_detect_Jpeak(QMainWindow):
Config["IntervalHigh"] = self.ui.spinBox_intervalHigh.value()
Config["UseCPU"] = self.ui.checkBox_useCPU.isChecked()
Config["DetectMethod"] = self.ui.comboBox_model.currentText()
if sender == self.ui.radioButton_skip_process:
Config["Filter"]["Mode"] = "skip"
elif sender == self.ui.radioButton_bandpass_process:
Config["Filter"]["Mode"] = "bandpass"
def __slot_btn_input__(self):
PublicFunc.__disableAllButton__(self, ButtonState)
@ -444,21 +451,24 @@ class Data:
Constants.FAILURE_REASON["Data_Not_Exist"])
try:
if ((Config["Filter"]["BandPassLow"] >= Config["Filter"]["BandPassHigh"]) or
(Config["Filter"]["BandPassLow"] <= 0) or (Config["Filter"]["BandPassHigh"] <= 0)):
return Result().failure(
info=Constants.PREPROCESS_FAILURE + Constants.FAILURE_REASON["Filter_Args_Not_Correct"])
self.processed_data = preprocess(self.raw_data,
Config["InputConfig"]["Freq"],
Config["Filter"]["BandPassLow"],
Config["Filter"]["BandPassHigh"],
Config["AmpValue"])
if Config["Filter"]["Mode"] == "skip":
self.processed_data = self.raw_data[:len(self.raw_data) // (Config["InputConfig"]["Freq"] * 10) * Config["InputConfig"]["Freq"] * 10]
return Result().success(info=Constants.PREPROCESS_NO_NEED)
elif Config["Filter"]["Mode"] == "bandpass":
if ((Config["Filter"]["BandPassLow"] >= Config["Filter"]["BandPassHigh"]) or
(Config["Filter"]["BandPassLow"] <= 0) or (Config["Filter"]["BandPassHigh"] <= 0)):
return Result().failure(
info=Constants.PREPROCESS_FAILURE + Constants.FAILURE_REASON["Filter_Args_Not_Correct"])
self.processed_data = preprocess(self.raw_data,
Config["InputConfig"]["Freq"],
Config["Filter"]["BandPassLow"],
Config["Filter"]["BandPassHigh"],
Config["AmpValue"])
return Result().success(info=Constants.PREPROCESS_FINISHED)
except Exception as e:
return Result().failure(info=Constants.PREPROCESS_FAILURE +
Constants.FAILURE_REASON["Preprocess_Exception"] + "\n" + format_exc())
return Result().success(info=Constants.PREPROCESS_FINISHED)
def predict_Jpeak(self, model):
if not (Path(model.model_folder_path) / Path(model.selected_model)).exists():
return Result().failure(info=Constants.DETECT_JPEAK_PREDICT_FAILURE +

View File

@ -201,6 +201,8 @@ class MainWindow_detect_Rpeak(QMainWindow):
self.ui.doubleSpinBox_bandPassHigh.editingFinished.connect(self.__update_config__)
self.ui.spinBox_peaksValue.editingFinished.connect(self.__update_config__)
self.ui.comboBox_method.currentTextChanged.connect(self.__update_config__)
self.ui.radioButton_skip_process.toggled.connect(self.__update_config__)
self.ui.radioButton_bandpass_process.toggled.connect(self.__update_config__)
@overrides
def closeEvent(self, event):
@ -260,10 +262,15 @@ class MainWindow_detect_Rpeak(QMainWindow):
return Result().failure(info=Constants.DRAW_FAILURE)
def __update_config__(self):
sender = self.sender()
Config["Filter"]["BandPassLow"] = self.ui.doubleSpinBox_bandPassLow.value()
Config["Filter"]["BandPassHigh"] = self.ui.doubleSpinBox_bandPassHigh.value()
Config["PeaksValue"] = self.ui.spinBox_peaksValue.value()
Config["DetectMethod"] = self.ui.comboBox_method.currentText()
if sender == self.ui.radioButton_skip_process:
Config["Filter"]["Mode"] = "skip"
elif sender == self.ui.radioButton_bandpass_process:
Config["Filter"]["Mode"] = "bandpass"
def __slot_btn_input__(self):
PublicFunc.__disableAllButton__(self, ButtonState)
@ -446,20 +453,23 @@ class Data:
Constants.FAILURE_REASON["Data_Not_Exist"])
try:
if ((Config["Filter"]["BandPassLow"] >= Config["Filter"]["BandPassHigh"]) or
(Config["Filter"]["BandPassLow"] <= 0) or (Config["Filter"]["BandPassHigh"] <= 0)):
return Result().failure(
info=Constants.PREPROCESS_FAILURE + Constants.FAILURE_REASON["Filter_Args_Not_Correct"])
self.processed_data = preprocess(self.raw_data,
Config["InputConfig"]["Freq"],
Config["Filter"]["BandPassLow"],
Config["Filter"]["BandPassHigh"])
if Config["Filter"]["Mode"] == "skip":
self.processed_data = self.raw_data
return Result().success(info=Constants.PREPROCESS_NO_NEED)
elif Config["Filter"]["Mode"] == "bandpass":
if ((Config["Filter"]["BandPassLow"] >= Config["Filter"]["BandPassHigh"]) or
(Config["Filter"]["BandPassLow"] <= 0) or (Config["Filter"]["BandPassHigh"] <= 0)):
return Result().failure(
info=Constants.PREPROCESS_FAILURE + Constants.FAILURE_REASON["Filter_Args_Not_Correct"])
self.processed_data = preprocess(self.raw_data,
Config["InputConfig"]["Freq"],
Config["Filter"]["BandPassLow"],
Config["Filter"]["BandPassHigh"])
return Result().success(info=Constants.PREPROCESS_FINISHED)
except Exception as e:
return Result().failure(info=Constants.PREPROCESS_FAILURE +
Constants.FAILURE_REASON["Preprocess_Exception"] + "\n" + format_exc())
return Result().success(info=Constants.PREPROCESS_FINISHED)
def predict_Rpeak(self):
if self.processed_data is None:
return Result().failure(info=Constants.DETECT_RPEAK_PREDICT_FAILURE +

View File

@ -122,6 +122,10 @@ class SettingWindow(QMainWindow):
self.ui.plainTextEdit_file_path_input_peak.setPlainText(Config["Path"]["Input_Peak"])
self.ui.plainTextEdit_file_path_input_approximately_align.setPlainText(Config["Path"]["Input_Approximately_Align"])
self.ui.plainTextEdit_file_path_save.setPlainText(Config["Path"]["Save"])
if Config["Filter"]["Mode"] == "skip":
self.ui.radioButton_skip_process.setChecked(True)
elif Config["Filter"]["Mode"] == "bandpass":
self.ui.radioButton_bandpass_process.setChecked(True)
if Config["Mode"] == "BCG":
self.ui.spinBox_bandPassOrder.setValue(Config["Filter"]["BCGBandPassOrder"])
self.ui.doubleSpinBox_bandPassLow.setValue(Config["Filter"]["BCGBandPassLow"])
@ -140,6 +144,10 @@ class SettingWindow(QMainWindow):
Config["Path"]["Input_Peak"] = self.ui.plainTextEdit_file_path_input_peak.toPlainText()
Config["Path"]["Input_Approximately_Align"] = self.ui.plainTextEdit_file_path_input_approximately_align.toPlainText()
Config["Path"]["Save"] = self.ui.plainTextEdit_file_path_save.toPlainText()
if self.ui.radioButton_skip_process.isChecked():
Config["Filter"]["Mode"] = "skip"
elif self.ui.radioButton_bandpass_process.isChecked():
Config["Filter"]["Mode"] = "bandpass"
if Config["Mode"] == "BCG":
Config["Filter"]["BCGBandPassOrder"] = self.ui.spinBox_bandPassOrder.value()
Config["Filter"]["BCGBandPassLow"] = self.ui.doubleSpinBox_bandPassLow.value()
@ -1054,7 +1062,7 @@ class Data:
try:
if Config["Mode"] == "BCG":
if Config["Filter"]["BCGBandPassOrder"] == 0:
if Config["Filter"]["BCGBandPassOrder"] == 0 or Config["Filter"]["Mode"] == "skip":
self.processed_data = self.raw_data
else:
if ((Config["Filter"]["BCGBandPassLow"] >= Config["Filter"]["BCGBandPassHigh"]) or
@ -1067,7 +1075,7 @@ class Data:
Config["Filter"]["BCGBandPassHigh"],
Config["InputConfig"]["Freq"])
elif Config["Mode"] == "ECG":
if Config["Filter"]["ECGBandPassOrder"] == 0:
if Config["Filter"]["ECGBandPassOrder"] == 0 or Config["Filter"]["Mode"] == "skip":
self.processed_data = self.raw_data
else:
if ((Config["Filter"]["ECGBandPassLow"] >= Config["Filter"]["ECGBandPassHigh"]) or

View File

@ -12,6 +12,7 @@ from matplotlib.backends.backend_qtagg import FigureCanvasQTAgg
from numpy import array, full, int64, append, zeros, where, arange, float64, nan, place, delete, setdiff1d
from overrides import overrides
from pandas import read_csv, DataFrame
from pandas.errors import EmptyDataError
from scipy.signal import find_peaks, resample
from yaml import dump, load, FullLoader
@ -1016,6 +1017,7 @@ class MainWindow_resp_quality_label(QMainWindow):
Constants.TIPS_TYPE_INFO)
result = self.data.save_resp_quality_label()
self.update_tableWidget()
self.update_info()
if not result.status:
PublicFunc.text_output(self.ui, result.info, Constants.TIPS_TYPE_ERROR)
PublicFunc.msgbox_output(self, result.info, Constants.MSGBOX_TYPE_ERROR)
@ -1559,16 +1561,21 @@ class Data():
return Result().success(info=Filename.RESP_QUALITY_LABEL + "" + Constants.ARCHIVE_EXIST)
def get_archive_tho_peak(self):
if not Path(Config["Path"]["Save_Tho_peak"]).exists():
try:
if not Path(Config["Path"]["Save_Tho_peak"]).exists():
self.Tho_peak = array([]).astype(int)
self.Tho_peak_y = array([]).astype(int)
return Result().success(info=Filename.RESP_QUALITY_LABEL + "" + Constants.ARCHIVE_NOT_EXIST)
else:
self.Tho_peak = read_csv(Config["Path"]["Save_Tho_peak"],
encoding=Params.UTF8_ENCODING,
header=None).to_numpy().reshape(-1)
return Result().success(info=Filename.THO_PEAK + "" + Constants.ARCHIVE_EXIST)
except EmptyDataError as e:
self.Tho_peak = array([]).astype(int)
self.Tho_peak_y = array([]).astype(int)
return Result().success(info=Filename.RESP_QUALITY_LABEL + "" + Constants.ARCHIVE_NOT_EXIST)
else:
self.Tho_peak = read_csv(Config["Path"]["Save_Tho_peak"],
encoding=Params.UTF8_ENCODING,
header=None).to_numpy().reshape(-1)
return Result().success(info=Filename.THO_PEAK + "" + Constants.ARCHIVE_EXIST)
return Result().success(info=Filename.RESP_QUALITY_LABEL + "" + Constants.ARCHIVE_EMPTY)
def resample_tho_and_OrgBCG(self):
if (self.OrgBCG is None) or (self.Tho is None):

View File

@ -139,6 +139,7 @@ class Params:
"Freq": 1000
},
"Filter": {
"Mode": "skip",
"BandPassLow": 2,
"BandPassHigh": 10
},
@ -159,6 +160,7 @@ class Params:
"Freq": 1000
},
"Filter": {
"Mode": "skip",
"BandPassLow": 1,
"BandPassHigh": 25
},
@ -174,6 +176,7 @@ class Params:
"Freq": 1000
},
"Filter": {
"Mode": "skip",
"BCGBandPassOrder": 2,
"BCGBandPassLow": 2,
"BCGBandPassHigh": 10,

View File

@ -24,6 +24,7 @@ class Constants:
PREPROCESSING_DATA: str = "正在预处理数据"
PREPROCESS_FINISHED: str = "预处理完成"
PREPROCESS_FAILURE: str = "预处理失败"
PREPROCESS_NO_NEED: str = "不需要预处理"
RESAMPLING_DATA: str = "正在数据重采样"
RESAMPLE_FINISHED: str = "重采样完成"
@ -33,6 +34,7 @@ class Constants:
LOADING_ARCHIVE: str = "正在获取历史存档"
ARCHIVE_EXIST: str = "找到历史存档,成功读取"
ARCHIVE_NOT_EXIST: str = "未找到历史存档,创建新存档"
ARCHIVE_EMPTY: str = "历史存档为空,创建新存档"
DRAWING_DATA: str = "正在绘制图形"
DRAW_FINISHED: str = "绘制完成"

View File

@ -18,9 +18,9 @@ from PySide6.QtGui import (QAction, QBrush, QColor, QConicalGradient,
QTransform)
from PySide6.QtWidgets import (QApplication, QCheckBox, QComboBox, QDoubleSpinBox,
QGridLayout, QGroupBox, QHBoxLayout, QLabel,
QMainWindow, QPushButton, QSizePolicy, QSpacerItem,
QSpinBox, QStatusBar, QTextBrowser, QVBoxLayout,
QWidget)
QMainWindow, QPushButton, QRadioButton, QSizePolicy,
QSpacerItem, QSpinBox, QStatusBar, QTextBrowser,
QVBoxLayout, QWidget)
class Ui_MainWindow_detect_Jpeak(object):
def setupUi(self, MainWindow_detect_Jpeak):
@ -99,34 +99,47 @@ class Ui_MainWindow_detect_Jpeak(object):
self.verticalLayout_5.setObjectName(u"verticalLayout_5")
self.groupBox_2 = QGroupBox(self.groupBox_args)
self.groupBox_2.setObjectName(u"groupBox_2")
self.horizontalLayout_5 = QHBoxLayout(self.groupBox_2)
self.horizontalLayout_5.setObjectName(u"horizontalLayout_5")
self.gridLayout_2 = QGridLayout(self.groupBox_2)
self.gridLayout_2.setObjectName(u"gridLayout_2")
self.label = QLabel(self.groupBox_2)
self.label.setObjectName(u"label")
self.label.setFont(font)
self.horizontalLayout_5.addWidget(self.label)
self.doubleSpinBox_bandPassLow = QDoubleSpinBox(self.groupBox_2)
self.doubleSpinBox_bandPassLow.setObjectName(u"doubleSpinBox_bandPassLow")
self.doubleSpinBox_bandPassLow.setFont(font)
self.doubleSpinBox_bandPassLow.setMaximum(100.000000000000000)
self.horizontalLayout_5.addWidget(self.doubleSpinBox_bandPassLow)
self.label_5 = QLabel(self.groupBox_2)
self.label_5.setObjectName(u"label_5")
self.label_5.setFont(font)
self.label_5.setAlignment(Qt.AlignmentFlag.AlignCenter)
self.horizontalLayout_5.addWidget(self.label_5)
self.gridLayout_2.addWidget(self.label, 2, 0, 1, 1)
self.doubleSpinBox_bandPassHigh = QDoubleSpinBox(self.groupBox_2)
self.doubleSpinBox_bandPassHigh.setObjectName(u"doubleSpinBox_bandPassHigh")
self.doubleSpinBox_bandPassHigh.setFont(font)
self.doubleSpinBox_bandPassHigh.setMaximum(100.000000000000000)
self.horizontalLayout_5.addWidget(self.doubleSpinBox_bandPassHigh)
self.gridLayout_2.addWidget(self.doubleSpinBox_bandPassHigh, 2, 3, 1, 1)
self.label_5 = QLabel(self.groupBox_2)
self.label_5.setObjectName(u"label_5")
self.label_5.setFont(font)
self.label_5.setAlignment(Qt.AlignmentFlag.AlignCenter)
self.gridLayout_2.addWidget(self.label_5, 2, 2, 1, 1)
self.radioButton_skip_process = QRadioButton(self.groupBox_2)
self.radioButton_skip_process.setObjectName(u"radioButton_skip_process")
self.radioButton_skip_process.setFont(font)
self.radioButton_skip_process.setChecked(True)
self.gridLayout_2.addWidget(self.radioButton_skip_process, 0, 0, 1, 1)
self.doubleSpinBox_bandPassLow = QDoubleSpinBox(self.groupBox_2)
self.doubleSpinBox_bandPassLow.setObjectName(u"doubleSpinBox_bandPassLow")
self.doubleSpinBox_bandPassLow.setFont(font)
self.doubleSpinBox_bandPassLow.setMaximum(100.000000000000000)
self.gridLayout_2.addWidget(self.doubleSpinBox_bandPassLow, 2, 1, 1, 1)
self.radioButton_bandpass_process = QRadioButton(self.groupBox_2)
self.radioButton_bandpass_process.setObjectName(u"radioButton_bandpass_process")
self.radioButton_bandpass_process.setFont(font)
self.gridLayout_2.addWidget(self.radioButton_bandpass_process, 1, 0, 1, 1)
self.verticalLayout_5.addWidget(self.groupBox_2)
@ -309,6 +322,8 @@ class Ui_MainWindow_detect_Jpeak(object):
self.groupBox_2.setTitle(QCoreApplication.translate("MainWindow_detect_Jpeak", u"BCG\u7684\u5e26\u901a\u6ee4\u6ce2", None))
self.label.setText(QCoreApplication.translate("MainWindow_detect_Jpeak", u"\u622a\u6b62\u9891\u7387(Hz)\uff1a", None))
self.label_5.setText(QCoreApplication.translate("MainWindow_detect_Jpeak", u"~", None))
self.radioButton_skip_process.setText(QCoreApplication.translate("MainWindow_detect_Jpeak", u"\u4e0d\u6ee4\u6ce2", None))
self.radioButton_bandpass_process.setText(QCoreApplication.translate("MainWindow_detect_Jpeak", u"\u5e26\u901a\u6ee4\u6ce2", None))
self.label_2.setText(QCoreApplication.translate("MainWindow_detect_Jpeak", u"\u5bfb\u5cf0\u9608\u503c(\u4e2a)", None))
self.label_6.setText(QCoreApplication.translate("MainWindow_detect_Jpeak", u"\u4fe1\u53f7\u5e45\u503c\u8c03\u6574\u53c2\u6570", None))
self.label_3.setText(QCoreApplication.translate("MainWindow_detect_Jpeak", u"\u95f4\u671f\u4e0b\u4e0a\u9650\u9608\u503c", None))

View File

@ -108,8 +108,8 @@
<property name="title">
<string>BCG的带通滤波</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<layout class="QGridLayout" name="gridLayout_2">
<item row="2" column="0">
<widget class="QLabel" name="label">
<property name="font">
<font>
@ -121,8 +121,8 @@
</property>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="doubleSpinBox_bandPassLow">
<item row="2" column="3">
<widget class="QDoubleSpinBox" name="doubleSpinBox_bandPassHigh">
<property name="font">
<font>
<pointsize>12</pointsize>
@ -133,7 +133,7 @@
</property>
</widget>
</item>
<item>
<item row="2" column="2">
<widget class="QLabel" name="label_5">
<property name="font">
<font>
@ -148,8 +148,23 @@
</property>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="doubleSpinBox_bandPassHigh">
<item row="0" column="0">
<widget class="QRadioButton" name="radioButton_skip_process">
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string>不滤波</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QDoubleSpinBox" name="doubleSpinBox_bandPassLow">
<property name="font">
<font>
<pointsize>12</pointsize>
@ -160,6 +175,18 @@
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QRadioButton" name="radioButton_bandpass_process">
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string>带通滤波</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>

View File

@ -17,8 +17,9 @@ from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
QPalette, QPixmap, QRadialGradient, QTransform)
from PySide6.QtWidgets import (QApplication, QComboBox, QDoubleSpinBox, QGridLayout,
QGroupBox, QHBoxLayout, QLabel, QMainWindow,
QPushButton, QSizePolicy, QSpacerItem, QSpinBox,
QStatusBar, QTextBrowser, QVBoxLayout, QWidget)
QPushButton, QRadioButton, QSizePolicy, QSpacerItem,
QSpinBox, QStatusBar, QTextBrowser, QVBoxLayout,
QWidget)
class Ui_MainWindow_detect_Rpeak(object):
def setupUi(self, MainWindow_detect_Rpeak):
@ -68,34 +69,47 @@ class Ui_MainWindow_detect_Rpeak(object):
self.verticalLayout_5.setObjectName(u"verticalLayout_5")
self.groupBox_2 = QGroupBox(self.groupBox_args)
self.groupBox_2.setObjectName(u"groupBox_2")
self.horizontalLayout_5 = QHBoxLayout(self.groupBox_2)
self.horizontalLayout_5.setObjectName(u"horizontalLayout_5")
self.gridLayout_2 = QGridLayout(self.groupBox_2)
self.gridLayout_2.setObjectName(u"gridLayout_2")
self.label = QLabel(self.groupBox_2)
self.label.setObjectName(u"label")
self.label.setFont(font1)
self.horizontalLayout_5.addWidget(self.label)
self.gridLayout_2.addWidget(self.label, 2, 0, 1, 1)
self.doubleSpinBox_bandPassLow = QDoubleSpinBox(self.groupBox_2)
self.doubleSpinBox_bandPassLow.setObjectName(u"doubleSpinBox_bandPassLow")
self.doubleSpinBox_bandPassLow.setFont(font1)
self.doubleSpinBox_bandPassLow.setMaximum(100.000000000000000)
self.horizontalLayout_5.addWidget(self.doubleSpinBox_bandPassLow)
self.gridLayout_2.addWidget(self.doubleSpinBox_bandPassLow, 2, 1, 1, 1)
self.label_5 = QLabel(self.groupBox_2)
self.label_5.setObjectName(u"label_5")
self.label_5.setFont(font1)
self.label_5.setAlignment(Qt.AlignmentFlag.AlignCenter)
self.horizontalLayout_5.addWidget(self.label_5)
self.gridLayout_2.addWidget(self.label_5, 2, 2, 1, 1)
self.radioButton_skip_process = QRadioButton(self.groupBox_2)
self.radioButton_skip_process.setObjectName(u"radioButton_skip_process")
self.radioButton_skip_process.setFont(font1)
self.radioButton_skip_process.setChecked(True)
self.gridLayout_2.addWidget(self.radioButton_skip_process, 0, 0, 1, 1)
self.doubleSpinBox_bandPassHigh = QDoubleSpinBox(self.groupBox_2)
self.doubleSpinBox_bandPassHigh.setObjectName(u"doubleSpinBox_bandPassHigh")
self.doubleSpinBox_bandPassHigh.setFont(font1)
self.doubleSpinBox_bandPassHigh.setMaximum(100.000000000000000)
self.horizontalLayout_5.addWidget(self.doubleSpinBox_bandPassHigh)
self.gridLayout_2.addWidget(self.doubleSpinBox_bandPassHigh, 2, 3, 1, 1)
self.radioButton_bandpass_process = QRadioButton(self.groupBox_2)
self.radioButton_bandpass_process.setObjectName(u"radioButton_bandpass_process")
self.radioButton_bandpass_process.setFont(font1)
self.gridLayout_2.addWidget(self.radioButton_bandpass_process, 1, 0, 1, 1)
self.verticalLayout_5.addWidget(self.groupBox_2)
@ -227,6 +241,8 @@ class Ui_MainWindow_detect_Rpeak(object):
self.groupBox_2.setTitle(QCoreApplication.translate("MainWindow_detect_Rpeak", u"ECG\u7684\u5e26\u901a\u6ee4\u6ce2", None))
self.label.setText(QCoreApplication.translate("MainWindow_detect_Rpeak", u"\u622a\u6b62\u9891\u7387(Hz)\uff1a", None))
self.label_5.setText(QCoreApplication.translate("MainWindow_detect_Rpeak", u"~", None))
self.radioButton_skip_process.setText(QCoreApplication.translate("MainWindow_detect_Rpeak", u"\u4e0d\u6ee4\u6ce2", None))
self.radioButton_bandpass_process.setText(QCoreApplication.translate("MainWindow_detect_Rpeak", u"\u5e26\u901a\u6ee4\u6ce2", None))
self.label_2.setText(QCoreApplication.translate("MainWindow_detect_Rpeak", u"\u5bfb\u5cf0\u9608\u503c(\u4e2a)", None))
self.groupBox_3.setTitle(QCoreApplication.translate("MainWindow_detect_Rpeak", u"\u65b9\u6cd5\u8bbe\u7f6e", None))
self.label_7.setText(QCoreApplication.translate("MainWindow_detect_Rpeak", u"\u68c0\u6d4b\u65b9\u6cd5\u9009\u62e9", None))

View File

@ -77,8 +77,8 @@
<property name="title">
<string>ECG的带通滤波</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<layout class="QGridLayout" name="gridLayout_2">
<item row="2" column="0">
<widget class="QLabel" name="label">
<property name="font">
<font>
@ -90,7 +90,7 @@
</property>
</widget>
</item>
<item>
<item row="2" column="1">
<widget class="QDoubleSpinBox" name="doubleSpinBox_bandPassLow">
<property name="font">
<font>
@ -102,7 +102,7 @@
</property>
</widget>
</item>
<item>
<item row="2" column="2">
<widget class="QLabel" name="label_5">
<property name="font">
<font>
@ -117,7 +117,22 @@
</property>
</widget>
</item>
<item>
<item row="0" column="0">
<widget class="QRadioButton" name="radioButton_skip_process">
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string>不滤波</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="3">
<widget class="QDoubleSpinBox" name="doubleSpinBox_bandPassHigh">
<property name="font">
<font>
@ -129,6 +144,18 @@
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QRadioButton" name="radioButton_bandpass_process">
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string>带通滤波</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>

View File

@ -17,8 +17,8 @@ from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
QPalette, QPixmap, QRadialGradient, QTransform)
from PySide6.QtWidgets import (QApplication, QDoubleSpinBox, QGridLayout, QGroupBox,
QHBoxLayout, QLabel, QMainWindow, QPlainTextEdit,
QPushButton, QSizePolicy, QSpinBox, QStatusBar,
QVBoxLayout, QWidget)
QPushButton, QRadioButton, QSizePolicy, QSpinBox,
QStatusBar, QVBoxLayout, QWidget)
class Ui_MainWindow_label_check_input_setting(object):
def setupUi(self, MainWindow_label_check_input_setting):
@ -69,14 +69,42 @@ class Ui_MainWindow_label_check_input_setting(object):
self.groupBox_2 = QGroupBox(self.groupBox_file_path_input_signal)
self.groupBox_2.setObjectName(u"groupBox_2")
self.horizontalLayout = QHBoxLayout(self.groupBox_2)
self.horizontalLayout.setObjectName(u"horizontalLayout")
self.gridLayout_2 = QGridLayout(self.groupBox_2)
self.gridLayout_2.setObjectName(u"gridLayout_2")
self.label_3 = QLabel(self.groupBox_2)
self.label_3.setObjectName(u"label_3")
self.label_3.setFont(font)
self.label_3.setAlignment(Qt.AlignmentFlag.AlignCenter)
self.gridLayout_2.addWidget(self.label_3, 1, 2, 1, 1)
self.doubleSpinBox_bandPassHigh = QDoubleSpinBox(self.groupBox_2)
self.doubleSpinBox_bandPassHigh.setObjectName(u"doubleSpinBox_bandPassHigh")
self.doubleSpinBox_bandPassHigh.setFont(font)
self.doubleSpinBox_bandPassHigh.setMaximum(100.000000000000000)
self.gridLayout_2.addWidget(self.doubleSpinBox_bandPassHigh, 1, 5, 1, 1)
self.label_4 = QLabel(self.groupBox_2)
self.label_4.setObjectName(u"label_4")
self.label_4.setFont(font)
self.label_4.setAlignment(Qt.AlignmentFlag.AlignCenter)
self.gridLayout_2.addWidget(self.label_4, 1, 4, 1, 1)
self.label = QLabel(self.groupBox_2)
self.label.setObjectName(u"label")
self.label.setFont(font)
self.label.setAlignment(Qt.AlignmentFlag.AlignCenter)
self.horizontalLayout.addWidget(self.label)
self.gridLayout_2.addWidget(self.label, 1, 0, 1, 1)
self.doubleSpinBox_bandPassLow = QDoubleSpinBox(self.groupBox_2)
self.doubleSpinBox_bandPassLow.setObjectName(u"doubleSpinBox_bandPassLow")
self.doubleSpinBox_bandPassLow.setFont(font)
self.doubleSpinBox_bandPassLow.setMaximum(100.000000000000000)
self.gridLayout_2.addWidget(self.doubleSpinBox_bandPassLow, 1, 3, 1, 1)
self.spinBox_bandPassOrder = QSpinBox(self.groupBox_2)
self.spinBox_bandPassOrder.setObjectName(u"spinBox_bandPassOrder")
@ -85,35 +113,20 @@ class Ui_MainWindow_label_check_input_setting(object):
self.spinBox_bandPassOrder.setMaximum(10)
self.spinBox_bandPassOrder.setValue(0)
self.horizontalLayout.addWidget(self.spinBox_bandPassOrder)
self.gridLayout_2.addWidget(self.spinBox_bandPassOrder, 1, 1, 1, 1)
self.label_3 = QLabel(self.groupBox_2)
self.label_3.setObjectName(u"label_3")
self.label_3.setFont(font)
self.label_3.setAlignment(Qt.AlignmentFlag.AlignCenter)
self.radioButton_skip_process = QRadioButton(self.groupBox_2)
self.radioButton_skip_process.setObjectName(u"radioButton_skip_process")
self.radioButton_skip_process.setFont(font)
self.radioButton_skip_process.setChecked(True)
self.horizontalLayout.addWidget(self.label_3)
self.gridLayout_2.addWidget(self.radioButton_skip_process, 0, 0, 1, 3)
self.doubleSpinBox_bandPassLow = QDoubleSpinBox(self.groupBox_2)
self.doubleSpinBox_bandPassLow.setObjectName(u"doubleSpinBox_bandPassLow")
self.doubleSpinBox_bandPassLow.setFont(font)
self.doubleSpinBox_bandPassLow.setMaximum(100.000000000000000)
self.radioButton_bandpass_process = QRadioButton(self.groupBox_2)
self.radioButton_bandpass_process.setObjectName(u"radioButton_bandpass_process")
self.radioButton_bandpass_process.setFont(font)
self.horizontalLayout.addWidget(self.doubleSpinBox_bandPassLow)
self.label_4 = QLabel(self.groupBox_2)
self.label_4.setObjectName(u"label_4")
self.label_4.setFont(font)
self.label_4.setAlignment(Qt.AlignmentFlag.AlignCenter)
self.horizontalLayout.addWidget(self.label_4)
self.doubleSpinBox_bandPassHigh = QDoubleSpinBox(self.groupBox_2)
self.doubleSpinBox_bandPassHigh.setObjectName(u"doubleSpinBox_bandPassHigh")
self.doubleSpinBox_bandPassHigh.setFont(font)
self.doubleSpinBox_bandPassHigh.setMaximum(100.000000000000000)
self.horizontalLayout.addWidget(self.doubleSpinBox_bandPassHigh)
self.gridLayout_2.addWidget(self.radioButton_bandpass_process, 0, 3, 1, 3)
self.verticalLayout_5.addWidget(self.groupBox_2)
@ -197,9 +210,11 @@ class Ui_MainWindow_label_check_input_setting(object):
self.groupBox_file_path_input_signal.setTitle(QCoreApplication.translate("MainWindow_label_check_input_setting", u"\u9884\u5904\u7406\u540e\u7684\u4fe1\u53f7\u8def\u5f84", None))
self.label_2.setText(QCoreApplication.translate("MainWindow_label_check_input_setting", u"\u91c7\u6837\u7387(Hz)\uff1a", None))
self.groupBox_2.setTitle(QCoreApplication.translate("MainWindow_label_check_input_setting", u"\u5e26\u901a\u6ee4\u6ce2\u8bbe\u7f6e", None))
self.label.setText(QCoreApplication.translate("MainWindow_label_check_input_setting", u"\u9636\u6570", None))
self.label_3.setText(QCoreApplication.translate("MainWindow_label_check_input_setting", u"\u622a\u6b62\u9891\u7387(Hz)", None))
self.label_4.setText(QCoreApplication.translate("MainWindow_label_check_input_setting", u"~", None))
self.label.setText(QCoreApplication.translate("MainWindow_label_check_input_setting", u"\u9636\u6570", None))
self.radioButton_skip_process.setText(QCoreApplication.translate("MainWindow_label_check_input_setting", u"\u4e0d\u6ee4\u6ce2", None))
self.radioButton_bandpass_process.setText(QCoreApplication.translate("MainWindow_label_check_input_setting", u"\u5e26\u901a\u6ee4\u6ce2", None))
self.plainTextEdit_file_path_input_signal.setPlainText("")
self.plainTextEdit_file_path_input_signal.setPlaceholderText(QCoreApplication.translate("MainWindow_label_check_input_setting", u"\u6587\u4ef6\u8def\u5f84", None))
self.groupBox_file_path_input_peak.setTitle(QCoreApplication.translate("MainWindow_label_check_input_setting", u"\u7b97\u6cd5\u5b9a\u4f4d\u7684\u5cf0\u503c\u8def\u5f84", None))

View File

@ -80,8 +80,50 @@
<property name="title">
<string>带通滤波设置</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QGridLayout" name="gridLayout_2">
<item row="1" column="2">
<widget class="QLabel" name="label_3">
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string>截止频率(Hz)</string>
</property>
<property name="alignment">
<set>Qt::AlignmentFlag::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="5">
<widget class="QDoubleSpinBox" name="doubleSpinBox_bandPassHigh">
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="maximum">
<double>100.000000000000000</double>
</property>
</widget>
</item>
<item row="1" column="4">
<widget class="QLabel" name="label_4">
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string>~</string>
</property>
<property name="alignment">
<set>Qt::AlignmentFlag::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label">
<property name="font">
<font>
@ -96,7 +138,19 @@
</property>
</widget>
</item>
<item>
<item row="1" column="3">
<widget class="QDoubleSpinBox" name="doubleSpinBox_bandPassLow">
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="maximum">
<double>100.000000000000000</double>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="spinBox_bandPassOrder">
<property name="font">
<font>
@ -114,57 +168,30 @@
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_3">
<item row="0" column="0" colspan="3">
<widget class="QRadioButton" name="radioButton_skip_process">
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string>截止频率(Hz)</string>
<string>不滤波</string>
</property>
<property name="alignment">
<set>Qt::AlignmentFlag::AlignCenter</set>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="doubleSpinBox_bandPassLow">
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="maximum">
<double>100.000000000000000</double>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_4">
<item row="0" column="3" colspan="3">
<widget class="QRadioButton" name="radioButton_bandpass_process">
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string>~</string>
</property>
<property name="alignment">
<set>Qt::AlignmentFlag::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="doubleSpinBox_bandPassHigh">
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="maximum">
<double>100.000000000000000</double>
<string>带通滤波</string>
</property>
</widget>
</item>