TIMI myocardial perfusion frame counting method and system

Through deep learning models and optical flow analysis technology, coronary angiography video is automatically processed, solving the problem that existing myocardial perfusion evaluation methods rely on manual counting, and achieving a more objective and efficient myocardial perfusion evaluation.

CN120070384APending Publication Date: 2025-05-30NORTH CHINA PETROLEUM BUREAU GENERAL HOSPITAL
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510155967.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-12
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

The existing myocardial perfusion evaluation methods are highly dependent on manual counting, which are time-consuming, subjective and lack of automation, and are difficult to widely use in clinical environments.

Method used

The deep learning model was used to combine optical flow analysis and topological analysis to automatically process vascular segmentation and contrast agent flow tracking in coronary angiography video, and the TIMI myocardial perfusion frame count was calculated through skeletonization and maximum extension path algorithms.

Benefits of technology

It significantly reduces manual intervention and subjective errors, improves the objectivity and consistency of myocardial perfusion evaluation, simplifies clinical operation procedures, and applies them in small and medium-sized hospitals.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120070384A_ABST
    Figure CN120070384A_ABST
Patent Text Reader

Abstract

The invention discloses a TIMI myocardial perfusion frame counting method and system, and belongs to the field of coronary artery disease diagnosis and evaluation. The method comprises the following steps: taking a contrast video as input, splitting the contrast video into video frames, and carrying out standardization and / or enhancement processing on an image; segmenting a blood vessel, and extracting a blood vessel region in the pre-video frame; combining a blood vessel segmentation result with an original video, marking a contrast agent region, and converting the contrast agent region into a binary mask; a Farneback dense optical flow algorithm is adopted to estimate the pixel-level motion condition between adjacent frames, a binary contrast agent image is obtained, and the flow and flow velocity characteristics of the contrast agent of each frame are extracted; skeletonizing the binary contrast agent image; calculating the maximum extension length of the contrast agent in the blood vessel in the skeletonized binary contrast agent image of each frame; according to the maximum extension length of each frame in combination with the contrast agent and flow velocity characteristics of each frame, determining the moment when the contrast agent reaches the far-end blood vessel for the first time and the moment when the contrast agent starts to leave the far-end blood vessel, and counting TIMI myocardial perfusion frames according to the corresponding difference between the two moments.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of coronary artery disease diagnosis and evaluation, and particularly to a TIMI myocardial perfusion frame count method and system. Background Art

[0002] Among current myocardial perfusion assessment methods, TIMI myocardial perfusion frame count (TMPFC) is a method for quantifying myocardial perfusion by frame counting, which can accurately evaluate the myocardial perfusion status. TMPFC calculates the number of frames required for the contrast agent to first appear in the myocardium until complete clearance in coronary angiography through image analysis technology. This method provides a continuous and objective quantitative index for reflecting the efficiency and quality of myocardial perfusion after coronary recanalization.

[0003] In myocardial perfusion assessment, existing qualitative or quantitative methods each have their limitations:

[0004] TIMI myocardial perfusion grade (TMPG): This method evaluates the degree of myocardial perfusion by observing the clearance rate of the contrast agent in the myocardium, and classifies the perfusion into grades 0 to 3. TMPG is widely used in clinical research, but its subjectivity is a major limitation.

[0005] Myocardial blush grade (MBG): MBG evaluates myocardial perfusion based on the concentration of the contrast agent in the infarcted area, providing another perspective to observe the myocardial perfusion status. However, MBG also faces the challenge of subjectivity.

[0006] Corrected TIMI frame count (CTFC): By calculating the number of frames required for the contrast agent to reach a predetermined end point from the coronary artery origin, CTFC provides a numerical index. Although CTFC is more objective, it mainly evaluates coronary blood flow rather than directly evaluating myocardial perfusion.

[0007] TIMI myocardial perfusion frame count (TMPFC): Aims to quantify TMPG. TMPFC evaluates myocardial perfusion by calculating the number of frames required for the contrast agent to appear and disappear in the myocardium. This method provides a continuous and quantitative index, which theoretically can more accurately reflect the myocardial perfusion status.

[0008] Although TMPG and MBG are widely used, they are both subjective and categorical assessment methods. Different observers may give different ratings to the same image, affecting the consistency and reproducibility of the results. CTFC mainly evaluates coronary blood flow rather than directly evaluating myocardial perfusion. Although coronary blood flow is closely related to myocardial perfusion, they are not exactly the same. For the TMPFC method, although it provides a quantitative index, its current application still mainly relies on manual counting. This is not only time-consuming but also prone to introducing subjective biases. Manual TMPFC calculations are error-prone, especially when viewing dynamic images for a long time. In addition, the TMPFC method lacks standardization and automation, limiting its application in large-scale studies or clinical trials.

[0009] In summary, most of the existing methods highly rely on the subjective visual judgment of the operator, lacking quantitative indicators and automated processes. This results in a relatively long evaluation process, requiring the intervention of professionals, and is difficult to be widely applied in a busy clinical environment.

[0010] Some researchers have tried to combine TMPG, MBG, and CTFC for a more comprehensive evaluation. This comprehensive approach aims to make up for the deficiencies of single methods but may increase the complexity of the evaluation. Some researchers have developed a computer-aided program based on MBG to objectively quantify myocardial perfusion. This method uses image processing techniques to analyze contrast images and provides a more objective evaluation. However, this method usually requires offline processing, is difficult to apply in real-time clinical decision-making, and cannot be updated iteratively.

[0011] For TMPFC, some researchers have tried to develop semi-automated software to assist in the calculation. These tools allow users to mark key frames on the computer and then automatically calculate the number of frames. This improves the efficiency to some extent but still requires manual intervention and does not fundamentally solve the problem of the lack of automated analysis.

[0012] So far, there has not been a widely accepted computer vision-based method to automate the calculation process of TMPFC. The existing improvements mainly focus on assisting manual calculations or combining with other methods rather than developing a truly automated solution. This gap provides an important opportunity for the development of new technologies. Especially in the context of the rapid development of computer vision and artificial intelligence, there is great potential in developing an automated TMPFC evaluation tool. Summary of the Invention

[0013] In view of the deficiencies of the prior art, the present invention proposes a TIMI myocardial perfusion frame counting method and system.

[0014] In the first aspect of the present invention, it relates to a TIMI myocardial perfusion frame counting method, including the following steps:

[0015] Take the contrast video as input, decompose it into video frames, and perform normalization and / or enhancement processing on the images;

[0016] Vessel segmentation to extract the vessel regions in the pre-video frames;

[0017] Combine the vessel segmentation results with the original video, mark the contrast agent regions and convert them into binary masks; Use the Farneback dense optical flow algorithm to estimate the pixel-level motion between adjacent frames, and obtain binary contrast agent images and the contrast agent flow rate and velocity characteristics of each frame;

[0018] Skeletonize the binary contrast agent image;

[0019] Calculate the maximum extension length of the contrast agent in the vessels in the skeletonized binary contrast agent images of each frame;

[0020] According to the maximum extension length of each frame, determine the moment when the contrast agent first reaches the distal vessels and the moment when the contrast agent starts to leave the distal vessels. The difference between the frame number corresponding to the moment when the contrast agent first reaches the distal vessels and the frame number corresponding to the moment when the contrast agent starts to leave the distal vessels is the TIMI myocardial perfusion frame count.

[0021] Optionally, the calculation method of the maximum extension length includes the following steps:

[0022] Convert the skeletonized binary contrast agent image of each frame into an undirected graph;

[0023] Select the largest connected component and approximately obtain the longest path in this connected component through two breadth-first searches;

[0024] Accumulate the Euclidean distances between adjacent pixels on the longest path to obtain the maximum extension length of the contrast agent in the vessels of this frame.

[0025] Optionally, the random noise and outliers in the optical flow tracking are processed by a clustering algorithm or a noise reduction algorithm.

[0026] Optionally, the clustering algorithm includes: the DBSCAN clustering algorithm, including the following steps:

[0027] 1) Select the pixel coordinates with valid motion vectors in each frame as input data;

[0028] 2) DBSCAN determines whether a pixel coordinate belongs to a core point, a border point, or a noise point based on the set ε and min_samples; ε represents the maximum distance when judging adjacent points. For a given point p, its ε-neighborhood consists of all points whose distance from p does not exceed ε; min_samples represents the minimum number of points required to form a dense region. When a point contains at least min_samples points in its ε-neighborhood, it is marked as a core point.

[0029] 3) Remove the noise points and retain the pixels of the contrast agent movement trajectory inside the blood vessels.

[0030] Optionally, ε and min_samples in the DBSCAN clustering algorithm are tuned through Bayesian optimization.

[0031] The anti-mask and CLAHE preprocessing can significantly improve the visibility of the blood vessel edges.

[0032] The Farneback optical flow algorithm can accurately capture the dynamic changes of the contrast agent, thereby improving the stability of the inter-frame motion analysis.

[0033] In the skeletonization and morphological operation steps, the combination of dilation and closing operations can effectively repair the broken regions of the blood vessel skeleton and ensure connectivity.

[0034] In the TMPFC key frame localization step, by analyzing the change trend of the maximum extension length, the F1 and F2 frames can be accurately identified to ensure the accuracy of the TMPFC value.

[0035] The second aspect of the present invention relates to a contrast video processing method, including the following steps:

[0036] 1) Take the contrast video as input, disassemble it into video frames, and perform normalization and / or enhancement processing on the images.

[0037] 2) Perform blood vessel segmentation to extract the blood vessel regions in the pre-video frames.

[0038] 3) Combine the blood vessel segmentation result with the original video, mark the contrast agent region and convert it into a binary mask; use the Farneback dense optical flow algorithm to estimate the pixel-level motion between adjacent frames to obtain a binary contrast agent image and the contrast agent flow rate and velocity characteristics of each frame.

[0039] 4) Skeletonize the binary contrast agent image to obtain the processing result.

[0040] The third aspect of the present invention relates to a TIMI myocardial perfusion frame counting system, including:

[0041] A preprocessing module that takes a video as input, disassembles it into video frames, and normalizes and / or enhances the images.

[0042] A blood vessel segmentation module for extracting the blood vessel regions in the pre-video frames.

[0043] A contrast agent trajectory tracking module that combines the processing results of the blood vessel segmentation module with the input video, marks the contrast agent regions and converts them into binary masks, and estimates the pixel-level motion between adjacent frames through the Farneback dense optical flow algorithm to obtain binary contrast agent images and the contrast agent flow rate and velocity characteristics for each frame.

[0044] A skeletonization and morphological operation module for skeletonizing the binary contrast agent images.

[0045] A maximum extension length calculation module for calculating the maximum extension length of the contrast agent in the blood vessels in the skeletonized binary contrast agent images for each frame.

[0046] And a key frame localization module that determines the moment when the contrast agent first reaches the distal blood vessels and the moment when the contrast agent starts to leave the distal blood vessels based on the maximum extension length of each frame, and determines the TIMI myocardial perfusion frame count through the difference between the frame number corresponding to the moment when the contrast agent first reaches the distal blood vessels and the frame number corresponding to the moment when the contrast agent starts to leave the distal blood vessels.

[0047] Optionally, it further includes a noise filtering module that processes the random noise in the optical flow tracking through a clustering algorithm or a noise reduction algorithm.

[0048] The system supports visual output, including blood vessel segmentation results, optical flow trajectories, skeletonized images, and TMPFC key frame localization results.

[0049] The system has real-time processing capabilities and can dynamically output TMPFC analysis results during interventional procedures.

[0050] In a fourth aspect of the present invention, there is provided a computer-readable storage medium configured with the above TIMI myocardial perfusion frame count system or storing instructions; when the instructions are executed, the above TIMI myocardial perfusion frame count method is implemented.

[0051] Advantages of the present invention:

[0052] The present invention uses a deep learning model combined with optical flow analysis and topological analysis to achieve automated processing of blood vessel segmentation and contrast agent flow tracking in coronary angiography videos, significantly reducing manual intervention and subjective errors, and improving the objectivity and consistency of TMPFC analysis; at the same time, preprocessing and denoising means effectively address the challenges of large noise and low contrast in coronary angiography images, greatly improving the accuracy of segmentation and tracking.

[0053] Traditional TMPFC analysis usually requires professional physicians to compare and observe frame by frame, which is not only time-consuming and laborious, but also requires rich clinical experience. The present invention realizes the fully automated process of key frame detection at the algorithm level, which can greatly simplify the clinical operation process. At the same time, by using Bayesian optimization to select the optimal parameter combination, the cumbersome manual parameter adjustment link is avoided, so that the method can be applied in medium and small-sized hospitals or medical scenarios with relatively limited resources, thus effectively reducing the medical cost.

[0054] After generating the skeletonized image, the present invention accurately identifies the key frames of the contrast agent reaching and leaving the distal blood vessels of the myocardium through the maximum extension path algorithm based on the graph structure, providing a more accurate, intuitive and quantitative myocardial perfusion evaluation index. This index can be widely used to monitor the thrombolytic treatment process or evaluate the reperfusion effect during surgery, helping doctors quickly judge the treatment effect and lesion risk, and providing an objective and reliable quantitative basis for clinical practice. Brief Description of the Drawings

[0055] The present invention will be further described below in conjunction with the accompanying drawings.

[0056] Figure 1 It is a schematic diagram of the coronary angiography video processing flow;

[0057] Figure 2 It is an example of the segmentation result of coronary angiography images based on deep learning, specifically the video segmentation results of 4 patients in the embodiment;

[0058] Figure 3 It is an example of the contrast agent optical flow tracking result, specifically selecting frames 11 - 13 of the coronary angiography video of this patient;

[0059] Figure 4 It is an example of the visualization result of denoising using the DBSCAN clustering algorithm, specifically selecting frames 10 - 12 of the coronary angiography video of this patient;

[0060] Figure 5 It is an example of the comparison chart of the contrast agent marker (the first row) and the initial skeletonization of the contrast agent optical flow trajectory (the second row) after denoising by DBSCAN, specifically selecting frames 10 - 12 of the coronary angiography video of this patient;

[0061] Figure 6 An example of the comparison chart of the contrast agent trajectory skeleton before (left figure) and after (right figure) morphological operation. The red box part in the right figure is the identified distal blood vessel area;

[0062] Figure 7 An example of the visualization of the calculation result of the longest path in the contrast agent trajectory skeleton;

[0063] Figure 8Example of the summary of the calculation results of the longest path for each frame of coronary angiography video. Detailed implementation

[0064] Next, in combination with the drawings in the embodiments of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative work belong to the scope of protection of the present invention.

[0065] In the embodiment, taking the coronary angiography video as the input, key frames (the moments when the contrast agent first reaches the distal blood vessel and starts to leave the distal blood vessel) are output, and the TIMI myocardial perfusion frame count (TMPFC) is calculated according to the frame number difference. The specific example is as follows:

[0066] Embodiment 1: Preprocessing and image segmentation of coronary angiography video

[0067] 1. Video frame extraction and resolution unification

[0068] 1) In a specific example ( Figure 1 ), the pydicom and OpenCV tools are used to read each frame of the DICOM

[0069] format coronary angiography video, convert each frame image to a grayscale image and uniformly adjust it to 512×512 pixels to ensure the calculation consistency and efficiency of the subsequent analysis process.

[0070] 2) Optionally, to ensure frame - to - frame time synchronization, the frame rate of the video is recorded in the database and referred to in the final count.

[0071] 2. Two - stage preprocessing

[0072] 1) First, perform unsharp masking on each frame image. By subtracting its smoothed version from the original image, high - frequency details are enhanced, thereby highlighting the coronary blood vessel edges.

[0073] 2) Subsequently, contrast - limited adaptive histogram equalization (CLAHE) is used to enhance the contrast of local regions of the image to improve the visibility differences caused by uneven contrast agent flow.

[0074] 3) Through the above two - stage preprocessing, the clarity of the coronary artery edges and local contrast can be effectively improved, providing good input quality for subsequent blood vessel segmentation and contrast agent tracking.

[0075] 3. Blood vessel segmentation (based on deep learning model)

[0076] 1) In a specific example ( Figure 2 ), the present invention uses a deep learning model for blood vessel segmentation.

[0077] 2) The model has good segmentation accuracy and robustness on coronary angiography images with high noise and low contrast.

[0078] Example 2: Contrast agent trajectory optical flow tracking and noise filtering

[0079] 1. Contrast agent trajectory optical flow tracking based on the Farneback method

[0080] 1) Combine the blood vessel segmentation result with the original video, mark the contrast agent area and convert it into a binary mask to locate the distribution of the contrast agent in the coronary artery.

[0081] 2) Use the Farneback dense optical flow algorithm to estimate the pixel-level motion between adjacent frames: perform a quadratic polynomial approximation on the gray-scale change of the marked contrast agent area in adjacent frames.

[0082] 3) Use this vector field to depict the frame-by-frame flow trajectory of the contrast agent in the blood vessel (

[0084] ), the number of vectors can be used to estimate the contrast agent flow rate, and the vector magnitude is the flow velocity of the contrast agent at the corresponding point, providing basic data for subsequent spatio-temporal analysis. Figure 3 )

[0085] 2. Noise filtering based on the DBSCAN clustering algorithm

[0086] 1) In a specific example ( Figure 4 ), the present invention uses DBSCAN (Density-Based Spatial Clustering of Applications

[0087] with Noise) to filter the random noise and outliers existing in the optical flow tracking:

[0088] (1) Select the pixel coordinates (x, y) with valid motion vectors in each frame as the input data;

[0089] (2) DBSCAN determines whether a pixel point belongs to a core point, a boundary point or a noise point according to the set ε and min_samples;

[0090] (3) Eliminate the noise points and only retain the high-density contrast agent motion pixels inside the blood vessel.

[0091] 2) Optionally, the ε and

[0092] Automatically adjust the parameter of min_samples to adapt to different video qualities and different vascular morphologies.

[0093] 3) Optionally, the DBSCAN clustering algorithm can be replaced by other clustering algorithms and noise reduction algorithms. Example 3: Optical flow skeletonization and calculation of the maximum path extension of the contrast agent

[0094] 1. Skeletonization and morphological operations

[0095] 1) In one example ( Figure 5 ), to facilitate tracking the central flow path of the contrast agent,

[0096] Skeletonize the binary contrast agent image after DBSCAN filtering:

[0097] (1) Execute the skeletonization algorithm on the high-density contrast agent pixel area to obtain the center line with the minimum width (single pixel);

[0098] (2) If local breaks occur, fill the gaps by combining morphological dilation and closing operations (Figure

[0099] 6) to keep the skeleton connected;

[0100] (3) Finally, refine the skeleton again to ensure that it still maintains a single-pixel width.

[0101] 2) The kernel size (such as 8×8) and the number of iterations (such as 6 times) of the morphological operation can be adjusted according to different data distributions to balance between repairing breaks and avoiding excessive merging.

[0102] 2. Calculation of the maximum extension path of the contrast agent based on the graph structure

[0103] 1) In a specific example ( Figure 7 ), convert the binary graph after skeletonization of each frame into an undirected graph G=(V, E), where:

[0104] (1) V represents the skeleton pixel points;

[0105] (2) E represents the 8-neighborhood connectivity relationship between pixels.

[0106] 2) Select the largest connected component to reduce the influence of noise or edge-unrelated branches on subsequent calculations;

[0107] 3) Approximately obtain the longest path in this connected component through two breadth-first searches (BFS):

[0108] (1) In the first BFS, start from an arbitrary pixel point s and find the node u that is farthest from s;

[0109] (2) In the second BFS, starting from u, find the node v that is farthest from u;

[0110] (3) The shortest path between u and v is the approximate longest path of the graph;

[0111] (4) Accumulate the Euclidean distances between adjacent pixels on the path to obtain the maximum extension length Lt of the contrast agent in the blood vessel of this frame.

[0112] Example 4: Model Optimization and TMPFC Calculation

[0113] 1. Bayesian Optimization for Parameter Tuning

[0114] (1) In this example, to improve the generality of the algorithm in various data and environments, the present invention uses Bayesian optimization to automatically tune parameters for multiple key steps. The specific parameters are shown in the following table, including:

[0115] (1) ε and min_samples of DBSCAN;

[0116] (2) The kernel size and number of iterations of morphological operations (dilation and closing operations);

[0117] (3) Several hyperparameters of the deep learning model for image segmentation (such as learning rate, batch size, etc.).

[0118] Table 1 Specific Parameters of Bayesian Optimization

[0119]

[0120] (2) Taking the accuracy and analysis efficiency of TMPFC calculation as the objective function, through multiple evaluations and iterations in the hyperparameter space, automatically find the optimal combination.

[0121] 2. Key Frame Location and TMPFC Calculation

[0122] (1) In a specific example ( Figure 8 ), successively perform the above-mentioned longest path calculation on video frames t = 1, 2,... to obtain Lt for each frame;

[0123] (2) Find and record two key frames:

[0124] (1) Frame F1: The moment when the contrast agent first reaches the distal blood vessel, which can be confirmed by judging whether Lt reaches a certain threshold of its global maximum value;

[0125] (2) Frame F2: The moment when the contrast agent starts to leave the distal blood vessel, which can be determined by the obvious decrease of Lt;

[0126] 3) Based on the difference in frame numbers corresponding to F1 and F2, the TIMI myocardial perfusion frame count

[0127] (TMPFC) can be obtained.

[0128] Example 5: Application of TMPFC Automatic Analysis in a Clinical Environment

[0129] After approval by the ethics committee and informed consent of the patients / families, coronary angiography videos of 151 patients were obtained. Each video included the process from the injection of the contrast agent to its complete disappearance. At the same time, basic information such as the patients' age and postoperative recovery status was recorded, and the data was cleaned and supplemented.

[0130] All the videos were input into the above-mentioned automated analysis system. The system automatically performed steps such as frame extraction, two-stage preprocessing, vessel segmentation, optical flow tracking, noise filtering, skeletonization, longest path analysis, and key frame localization, and finally output the TMPFC value.

[0131] The system output includes: the frame numbers and specific times corresponding to F1 and F2; the calculated TMPFC value, as well as the visualization of the flow trajectory of the contrast agent in the blood vessels and the contrast agent flow rate and velocity in each frame (including the skeleton diagram and the distribution of optical flow vectors). Physicians can comprehensively evaluate according to TMPFC and other clinical indicators, which can be used in various clinical scenarios such as coronary stenosis degree analysis, thrombolysis efficacy monitoring, and intraoperative reperfusion observation.

[0132] Table 2 Comparison Results of TMPFC Values Measured by the Automated Analysis System with the True Values

[0133]

[0134] From these statistical results, the mean of the predicted value and the true value differed by approximately 5 units of TMPFC, and the distribution of the errors was relatively concentrated (the median error was 14 units, and the standard deviation was 13.46 units). The total prediction error (MAE≈16.54 units) was within an acceptable range, and the model had a good effect on capturing the overall trend.

[0135] In the description of this specification, the descriptions referring to terms such as "one embodiment", "example", "specific example", etc. mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in a suitable manner in any one or more embodiments or examples.

[0136] The basic principles, main features and advantages of the present invention have been shown and described above. Those skilled in the art should understand that the present invention is not limited by the above embodiments, and what is described in the above embodiments and the specification only illustrates the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention will have various changes and improvements, and these changes and improvements all fall within the scope of the present invention claimed.

Claims

1. A TIMI myocardial perfusion frame counting method, characterized in that: The following steps are involved: Taking the contrast video as input, disassembling it into video frames, and normalizing and / or enhancing the images; Blood vessel segmentation, extracting blood vessel regions in pre-video frames; The blood vessel segmentation results are combined with the original video, and the contrast agent area is marked and converted into a binary mask. The Farneback dense optical flow algorithm is used to estimate the pixel-level motion between adjacent frames to obtain a binary contrast agent image and the contrast agent flow and velocity characteristics of each frame. skeletonizing the binary contrast agent image; Calculate the maximum extension length of the contrast agent in the blood vessel in the skeletonized binary contrast agent image of each frame; The time when the contrast agent first arrives at the distal blood vessel and the time when the contrast agent begins to leave the distal blood vessel are determined according to the maximum extension length of each frame. The difference between the frame number corresponding to the time when the contrast agent first arrives at the distal blood vessel and the frame number corresponding to the time when the contrast agent begins to leave the distal blood vessel is the TIMI myocardial perfusion frame count.

2. The TIMI myocardial perfusion frame counting method according to claim 1, characterized in that: The blood vessel segmentation is achieved through a deep learning model.

3. The TIMI myocardial perfusion frame counting method according to claim 1, characterized in that: The method for calculating the maximum extension length comprises the following steps: Convert each frame of skeletonized binary contrast agent image into an undirected graph; Select the largest connected component and approximately find the longest path in the connected component through two breadth-first searches; The Euclidean distances of adjacent pixels on the longest path are accumulated to obtain the maximum extension length of the contrast agent in the blood vessel in the frame.

4. The TIMI myocardial perfusion frame counting method according to claim 1, characterized in that: The random noise and outliers in the optical flow tracing are processed by a clustering algorithm or a noise reduction algorithm.

5. The TIMI myocardial perfusion frame counting method according to claim 4, characterized in that: The clustering algorithm includes: DBSCAN clustering algorithm, including the following steps: 1) Select the pixel coordinates with valid motion vectors in each frame as input data; 2) DBSCAN determines whether the pixel coordinates belong to core points, boundary points or noise points according to the set ε and min_samples; ε represents the maximum distance when judging adjacent points. For a given point p, its ε neighborhood consists of all points whose distance from p does not exceed ε; min_samples represents the minimum number of points required to form a dense area; when a point contains at least min_samples points in its ε neighborhood, it is marked as a core point; 3) Remove noise points and retain the pixels of the contrast agent motion trajectory inside the blood vessel.

6. The TIMI myocardial perfusion frame counting method according to claim 5, characterized in that: ε and min_samples in the DBSCAN clustering algorithm are adjusted through Bayesian optimization.

7. A method for processing angiographic video, characterized in that: The following steps are involved: 1) Taking the contrast video as input, disassembling it into video frames, and normalizing and / or enhancing the image; 2) Blood vessel segmentation, extracting blood vessel regions in the pre-video frame; 3) Combine the blood vessel segmentation results with the original video, mark the contrast agent area and convert it into a binary mask; use the Farneback dense optical flow algorithm to estimate the pixel-level motion between adjacent frames to obtain the binary contrast agent image and the contrast agent flow and velocity characteristics of each frame; 4) Skeletonizing the binary contrast agent image to obtain a processing result.

8. A TIMI myocardial perfusion frame counting system, characterized in that: include: A preprocessing module that takes the video as input, decomposes it into video frames, and performs image normalization and / or enhancement; A blood vessel segmentation module, used to extract blood vessel regions in a pre-video frame; The contrast agent trajectory tracking module combines the processing results of the blood vessel segmentation module with the input video, marks the contrast agent area and converts it into a binary mask, and estimates the pixel-level motion between adjacent frames through the Farneback dense optical flow algorithm to obtain the binary contrast agent image and the contrast agent flow and velocity characteristics of each frame; A skeletonization and morphological operation module, used for skeletonizing the binary contrast agent image; A maximum extension length calculation module, used to calculate the maximum extension length of the contrast agent in the blood vessel in the skeletonized binary contrast agent image of each frame; And, the key frame positioning module determines the time when the contrast agent first arrives at the distal blood vessel and the time when the contrast agent begins to leave the distal blood vessel according to the maximum extension length of each frame, and determines the TIMI myocardial perfusion frame count by the difference between the number of frames corresponding to the time when the contrast agent first arrives at the distal blood vessel and the number of frames corresponding to the time when the contrast agent begins to leave the distal blood vessel.

9. The TIMI myocardial perfusion frame counting system according to claim 8, characterized in that: It also includes a noise filtering module, which processes random noise in optical flow tracking through clustering algorithm or noise reduction algorithm.

10. A computer-readable storage medium, characterized in that: The device is equipped with the TIMI myocardial perfusion frame counting system of claim 8, or stores instructions; when the instructions are executed, the TIMI myocardial perfusion frame counting method of any one of claims 1 to 7 is implemented.