A method and apparatus for R-wave detection in CT scans
By optimizing the R-wave detection algorithm and employing techniques such as dynamic threshold adjustment and adaptive refractory period, the accuracy problem of R-wave recognition in CT cardiac scans has been solved, improving the scan success rate and image quality while reducing radiation dose.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SAINUO WEISHENG SCI & TECH BEIJING
- Filing Date
- 2026-02-28
- Publication Date
- 2026-05-26
AI Technical Summary
In existing CT cardiac scans, R-wave recognition schemes suffer from high latency, noise interference, lead instability, and high rates of missed or false detections due to heart rate changes, which affect scan quality and radiation dose and make it difficult to meet the requirements for high real-time performance.
By employing dynamic threshold adjustment, adaptive refractory period, dual-channel morphological judgment, and T-wave protection period, combined with timeout backtracking and threshold update, the R-wave detection algorithm is optimized to improve recognition accuracy.
It effectively suppresses image artifacts, shortens exposure time, and improves the success rate of cardiac CT scans and the safety of scanning equipment.
Smart Images

Figure CN122075009A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the technical field of image reconstruction, and particularly relates to a method and apparatus for R-wave detection in CT scans. Background Technology
[0002] In the field of cardiac CT scanning, the periodic contraction and relaxation of the heart is a core challenge affecting scan quality (for example, continuous cardiac motion can easily cause motion artifacts in critical structures such as coronary arteries and valves). Simultaneously, multiple subsystems, including the CT scanner, scanning bed motion, and angiography injection, require precise timing coordination to achieve clear imaging and radiation dose control. In this process, the R wave, as the core peak of the QRS complex in the electrocardiogram (ECG) signal, provides a zero-point reference for the cardiac cycle and is a key technological support for addressing these challenges.
[0003] High real-time performance and high accuracy of R-wave markers (i.e., rapid and accurate R-wave identification) play a decisive role in the overall performance of CT cardiac scans: First, R-waves can accurately pinpoint the diastolic resting phase of the heart (typically 70–80% of the RR interval), allowing the scan to focus on the phase of minimal cardiac motion, significantly reducing motion artifacts and effectively improving the clarity of coronary artery and valve boundaries; Second, they provide accurate phase localization for prospective triggering step-and-shoot mode, which exposes only at the optimal scanning phase, significantly reducing radiation dose compared to continuous spiral + retrospective gating mode; Third, stable and low-latency R-wave markers prevent missing the optimal scanning phase, reducing the probability of rescanning or re-scanning due to phase drift or false triggering, and improving scan success rate; Fourth, R-wave triggering can serve as a unified clock reference for multiple CT subsystems, ensuring precise matching between contrast agent injection peak and scanning acquisition window, optimizing and enhancing scan quality; Fifth, accurate and reliable R-wave markers... Wave markers can reduce the risk of overexposure or invalid scans caused by accidental triggering, ensuring the safety and compliance of the scanning process.
[0004] Currently, the mainstream R-wave recognition scheme in CT cardiac scans is based on the Pan-Tompkins algorithm, a classic real-time QRS wave detection method. Its core idea is to sequentially enhance QRS wave features, suppress noise, and then utilize threshold determination and search backtracking logic to achieve stable R-wave peak detection. However, CT cardiac scans place stringent demands on R-wave recognition, and the Pan-Tompkins algorithm has significant limitations in practical applications: when facing high real-time requirements (e.g., detection within 50ms of R-wave arrival), the inherent delay caused by the algorithm's multi-step computation process makes it difficult to meet timing requirements; simultaneously, equipment noise and physiological noise in the scanning environment, unstable lead contact during scanning, excessively high T waves in some patients, and rapid changes in heart rate can all significantly increase the algorithm's false positive or false negative R-wave detection rate.
[0005] The aforementioned reliability issues in R-wave recognition directly trigger a chain reaction: increased motion artifacts lead to reduced image clarity, invalid exposures and rescans result in increased radiation dose, and temporal coordination disorders of CT multi-subsystems lead to invalid scans, ultimately severely impacting the core functions and clinical application effectiveness of CT cardiac scanning. Therefore, a highly reliable R-wave recognition solution adapted to CT cardiac scanning scenarios is urgently needed to address the technical shortcomings of the existing Pan-Tompkins algorithm. Summary of the Invention
[0006] This invention provides a method and apparatus for R-wave detection in CT scans. This method can quickly and accurately identify R-waves in ECG signals, effectively solving the problem of image artifacts in existing CT cardiac scans, thereby reducing the exposure time of CT scanning equipment and improving the success rate of cardiac CT scans.
[0007] According to a first aspect of the present invention, a method for R-wave detection in CT scanning is provided. The method includes: acquiring a current R-wave reference threshold and a current refractory period corresponding to a current ECG signal; when it is determined that the current ECG signal is not in the current refractory period, detecting the peak morphology of the current ECG signal based on historical ECG signals; if the morphology detection result indicates that the peak morphology of the current ECG signal satisfies a strict R-wave peak, then using the current R-wave reference threshold as a quasi-R-wave threshold; if the morphology detection result indicates that the peak morphology of the current ECG signal is a loose peak, then performing an increase operation on the current R-wave reference threshold to generate a quasi-R-wave threshold; and detecting the current ECG signal based on the quasi-R-wave threshold to generate an R-wave detection result.
[0008] According to a second aspect of the present invention, an R-wave detection device for CT scanning is also provided. The device includes: a first acquisition module, configured to acquire a current R-wave reference threshold and a current refractory period corresponding to a current ECG signal; a peak shape detection module, configured to detect the peak shape of the current ECG signal based on historical ECG signals when it is determined that the current ECG signal is not in the current refractory period; a generation module, configured to, if the shape detection result indicates that the peak shape of the current ECG signal satisfies a strict R-wave peak, use the current R-wave reference threshold as a quasi-R-wave threshold; if the shape detection result indicates that the peak shape of the current ECG signal is a loose peak, perform an increase operation on the current R-wave reference threshold to generate a quasi-R-wave threshold; and a detection module, configured to detect the current ECG signal based on the quasi-R-wave threshold to generate an R-wave detection result.
[0009] According to a third aspect of the present invention, a computer-readable medium is also provided, on which a computer program is stored, wherein the program, when executed by a processor, implements the method described in the first aspect.
[0010] This embodiment provides a method and apparatus for R-wave detection in CT scans. The method includes at least the following steps: First, obtaining the current R-wave reference threshold and the current refractory period corresponding to the current ECG signal; Second, when it is determined that the current ECG signal is not in the current refractory period, detecting the peak shape of the current ECG signal based on historical ECG signals; Then, if the shape detection result indicates that the peak shape of the current ECG signal satisfies a strict R-wave peak, the current R-wave reference threshold is used as a quasi-R-wave threshold; If the shape detection result indicates that the peak shape of the current ECG signal is a loose peak, an increase operation is performed on the current R-wave reference threshold to generate a quasi-R-wave threshold; Finally, based on the quasi-R-wave threshold, the current ECG signal is detected to generate an R-wave detection result. This embodiment adds dynamic threshold adjustment, adaptive refractory period, and dual-channel morphological judgment to the standard Pan-Tompkins algorithm, thereby solving the problem of missed or false detections caused by the standard Pan-Tompkins algorithm being susceptible to noise, lead instability, and drastic heart rate changes when processing ECG signals. Furthermore, it effectively suppresses image artifacts in existing CT cardiac scans, thereby shortening the exposure time of CT scanning equipment and ultimately significantly improving the overall success rate of cardiac CT scans. Attached Figure Description
[0011] The following sections will describe some specific embodiments of the invention in detail by way of example and not limitation, with reference to the accompanying drawings. The same reference numerals in the drawings denote the same or similar parts or portions. Those skilled in the art should understand that these drawings are not necessarily drawn to scale. In the drawings:
[0012] Figure 1 This is a schematic flowchart of an R-wave detection method for CT scanning provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of the structure of a CT scanning system according to an embodiment of the present invention; Figure 3 This is a schematic diagram of an R-wave detection device for CT scanning provided in an embodiment of the present invention. Detailed Implementation
[0013] To make the objectives, features, and advantages of this invention more apparent and understandable, the technical solutions of the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0014] like Figure 1 The diagram shown is a flowchart illustrating an R-wave detection method for CT scanning according to an embodiment of the present invention.
[0015] A method for R-wave detection in CT scans, comprising at least the following steps: S101, obtain the current R-wave reference threshold and current refractory period corresponding to the current ECG signal; S102, when it is determined that the current ECG signal is not in the current refractory period, the peak shape of the current ECG signal is detected based on historical ECG signals; S103, If the morphology detection result indicates that the peak morphology of the current ECG signal meets the strict peak of the R wave, then the current R wave reference threshold is used as the quasi-R wave threshold; if the morphology detection result indicates that the peak morphology of the current ECG signal is a loose peak, then the current R wave reference threshold is increased to generate the quasi-R wave threshold. S104, based on the quasi-R-wave threshold, detects the current ECG signal and generates R-wave detection results.
[0016] In S101, based on the current ECG signal and historical ECG signals, the R-wave reference threshold is adaptively adjusted according to preset rules or model algorithms to obtain the current R-wave reference threshold; based on the current ECG signal and historical ECG signals, the refractory period is adaptively adjusted according to preset rules or model algorithms to obtain the current refractory period.
[0017] For example, determining the current R-wave reference threshold corresponding to the current ECG signal includes: determining a sliding time window preceding and adjacent to the current time, and obtaining the average heart rate based on the heart rate value corresponding to each R-wave signal among several R-wave signals within the sliding time window; determining the threshold coefficient corresponding to the average heart rate based on a threshold mapping table; determining the signal peak level SPKI and noise peak level NPKI at the current time based on historical ECG signals within the sliding time window; and determining the current R-wave reference threshold corresponding to the current ECG signal using the Pan-Tompkins algorithm based on the signal peak level SPKI, noise peak level NPKI, and threshold coefficient. For example: first, based on the historical ECG signals corresponding to the sliding time window, determining the heart rate value corresponding to each of the K R-wave signals within the sliding time window to obtain the average heart rate; where K is a natural number, and K≥2. The threshold mapping table is used to store the correspondence between heart rate and threshold coefficient; the higher the average heart rate, the larger the threshold coefficient α. Secondly, R-wave signals and noise signals are obtained from historical ECG signals within the sliding time window, resulting in several R-wave signals and several noise signals. Based on the signal peak value corresponding to each R-wave signal, the average value is calculated to determine the signal peak level SPKI at the current moment. Based on the signal peak value corresponding to each noise signal, the average value is calculated to determine the noise peak level NPKI at the current moment. The current R-wave reference threshold A is obtained through the following formula (1): A= NPKI + α (SPKI-NPKI) formula (1).
[0018] It should be noted that the initialization of the R-wave reference threshold is as follows: after the system stabilizes, a 3-second ECG signal is collected to calculate the initial R-wave reference threshold.
[0019] Determining the current refractory period corresponding to the current ECG signal includes: determining the refractory period duration corresponding to the average heart rate based on a refractory period mapping table; and determining the current refractory period corresponding to the current ECG signal based on the refractory period duration and the current time. For example, the refractory period is used to indicate that R-wave detection will not be performed again for a certain period of time after R-wave detection. The refractory period mapping table is used to store the correspondence between heart rate and refractory period duration. When the refractory period duration corresponding to an average heart rate of 60 beats / min is 100ms, the identified detection time Xms of the previous R-wave before the current time is obtained, thereby determining the current refractory period as [Xms, (X+100)ms]. The refractory period duration in the refractory period mapping table has a specific range; for example, the refractory period duration can take values within the time range of 100-200ms.
[0020] This embodiment adaptively adjusts the threshold coefficient based on average heart rate. This allows for timely tightening or loosening of the current R-wave baseline threshold A as heart rate amplitude changes, thereby improving the accuracy of R-wave detection. This embodiment also adaptively adjusts the refractory period based on average heart rate. This ensures that the refractory period remains within a reasonable range as heart rate amplitude changes, preventing it from becoming too wide or too narrow, thus improving the accuracy of R-wave detection. Clearly, this embodiment adaptively adjusts the current R-wave baseline threshold and the current refractory period based on heart rate, avoiding missed and false detections due to large heart rate variations, thereby improving the accuracy of R-wave detection.
[0021] In S102 and S103, for example, when it is determined that the current ECG signal is not in the current refractory period, the peak shape of the current ECG signal is detected based on historical ECG signals. If the shape detection result indicates that the peak shape of the current ECG signal satisfies a strict R-wave peak, then the current R-wave reference threshold is used as a quasi-R-wave threshold. If the shape detection result indicates that the peak shape of the current ECG signal is a loose peak, then an increase operation is performed on the current R-wave reference threshold to generate a quasi-R-wave threshold. Here, the increase operation on the current R-wave reference threshold is performed based on preset rules or model algorithms to generate the quasi-R-wave threshold.
[0022] It should be noted that the strict peak of the R-wave is used to indicate pulse-type ECG signals, while the loose peak is used to indicate smooth ECG signals. The noise pattern in the ECG signal conforms to the pulse spike pattern, but the noise peak value is smaller than the R-wave peak value. Therefore, when a loose peak pattern is detected in the current ECG signal, increasing the current R-wave reference threshold can effectively filter out the influence of noise signals on R-wave detection, thereby improving the accuracy of R-wave detection.
[0023] This embodiment uses a dual-channel morphological judgment system to both catch blunt peaks and suppress false detections, thus overcoming the technical problem of false detections caused by the standard Pan-Tompkins algorithm, which only uses a single local maximum for judgment.
[0024] In S104, it is detected whether the current ECG signal is not less than the quasi-R-wave threshold; if so, it is determined that the current ECG signal is an R-wave; if not, it is determined that the current ECG signal is not an R-wave, the quasi-R-wave threshold is corrected, and the current ECG signal is re-detected based on the corrected R-wave threshold.
[0025] This embodiment adds dynamic threshold adjustment, adaptive refractory period, and dual-channel morphological judgment to the standard PT (Pan-Tompkins) algorithm, thereby solving the problem of missed or false detections caused by the standard Pan-Tompkins algorithm being susceptible to noise, lead instability, and drastic heart rate changes when processing ECG signals. Furthermore, it effectively suppresses image artifacts in existing CT cardiac scans, thereby shortening the exposure time of CT scanning equipment and ultimately significantly improving the overall success rate of cardiac CT scans.
[0026] In a preferred embodiment of this example, the step of detecting the current ECG signal based on the quasi-R-wave threshold and generating an R-wave detection result includes: if the current ECG signal is not less than the quasi-R-wave threshold, then outputting a detection result indicating that the current ECG signal is an R-wave; if the current ECG signal is less than the quasi-R-wave threshold, then obtaining the previous R-wave peak time that is before and adjacent to the current time, and calculating the time difference between the current time and the previous R-wave peak time; if the time difference reaches a first preset time and no R-wave is detected within the first preset time, then performing a reduction operation on the quasi-R-wave threshold, and re-detecting the current ECG signal based on the corrected R-wave threshold obtained from each reduction operation, until the current ECG signal is detected again. The reduction operation ends only when the current ECG signal is not less than the corrected R-wave threshold for the first time, and the corrected R-wave threshold is still greater than the first preset threshold. The result indicating that the current ECG signal is an R-wave is then output. Alternatively, a reduction operation is performed on the quasi-R-wave threshold, and the current ECG signal is re-detected based on the corrected R-wave threshold obtained in each reduction operation. This process continues until the corrected R-wave threshold is not greater than the first preset threshold for the first time, and the current ECG signal is still less than the corrected R-wave threshold. The result indicating that the current ECG signal is not an R-wave is then output. The first preset threshold indicates the peak value of the maximum noise in historical ECG signals traced back a first preset time period from the current moment. The second preset time period is less than the first preset time period. If the time difference does not reach the first preset time period, and / or an R-wave has already been detected within the first preset time period, the result indicating that the current ECG signal is not an R-wave is output.
[0027] For example: Determine if the time difference reaches 2 seconds; if not, end the operation and output the detection result that the current ECG signal is not an R-wave. If yes, determine if an R-wave has appeared within 2 seconds; if yes, output the detection result that the current ECG signal is not an R-wave; if not, backtrack 1 second and select the maximum peak value of the noise signal from the historical ECG signals corresponding to the 1 second window as the first preset threshold. Perform a proportional step reduction operation on the R-wave threshold, and after each reduction operation, detect the current ECG signal based on the corrected R-wave threshold until the first occurrence that the corrected R-wave threshold is not greater than the first preset threshold, or the first occurrence that the current ECG signal is greater than the corrected R-wave threshold, then end the reduction operation and output the R-wave detection result. For example: Perform a proportional step reduction operation on the R-wave threshold to generate a first corrected R-wave threshold; when the first corrected R-wave threshold is determined to be greater than a first preset threshold, re-detect the current ECG signal based on the first corrected R-wave threshold. If the re-detection result indicates that the current ECG signal is not greater than the first corrected R-wave threshold, then continue to perform a proportional step reduction operation on the R-wave threshold to generate a second corrected R-wave threshold; when the second corrected R-wave threshold is determined to be less than the first preset threshold, use the adjacent previous R-wave detection result as the output, i.e., output the detection result that the current ECG signal is not an R-wave; when the second corrected R-wave threshold is determined to be greater than the first preset threshold, if the current ECG signal is greater than the second corrected R-wave threshold for the first time, then end the above reduction operation and output the detection result that the current ECG signal is an R-wave.
[0028] The standard Pan-Tompkins algorithm's backtracking search is relatively simple, making it prone to missing detections under low amplitude / noise conditions. This embodiment, through timeout backtracking and R-wave threshold updating, avoids missed or false detections due to noise, improving the accuracy of R-wave detection. This effectively solves the problem of image artifacts in existing CT cardiac scans, thereby reducing the exposure time of CT scanning equipment and improving the success rate of cardiac CT scans.
[0029] In a preferred embodiment of this example, the method further includes: acquiring the original ECG signal corresponding to the target object at the current time; sequentially performing bandpass filtering, differentiation, squaring, and moving window integration on the original ECG signal to generate the current ECG signal. This effectively removes noise from the original ECG signal, reduces the impact of noise on R-wave detection, and thus improves the accuracy of R-wave detection in the ECG signal.
[0030] In a preferred embodiment of this example, the step of increasing the current R-wave reference threshold to generate a quasi-R-wave threshold includes: increasing the current R-wave reference threshold to generate a candidate R-wave threshold; determining the current T-wave protection period corresponding to the current ECG signal; detecting whether the current ECG signal falls within the current T-wave protection period; if the detection result indicates that the current ECG signal falls within the current T-wave protection period, then increasing the candidate R-wave threshold to generate a quasi-R-wave threshold. If the detection result indicates that the current ECG signal does not fall within the current T-wave protection period, then the candidate R-wave threshold is used as the quasi-R-wave threshold.
[0031] Specifically, the candidate R-wave reference threshold is increased by applying a preset coefficient to the candidate R-wave threshold. Here, the preset coefficient is an empirical value obtained from several trials.
[0032] In this embodiment, both the candidate R-wave threshold and the quasi-R-wave threshold are less than the upper limit of hardware acquisition.
[0033] As further exemplified, determining the current T-wave protection period corresponding to the current ECG signal includes: determining the T-wave initiation time corresponding to the average heart rate based on a T-wave initiation time mapping table; and determining the current T-wave protection period corresponding to the current ECG signal based on a preset T-wave duration and the T-wave initiation time. This embodiment adaptively adjusts the T-wave protection period based on the average heart rate, thereby suppressing false detection of T waves as R waves and improving the accuracy of R-wave detection.
[0034] For example, the T-wave protection period is used to indicate a specific time period to avoid misinterpreting T waves as R waves. It typically starts after the refractory period, thus avoiding the refractory period and accurately covering the T-wave occurrence time. The T-wave initiation time mapping table stores the correspondence between heart rate and T-wave initiation time. The T-wave initiation time in the mapping table has a specific range; for example, the T-wave initiation time can be within the range of 200-300ms. The higher the average heart rate, the earlier the T-wave initiation time appears; the lower the average heart rate, the later the T-wave initiation time appears.
[0035] In the existing standard Pan-Tompkins algorithm, the current R-wave baseline threshold A is typically determined based on a fixed threshold coefficient, and a fixed refractory period is set; moreover, a T-wave protection period is not designed. This embodiment adds dynamic threshold adjustment, adaptive refractory period, morphological dual-channel judgment, T-wave protection period judgment, and timeout backtracking and threshold update to the standard Pan-Tompkins algorithm. This solves the problem of missed or false detections caused by the standard Pan-Tompkins algorithm being susceptible to noise, lead instability, excessively high T waves, and drastic heart rate changes when processing ECG signals. Furthermore, it effectively suppresses the generation of image artifacts in existing CT cardiac scans, thereby shortening the exposure time of CT scanning equipment and ultimately significantly improving the overall success rate of cardiac CT scans.
[0036] In a preferred embodiment of this example, the method further includes: when outputting the detection result that the current ECG signal is an R-wave, updating the signal peak level SPKI and the noise peak level NPKI within the sliding time window; when outputting the detection result that the current ECG signal is not an R-wave, updating the noise peak level NPKI within the sliding time window.
[0037] Specifically, after determining that the current ECG signal is an R-wave detection result, the current ECG signal is added to the sliding time window, and the ECG signal at the top of the sliding time window is removed. Then, the signal peak level SPKI and NPKI within the sliding time window are recalculated.
[0038] like Figure 2 The diagram shown is a schematic diagram of the CT scan control system in one embodiment of the present invention.
[0039] The CT scan control system 200 includes: an electrocardiogram acquisition and processing board 201 and a CT static part control board 202.
[0040] The ECG acquisition and processing board acquires the raw ECG signal of the target object through the lead wires, accurately identifies the R wave in the acquired ECG signal, generates the corresponding R wave marker signal, and synchronously transmits the R wave marker signal to the CT static part control board to realize the time-series linkage between ECG detection and CT control module.
[0041] The CT static control board uses the received R-wave marker signal as the core timing reference. Combined with the real-time heart rate characteristics of the target object, it accurately calculates the optimal exposure time and appropriate exposure duration of the CT equipment. By starting the exposure during the optimal time period within the heart rate cycle and reasonably controlling the exposure duration, it effectively reduces the radiation dose caused by invalid exposure, thereby reducing the total radiation dose borne by the target object and balancing the quality of the scanned image with the patient's radiation safety.
[0042] The following describes in detail an R-wave detection method for CT scans provided in this embodiment, using a specific application scenario. Electrocardiogram (ECG) signals are acquired at a frequency of 600 Hz. The following steps are performed for each ECG signal acquisition.
[0043] A method for R-wave detection in CT scans, comprising at least the following steps: S1, obtain the original ECG signal corresponding to the target object at the current time; perform bandpass filtering, differentiation, squaring, and moving window integration on the original ECG signal in sequence to generate the current ECG signal.
[0044] S2, determine the sliding time window that is prior to and adjacent to the current time, and obtain the average heart rate based on the heart rate value corresponding to each R-wave signal among several R-wave signals within the sliding time window; determine the threshold coefficient corresponding to the average heart rate based on the threshold mapping table; determine the signal peak level SPKI and noise peak level NPKI at the current time based on the historical ECG signals within the sliding time window; determine the current R-wave reference threshold corresponding to the current ECG signal using the Pan-Tompkins algorithm based on the signal peak level SPKI, the noise peak level NPKI, and the threshold coefficient.
[0045] S3, based on the refractory period mapping table, determine the duration of the refractory period corresponding to the average heart rate; based on the duration of the refractory period and the current time, determine the current refractory period corresponding to the current ECG signal.
[0046] S4. Based on the T-wave protection period mapping table, determine the T-wave initiation time corresponding to the average heart rate; based on the T-wave preset duration, T-wave initiation time, and the current time, determine the current T-wave protection period corresponding to the current ECG signal.
[0047] S5, determine whether the current ECG signal is in the current refractory period; if the current ECG signal is not in the current refractory period, proceed to step S6; if the current ECG signal is in the current refractory period, proceed to step S15.
[0048] S6. Based on historical ECG signals, detect the peak shape of the current ECG signal; if the shape detection result indicates that the peak shape of the current ECG signal meets the strict peak of the R wave, then the current R wave reference threshold is used as the quasi-R wave threshold; if the shape detection result indicates that the peak shape of the current ECG signal is a loose peak, then the current R wave reference threshold is increased to generate a candidate R wave threshold.
[0049] S7, detect whether the current ECG signal falls within the current T-wave protection period; if the detection result indicates that the current ECG signal falls within the current T-wave protection period, then proceed to step S8; if the detection result indicates that the current ECG signal does not fall within the current T-wave protection period, then proceed to step S9.
[0050] S8, perform an increase operation on the candidate R-wave threshold to generate a quasi-R-wave threshold.
[0051] S9, the candidate R-wave threshold is used as the quasi-R-wave threshold.
[0052] S10, based on the quasi-R-wave threshold, detect the current ECG signal and generate an R-wave detection result; if the R-wave detection result indicates that the current ECG signal is not less than the quasi-R-wave threshold, then execute step S11; if the R-wave detection result indicates that the current ECG signal is less than the candidate R-wave threshold, then execute step S12.
[0053] S11, output the detection result that the current ECG signal is an R wave; and update the signal peak level SPKI and noise peak level NPKI within the sliding time window.
[0054] S12, obtain the previous R-wave peak time that is before and adjacent to the current time, and calculate the time difference between the current time and the previous R-wave peak time; if the time difference reaches a first preset time and no R-wave is detected within the first preset time, then execute step S13; if the time difference does not reach the first preset time, and / or an R-wave has been detected within the first preset time, then execute step S14.
[0055] S13, perform a reduction operation on the quasi-R-wave threshold, and re-detect the current ECG signal based on the corrected R-wave threshold obtained in each reduction operation, until the current ECG signal is not less than the corrected R-wave threshold for the first time and the corrected R-wave threshold is still greater than the first preset threshold, then the reduction operation ends and the detection result that the current ECG signal is an R-wave is output; update the signal peak level SPKI and noise peak level NPKI within the sliding time window; wherein, the first preset threshold is used to indicate the peak value of the maximum noise in the historical ECG signal traced back a first preset time from the current time; the second preset time is less than the first preset time.
[0056] S14, output the detection result that the current ECG signal is not an R wave, and update the noise peak level NPKI within the sliding time window.
[0057] S15, End of process.
[0058] This embodiment adds dynamic threshold adjustment, adaptive refractory period, dual-channel morphological judgment, T-wave protection period, timeout backtracking, and threshold update to the Pan-Tompkins algorithm. This solves the problem of missed or false detections caused by the standard Pan-Tompkins algorithm being susceptible to noise, lead instability, and drastic heart rate changes when processing ECG signals. Furthermore, it can quickly and accurately identify the R wave in the ECG signal, effectively solving the problem of image artifacts in existing CT cardiac scans, reducing the exposure time of CT scanning equipment, and improving the success rate of cardiac CT scans.
[0059] It should be noted that, after several experimental verifications, the time required for each execution of the R-wave detection method for CT scan on the current ECG signal is less than 20ms. Therefore, the method in this embodiment meets the high real-time requirements.
[0060] like Figure 3 The diagram shown is a structural schematic of an R-wave detection device for CT scanning provided in an embodiment of the present invention.
[0061] An R-wave detection device for CT scans, the device 300 comprising at least: a first acquisition module 301, configured to acquire the current R-wave reference threshold and the current refractory period corresponding to the current ECG signal; a peak morphology detection module 302, configured to detect the peak morphology of the current ECG signal based on historical ECG signals when it is determined that the current ECG signal is not in the current refractory period; a generation module 303, configured to, if the morphology detection result indicates that the peak morphology of the current ECG signal satisfies a strict R-wave peak, use the current R-wave reference threshold as a quasi-R-wave threshold; if the morphology detection result indicates that the peak morphology of the current ECG signal is a loose peak, perform an increase operation on the current R-wave reference threshold to generate a quasi-R-wave threshold; and a detection module 304, configured to detect the current ECG signal based on the quasi-R-wave threshold to generate an R-wave detection result.
[0062] In a preferred embodiment of this example, the detection module includes: a first output unit, configured to output a detection result indicating that the current ECG signal is an R-wave if the current ECG signal is not less than the quasi-R-wave threshold; a calculation unit, configured to, if the current ECG signal is less than the quasi-R-wave threshold, obtain the previous R-wave peak time located before and adjacent to the current time, and calculate the time difference between the current time and the previous R-wave peak time; and a second output unit, configured to, if the time difference reaches a first preset time and no R-wave is detected within the first preset time, perform a reduction operation on the quasi-R-wave threshold, and re-detect the current ECG signal based on the corrected R-wave threshold obtained in each reduction operation, until the current ECG signal is detected. The reduction operation ends only when the signal is not less than the corrected R-wave threshold for the first time and the corrected R-wave threshold is still greater than the first preset threshold, and the detection result that the current ECG signal is an R-wave is output; or, the reduction operation is performed on the quasi-R-wave threshold, and the current ECG signal is re-detected based on the corrected R-wave threshold obtained in each reduction operation, until the corrected R-wave threshold is not greater than the first preset threshold for the first time and the current ECG signal is still less than the corrected R-wave threshold, and the reduction operation ends only when the detection result that the current ECG signal is not an R-wave is output; wherein, the first preset threshold is used to indicate the peak value of the maximum noise in the historical ECG signal traced back a first preset time from the current time; the second preset time is less than the first preset time.
[0063] In a preferred embodiment of this example, the detection module further includes a third output unit, used to output a detection result that the current ECG signal is not an R-wave if the time difference has not reached a first preset time and / or an R-wave has been detected within the first preset time.
[0064] In a preferred embodiment of this example, the generation module includes: a first amplification unit, configured to perform an amplification operation on the current R-wave reference threshold to generate a candidate R-wave threshold; a first determination unit, configured to determine the current T-wave protection period corresponding to the current ECG signal; a detection unit, configured to detect whether the current ECG signal falls within the current T-wave protection period; a second amplification unit, configured to perform an amplification operation on the candidate R-wave threshold to generate a quasi-R-wave threshold if the detection result indicates that the current ECG signal falls within the current T-wave protection period; and a second determination unit, configured to use the candidate R-wave threshold as the quasi-R-wave threshold if the detection result indicates that the current ECG signal does not fall within the current T-wave protection period.
[0065] In a preferred embodiment of this invention, the device further includes: a first determining module, configured to determine the current R-wave reference threshold corresponding to the current ECG signal; the first determining module includes: a first determining unit, configured to determine a sliding time window located before and adjacent to the current time, and obtain an average heart rate based on the heart rate value corresponding to each of several R-wave signals within the sliding time window; a second determining unit, configured to determine a threshold coefficient corresponding to the average heart rate based on a threshold mapping table; a third determining unit, configured to determine the signal peak level SPKI and noise peak level NPKI at the current time based on historical ECG signals within the sliding time window; and a fourth determining unit, configured to determine the current R-wave reference threshold corresponding to the current ECG signal using the Pan-Tompkins algorithm based on the signal peak level SPKI, the noise peak level NPKI, and the threshold coefficient.
[0066] In a preferred embodiment of this invention, the device further includes: a second determining module, configured to determine the current refractory period corresponding to the current ECG signal; the second determining module includes: a first determining unit, configured to determine the duration of the refractory period corresponding to the average heart rate based on a refractory period mapping table; and a second determining unit, configured to determine the current refractory period corresponding to the current ECG signal based on the duration of the refractory period and the current time.
[0067] In a preferred embodiment of this example, the first determining unit in the generation module includes: a first determining subunit, used to determine a sliding time window located before and adjacent to the current time, and to obtain an average heart rate based on the heart rate value corresponding to each of the several R-wave signals within the sliding time window; a second determining subunit, used to determine the T-wave initiation time corresponding to the average heart rate based on a T-wave initiation time mapping table; and a third determining subunit, used to determine the current T-wave protection period corresponding to the current ECG signal based on the T-wave preset duration, the T-wave initiation time, and the current time.
[0068] In a preferred embodiment of this invention, the device further includes: a first update module, configured to update the signal peak level SPKI and noise peak level NPKI within a sliding time window when the detection result determines that the current ECG signal is an R-wave; and a second update module, configured to update the noise peak level NPKI within a sliding time window when the detection result determines that the current ECG signal is not an R-wave.
[0069] In a preferred embodiment of this invention, the device further includes: a second acquisition module, used to acquire the original ECG signal corresponding to the target object at the current time; and a denoising module, used to sequentially perform bandpass filtering, differentiation, squaring, and moving window integration on the original ECG signal to generate the current ECG signal.
[0070] The aforementioned R-wave detection device for CT scans can execute the R-wave detection method for CT scans provided in an embodiment of the present invention, and possesses the corresponding functional modules and beneficial effects of executing the R-wave detection method for CT scans. Technical details not described in detail in this embodiment can be found in the R-wave detection method for CT scans provided in an embodiment of the present invention.
[0071] The present invention also provides an electronic device, comprising: a processor; a memory for storing executable instructions of the processor; the processor being configured to read the executable instructions from the memory and execute the instructions to implement the R-wave detection method for CT scans described in the present invention.
[0072] In addition to the methods and apparatus described above, embodiments of this application may also be computer program products, which include computer program instructions that, when executed by a processor, cause the processor to perform the steps in the methods according to various embodiments of this application described in the "Exemplary Methods" section above.
[0073] The computer program product can be written in any combination of one or more programming languages to perform the operations of the embodiments of this application. The programming languages include object-oriented programming languages such as Java and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0074] Furthermore, embodiments of this application may also be computer-readable storage media storing computer program instructions thereon, which, when executed by a processor, cause the processor to perform the steps in the methods according to the following embodiments of this application described in the "Exemplary Methods" section above.
[0075] The computer-readable storage medium may be any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof.
[0076] The basic principles of this application have been described above with reference to specific embodiments. However, it should be noted that the advantages, benefits, and effects mentioned in this application are merely examples and not limitations, and should not be considered as essential features of each embodiment of this application. Furthermore, the specific details disclosed above are for illustrative and facilitative purposes only, and are not limitations. These details do not limit the application to the necessity of employing the aforementioned specific details for implementation.
[0077] The block diagrams of devices, apparatuses, devices, and systems involved in this application are merely illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, apparatuses, devices, and systems can be connected, arranged, and configured in any manner. Words such as “comprising,” “including,” “having,” etc., are open-ended terms meaning “including but not limited to,” and are used interchangeably with them. The terms “or” and “and” as used herein refer to the terms “and / or,” and are used interchangeably with them unless the context clearly indicates otherwise. The term “such as” as used herein refers to the phrase “such as but not limited to,” and is used interchangeably with it.
[0078] It should also be noted that in the apparatus, equipment, and methods of this application, the components or steps can be disassembled and / or recombined. These disassemblies and / or recombinations should be considered as equivalent solutions of this application.
[0079] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use this application. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein can be applied to other aspects without departing from the scope of this application. Therefore, this application is not intended to be limited to the aspects shown herein, but rather to be accorded the widest scope consistent with the principles and novel features disclosed herein.
[0080] The above description has been given for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of this application to the forms disclosed herein. Although numerous exemplary aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations thereof.
[0081] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of those different embodiments or examples.
[0082] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0083] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for R-wave detection in CT scans, characterized in that, include: Obtain the current R-wave reference threshold and current refractory period corresponding to the current ECG signal; If it is determined that the current ECG signal is not in the current refractory period, then the peak shape of the current ECG signal is detected based on historical ECG signals; If the morphology detection result indicates that the peak morphology of the current ECG signal satisfies the strict peak of the R-wave, then the current R-wave reference threshold is used as the quasi-R-wave threshold; if the morphology detection result indicates that the peak morphology of the current ECG signal is a loose peak, then the current R-wave reference threshold is increased to generate the quasi-R-wave threshold. Based on the quasi-R-wave threshold, the current ECG signal is detected to generate an R-wave detection result.
2. The method according to claim 1, characterized in that, The step of detecting the current ECG signal based on the quasi-R-wave threshold and generating an R-wave detection result includes: If the current ECG signal is not less than the quasi-R-wave threshold, then output the detection result that the current ECG signal is an R-wave; If the current ECG signal is less than the quasi-R-wave threshold, then the previous R-wave peak time that is before the current time and adjacent to the current time is obtained, and the time difference between the current time and the previous R-wave peak time is calculated. If the time difference reaches a first preset time and no R-wave is detected within the first preset time, then a reduction operation is performed on the quasi-R-wave threshold. Based on the corrected R-wave threshold obtained from each reduction operation, the current ECG signal is re-detected until the current ECG signal is not less than the corrected R-wave threshold for the first time and the corrected R-wave threshold is still greater than the first preset threshold. Only then does the reduction operation end, and the detection result that the current ECG signal is an R-wave is output. Alternatively, a reduction operation is performed on the quasi-R-wave threshold, and based on the corrected R-wave threshold obtained from each reduction operation, the current ECG signal is re-detected until the corrected R-wave threshold is not greater than the first preset threshold for the first time and the current ECG signal is still less than the corrected R-wave threshold. Only then does the reduction operation end, and the detection result that the current ECG signal is not an R-wave is output. Wherein, the first preset threshold is used to indicate the peak value of the maximum noise in the historical ECG signal traced back from the current time within a first preset time. The second preset time is less than the first preset time.
3. The method according to claim 2, characterized in that, Also includes: If the time difference does not reach the first preset time, and / or an R-wave has been detected within the first preset time, then the detection result that the current ECG signal is not an R-wave is output.
4. The method according to claim 1, characterized in that, The step of increasing the current R-wave reference threshold to generate a quasi-R-wave threshold includes: An increase operation is performed on the current R-wave reference threshold to generate candidate R-wave thresholds; Determine the current T-wave protection period corresponding to the current ECG signal; Detect whether the current ECG signal falls within the current T-wave protection period; If the detection result indicates that the current ECG signal falls within the current T-wave protection period, then the candidate R-wave threshold is increased to generate a quasi-R-wave threshold. If the detection result indicates that the current ECG signal does not fall within the current T-wave protection period, then the candidate R-wave threshold is used as the quasi-R-wave threshold.
5. The method according to claim 1, characterized in that, Also includes: Determine the current R-wave reference threshold corresponding to the current ECG signal; Determining the current R-wave reference threshold corresponding to the current ECG signal includes: Determine a sliding time window that is prior to and adjacent to the current time, and obtain the average heart rate based on the heart rate value corresponding to each R-wave signal among several R-wave signals within the sliding time window; Based on the threshold mapping table, determine the threshold coefficient corresponding to the average heart rate; Based on the historical ECG signals within the sliding time window, determine the signal peak level SPKI and noise peak level NPKI at the current moment. Based on the signal peak level SPKI, the noise peak level NPKI, and the threshold coefficient, the current R-wave reference threshold corresponding to the current ECG signal is determined by the Pan-Tompkins algorithm.
6. The method according to claim 5, characterized in that, Also includes: Determine the current refractory period corresponding to the current ECG signal; Determining the current refractory period corresponding to the current ECG signal includes: Based on the refractory period mapping table, determine the duration of the refractory period corresponding to the average heart rate; Based on the duration of the refractory period and the current time, the current refractory period corresponding to the current ECG signal is determined.
7. The method according to claim 4, characterized in that, Determining the current T-wave protection period corresponding to the current ECG signal includes: Determine a sliding time window that is prior to and adjacent to the current time, and obtain the average heart rate based on the heart rate value corresponding to each R-wave signal among several R-wave signals within the sliding time window; Based on the T-wave initiation time mapping table, the T-wave initiation time corresponding to the average heart rate is determined; Based on the preset duration of the T-wave, the T-wave initiation time, and the current time, the current T-wave protection period corresponding to the current ECG signal is determined.
8. The method according to claim 1, characterized in that, Also includes: When outputting the detection result that the current ECG signal is an R wave, update the signal peak level SPKI and noise peak level NPKI within the sliding time window; When outputting the detection result that the current ECG signal is a non-R wave, update the noise peak level NPKI within the sliding time window.
9. The method according to claim 1, characterized in that, Also includes: Obtain the raw ECG signal corresponding to the target object at the current moment; The original ECG signal is sequentially subjected to bandpass filtering, differentiation, squaring, and moving window integration to generate the current ECG signal.
10. An R-wave detection device for CT scans, characterized in that, include: The first acquisition module is used to acquire the current R-wave reference threshold and the current refractory period corresponding to the current ECG signal; The peak shape detection module is used to detect the peak shape of the current ECG signal based on historical ECG signals when it is determined that the current ECG signal is not in the current refractory period. The generation module is used to take the current R-wave reference threshold as a quasi-R-wave threshold if the morphology detection result indicates that the peak morphology of the current ECG signal meets the strict peak of the R-wave; and to perform an increase operation on the current R-wave reference threshold to generate a quasi-R-wave threshold if the morphology detection result indicates that the peak morphology of the current ECG signal is a loose peak. The detection module is used to detect the current ECG signal based on the quasi-R-wave threshold and generate R-wave detection results.
11. A computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the method as claimed in any one of claims 1-9.