X-ray angiography visualization enhancement method and device, computer device and storage medium

CN122929153APending Publication Date: 2026-10-16SHANTOU INST OF UITRASONIC INSTR CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611265892.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-20
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

[0005]本发明实施例提供一种X射线血管造影显影增强方法、装置、计算机设备及存储介质,以解决低剂量低帧率成像条件下呼吸位移导致伪影、造影剂显影不显著以及帧间配准困难、血管流动性不明显的问题

Benefits of technology

[0016] The aforementioned X-ray angiography enhancement method, device, computer equipment, and storage medium, through the innovative introduction of a dual judgment mechanism based on multi-mask comparison and non-vascular tissue contour masking, effectively overcomes the interference caused by respiratory motion artifacts and registration deviations. At the same time, the sliding window differential technology compensates for the insufficient dynamic capture caused by low frame rate. It can accurately identify and enhance the real contrast agent filling area, significantly improve the clarity of vascular edges and the overall image signal-to-noise ratio, and provide reliable high-quality image support for rapid and accurate interventional diagnosis in clinical practice.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122929153A_ABST
    Figure CN122929153A_ABST
Patent Text Reader

Abstract

The application relates to the field of medical image processing and discloses an X-ray angiography development enhancement method and device, computer equipment and a storage medium, which comprises the following steps: registering a contrast agent image and each frame of a mask library to screen an optimal mask; performing subtraction to obtain a subtraction image; performing noise suppression and threshold segmentation on the subtraction image to extract a candidate interest region; intercepting a sub-region on the contrast agent image and the optimal mask based on the candidate region coordinates, and calculating a first image similarity index; extracting a contrast agent contour to generate a mask and superimpose the mask on the corresponding sub-region of the optimal mask, and calculating a second image similarity index; comparing the change amounts of the two indexes, and determining a contrast agent filling region when the change amount exceeds a threshold; performing sliding window difference on the region and a previous frame to extract a newly added contrast agent filling region; and finally performing enhancement processing to output an enhanced image. The application can accurately identify and enhance a real contrast agent filling region, and improve the blood vessel edge definition and the image signal-to-noise ratio.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of medical image processing, and more particularly to a method, apparatus, computer equipment, and storage medium for enhancing X-ray angiography imaging. Background Technology

[0002] Angiography is the gold standard for diagnosing vascular diseases such as coronary heart disease, cerebrovascular disease, and peripheral vascular disease. It involves injecting a contrast agent into blood vessels and using X-ray imaging to display the morphology, course, and hemodynamic information of the vessels in real time. Traditional digital subtraction angiography (DSA) systems typically use high X-ray doses and high imaging frame rates (15-30 frames / second) for continuous exposure to achieve clear contrast agent visualization. While this high-dose, high-frame-rate imaging mode yields superior image quality, it also presents several clinical challenges: long-term or repeated X-ray exposure poses potential health hazards to patients and healthcare workers; and high-frequency exposure exacerbates equipment wear and heat dissipation difficulties. In recent years, with the development of interventional radiology and increased awareness of radiation protection, low-dose and low-frame-rate imaging techniques have become a research hotspot and development trend in the field of angiography.

[0003] Meanwhile, the rapid development of pre-hospital emergency medicine has presented new and more challenging demands on angiography technology. Portable X-ray angiography equipment has irreplaceable application value in outdoor emergency scenarios, but it must achieve arterial angiography at low doses and low frame rates, leading to a series of technical challenges: First, patients cannot actively hold their breath in emergency situations, and respiratory movements are unavoidable. Conventional subtraction algorithms struggle to distinguish the boundaries between blood vessels, bones, or non-vascular tissues and the contrast agent area, resulting in respiratory displacement artifacts that severely affect the display of the contrast agent filling area. Second, quantum noise increases significantly under low-dose conditions, resulting in insignificant contrast agent imaging, reduced contrast with surrounding soft tissues, and an overall unsatisfactory presentation, impacting physician assessment and treatment outcomes. Third, low frame rate acquisition leads to a relatively longer exposure time per frame, accumulating tissue displacement caused by physiological activities such as breathing and cardiac pulsation within the frame, resulting in significant overall displacement and local deformation between adjacent frames, making accurate registration difficult. Simultaneously, the continuous dynamic flow of contrast agent within blood vessels is difficult to capture fully due to insufficient sampling, leading to significant jumps in vascular filling states between frames.

[0004] Therefore, there is an urgent need for an angiography enhancement method that can effectively overcome respiratory motion artifacts, enhance contrast agent visualization, and achieve precise inter-frame registration under low-dose and low-frame-rate conditions. Summary of the Invention

[0005] This invention provides an X-ray angiography enhancement method, apparatus, computer equipment, and storage medium to solve the problems of respiratory displacement artifacts, insignificant contrast agent imaging, difficulty in inter-frame registration, and unclear vascular fluidity under low-dose, low-frame-rate imaging conditions.

[0006] An X-ray angiography enhancement method includes: The contrast agent image is registered with each frame of the mask library, and the optimal mask with the highest registration accuracy with the contrast agent image is selected. The contrast agent image is subtracted from the optimal mask to obtain a subtracted image; The subtraction image is subjected to noise suppression and threshold segmentation to extract candidate regions of interest; Based on the coordinates of the candidate region of interest, corresponding sub-regions are cropped from the contrast agent image and the optimal mask, respectively, and a first image similarity index between the two sub-regions is calculated. Extract the contrast agent contour from the candidate region of interest of the contrast agent image and generate a mask based on the contrast agent contour. Superimpose the mask onto the corresponding sub-region of the optimal mask and calculate the similarity index of the superimposed second image. Compare the change between the first image similarity index and the second image similarity index. When the change exceeds a preset threshold, the candidate region of interest is determined to be a contrast agent-filled region. The contrast agent image identified as a contrast agent filling area is subjected to sliding window difference processing with the previous frame to extract the newly added contrast agent filling area; The newly added contrast agent-filled area is enhanced, and the enhanced angiography image is output.

[0007] Optionally, the step of registering the contrast agent image with each frame of masks in the mask library and selecting the optimal mask with the highest registration accuracy to the contrast agent image includes: By performing Gaussian filtering on the contrast agent image and each frame of mask in the mask library to denoise, a denoised image pair is obtained. By registering the denoised image pairs using optical flow, the direction and amplitude of the motion field are extracted to obtain motion field parameters. The mean amplitude of the sports field is calculated based on the sports field parameters, and multidimensional statistical features are obtained by combining the mean pixel difference and the variance of pixel difference of the registered difference image. Based on the discrimination criteria constructed using the multidimensional statistical features, the mask with the smallest overall registration error is selected to obtain the optimal mask.

[0008] Optionally, before registering the contrast agent image with each frame of masks in the mask library and selecting the optimal mask with the highest registration accuracy to the contrast agent image, the method further includes: Real-time input of image frames; The image frames are preprocessed to obtain preprocessed images; Determine whether the preprocessed image frame is a mask; If so, the image frame is stored in the mask library; If not, then the image frame is used as the contrast agent image.

[0009] Optionally, the step of performing noise suppression and threshold segmentation on the subtraction image to extract candidate regions of interest includes: The subtraction image is subjected to various noise suppression processes to obtain a denoised image; The tissue contours in the denoised image are coarsely extracted and enhanced using an edge detection operator to obtain an enhanced edge image. The enhanced edge image is thresholded using the Otsu's method to obtain the preliminarily separated blood vessel regions; The shape of the initially separated vascular region is restored by connecting region enhancement optimization to obtain the restored vascular region; The contour of the repaired vascular region is extracted, and its area and perimeter are calculated. Shape fitting is performed, and contours with areas smaller than a preset threshold or that do not conform to the morphological characteristics of blood vessels are removed to obtain the candidate region of interest.

[0010] Optionally, after performing sliding window difference processing on the contrast agent image determined to be a contrast agent-filled area and the previous frame to extract the newly added contrast agent-filled area, the method further includes: Obtain the second mask that is closest to the optimal mask, and perform enhancement processing and edge extraction on the optimal mask and the second mask to obtain a non-vascular tissue contour mask; The newly added contrast agent-filled area is compared with the non-vascular tissue contour mask at the pixel level, and the part that overlaps with the non-vascular tissue contour is removed to obtain the pure contrast agent-filled area.

[0011] Optionally, obtaining the second mask closest to the optimal mask, and performing enhancement processing and edge extraction on the optimal mask and the second mask to obtain a non-vascular tissue contour mask includes: The optimal mask is enhanced by histogram equalization, and the second mask is enhanced by image enhancement. The closed boundaries of the two enhanced mask frames are extracted and filled using edge detection operators. The boundaries extracted from the two frames of the mask are differentially analyzed to obtain the non-vascular tissue motion contour mask.

[0012] Optionally, the enhancement processing of the newly added contrast agent-filled area to output an enhanced angiographic image includes: The subtraction image is binarized to obtain a binarized image; Extract the low-gray-value regions within the newly added contrast agent filling area of ​​the binarized image, perform morphological restoration on the low-gray-value regions, and then extract all boundary contours to obtain a set of boundary contours. The area of ​​each contour is calculated and sorted according to the set of boundary contours. The connected contour with the largest area is extracted to obtain an accurate contrast agent binary mask. By mapping the contrast agent binary mask onto the subtraction image, the grayscale sub-image within the mask area is extracted to obtain the grayscale image to be enhanced; The grayscale sub-image is subjected to contrast enhancement and brightness enhancement processing, and the enhanced sub-image is overlaid back onto the corresponding position of the subtraction image to obtain the enhanced angiography image.

[0013] An X-ray angiography contrast-enhancing device, comprising: The optimal mask selection module is used to register the contrast agent image with each frame of the mask library and select the optimal mask with the highest registration accuracy with the contrast agent image. The subtraction processing module is used to perform subtraction processing on the contrast agent image and the optimal mask to obtain a subtracted image; The candidate region extraction module is used to perform noise suppression and threshold segmentation processing on the subtraction image and extract candidate regions of interest. The first similarity calculation module is used to extract corresponding sub-regions on the contrast agent image and the optimal mask respectively according to the coordinates of the candidate interest region, and calculate the first image similarity index between the two sub-regions; The second similarity calculation module is used to extract the contrast agent contour from the candidate interest region of the extracted contrast agent image and generate a mask based on the contrast agent contour, superimpose the mask onto the corresponding sub-region of the optimal mask, and calculate the superimposed second image similarity index. The contrast agent region determination module is used to compare the change between the first image similarity index and the second image similarity index. When the change exceeds a preset threshold, the candidate region of interest is determined to be a contrast agent-filled region. A new region extraction module has been added, which is used to perform sliding window difference processing on the contrast agent image that is determined to be a contrast agent filling area and the previous frame to extract the newly added contrast agent filling area. The enhanced output module is used to enhance the newly added contrast agent filling area and output the enhanced angiography image.

[0014] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-described X-ray angiography enhancement method.

[0015] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described X-ray angiography enhancement method.

[0016] The aforementioned X-ray angiography enhancement method, device, computer equipment, and storage medium, through the innovative introduction of a dual judgment mechanism based on multi-mask comparison and non-vascular tissue contour masking, effectively overcomes the interference caused by respiratory motion artifacts and registration deviations. At the same time, the sliding window differential technology compensates for the insufficient dynamic capture caused by low frame rate. It can accurately identify and enhance the real contrast agent filling area, significantly improve the clarity of vascular edges and the overall image signal-to-noise ratio, and provide reliable high-quality image support for rapid and accurate interventional diagnosis in clinical practice. Attached Figure Description

[0017] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This is a flowchart of an X-ray angiography enhancement method according to an embodiment of the present invention; Figure 2 This is the original image frame in one embodiment of the present invention; Figure 3 This is one embodiment of the present invention. Figure 2 The preprocessed image obtained after processing; Figure 4 This is a subtraction image in one embodiment of the present invention that has not undergone mask registration processing; Figure 5 This is a subtraction image after precise registration processing based on optical flow in one embodiment of the present invention; Figure 6 This is a binarized subtraction image in one embodiment of the present invention; Figure 7 Is Figure 6 Based on the binarized subtraction image, after removing artifacts through connected component enhancement and shape fitting, the precise candidate regions of interest are marked on the original grayscale image; Figure 8This is a sub-region in the contrast agent image in one embodiment of the present invention; Figure 9 This is the corresponding sub-region of the optimal mask in one embodiment of the present invention; Figure 10 This is the image of the corresponding sub-region in the optimal mask in one embodiment of the present invention before overlay; Figure 11 This is the effect of superimposing the extracted and enhanced boundary mask onto the sub-region in one embodiment of the present invention; Figure 12 This is an image after preliminary enhancement processing in one embodiment of the present invention; Figure 13 This is a view of the result after processing and judging an image using the Structural Similarity Index (SSIM) algorithm in one embodiment of the present invention; Figure 14 This is the original, unprocessed mask library image in one embodiment of the present invention; Figure 15 This is a registration mask enhancement image after CLAHE enhancement processing in one embodiment of the present invention; Figure 16 This is a subtraction image of the boundary of non-vascular tissue in one embodiment of the present invention; Figure 17 This is the contrast agent filling area of ​​the previous frame in one embodiment of the present invention; Figure 18 This is the contrast agent filling area in this frame in one embodiment of the present invention; Figure 19 This is the newly added region obtained by subtraction in one embodiment of the present invention; Figure 20 This is the contrast agent area before removing static tissue artifacts in one embodiment of the present invention; Figure 21 This is the final pure contrast agent-filled region after the differential rejection process in step S72 in one embodiment of the present invention. Figure 22 This is an unprocessed subtraction image in one embodiment of the present invention; Figure 23 This is the display effect enhanced by contrast agent in one embodiment of the present invention; Figure 24 This is a schematic diagram of an X-ray angiography imaging enhancement device according to an embodiment of the present invention; Figure 25 This is a schematic diagram of a computer device according to an embodiment of the present invention. Detailed Implementation

[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0020] In one embodiment, such as Figure 1 As shown, an X-ray angiography enhancement method is provided, including the following steps S10~S80.

[0021] S10. Register the contrast agent image with each frame of the mask in the mask library, and select the optimal mask with the highest registration accuracy with the contrast agent image. S20. Subtract the contrast agent image from the optimal mask to obtain a subtracted image; S30. Perform noise suppression and threshold segmentation on the subtraction image to extract candidate regions of interest; S40. Based on the coordinates of the candidate region of interest, extract corresponding sub-regions from the contrast agent image and the optimal mask respectively, and calculate the first image similarity index between the two sub-regions; S50. Extract the contrast agent contour from the candidate region of interest of the extracted contrast agent image and generate a mask based on the contrast agent contour. Superimpose the mask onto the corresponding sub-region of the optimal mask and calculate the similarity index of the superimposed second image. S60. Compare the change between the first image similarity index and the second image similarity index. When the change exceeds a preset threshold, determine that the candidate region of interest is a contrast agent-filled region. S70. Perform sliding window difference processing on the contrast agent image that is determined to be a contrast agent filling area and the previous frame to extract the newly added contrast agent filling area. S80. Enhance the newly added contrast agent filling area and output the enhanced angiography image.

[0022] Understandably, the X-ray angiography enhancement method provided in this embodiment is mainly applicable to low-dose, low-frame-rate angiography imaging based on portable X-ray equipment in complex scenarios such as outdoor emergency rescue. To address issues such as respiratory motion artifacts, registration deviations, and insufficient dynamic capture due to low frame rates that are prone to occur under these harsh imaging conditions, this embodiment constructs a mask library for high-precision registration and initial subtraction. Subsequently, it utilizes a mask overlay similarity index change determination mechanism to accurately distinguish between real contrast agent-filled areas and static non-vascular background interference. Furthermore, it combines sliding window difference operations between adjacent frames to extract newly added contrast agent regions and implements precise local enhancement processing, ultimately achieving clear reconstruction and high-quality image output of the vascular dynamic imaging process under low sampling conditions.

[0023] In step S10, during the system initialization phase, multiple X-ray images are continuously acquired before the injection of contrast agent to construct a mask library representing the static anatomical background. Here, the mask library refers to a set of multiple contrast-free X-ray images acquired and stored in advance before the injection of contrast agent into the patient. This library serves as a static background benchmark for subsequent image processing to counteract static interference from human tissues during respiration or changes in body position. When the contrast agent image to be processed is input, the system iterates through each frame in the mask library and adaptively selects the benchmark frame with the highest spatial positional match to the current input frame as the optimal mask, thereby eliminating non-vascular boundary artifacts caused by macroscopic movements such as respiratory displacement.

[0024] The specific registration optimization process is as follows: First, Gaussian filtering preprocessing is performed on the contrast agent image and all masks in the mask library to reduce noise interference. Then, the optical flow registration algorithm is used to perform pixel-by-pixel motion estimation on the image to be registered and each mask in the library, extracting the motion direction and amplitude inferred from the optical flow field. Based on this, multi-dimensional similarity measurement operations (including pixel value normalization subtraction, logarithmic domain subtraction, and weighted subtraction) are performed to generate N sets of corresponding motion fields and difference calculation results. Here, optical flow registration is a pixel-level motion estimation technique that estimates the overall displacement vector field (i.e., motion field) of the image by calculating the spatiotemporal gradient changes of pixels between adjacent frames, and performs spatial geometric transformation on the image accordingly to achieve accurate alignment between different frames. Furthermore, multi-dimensional statistical features are extracted for each set of results, focusing on obtaining key indicators such as the mean of the motion field amplitude, the mean and variance of the calculation results. Based on the core assumption that "the higher the registration accuracy, the fewer abnormal grayscale pixels caused by geometric misalignment," and combined with the statistical features extracted above, a multi-dimensional decision criterion is constructed, including single-index extreme value discrimination and multi-index weighted fusion discrimination. Finally, the mask with the smallest fusion index value (representing the smallest difference and the most accurate registration) is selected as the optimal mask.

[0025] In step S20, spatial registration technology is used to perform pixel-level geometric alignment between the input contrast agent image and the optimal mask selected in step S10, ensuring that the corresponding anatomical structures in the two images are in exactly the same spatial coordinate position. Subsequently, the system performs subtraction processing, which cancels out the signals of bones, organs, and other tissues in the background that have not undergone displacement changes by performing pixel-by-pixel mathematical difference operations (usually subtracting the grayscale values ​​of corresponding pixels). This processing effectively eliminates strong scattering interference from non-vascular backgrounds, retaining only the grayscale difference information generated by contrast agent injection, ultimately generating a subtraction image that only highlights the morphology of the vascular network. This image provides a crucial preprocessing foundation for subsequent extraction of clean vascular candidate regions and elimination of static artifact interference.

[0026] In step S30, since the previous subtraction operation often amplifies random noise in the image, and the low-dose imaging conditions result in a low signal-to-noise ratio, noise suppression processing is first required on the generated subtracted image. By applying specific spatial or frequency domain filtering algorithms, the image background is effectively smoothed and the interference of isolated noise points is reduced, while maintaining the edge sharpness of microvessels as much as possible. Subsequently, the optimal gray-level threshold is automatically calculated using threshold segmentation techniques (such as the Otsu method or the Otsu method), and connected regions with gray-level values ​​significantly higher than the background are extracted and marked as candidate regions of interest (ROIs). This step initially defines the possible range of blood vessels, providing basic data for subsequent high-precision determination based on texture features and dynamic changes.

[0027] In step S40, to accurately distinguish whether the candidate regions of interest extracted in step S30 are genuine contrast agent filling blood vessels or artifacts caused by image registration errors or noise, the system needs to perform local cropping on the original contrast agent image and the optimal mask, respectively, based on the coordinate indices of these candidate regions, to extract sub-regions with strictly corresponding spatial locations. Subsequently, the system calculates the statistical difference in grayscale between these two sub-regions to derive a first image similarity index. The core logic of this index is that: in the real blood vessel area, the injection of contrast agent will cause obvious grayscale jumps, resulting in a large difference between the two sub-regions (low similarity index); while static artifacts or background noise are usually consistent between the original image and the mask, so the difference is small (high similarity index). This step provides a crucial basis for subsequent dynamic / static classification.

[0028] like Figure 8 As shown, Figure 8 This example demonstrates a sub-region within a contrast agent image, where key regions of interest (ROIs) containing abdominal blood vessels were precisely located and extracted. These regions contain information on the dynamic changes of the contrast agent to be analyzed. Figure 9As shown, this figure represents the corresponding sub-region of the optimal mask in the same example. By... Figure 9 The area shown is Figure 8 Image similarity comparison can effectively distinguish which areas of grayscale change are caused by contrast agent inflow and which are caused by background misalignment due to respiratory motion, thereby eliminating artifact interference.

[0029] In step S50, to further eliminate static background interference and verify the authenticity of the candidate regions, the system first performs edge enhancement processing on the candidate regions of interest extracted in step S30 in the subtraction image, accurately locating and extracting their contrast agent contours. Subsequently, a black-and-white binary mask is generated based on these contours to geometrically and accurately define the spatial extent of the suspected blood vessels. Here, the mask refers to a binary image (or masking layer) generated based on the extracted contrast agent contours. In the mask, the pixel values ​​inside the corresponding contour (i.e., the suspected blood vessel region) are typically set to valid values ​​(e.g., 1 or 255), while the external background region is set to invalid values ​​(e.g., 0). Next, the system superimposes this mask onto the corresponding sub-region of the optimal mask according to a strict coordinate mapping relationship. Through this superposition operation, the mask logically masks or marks the corresponding local background regions on the mask. Finally, the system recalculates the similarity between the superimposed image and the original mask (or the image before processing) to obtain a second image similarity index. The core purpose of this step is to observe the changes in background consistency in the remaining image by using a mask to "erase" the background of the candidate region, thereby accurately identifying whether the region is a purely static background artifact. For example... Figure 10 and Figure 11 As shown, Figure 10 The image is the corresponding sub-region before overlay in the optimal mask (the background shows the shadow of the spinal skeleton, and the blood vessel structure is relatively blurred). Figure 11 This shows the effect after the extracted and enhanced boundary mask is superimposed onto the sub-region. By highlighting the outline of the target structure, anatomical boundaries such as blood vessels become exceptionally clear and sharp, intuitively achieving visual enhancement and precise positioning of key areas.

[0030] In step S60, the system performs final motion / static discrimination and region confirmation based on the calculation results of the preceding steps. First, the system calculates the absolute difference between the first image similarity index and the second image similarity index, defining it as a change. The physical meaning of this change is to measure the degree of influence of the masking operation (removing suspected blood vessel regions) on local image similarity. Subsequently, the system compares this change with a preset threshold built into the system. Here, the preset threshold refers to an empirical value set during the algorithm design phase based on training with a large number of samples or statistical analysis.

[0031] If the change significantly exceeds the threshold, it indicates a large difference in grayscale features between the original image and the masked area, consistent with the dynamic changes caused by contrast agent filling. The system then determines the candidate region of interest to be a contrast agent-filled area. Conversely, if the change is small, it indicates that the grayscale features of the area are stable, more likely to be a static background or artifact, and is therefore removed. This step, through a dual verification mechanism, ensures extremely high accuracy in the final blood vessel extraction results.

[0032] After the region contour discrimination in step S50, although most non-vascular boundaries have been removed, some non-vascular tissue boundaries still overlap with the contrast agent filling area, making it difficult to completely separate them based on contour alone. Figure 12 , Figure 13 As shown, the contrast agent area overlaps with the boundaries of organs such as the liver and lungs. The area marked by the yellow box is the area that was ultimately determined to be filled with contrast agent. Figure 12 The image shows the vascular structures as distinct black contrast agent channels after initial enhancement processing. However, complex tissue overlap exists around the blood vessels (such as at the edges of the liver and lungs), resulting in unclear target boundaries and making direct and precise differentiation difficult. Figure 13 This displays a view of the results after processing and judging the image using the Structural Similarity Index (SSIM) algorithm. Figure 13 In the image, the yellow box precisely identifies the core area filled with contrast agent, while the green box circles the interfering areas that overlap with surrounding tissues (such as the liver and lung boundaries). This visually demonstrates the algorithm's judgment criteria when identifying overlap between real blood vessels and artifacts: prioritizing the preservation of areas with the most significant dynamic changes in grayscale.

[0033] In step S70, to track the injection path of the contrast agent and dynamically monitor the real-time progression of blood flow, the system introduces a temporal analysis mechanism. First, the system retrieves the coordinates of the region identified as a real blood vessel in step S60 within the contrast agent image (i.e., the current processing frame), and obtains pixel data within the same coordinate range in the adjacent previous frame on its timeline. Then, the system performs sliding window difference processing on this local region: that is, within a local spatial window, it calculates the absolute difference between the pixel grayscale values ​​of the current frame and the previous frame. When the difference exceeds a set spatiotemporal dynamic threshold, it is marked as a significant change. Finally, the system extracts all connected components that satisfy the condition "contrast agent in the current frame but not in the previous frame," defining them as newly added contrast agent filling regions. These newly added contrast agent filling regions represent the newly arrived blood vessel segment, reflecting the forward flow trajectory of blood in a short time. This step successfully removes the ever-present static vascular background and accurately captures the instantaneous state of the contrast agent just filling the microcirculation.

[0034] like Figures 17-19 As shown, Figure 17 The contrast agent filling area of ​​the previous frame shows the distribution of contrast agent already present in the blood vessel at the previous moment, mainly constituting the background structure of the blood vessel. Figure 18 This is the area filled with contrast agent in this frame. At this time, the contrast agent moves forward with the blood flow, and the range of contrast agent inside the blood vessel is significantly expanded, with a new bright white filling area appearing on the original background. Figure 19 To identify the newly added region resulting from the subtraction, the system successfully stripped away the static vascular background (the portion shared by both frames) by subtracting the previous frame from the current frame, retaining only the contrast agent highlights that appeared at the current moment. These isolated highlights precisely mark the new vascular segments where the contrast agent has just arrived, visually reflecting the forward flow trajectory of blood within a short period.

[0035] In step S80, to make the vascular features extracted by the algorithm more intuitive and diagnostically valuable, the system performs a final visual optimization operation on the newly added contrast agent-filled area identified in step S70. Through specific enhancement algorithms (such as adaptive histogram equalization to broaden local contrast, or edge sharpening filters to outline vascular contours), the visual quality of this area is significantly improved, and even the fine terminal vessels are clearly displayed. Finally, the system executes the output command, rendering the enhanced image into the final enhanced angiography image. This step not only completes the computer processing of the data but also realizes the transformation to clinical visualization, providing doctors with high signal-to-noise ratio and high contrast auxiliary diagnostic evidence.

[0036] This embodiment innovatively introduces a dual judgment mechanism based on multi-mask comparison and non-vascular tissue contour masking, effectively overcoming the interference caused by respiratory motion artifacts and registration deviations. At the same time, it combines sliding window differential technology to compensate for the insufficient dynamic capture caused by low frame rate. It can accurately identify and enhance the real contrast agent filling area, significantly improve the clarity of vascular edges and the overall image signal-to-noise ratio, and provide reliable high-quality image support for rapid and accurate interventional diagnosis in clinical practice.

[0037] Optionally, before step S10, that is, before registering the contrast agent image with each frame of the mask library and selecting the optimal mask with the highest registration accuracy to the contrast agent image, the method further includes: S11, Real-time input of image frames; S12. Preprocess the image frame to obtain a preprocessed image; S13. Determine whether the preprocessed image frame is a mask; S14. If so, the image frame is stored in the mask library; S15. If not, then the image frame is used as the contrast agent image.

[0038] Understandably, after the contrast examination begins, the X-ray imaging equipment continues to operate, and the system receives real-time input image frames at a fixed frame rate (e.g., 2-5 frames per second). These image frames enter the processing pipeline sequentially in chronological order, each carrying raw grayscale data, awaiting subsequent classification and processing. This step is the data entry point for the entire process, ensuring that the system can synchronously track the timing and flow of the contrast agent.

[0039] Each raw image frame needs to be preprocessed before it is used in the actual application to eliminate sensor noise, correct non-uniform responses, and unify the grayscale range. Typical operations include: applying Gaussian filtering to remove high-frequency noise; performing histogram equalization to enhance contrast; and performing geometric correction if necessary to compensate for detector distortion. The preprocessed image is called the preprocessed image, and its quality is guaranteed, providing reliable input for subsequent mask / contrast agent classification and registration.

[0040] like Figure 2 As shown, Figure 2 This is an example of an original image frame. The image shows an X-ray image acquired under low-dose conditions. Due to the reduced X-ray dose, the energy distribution of the effective signal in the image is highly concentrated, resulting in a significant "compression" of pixel grayscale values. The overall image is dark, and details such as blood vessels are blurred and difficult to discern. Figure 3 That is Figure 2 The preprocessed image obtained after processing. It can be seen that... Figure 3 The overall brightness and contrast have been significantly improved, the outline of the blood vessel wall is clearer and sharper, and the boundaries between anatomical structures are more distinct, effectively solving the problem of detail loss in low-dose imaging.

[0041] The system needs to automatically identify the type of the currently input image frame, i.e., determine whether it contains contrast agent. This determination is usually based on the image's grayscale statistical characteristics or external trigger signals. For example, the overall grayscale mean of the image or the grayscale peak value of a local blood vessel region can be calculated. If the value is below a certain preset threshold (indicating no bright contrast agent), it is determined to be a mask; conversely, if a significant high grayscale area appears, it is determined to be a contrast agent image. Additionally, the synchronization signal from the infusion pump can be used as an auxiliary factor in the determination.

[0042] When step S13 determines that the current frame is a mask, the system immediately stores the preprocessed image of that frame into the mask library. A mask is an X-ray image without contrast agent, acquired before contrast agent injection, used as a static background reference for subsequent subtraction operations. Its characteristic is that it only contains anatomical structures such as bones and soft tissues, without intravascular contrast agent signals. The mask library is a dynamically updated image buffer, typically storing several consecutive frames (e.g., 10-20 frames) of masks acquired before contrast agent injection, used to cover anatomical locations at different respiratory phases. As new masks are added, older masks are discarded according to a first-in, first-out principle, ensuring the library always contains the latest background information.

[0043] When step S13 determines that the current frame is not a mask (i.e., contains contrast agent), the system marks the frame as a contrast agent image and sends it to the subsequent main processing flow (steps S10~S80). A contrast agent image refers to an X-ray image acquired after contrast agent injection. At this time, the blood vessel is filled with contrast agent, and the image contains bright vascular structures, making it the primary target for subsequent vascular extraction. Thus, the system has completed the automatic sorting of input images: all frames before injection are assigned to the mask library, while frames after injection are used as target images to be processed, achieving intelligent startup without manual intervention.

[0044] This embodiment achieves dynamic construction of the mask library and automatic recognition of contrast agent images by adding real-time input, preprocessing, and automatic classification steps before step S10. The system eliminates the need for operators to manually select masks or mark the starting frame of the contrast agent, and can adaptively adapt to different injection timings and respiratory rhythms. This embodiment not only simplifies clinical procedures and reduces the risk of human error, but also ensures that the mask library always contains background frames closest to the current anatomical location, laying a solid foundation for subsequent high-precision registration and subtraction.

[0045] Optionally, step S10, namely, registering the contrast agent image with each frame of the mask library and selecting the optimal mask with the highest registration accuracy to the contrast agent image, includes: S101. Gaussian filtering is applied to the contrast agent image and each frame of mask in the mask library to denoise the image, resulting in a denoised image pair. S102. Based on the optical flow method, the denoised image pairs are registered to extract the direction and amplitude of the motion field and obtain the motion field parameters. S103. Calculate the mean amplitude of the motion field based on the motion field parameters, and combine it with the mean pixel difference and the variance of pixel difference of the registered difference image to obtain multidimensional statistical features. S104. Based on the discrimination criteria constructed according to the multidimensional statistical features, the mask with the smallest overall registration error is selected to obtain the optimal mask.

[0046] Understandably, preprocessing of the contrast agent image and mask is necessary to reduce noise interference before registration. Due to quantum and electronic noise present in X-ray imaging, these high-frequency components severely affect the motion estimation accuracy of the optical flow method. Therefore, Gaussian filtering is applied to the input contrast agent image and each mask frame in the mask library for denoising. Gaussian filter denoising is a linear smoothing filtering method that effectively suppresses random noise and smooths image details by applying Gaussian weighted convolutions to image pixels and their neighborhoods, while preserving edge structure information as much as possible. By setting an appropriate Gaussian kernel size (e.g., 5×5 or 7×7 pixels) and standard deviation σ, convolution is performed on the image to filter out high-frequency noise while maintaining the basic contours of low-frequency anatomical structures. After processing, a smoothed image pair is obtained—the denoised contrast agent image and the denoised mask—laying the foundation for subsequent accurate registration.

[0047] After image denoising, optical flow is used to perform pixel-level motion estimation on each frame of the denoised mask and contrast agent image. Based on the assumption of constant brightness and spatiotemporal gradient constraint equations, optical flow calculates the displacement vector of each pixel between the two images, forming a complete motion field parameter set. The motion field parameters are a two-dimensional vector field output by the optical flow method, containing the displacement components of each pixel in the horizontal (x) and vertical (y) directions. This parameter set describes the local offset caused by non-rigid deformations such as respiratory movements and body positional shifts. The direction of the motion field indicates the orientation of the offset (e.g., up / down, left / right), while the amplitude of the motion field quantifies the distance of the offset (in pixels). This step allows for the quantitative capture of spatial inconsistencies between the mask and contrast agent image caused by physiological motion.

[0048] After obtaining the motion field parameters, it is necessary to extract comprehensive indicators that characterize the registration quality. First, the average motion field amplitude of all pixels is calculated to obtain the mean motion field amplitude. The smaller this value, the lower the overall offset and the better the registration. Second, the mask and contrast agent image are spatially transformed (i.e., registered) according to the deformation field derived from the optical flow field, and then subtracted pixel by pixel to obtain the difference image. The mean grayscale difference and the variance of the pixel difference are calculated for this difference image: the mean difference reflects the overall brightness deviation, while the variance characterizes the dispersion of local residuals. These three indicators—mean motion field amplitude, mean pixel difference, and variance of pixel difference—constitute multi-dimensional statistical features, comprehensively evaluating the residual error of registration from different perspectives. Here, multi-dimensional statistical features are a comprehensive numerical indicator reflecting multiple aspects of registration quality, used to quantify the degree of residual differences between images.

[0049] Based on the multidimensional statistical features extracted in step S103, a discrimination criterion is constructed to select the optimal mask. Two strategies can be employed: one is single-index extreme value discrimination, where the mask with the smallest value for a single index (e.g., the mean amplitude of the motion field) is selected; the other is multi-index weighted fusion discrimination, where the three features are normalized, assigned different weights, and summed to obtain a comprehensive score, with lower scores indicating higher registration accuracy. In practical applications, the weighted fusion method is preferred to balance the contributions of different dimensions. All frames in the mask library are traversed, and the comprehensive score for each frame is calculated. Finally, the mask with the lowest score (i.e., the smallest overall registration error) is selected as the optimal mask. This mask will be used in subsequent subtraction and vessel extraction steps, fundamentally ensuring the effectiveness of background suppression.

[0050] like Figure 4 As shown, Figure 4 The image shown is a subtraction image without masking and registration. Due to factors such as respiratory movement or body position, there are obvious motion artifacts and residual background structures in the image, resulting in blurred blood vessel edges, unclear details, and severely interfering with the overall visual effect. Figure 5 As shown, Figure 5 It is a subtraction image after precise registration processing based on optical flow. Figure 5 By eliminating misalignment between images, motion artifacts and static background interference are effectively removed, resulting in a purer vascular structure and sharper, more distinct edge contours, significantly improving image quality.

[0051] This embodiment removes high-frequency noise through Gaussian filtering, accurately estimates the motion field using optical flow, and extracts multidimensional statistical features to construct a weighted fusion discrimination criterion, achieving the goal of adaptively selecting the optimal mask from the mask library. Compared with traditional fixed-frame or simple cross-correlation registration methods, this embodiment can effectively cope with non-rigid deformations such as respiratory displacement, significantly reducing the risk of artifacts caused by registration misalignment. The final output of the optimal mask has extremely high spatial alignment with the contrast agent image, providing a reliable benchmark for subsequent subtraction and precise blood vessel extraction, and significantly improving the image quality and diagnostic reliability of angiography under low-dose and low-frame-rate conditions.

[0052] Optionally, step S30, namely, performing noise suppression and thresholding processing on the subtraction image to extract candidate regions of interest, includes: S301. Perform various noise suppression processes on the subtraction image to obtain a denoised image; S302. Use an edge detection operator to coarsely extract and enhance the tissue contours in the denoised image to obtain an enhanced edge image; S303. The enhanced edge image is segmented using the maximum inter-class variance method to obtain the preliminarily separated blood vessel region; S304. The shape of the initially separated blood vessel region is repaired by connection enhancement optimization to obtain the repaired blood vessel region; S305. Extract the contour of the repaired vascular region and calculate its area and perimeter. Perform shape fitting and remove contours with an area smaller than a preset threshold or that do not conform to the vascular morphology characteristics to obtain the candidate region of interest.

[0053] Understandably, since low-dose X-ray imaging and subtraction operations introduce compound noise, a single filtering method often struggles to simultaneously achieve denoising and edge preservation. Therefore, multiple noise suppression processes can be applied sequentially or in parallel to the subtraction image output from step S20. For example, Gaussian filtering can be used first to remove high-frequency random noise, then bilateral filtering can be used to preserve edge details, and finally, nonlocal mean filtering can be used to further smooth homogeneous regions. After multi-level filtering, a denoised image with a clean background and clear blood vessel edges is obtained, providing high-quality input for subsequent edge detection.

[0054] Based on the denoised image, an appropriate edge detection operator (such as the Canny operator) is selected to extract edges from the image. Taking the Canny operator as an example, through non-maximum suppression and double-threshold hysteresis tracking, continuous edges at the boundary between the vessel wall and the background can be effectively extracted. To further highlight weak blood vessels, enhancement operations (such as edge intensity stretching or morphological dilation) can be performed on the detected edges to obtain an enhanced edge image with prominent edge information. In this image, the boundary of the blood vessel is significantly enhanced, while the flat background area shows a low response.

[0055] After converting the enhanced edge image to grayscale, the optimal segmentation threshold is automatically calculated using Otsu's method. This method finds the threshold that maximizes the inter-class variance between the foreground (edges) and background (non-edges) by traversing all possible grayscale levels. Applying this threshold to binarize the image sets high-response edge pixels to white (foreground) and the rest to black (background), resulting in a binary image where the white connected regions represent the initially separated blood vessel areas. These regions may contain complete blood vessel trunks or contain breaks or small holes. Figure 6 As shown, Figure 6 This is a binarized subtraction image for an example. Figure 6 The bright white pixels form the initial skeleton and branching structure of the blood vessels, while also containing some minor noise and incomplete outlines.

[0056] Initially separated vascular regions often exhibit breaks, burrs, or internal voids due to noise or low contrast. Morphological operations can be used for connected component enhancement: first, a closing operation (dilation followed by erosion) is performed to fill small voids within the vessel and connect adjacent broken segments; then, an opening operation (erosion followed by dilation) is performed to remove isolated noise particles and smooth vessel edges. After this series of repairs, a more complete and continuous repaired vascular region is obtained, providing a more realistic vascular morphology for subsequent screening.

[0057] For the repaired binary image, the contour of each connected region is extracted, and its area (number of pixels) and perimeter (boundary pixel length) are calculated. Shape fitting is then performed, such as calculating the ratio of the major axis to the minor axis and roundness (4π × area / perimeter²) of the region using ellipse fitting. Blood vessels are typically long and thin tubular, with a large aspect ratio and low roundness. Based on these morphological features, a lower area threshold (e.g., areas less than 50 pixels are considered noise) and shape constraints (e.g., aspect ratio > 2 and roundness < 0.5) are set, and contours that do not meet the conditions are eliminated one by one. The remaining connected regions are candidate regions of interest, which likely correspond to real blood vessel structures and will be sent to the subsequent similarity verification step. Figure 7 As shown, Figure 7 Is Figure 6 Based on the binarized subtraction image, after removing artifacts through connected component enhancement and shape fitting, precise candidate regions of interest (ROIs) are marked on the original grayscale image. Figure 7 The rectangular boxes in the image mark the slender branch regions that conform to the morphological characteristics of blood vessels, and the cluttered background that does not conform to the blood vessel pattern is removed, so as to intuitively present the effective blood vessel boundary range of the final extraction.

[0058] This embodiment robustly extracts candidate vascular regions from subtraction images by combining multi-layer noise suppression, edge enhancement, adaptive threshold segmentation, and morphological restoration. Compared to simple single-step threshold segmentation, this method effectively resists low-dose noise interference, repairs vascular ruptures and voids, and utilizes shape features to remove artifacts and noise spots. The final output candidate regions of interest have a high vascular detection rate and a low false positive rate, providing accurate initial screening results for subsequent contrast agent filling determination, and significantly improving the robustness and efficiency of the entire vascular extraction process.

[0059] Optionally, after step S70, which involves performing sliding window difference processing on the contrast agent image determined to be a contrast agent filling area and the previous frame to extract the newly added contrast agent filling area, the method further includes: S71. Obtain the second mask that is closest to the optimal mask, and perform enhancement processing and edge extraction on the optimal mask and the second mask to obtain a non-vascular tissue contour mask. S72. Perform pixel-level difference analysis between the newly added contrast agent filling area and the non-vascular tissue contour mask, and remove the part that overlaps with the non-vascular tissue contour to obtain a pure contrast agent filling area.

[0060] Understandably, to further eliminate static tissue artifacts that may be mixed into the newly added contrast agent area, the system first retrieves the second mask (usually the frame before or after the optimal mask determined in step S10) from the mask library that is closest in acquisition time to the optimal mask. Then, these two mask frames are enhanced to make anatomical structures such as bone and organ edges clearer. Here, enhancement processing refers to operations such as contrast stretching, edge sharpening, or adaptive histogram equalization to highlight tissue boundaries or texture details in the image, facilitating subsequent edge extraction. Next, edge extraction operators such as Canny are used to extract all significant edge contours from the enhanced image. The edges extracted from the two mask frames are combined using a logical OR operation to obtain a binary image covering the static tissue boundaries, i.e., a non-vascular tissue contour mask. The non-vascular tissue contour mask is a binary mask extracted based on the mask image (without contrast agent), where white pixels represent the contour areas of static anatomical structures such as bone and organ edges, and black represents the background. Nonvascular tissue contour masks accurately mark the relatively stable anatomical boundary locations during respiratory movements or changes in body position, which are then used for subsequent interference removal.

[0061] After obtaining the non-vascular tissue contour mask, the system performs pixel-wise subtraction on it and the newly added contrast agent-filled area (binary image) extracted in step S70. Pixel-wise subtraction refers to subtracting pixel values ​​at the same coordinate positions in two binary or grayscale images point by point to eliminate overlapping parts and retain non-overlapping areas. Specifically, for each pixel position, if the pixel is white in the non-vascular tissue contour mask (indicating it belongs to the edge of static tissue), then the pixel is forcibly set to black (background) in the newly added contrast agent-filled area. Through this point-by-point elimination, any pixels that overlap with static structures such as bone and organ edges are removed, retaining only those areas that are truly caused by contrast agent flow and do not overlap with the known background contour. The final output binary image is the pure contrast agent-filled area, which eliminates static artifacts mixed in due to registration residues or edge misdetection, ensuring the purity of blood vessel extraction.

[0062] like Figure 20 As shown, Figure 20The contrast agent area before static tissue artifact removal is shown. Small, radial or mesh-like interfering pixels can be observed around the target vascular structure. These are usually registration residual artifacts at the edges of bones or organs caused by respiratory displacement. Figure 21 This demonstrates the final purified contrast agent-filled ROI region obtained after the differential rejection process in step S72. Through point-by-point comparison with the non-vascular tissue contour mask, interfering pixels that overlap with the background structure were successfully filtered out, and the contours of the main vascular trunk and its branches became clearer, more continuous, and free of impurities, providing a high-fidelity data foundation for subsequent clinical quantitative analysis.

[0063] This embodiment effectively eliminates static tissue artifacts caused by respiratory motion or edge detection errors by adding a round of verification and removal based on the mask edge after the extraction of the new contrast agent region. By using the edge information of the optimal mask and its neighboring masks to construct a non-vascular tissue contour mask, it is possible to accurately locate areas such as bone and organ boundaries that are prone to false positives. After pixel-level differential processing, the final output pure contrast agent filling area has higher specificity, reduces misjudgments, and provides a more reliable data foundation for subsequent vascular enhancement and diagnosis.

[0064] Optionally, step S71, namely obtaining the second mask closest to the optimal mask, and performing enhancement processing and edge extraction on the optimal mask and the second mask to obtain a non-vascular tissue contour mask, includes: S711. Perform histogram equalization enhancement on the optimal mask and image enhancement on the second mask; S712. Use the edge detection operator to extract the closed boundaries of the two enhanced mask frames and fill them respectively; S713. Differencing the boundaries extracted from the two frames of the mask yields the non-vascular tissue motion contour mask.

[0065] Understandably, to improve the quality of subsequent edge extraction, different enhancement strategies can be applied to the two masking frames. For the optimal mask, histogram equalization is applied to homogenize its overall grayscale distribution, significantly stretching low-contrast details such as bone and organ edges. For the second mask, another image enhancement method is used, such as contrast-limited adaptive histogram equalization (CLAHE), which enhances local contrast while suppressing noise amplification. Both enhancement methods aim to highlight the edge information of anatomical structures, creating favorable conditions for subsequent accurate edge extraction.

[0066] like Figure 14 As shown, Figure 14This is the raw, unprocessed image from the mask library. The image shows grayscale projections of the human chest and abdomen bones and internal organs. At this stage, the contrast between the bones and soft tissues is relatively low, and some subtle anatomical boundaries have not yet reached optimal visual discernibility. For example... Figure 15 As shown, Figure 15 The enhanced image of the registration mask after CLAHE enhancement significantly improves the sharpness of the bones and further stretches the grayscale differences between the edges of muscles and organs, effectively highlighting the edge features of static anatomical structures.

[0067] After enhancement processing, edge detection operators (preferably the Canny operator) are used on the optimal and second masks to extract pixels with abrupt grayscale changes, resulting in preliminary edge maps. Since noise or weak contrast may cause edge breaks, morphological closing operations (dilation followed by erosion) are used to connect adjacent breakpoints, forming complete closed boundaries. Subsequently, a filling operation (such as a seed filling algorithm) is performed inside each closed boundary, setting the entire region enclosed by the contour to foreground values, generating two binarized images of solid regions. These two images represent the internal regions of all statically organized contours in the optimal and second masks, respectively.

[0068] The two binary masks generated in step S712 are subjected to pixel-level difference operations (usually using XOR or absolute value subtraction). Since the optimal and second masks were acquired at different time points, respiratory motion can cause slight displacements in certain tissue boundaries (such as the diaphragm and lower rib margins), resulting in differences between the two masks at these locations. The difference result will only retain those edge regions whose positions are inconsistent between the two masks, i.e., the contour changes caused by motion. The final output binary image is the non-vascular tissue motion contour mask, which accurately marks the static tissue boundaries that have moved due to physiological motion, providing a direct filtering basis for subsequent removal of motion artifacts in newly added contrast agent areas.

[0069] like Figure 16 As shown, this is a non-vascular tissue boundary subtraction image obtained after the above series of image processing steps. By extracting the closed edges from the middle and left images and filling them with solid areas, pixel-level difference operations are then performed. Figure 16 Static tissue that completely overlaps between the two images was precisely filtered out. The bright white reticular and blocky structures in the images represent the boundaries of non-vascular tissues that have shifted in position due to physiological movements such as the patient's breathing.

[0070] This embodiment enhances the optimal and second masks separately and extracts their closed boundaries for differential analysis, efficiently capturing areas of static tissue contour changes caused by respiratory motion. The generated non-vascular tissue motion contour mask can accurately locate background edges altered by motion, preventing these areas from being misidentified as contrast agent filling areas. This embodiment significantly improves the resistance to motion interference during vessel recognition, especially suitable for clinical scenarios with significant respiratory motion, further ensuring the purity and diagnostic reliability of the final angiography image.

[0071] Optionally, step S80, namely, enhancing the newly added contrast agent-filled area and outputting the enhanced angiography image, includes: S801. Binarize the subtraction image to obtain a binarized image; S802. Extract the low gray value region within the newly added contrast agent filling area in the binarized image, and extract all boundary contours after morphological repair of the low gray value region to obtain a boundary contour set. S803. Calculate and sort the area of ​​each contour according to the set of boundary contours, extract the connected contour with the largest area, and obtain an accurate contrast agent binary mask. S804. Based on mapping the contrast agent binary mask onto the subtraction image, extract the grayscale sub-image within the mask area to obtain the grayscale image to be enhanced; S805. Perform contrast enhancement and brightness enhancement processing on the grayscale sub-image, and overwrite the corresponding position of the subtraction image with the enhanced sub-image to obtain the enhanced angiography image.

[0072] Understandably, the subtraction image output in step S20 is first binarized. Since the blood vessel region in the subtraction image is presented as a bright grayscale value, while the background region has a lower grayscale value, an appropriate grayscale threshold can be set (e.g., automatically calculated using the Otsu method) to segment the image into foreground (blood vessels and bright areas) and background. In the binarized image, foreground pixels are set to white (255), and background pixels are set to black (0), resulting in a binarized image. This image simplifies the original grayscale information, highlights the shape and contour of the target region, and lays the foundation for subsequent region extraction.

[0073] Based on the binarized image, and combined with the newly added contrast agent filling area (binary mask) output in step S70, the corresponding position of this area in the binarized image is located. Within this local area, there may be low-gray-value regions (i.e., black holes or depressions in the binarized image) formed due to uneven gray-level within the blood vessel. These low-value regions lead to incomplete blood vessel morphology, thus requiring morphological restoration: first, a closing operation (dilation followed by erosion) is used to fill the small holes, and then an opening operation (erosion followed by dilation) is used to remove edge burrs, making the blood vessel region morphology more complete. After restoration, a contour tracking algorithm (such as the Moore-Neighbor algorithm) is used to extract the set of boundary contours of all independent connected components, each contour consisting of a series of boundary pixel coordinates.

[0074] For each contour in the boundary contour set extracted in step S802, calculate the area of ​​the region it encloses (i.e., the total number of pixels within the contour). Sort all contours in descending order of area. Since the real blood vessel region is usually the largest connected structure in the image, while isolated regions formed by noise or artifacts are smaller, the contour with the largest area is selected as the final blood vessel region. Fill the interior of this contour to generate a new binary image, i.e., a precise contrast agent binary mask. This mask eliminates small interference areas and preserves the most representative main blood vessel structure.

[0075] The precise contrast agent binary mask generated in step S803 is used as a spatial index and mapped onto the original subtraction image. Specifically, for each white pixel in the mask, the corresponding grayscale value is read from the subtraction image; the positions of black pixels in the mask are ignored. This results in a cropped local image patch containing only the grayscale information of the mask region, i.e., a grayscale sub-image. This sub-image preserves the original grayscale details of the blood vessel region while completely eliminating background interference, making it the precise target for subsequent enhancement processing.

[0076] A joint enhancement operation is performed on the grayscale sub-image obtained in step S804: First, contrast enhancement is performed, for example, by using linear stretching or adaptive histogram equalization to amplify the grayscale difference between the blood vessel and surrounding tissue; then, brightness enhancement is performed, using gamma correction or grayscale shift to make the overall blood vessel area brighter for easier visual observation. After the enhancement process is complete, the processed sub-image is overlaid onto the corresponding area of ​​the subtraction image according to its original coordinates, replacing the original grayscale values. The final output image is the enhanced angiography image. Figure 22 and Figure 23 As shown, Figure 22 The image is an unprocessed subtraction image. Although the vascular structure is visible, the overall contrast is low, the background is bright, and there is uneven grayscale inside the blood vessels. Figure 23The contrast agent enhances the visual effect, making the blood vessel morphology clearer and sharper, effectively suppressing (darkening) the background, and maintaining good vascular connectivity. This achieves precise local enhancement, significantly improving the visual representation of the vascular area.

[0077] This embodiment obtains a precisely located vascular mask by binarizing, morphologically repairing, and selecting the maximum contour of the newly added contrast agent-filled area. Based on this mask, the grayscale sub-image to be enhanced is extracted from the original subtraction image. After contrast enhancement and brightness improvement, the enhancement result is accurately overlaid on the original image, achieving local enhancement of only the real vascular area and avoiding background overexposure or artifact magnification. The final output angiography image has higher vascular-background contrast and clearer edge details, significantly improving the visualization effect of vascular structures under low-dose and low-frame-rate conditions, and providing higher-quality imaging evidence for clinical diagnosis.

[0078] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0079] In one embodiment, an X-ray angiography contrast-enhancing device is provided, which corresponds one-to-one with the X-ray angiography contrast-enhancing method described in the above embodiments. For example... Figure 24 As shown, the X-ray angiography contrast-enhancing device includes: The optimal mask selection module 10 is used to register the contrast agent image with each frame of mask in the mask library and select the optimal mask with the highest registration accuracy with the contrast agent image. Subtraction processing module 20 is used to perform subtraction processing on the contrast agent image and the optimal mask to obtain a subtracted image; The candidate region extraction module 30 is used to perform noise suppression and threshold segmentation processing on the subtraction image and extract candidate regions of interest. The first similarity calculation module 40 is used to extract corresponding sub-regions on the contrast agent image and the optimal mask respectively according to the coordinates of the candidate interest region, and calculate the first image similarity index between the two sub-regions; The second similarity calculation module 50 is used to extract the contrast agent contour from the candidate interest region of the extracted contrast agent image and generate a mask based on the contrast agent contour, superimpose the mask onto the corresponding sub-region of the optimal mask, and calculate the superimposed second image similarity index. The contrast agent region determination module 60 is used to compare the change between the first image similarity index and the second image similarity index. When the change exceeds a preset threshold, the candidate region of interest is determined to be a contrast agent-filled region. A new region extraction module 70 is added, which is used to perform sliding window difference processing on the contrast agent image that is determined to be a contrast agent filling area and the previous frame to extract the newly added contrast agent filling area. The enhanced output module 80 is used to enhance the newly added contrast agent filling area and output the enhanced angiography image.

[0080] Optionally, the optimal mask filtering module 10 is also used for: By performing Gaussian filtering on the contrast agent image and each frame of mask in the mask library to denoise, a denoised image pair is obtained. By registering the denoised image pairs using optical flow, the direction and amplitude of the motion field are extracted to obtain motion field parameters. The mean amplitude of the sports field is calculated based on the sports field parameters, and multidimensional statistical features are obtained by combining the mean pixel difference and the variance of pixel difference of the registered difference image. Based on the discrimination criteria constructed using the multidimensional statistical features, the mask with the smallest overall registration error is selected to obtain the optimal mask.

[0081] Optionally, it also includes a mask recognition and splitting module for: Real-time input of image frames; The image frames are preprocessed to obtain preprocessed images; Determine whether the preprocessed image frame is a mask; If so, the image frame is stored in the mask library; If not, then the image frame is used as the contrast agent image.

[0082] Optionally, the candidate region extraction module 30 is also used for: The subtraction image is subjected to various noise suppression processes to obtain a denoised image; The tissue contours in the denoised image are coarsely extracted and enhanced using an edge detection operator to obtain an enhanced edge image. The enhanced edge image is thresholded using the Otsu's method to obtain the preliminarily separated blood vessel regions; The shape of the initially separated vascular region is restored by connecting region enhancement optimization to obtain the restored vascular region; The contour of the repaired vascular region is extracted, and its area and perimeter are calculated. Shape fitting is performed, and contours with areas smaller than a preset threshold or that do not conform to the morphological characteristics of blood vessels are removed to obtain the candidate region of interest.

[0083] Optionally, it also includes: The non-vascular tissue contour mask extraction module is used to obtain the second mask that is closest to the optimal mask, and to perform enhancement processing and edge extraction on the optimal mask and the second mask to obtain the non-vascular tissue contour mask. The mask differential static elimination module is used to perform pixel-level difference between the newly added contrast agent filling area and the non-vascular tissue contour mask, and eliminate the part that overlaps with the non-vascular tissue contour to obtain a pure contrast agent filling area.

[0084] Optionally, the non-vascular tissue contour mask extraction module is further used for: The optimal mask is enhanced by histogram equalization, and the second mask is enhanced by image enhancement. The closed boundaries of the two enhanced mask frames are extracted and filled using edge detection operators. The boundaries extracted from the two frames of the mask are differentially analyzed to obtain the non-vascular tissue motion contour mask.

[0085] Optionally, the enhanced output module 80 is also used for: The subtraction image is binarized to obtain a binarized image; Extract the low-gray-value regions within the newly added contrast agent filling area of ​​the binarized image, perform morphological restoration on the low-gray-value regions, and then extract all boundary contours to obtain a set of boundary contours. The area of ​​each contour is calculated and sorted according to the set of boundary contours. The connected contour with the largest area is extracted to obtain an accurate contrast agent binary mask. By mapping the contrast agent binary mask onto the subtraction image, the grayscale sub-image within the mask area is extracted to obtain the grayscale image to be enhanced; The grayscale sub-image is subjected to contrast enhancement and brightness enhancement processing, and the enhanced sub-image is overlaid back onto the corresponding position of the subtraction image to obtain the enhanced angiography image.

[0086] Specific limitations regarding X-ray angiography contrast-enhancing devices can be found in the limitations of X-ray angiography contrast-enhancing methods described above, and will not be repeated here. Each module in the aforementioned X-ray angiography contrast-enhancing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the computer device's memory as software, allowing the processor to call and execute the corresponding operations of each module.

[0087] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 25As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computational and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database stores data related to the X-ray angiography enhancement method. The network interface communicates with external terminals via a network connection. When the computer program is executed by the processor, it implements an X-ray angiography enhancement method.

[0088] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the X-ray angiography contrast enhancement method described in the above embodiment; to avoid repetition, this will not be repeated here. Alternatively, when the processor executes the computer program, it implements the functions of each module / unit in the X-ray angiography contrast enhancement device embodiment; to avoid repetition, this will not be repeated here.

[0089] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When executed by a processor, the computer program implements the X-ray angiography contrast enhancement method described in the above embodiment. To avoid repetition, this will not be described again here. Alternatively, when executed by a processor, the computer program implements the functions of each module / unit in the X-ray angiography contrast enhancement apparatus embodiment described above. To avoid repetition, this will not be described again here.

[0090] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0091] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0092] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.

Claims

1. A method for enhancing X-ray angiography imaging, characterized in that, include: The contrast agent image is registered with each frame of the mask library, and the optimal mask with the highest registration accuracy with the contrast agent image is selected. The contrast agent image is subtracted from the optimal mask to obtain a subtracted image; The subtraction image is subjected to noise suppression and threshold segmentation to extract candidate regions of interest; Based on the coordinates of the candidate region of interest, corresponding sub-regions are cropped from the contrast agent image and the optimal mask, respectively, and a first image similarity index between the two sub-regions is calculated. The contrast agent contour is extracted from the candidate region of interest of the contrast agent image and a mask is generated based on the contrast agent contour. The mask is superimposed on the corresponding sub-region of the optimal mask, and the similarity index of the superimposed second image is calculated. Compare the change between the first image similarity index and the second image similarity index. When the change exceeds a preset threshold, the candidate region of interest is determined to be a contrast agent-filled region. The contrast agent image identified as a contrast agent filling area is subjected to sliding window difference processing with the previous frame to extract the newly added contrast agent filling area; The newly added contrast agent-filled area is enhanced, and the enhanced angiography image is output.

2. The method according to claim 1, characterized in that, The step of registering the contrast agent image with each frame of masks in the mask library and selecting the optimal mask with the highest registration accuracy to the contrast agent image includes: By performing Gaussian filtering on the contrast agent image and each frame of mask in the mask library to denoise, a denoised image pair is obtained. By registering the denoised image pairs using optical flow, the direction and amplitude of the motion field are extracted to obtain motion field parameters. The mean amplitude of the sports field is calculated based on the sports field parameters, and multidimensional statistical features are obtained by combining the mean pixel difference and the variance of pixel difference of the registered difference image. Based on the discrimination criteria constructed using the multidimensional statistical features, the mask with the smallest overall registration error is selected to obtain the optimal mask.

3. The method according to claim 1, characterized in that, Before registering the contrast agent image with each frame of masks in the mask library and selecting the optimal mask with the highest registration accuracy to the contrast agent image, the process further includes: Real-time input of image frames; The image frames are preprocessed to obtain preprocessed images; Determine whether the preprocessed image frame is a mask; If so, the image frame is stored in the mask library; If not, then the image frame is used as the contrast agent image.

4. The method according to claim 1, characterized in that, The noise suppression and threshold segmentation processing of the subtraction image, and the extraction of candidate regions of interest, includes: The subtraction image is subjected to various noise suppression processes to obtain a denoised image; The tissue contours in the denoised image are coarsely extracted and enhanced using an edge detection operator to obtain an enhanced edge image. The enhanced edge image is thresholded using the Otsu's method to obtain the preliminarily separated blood vessel regions; The shape of the initially separated vascular region is restored by connecting region enhancement optimization to obtain the restored vascular region; The contour of the repaired vascular region is extracted, and its area and perimeter are calculated. Shape fitting is performed, and contours with areas smaller than a preset threshold or that do not conform to the morphological characteristics of blood vessels are removed to obtain the candidate region of interest.

5. The method according to claim 1, characterized in that, After performing sliding window difference processing on the contrast agent image determined to be a contrast agent-filled area and the previous frame to extract the newly added contrast agent-filled area, the method further includes: Obtain the second mask that is closest to the optimal mask, and perform enhancement processing and edge extraction on the optimal mask and the second mask to obtain a non-vascular tissue contour mask; The newly added contrast agent-filled area is compared with the non-vascular tissue contour mask at the pixel level, and the part that overlaps with the non-vascular tissue contour is removed to obtain the pure contrast agent-filled area.

6. The method according to claim 5, characterized in that, The process of obtaining the second mask closest to the optimal mask, enhancing and extracting the edges of the optimal mask and the second mask to obtain a non-vascular tissue contour mask includes: The optimal mask is enhanced by histogram equalization, and the second mask is enhanced by image enhancement. The closed boundaries of the two enhanced mask frames are extracted and filled using edge detection operators. The boundaries extracted from the two frames of the mask are differentially analyzed to obtain the non-vascular tissue motion contour mask.

7. The method according to claim 1, characterized in that, The enhancement process for the newly added contrast agent-filled area, and the output of the enhanced angiography image, includes: The subtraction image is binarized to obtain a binarized image; Extract the low-gray-value regions within the newly added contrast agent filling area of ​​the binarized image, perform morphological restoration on the low-gray-value regions, and then extract all boundary contours to obtain a set of boundary contours. The area of ​​each contour is calculated and sorted according to the set of boundary contours. The connected contour with the largest area is extracted to obtain an accurate contrast agent binary mask. By mapping the contrast agent binary mask onto the subtraction image, the grayscale sub-image within the mask area is extracted to obtain the grayscale image to be enhanced; The grayscale sub-image is subjected to contrast enhancement and brightness enhancement processing, and the enhanced sub-image is overlaid back onto the corresponding position of the subtraction image to obtain the enhanced angiography image.

8. An X-ray angiography contrast-enhancing device, characterized in that, include: The optimal mask selection module is used to register the contrast agent image with each frame of the mask library and select the optimal mask with the highest registration accuracy with the contrast agent image. The subtraction processing module is used to perform subtraction processing on the contrast agent image and the optimal mask to obtain a subtracted image; The candidate region extraction module is used to perform noise suppression and threshold segmentation processing on the subtraction image and extract candidate regions of interest. The first similarity calculation module is used to extract corresponding sub-regions on the contrast agent image and the optimal mask respectively according to the coordinates of the candidate interest region, and calculate the first image similarity index between the two sub-regions; The second similarity calculation module is used to extract the contrast agent contour from the candidate interest region of the extracted contrast agent image and generate a mask based on the contrast agent contour, superimpose the mask onto the corresponding sub-region of the optimal mask, and calculate the superimposed second image similarity index. The contrast agent region determination module is used to compare the change between the first image similarity index and the second image similarity index. When the change exceeds a preset threshold, the candidate region of interest is determined to be a contrast agent-filled region. A new region extraction module has been added, which is used to perform sliding window difference processing on the contrast agent image that is determined to be a contrast agent filling area and the previous frame to extract the newly added contrast agent filling area. The enhanced output module is used to enhance the newly added contrast agent filling area and output the enhanced angiography image.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the X-ray angiography enhancement method according to any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the X-ray angiography enhancement method according to any one of claims 1 to 7.