An image subtraction method, apparatus, and storage medium
By using an iterative registration method, the registration trend is passed through the target mask image of the previous frame, which solves the problems of large computation and limited effect in the existing technology, reduces the computation and improves the registration effect, and improves the continuity of image subtraction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- UNITED IMAGING RES INST OF INNOVATIVE MEDICAL EQUIP
- Filing Date
- 2023-06-30
- Publication Date
- 2026-05-26
AI Technical Summary
In existing image subtraction processes, image registration computation is large and the registration effect is limited, resulting in severe motion artifacts and reducing the diagnostic value of DSA.
By iteratively registering the current frame's mask image with the target mask image of the previous frame, the target mask image of the current frame is determined, and the registration trend is conveyed using the target mask image of the previous frame, reducing the amount of computation and improving the registration effect.
It reduces the computational load in the image registration process, improves the registration effect, and solves the problem of pixel jump discontinuity between two adjacent subtraction images, thereby improving the quality of image subtraction.
Smart Images

Figure CN116630378B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to an image subtraction method, apparatus and storage medium. Background Technology
[0002] Digital subtraction angiography (DSA) has become an irreplaceable vascular visualization tool in clinical cardiovascular diagnosis and treatment due to its high resolution and contrast. Typically, DSA begins by taking consecutive X-ray images of the region of interest, using a frame before contrast agent injection as a mask. Then, the contrast agent, such as iodine, is injected, and real-time filling images are captured (iodine, etc., entering the blood vessel and leaving a unique image on X-ray, called a filling image). Finally, the mask is subtracted from the filling image to obtain an image containing only the blood vessels. However, because the mask (without contrast agent) and the filling image (with contrast agent) are acquired at different times, unavoidable factors such as the patient's movement, breathing, heartbeat, and visceral peristalsis can cause inaccurate alignment between corresponding pixels. This often results in numerous motion artifacts in the subtracted image, reducing the diagnostic value of DSA. Removing motion artifacts is essentially an image registration process, also known as pixel shift, which aligns the same anatomical tissues in the mask and the film in spatial position. After alignment, digital subtraction is performed to remove bone and soft tissue, resulting in an image containing only blood vessels.
[0003] Existing image registration schemes involve registering each new mask image with the original mask image and the current frame's overlay image. However, due to significant differences between the original mask image and the current frame's overlay image, obtaining an ideal new mask image requires substantial computation during registration, and the registration effect is limited. Alternatively, to achieve the best registration result, multiple registrations can be performed per frame, i.e., iterative single-frame registration, but this also increases the computational load exponentially. Therefore, existing image registration schemes in image subtraction processes involve a high computational load during image registration. Summary of the Invention
[0004] This application provides an image subtraction method, apparatus, and storage medium to address the problem of high computational load in existing image registration schemes during image subtraction.
[0005] In a first aspect, this application provides an image subtraction method, the method comprising:
[0006] Register the current frame's mask image with the previous frame's target mask image to determine the current frame's target mask image;
[0007] The subtraction image of the current frame is determined based on the target mask image and the overlay image of the current frame.
[0008] In some embodiments, registering the current frame's overlay image and the previous frame's target mask image to determine the current frame's target mask image includes:
[0009] Iterative registration is performed on the current frame's overlay image and the previous frame's target mask image to determine the current frame's target mask image; the current frame's target mask image is a mask image whose similarity to the current frame's overlay image meets a preset condition.
[0010] In some embodiments, an iteration cycle of the iterative registration includes:
[0011] Calculate the similarity between the current frame's mask image and the target mask image from the previous iteration cycle to obtain the first similarity score; where the target mask image from the previous iteration cycle in the first iteration cycle is the target mask image from the previous frame.
[0012] The target mask image of the previous iteration cycle is registered based on the current frame's mask image to obtain the target mask image of the current iteration cycle.
[0013] Calculate the similarity between the current frame's mask image and the target mask image of the current iteration period to obtain a second similarity.
[0014] Based on the first similarity and the second similarity, determine whether the iterative registration has ended.
[0015] In some embodiments, determining whether the iterative registration has ended based on the first similarity and the second similarity includes:
[0016] When the second similarity is greater than the first similarity and the number of iterations is less than a preset value, the next iteration registration is performed based on the target mask image of the current iteration cycle and the full-screen image of the current frame.
[0017] In some embodiments, determining whether the iterative registration has ended based on the first similarity and the second similarity includes:
[0018] When the second similarity is less than or equal to the first similarity, the iterative registration is determined to be over; and the target mask image of the previous iteration cycle is determined to be the target mask image of the current frame.
[0019] In some embodiments, determining whether the iterative registration has ended based on the first similarity and the second similarity includes:
[0020] When the second similarity is greater than the first similarity and the number of iterations is greater than a preset value, the iterative registration is determined to be completed, and the target mask image of the current iteration period is determined to be the target mask image of the current frame.
[0021] In some embodiments, after determining that the iterative registration has been completed, the method further includes:
[0022] Obtain target mask images for multiple iterations of iterative registration;
[0023] Based on the second similarity of multiple iteration cycles, the corresponding weighted values of the target mask images of the multiple iteration cycles are determined; the weighted values are directly proportional to the second similarity.
[0024] The target mask images of the current frame are generated by superimposing the target mask images of the multiple iteration cycles based on the corresponding weighting values of the target mask images of the multiple iteration cycles.
[0025] In some embodiments, registering the target mask image of the previous iteration period based on the overlay image of the current frame to obtain the target mask image of the current iteration period includes:
[0026] Determine the target control points based on the target mask image from the previous iteration cycle;
[0027] Based on the current frame's mask image and the target control point, the target mask image of the previous iteration cycle is registered to obtain the target mask image of the current iteration cycle.
[0028] In some embodiments, the method further includes:
[0029] The preset mask image and the first frame of the film image are iteratively registered to determine the target mask image corresponding to the first frame of the film image.
[0030] Secondly, this application provides an image subtraction apparatus, the apparatus comprising:
[0031] The first determining module is used to register the current frame's mask image with the previous frame's target mask image to determine the current frame's target mask image.
[0032] The second determining module is used to determine the subtraction image of the current frame based on the target mask image of the current frame and the overlay image of the current frame.
[0033] Thirdly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the image subtraction method described in the first aspect.
[0034] Compared with existing technologies, the image subtraction method, apparatus, and storage medium provided in this application determine the target mask image of the current frame by registering the current frame's overlay image and the previous frame's target mask image. Based on the current frame's target mask image and the current frame's overlay image, the subtraction image of the current frame is then determined. During the registration process, the current frame utilizes the target mask image of the previous frame, transferring the registration trend from the previous frame to the current frame. This is equivalent to the current frame undergoing several registrations, thereby reducing the computational load in the image registration process and improving the registration effect. Furthermore, the image registration method provided in this application utilizes the target mask image of the previous frame during the registration process. The target mask image of the current frame is obtained based on the target mask image of the previous frame, and the target mask images of adjacent frames are correlated. This allows for a natural pixel transition between the subtraction images of adjacent frames, solving the problem of discontinuous jumps between the subtraction images of adjacent frames in existing image registration schemes.
[0035] Details of one or more embodiments of this application are set forth in the following drawings and description to make other features, objects and advantages of this application more readily apparent. Attached Figure Description
[0036] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0037] Figure 1 This is a hardware structure block diagram of a terminal that executes an image subtraction method according to an embodiment of this application;
[0038] Figure 2 This is a flowchart of an image subtraction method according to an embodiment of this application;
[0039] Figure 3 This is a flowchart of an image subtraction method according to a specific embodiment of this application;
[0040] Figure 4 This is a flowchart of a single-stage registration scheme used in existing image registration technologies;
[0041] Figure 5 This is a flowchart of a single-pass registration scheme used in image registration according to a specific embodiment of this application;
[0042] Figure 6This is a flowchart of another image subtraction method according to a specific embodiment of this application;
[0043] Figure 7 This is a flowchart of the iterative registration scheme used in existing image registration technologies;
[0044] Figure 8 This is a flowchart of the iterative registration scheme used for image registration in a specific embodiment of this application;
[0045] Figure 9 This is a flowchart of the iterative registration process in a specific embodiment of this application;
[0046] Figure 10 This is a structural block diagram of an image subtraction device according to an embodiment of this application. Detailed Implementation
[0047] To better understand the purpose, technical solution, and advantages of this application, the application is described and illustrated below in conjunction with the accompanying drawings and embodiments.
[0048] Unless otherwise defined, the technical or scientific terms used in this application shall have the general meaning as understood by one of ordinary skill in the art to which this application pertains. Words such as “a,” “an,” “an,” “the,” “the,” and “these,” used in this application, do not indicate quantitative limitation and may be singular or plural. The terms “comprising,” “including,” “having,” and any variations thereof used in this application are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device that comprises a series of steps or modules (units) is not limited to the listed steps or modules (units) but may include steps or modules (units) not listed, or may include other steps or modules (units) inherent to such processes, methods, products, or devices. The terms “connected,” “linked,” and “coupled,” used in this application, are not limited to physical or mechanical connections but may include electrical connections, whether direct or indirect. The term “multiple” used in this application refers to two or more. The "and / or" operator describes the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: A alone, A and B simultaneously, and B alone. Typically, the character " / " indicates that the objects before and after it are in an "or" relationship. The terms "first," "second," and "third," etc., used in this application are merely for distinguishing similar objects and do not represent a specific ordering of the objects.
[0049] The method embodiments provided in this application can be executed on a terminal, computer, or similar computing device. For example, they can be run on a terminal. Figure 1This is a hardware structure block diagram of a terminal executing an image subtraction method according to an embodiment of this application. For example... Figure 1 As shown, a terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 and a memory 104 for storing data are also included. The processor 102 may be, but is not limited to, a microprocessor (MCU), a programmable logic device (FPGA), a central processing unit (CPU), etc. The terminal may also include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the terminal described above. For example, the terminal may also include components that are larger than... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown are illustrated.
[0050] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to an image subtraction method in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thereby implementing the aforementioned method. The memory 104 may include high-speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0051] The transmission device 106 is used to receive or send data via a network. This network includes a wireless network provided by the terminal's communication provider. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 can be a Radio Frequency (RF) module used for wireless communication with the Internet.
[0052] This application provides an image subtraction method. Figure 2 This is a flowchart of an image subtraction method according to an embodiment of this application, such as... Figure 2 As shown, the process includes the following steps:
[0053] Step S210: Register the current frame's mask image with the previous frame's target mask image to determine the current frame's target mask image.
[0054] Specifically, the processor acquires the current frame's image from the image sequence. The processor registers the current frame's image with the target mask image from the previous frame to determine the target mask image for the current frame. This target mask image is the registered mask image. In the first frame, a preset mask image is iteratively registered with the first frame's image to determine the corresponding target mask image. This preset mask image can be the best-performing mask image among the acquired mask images. Further, the processor performs single or multiple registrations between the current frame's image and the previous frame's target mask image to determine the target mask image for the current frame. Single-step registration here refers to registering the current frame's mask image and the previous frame's target mask image once using a preset registration algorithm. Multiple-step registration refers to registering the current frame's mask image and the previous frame's target mask image multiple times using the same preset algorithm. The termination condition for iteration can be either reaching a preset number of iterations or the target mask image in the current frame satisfying a preset similarity condition with the current frame's mask image. In single-step registration, the current frame's registration utilizes the target mask image from the previous frame. Although only one registration is performed, it's equivalent to several registrations being done in the current frame, transferring the registration trend from the previous frame to the current frame. This reduces computational load while effectively performing more iterative registrations, thus reducing the computational burden in the image registration process and simultaneously improving the registration effect. When performing multiple registrations, the registration of the current frame utilizes the target mask image of the previous frame. This allows the registration trend of the previous frame to be passed to the current frame during the registration process, reducing the number of iterations, thereby reducing the amount of computation in the image registration process and improving the registration effect.
[0055] It should be noted that the current frame here refers to the frame at the current time, and the previous frame refers to the frame at the time before the current time. The time interval between the current frame and the previous frame is determined according to the sampling time of the film image sequence, that is, the sampling interval.
[0056] Step S220: Determine the subtraction image of the current frame based on the target mask image and the overlay image of the current frame.
[0057] Specifically, the processor determines the subtraction image of the current frame based on the target mask image and the current frame's overlay image. Further, the processor performs digital subtraction on the current frame's overlay image using the target mask image, subtracting the target mask image from the overlay image to obtain the subtraction image of the current frame.
[0058] In this embodiment, the target mask image of the current frame is determined by registering the current frame's overlay image and the previous frame's target mask image. Based on the current frame's target mask image and the current frame's overlay image, the subtraction image of the current frame is then determined. During the registration process, the current frame utilizes the target mask image of the previous frame, transferring the registration trend from the previous frame to the current frame. This is equivalent to the current frame undergoing several registrations, thereby reducing the computational load during image registration and improving the registration effect.
[0059] Furthermore, existing image registration schemes involve independently transforming the original mask image and the film image of each frame to generate a target mask image similar to the film image. Then, the target mask image of each frame is subtracted from the film image of each frame to obtain the subtracted image of each frame. Since there is no direct connection between the target mask images of adjacent frames, the pixels in the subtracted images of adjacent frames may not transition naturally, resulting in abrupt discontinuities. However, the image registration method provided in this embodiment utilizes the target mask image of the previous frame during the registration process. The target mask image of the current frame is obtained based on the target mask image of the previous frame, and the target mask images of adjacent frames are related. This allows for a natural pixel transition between the subtracted images of adjacent frames, solving the problem of abrupt discontinuities in the subtracted images of adjacent frames in existing image registration schemes.
[0060] In some embodiments, registering the current frame's overlay image and the previous frame's target mask image to determine the current frame's target mask image includes: iteratively registering the current frame's overlay image and the previous frame's target mask image to determine the current frame's target mask image; the current frame's target mask image is a mask image whose similarity to the current frame's overlay image meets a preset condition.
[0061] Specifically, the processor performs multiple registrations between the current frame's overlay image and the previous frame's target mask image to determine the current frame's target mask image. The target mask image of the current frame is a mask image whose similarity to the current frame's overlay image meets preset conditions.
[0062] In some embodiments, one iteration of the multiple registrations includes: calculating the similarity between the current frame's mask image and the target mask image of the previous iteration to obtain a first similarity; wherein the target mask image of the previous iteration is the target mask image of the previous frame; registering the target mask image of the previous iteration based on the current frame's mask image to obtain the target mask image of the current iteration; calculating the similarity between the current frame's mask image and the target mask image of the current iteration to obtain a second similarity; and determining whether the iterative registration has ended based on the first and second similarities.
[0063] Specifically, the multiple registration processes involve multiple iteration cycles. In the first iteration cycle, the processor calculates the similarity between the current frame's mask image and the target mask image of the previous frame, obtaining a first similarity score. Starting from the second iteration cycle, the processor calculates the similarity between the current frame's mask image and the target mask image of the previous iteration cycle, obtaining another first similarity score. The processor then uses a preset registration algorithm to register the target mask image of the previous iteration cycle with the current frame's mask image, obtaining the target mask image for the current iteration cycle. The processor then calculates the similarity between the current frame's mask image and the target mask image of the current iteration cycle, obtaining a second similarity score. Based on the first and second similarity scores, it is determined whether the iterative registration process has ended.
[0064] In some embodiments, determining whether iterative registration has ended based on a first similarity and a second similarity includes: when the second similarity is greater than the first similarity and the number of iterations is less than a preset value, performing iterative registration for the next iteration cycle based on the target mask image of the current iteration cycle and the full-frame image of the current frame.
[0065] Specifically, when the second similarity is greater than the first similarity, it proves that the target mask image of the current iteration cycle is more similar to the current frame's image, and the preset registration algorithm is effective. Then, the target mask image of the current iteration cycle is used as the target mask image of the previous iteration cycle in the next iteration cycle. The first similarity is calculated, and the iterative registration of the next iteration cycle is performed. The target mask image of the current iteration cycle is generated again until the second similarity of the next iteration cycle is less than or equal to the first similarity of the next iteration cycle. The similarity between the new target mask image and the image no longer increases, but decreases instead, or the iteration count reaches a preset value, and the iteration ends.
[0066] In some embodiments, determining whether iterative registration has ended based on a first similarity and a second similarity includes: determining that iterative registration has ended when the second similarity is less than or equal to the first similarity; and determining the target mask image of the previous iteration cycle as the target mask image of the current frame.
[0067] Specifically, when the second similarity is less than or equal to the first similarity, the similarity between the new target mask image and the film image no longer increases, but decreases instead, indicating the end of the iterative registration. At this point, the target mask image and the film image from the previous iteration are the most similar. Finally, a subtraction image is generated based on the target mask image and the film image from the previous iteration, resulting in the subtraction image with the fewest motion artifacts.
[0068] In some embodiments, determining whether iterative registration has ended based on a first similarity and a second similarity includes: when the second similarity is greater than the first similarity and the number of iterations is greater than a preset value, determining that iterative registration has ended, and determining that the target mask image of the current iteration period is the target mask image of the current frame.
[0069] Specifically, when the second similarity is greater than the first similarity, it proves that the target mask image of the current iteration period is more similar to the mask image of the current frame, and the preset registration algorithm is effective. However, at this time, the number of iterations has reached the preset value, and continuing to iterate will consume too much computing resources of the system. At this time, the iteration ends, the iterative registration is determined to be over, and the target mask image of the current iteration period is determined to be the target mask image of the current frame.
[0070] In some embodiments, after determining that the iterative registration is complete, the method further includes: acquiring target mask images for multiple iteration periods of iterative registration; determining corresponding weighting values for the target mask images for multiple iteration periods based on the second similarity of the multiple iteration periods; the weighting values being proportional to the second similarity; and superimposing the target mask images for multiple iteration periods based on the corresponding weighting values to generate the target mask image for the current frame.
[0071] Specifically, during iterative registration across multiple iteration cycles, each iteration cycle generates a corresponding target mask image. Assuming N iteration cycles are performed, N target mask images are generated after the iteration registration is complete. A second similarity is calculated for each iteration cycle. Based on the second similarity of the i-th iteration cycle, a weighted value corresponding to the target mask image of the i-th iteration cycle is calculated, resulting in N weighted values corresponding to the target mask image. The sum of these N weighted values is 1. Based on the weighted values corresponding to the target mask images of the N iteration cycles, the target mask images of the N iteration cycles are superimposed to generate the target mask image for the current frame. The weighted value is directly proportional to the second similarity; that is, the higher the second similarity of the target mask image, the greater the superposition weight. Here, N is a positive integer greater than 1, and i is a positive integer from 1 to N.
[0072] It should be noted that there are two methods for determining the target mask image of the current frame in iterative registration. One is to directly use the target mask image of the last iteration cycle as the target mask image of the current frame, because the second similarity of the target mask at this time is the highest. The other is to use the target mask images of all iteration cycles in the iterative process and overlay them, with higher similarity corresponding to higher overlay weights.
[0073] In some embodiments, registering the target mask image of the previous iteration period based on the current frame's overlay image to obtain the target mask image of the current iteration period includes: determining target control points based on the target mask image of the previous iteration period; and registering the target mask image of the previous iteration period based on the current frame's overlay image and the target control points to obtain the target mask image of the current iteration period.
[0074] It should be noted that the preset registration algorithms in the embodiments of this application include, but are not limited to, rigid registration algorithms, affine transformation registration algorithms, thin plate spline elastic registration algorithms, B-spline elastic registration algorithms, Demons elastic registration algorithms, etc., and are not specifically limited here. The similarity calculation functions in the embodiments of this application include, but are not limited to, mutual information, normalized mutual information, correlation coefficient, energy of the histogram of differences, and sum of squared differences, etc., and are not specifically limited here.
[0075] The embodiments of this application will be described and illustrated below through specific examples.
[0076] Figure 3 This is a flowchart of an image subtraction method according to a specific embodiment of this application, such as... Figure 3 The image subtraction method includes the following steps:
[0077] Step S310: Obtain the preset mask image and the filled image from the image sequence.
[0078] Specifically, the image sequence here can be a digital subtraction angiography (DSA) sequence, a digital subtraction gastrointestinal angiography sequence, a digital subtraction intravenous pyelography sequence, a digital subtraction hysterosalpingography sequence, or other X-ray angiography sequences, without any specific limitations. The film images here include multiple film images, and the preset mask image here can be the best-looking mask image among the acquired mask images.
[0079] Step S320: Using a preset registration algorithm, perform a single registration of the current frame's mask image and the previous frame's target mask image to determine the current frame's target mask image.
[0080] Specifically, the single registration here refers to a single-frame registration. For the first frame, a preset registration algorithm is used to perform a single registration between the full-frame image and the preset mask image to determine the target mask image of the first frame.
[0081] Step S330: Perform digital subtraction on the target mask image and the overlay image of the current frame to obtain the subtracted image of the current frame.
[0082] Specifically, taking a DSA sequence as an example, firstly, X-ray images are continuously taken in the target area of interest, and a frame image before the injection of contrast agent is fixed as a preset mask image. Then, a contrast agent, such as iodine, is injected into the patient, and X-rays are taken again to obtain real-time filling images. Iodine enters the blood vessels and leaves a unique image on the X-ray, called a filling image. After determining the target mask image of the current frame, digital subtraction is performed between the target mask image of the current frame and the filling image of the current frame to remove bone and soft tissue, resulting in an image containing only blood vessels.
[0083] The flowchart of the single-pass registration scheme used in existing image registration technology is as follows: Figure 4 As shown, each frame restarts from the preset mask image, performing a single-frame registration. For example, the target mask image of the first frame is registered with the preset mask image to obtain the target mask image of the first frame; the target mask image of the second frame is registered with the preset mask image to obtain the target mask image of the second frame; and so on, until the target mask image of the Nth frame is registered with the preset mask image to obtain the target mask image of the Nth frame. Here, N is a positive integer greater than 2.
[0084] The flowchart of the single-pass registration scheme used for image registration in this embodiment is as follows: Figure 5As shown, each frame begins with the target mask image of the previous frame and performs a single-frame registration. For example, the target mask image of the first frame is registered with the preset mask image to obtain the target mask image of the first frame; the target mask image of the second frame is registered with the target mask image of the first frame to obtain the target mask image of the second frame; and so on, the target mask image of the Nth frame is registered with the target mask image of the (N-1)th frame to obtain the target mask image of the Nth frame. Here, N is a positive integer greater than 2. That is, the target mask image of the second frame is no longer generated from the original preset mask image and the fill image of the second frame, but is generated from the best mask corresponding to the fill image of the previous frame, that is, the target mask image of the first frame and the fill image of the second frame. Since the fill image of the second frame is very similar to the fill image of the first frame, the target mask image of the first frame is also approximately applicable to the fill image of the second frame. The target mask image of the first frame is directly used as the input for single-frame registration of the fill image of the second frame. During the registration process, the current frame uses the target mask image of the previous frame and passes the registration trend of the previous frame to the current frame. It is equivalent to the current frame having already performed several registrations, thereby reducing the amount of computation in the image registration process and improving the registration effect.
[0085] Figure 6 This is a flowchart of another image subtraction method according to a specific embodiment of this application, such as... Figure 6 The image subtraction method includes the following steps:
[0086] Step S610: Obtain the preset mask image and the filled image from the image sequence.
[0087] Specifically, the image sequence here can be a digital subtraction angiography (DSA) sequence, the film image here includes multiple film images, and the preset mask image here can be the best mask image among the acquired mask images.
[0088] Step S620: Using a preset registration algorithm, iteratively register the mask image of the current frame and the target mask image of the previous frame to determine the target mask image of the current frame.
[0089] Specifically, for the first frame, a preset registration algorithm is used to iteratively register the full-frame image and the preset mask image of the first frame to determine the target mask image of the first frame. This iterative registration is called single-frame iterative registration.
[0090] Step S630: Perform digital subtraction on the target mask image and the overlay image of the current frame to obtain the subtracted image of the current frame.
[0091] Specifically, taking a DSA sequence as an example, firstly, X-ray images are continuously taken in the target area of interest, and a frame image before the injection of contrast agent is fixed as a preset mask image. Then, a contrast agent, such as iodine, is injected into the patient, and X-rays are taken again to obtain real-time filling images. Iodine enters the blood vessels and leaves a unique image on the X-ray, called a filling image. After determining the target mask image of the current frame, digital subtraction is performed between the target mask image of the current frame and the filling image of the current frame to remove bone and soft tissue, resulting in an image containing only blood vessels.
[0092] The flowchart of the iterative registration scheme used in existing image registration technology is as follows: Figure 7 As shown, each frame restarts from the preset mask image, performing single-frame iterative registration. This single-frame iterative registration means multiple registrations within a single frame. For example, the first frame's holographic image and the preset mask image are registered 9 times, meaning the first frame's iterative registration includes 9 iterations, resulting in target mask image 19 as the target mask image for the first frame. The second frame's holographic image and the preset mask image are registered 9 times, resulting in target mask image 29 as the target mask image for the second frame, and so on, until the Nth frame's holographic image and the preset mask image are registered 9 times, resulting in target mask image N9 as the target mask image for the Nth frame. Here, N is a positive integer greater than 2. It is evident that the preset mask requires 9 registrations to achieve the best match with the current frame's holographic image. It should be noted that the number 9 here is merely to indicate multiple registrations and is for illustrative purposes only, not a specific limitation.
[0093] The flowchart of the iterative registration scheme used for image registration in this embodiment is as follows: Figure 8As shown, each frame starts from the target mask image of the previous frame and performs single-frame iterative registration. Here, single-frame iterative registration means multiple registrations in a single frame. For example, the film image and the preset mask image of the first frame are registered 9 times, that is, the iterative registration of the first frame includes 9 iteration cycles, and the target mask image 19 is obtained as the target mask image of the first frame. The film image of the second frame and the target mask image of the first frame are registered 5 times, and the target mask image 25 is obtained as the target mask image of the second frame, ..., the film image of the Nth frame and the target mask image of the N-1th frame are registered 2 times, and the target mask image N2 is obtained as the target mask image of the Nth frame. Where N is a positive integer greater than 2, the intermediate images generated during the iterative registration process of the first frame include target mask image 11, target mask image 12, target mask image 13, ..., target mask image 19, the intermediate images generated during the iterative registration process of the second frame include target mask image 21, target mask image 22, target mask image 23, ..., target mask image 25, and the intermediate images generated during the iterative registration process of the Nth frame include target mask image N1 and target mask image N2. Target mask image 21 is no longer generated from the preset mask image and the fill image of the second frame, but is generated using the best mask image corresponding to the fill image of the previous frame, that is, target mask image 19 and the fill image of the second frame. Because the fill image of the second frame is very close to the fill image of the first frame, the target mask image of the first frame is also approximately applicable to the fill image of the second frame. Directly using the target mask image of the first frame as the input for the single-frame iterative registration of the fill image of the second frame can reduce the number of iterations and improve the registration effect. During the registration process, the current frame utilizes the target mask image of the previous frame, passing the registration trend of the previous frame to the current frame. This is equivalent to the current frame having already performed several registrations, thereby reducing the amount of computation in the image registration process and improving the registration effect.
[0094] As an optional approach, multiple target mask images obtained through multiple registrations of a single frame can be superimposed to obtain the target mask image of the current frame. For example, continue to refer to... Figure 8For the first frame, the target mask images 11, 12, 13, ..., 19 obtained from nine registrations can be superimposed. The corresponding superposition weights are set based on their second similarity values S11 to S19. The higher the similarity, the larger the corresponding superposition weight value. The sum of the weight values must be 1 to ensure that the superimposed target mask meets the pixel value requirements. The specific mapping relationship between similarity and weight values is not limited here; for example, if the sum of similarities Sum = S11 + S12 + ... + S19, then the target mask image of the first frame = S11 / Sum * target mask image 11 + S12 / Sum * target mask image 12 + ... + S19 / Sum * target mask image 19. The target mask image of the first frame generated by superposition effectively utilizes all target mask information from the entire iteration process. After obtaining the target mask image of the first frame, iterative registration is continued between the target mask image of the second frame and the target mask image of the first frame. In subsequent frames, multiple target mask images can be superimposed in the same way to obtain the target mask image of the current frame.
[0095] Figure 9 This is a flowchart of the iterative registration process in a specific embodiment of this application, such as... Figure 9 As shown, the iterative registration includes the following steps:
[0096] Step S910: Obtain the current frame's mask image and the previous frame's target mask image.
[0097] Step S920: Calculate the similarity between the current frame's mask image and the target mask image from the previous iteration cycle to obtain the first similarity score.
[0098] Step S930: Using a preset registration algorithm, the mask image of the current frame and the target mask image of the previous iteration cycle are registered to obtain the target mask image of the current iteration cycle.
[0099] Step S940: Calculate the similarity between the current frame's mask image and the target mask image of the current iteration cycle to obtain the second similarity.
[0100] Step S950: Determine whether the second similarity is greater than the first similarity; if yes, proceed to step S960; otherwise, proceed to step S970.
[0101] Step S960: Determine whether the number of iterations is less than a preset value; if yes, proceed to step S920; if no, proceed to step S980.
[0102] Specifically, when the second similarity is greater than the first similarity and the number of iterations is less than a preset value, step S920 is executed to perform iterative registration for the next iteration cycle based on the target mask image of the current iteration cycle and the full image of the current frame.
[0103] Step S970: The iterative registration ends, and the target mask image of the previous iteration cycle is determined as the target mask image of the current frame.
[0104] Step S980: The iterative registration ends, and the target mask image of the current iteration period is determined to be the target mask image of the current frame.
[0105] It should be noted that the steps shown in the above process or in the flowchart of the accompanying figures can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0106] This application also provides an image subtraction apparatus for implementing the above embodiments and preferred embodiments, which will not be repeated hereafter. The terms "module," "unit," "subunit," etc., used below can refer to a combination of software and / or hardware that performs a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0107] Figure 10 This is a structural block diagram of an image subtraction device according to an embodiment of this application, such as... Figure 10 As shown, the device includes:
[0108] The first determining module 10 is used to register the current frame's mask image and the previous frame's target mask image to determine the current frame's target mask image.
[0109] The second determining module 20 is used to determine the subtraction image of the current frame based on the target mask image of the current frame and the overlay image of the current frame.
[0110] It should be noted that the above modules can be functional modules or program modules, and can be implemented through software or hardware. For modules implemented through hardware, the above modules can reside in the same processor; or the above modules can be located in different processors in any combination.
[0111] This application also provides an electronic device including a memory and a processor, the memory storing a computer program and the processor being configured to run the computer program to perform the steps in any of the above method embodiments.
[0112] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.
[0113] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:
[0114] S1, Register the current frame's mask image with the previous frame's target mask image to determine the current frame's target mask image;
[0115] S2, determine the subtraction image of the current frame based on the target mask image and the overlay image of the current frame.
[0116] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated in this embodiment.
[0117] Furthermore, in conjunction with the image subtraction method provided in the above embodiments, this embodiment can also provide a storage medium for implementation. The storage medium stores a computer program; when executed by a processor, the computer program implements the steps of any of the image subtraction methods described in the above embodiments.
[0118] It should be understood that the specific embodiments described herein are merely illustrative of the application and not intended to limit it. All other embodiments derived by those skilled in the art based on the embodiments provided in this application without inventive effort are within the scope of protection of this application.
[0119] Obviously, the accompanying drawings are merely some examples or embodiments of this application. Those skilled in the art can apply this application to other similar situations based on these drawings without any creative effort. Furthermore, it is understood that although the work done in this development process may be complex and lengthy, for those skilled in the art, certain design, manufacturing, or production modifications made based on the technical content disclosed in this application are merely conventional technical means and should not be considered as insufficient disclosure of this application.
[0120] The term "embodiment" in this application refers to a specific feature, structure, or characteristic described in connection with an embodiment that may be included in at least one embodiment of this application. The appearance of this phrase in various places in the specification does not necessarily imply the same embodiment, nor does it imply that it is mutually exclusive with or independent of other embodiments. It will be clearly or implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments without conflict.
[0121] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of patent protection. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the appended claims.
Claims
1. An image subtraction method, characterized by, The method includes: The current frame's overlay image and the previous frame's target mask image are registered to determine the current frame's target mask image; wherein, when it is the first frame, the first frame's overlay image is registered with a preset mask image to determine the target mask image corresponding to the first frame's overlay image. The subtraction image of the current frame is determined based on the target mask image and the overlay image of the current frame.
2. The image subtraction method of claim 1, wherein, The process of registering the current frame's mask image with the previous frame's target mask image to determine the current frame's target mask image includes: Iterative registration is performed on the current frame's overlay image and the previous frame's target mask image to determine the current frame's target mask image; the current frame's target mask image is a mask image whose similarity to the current frame's overlay image meets a preset condition.
3. The image subtraction method of claim 2, wherein, One iteration cycle of the iterative registration includes: Calculate the similarity between the current frame's mask image and the target mask image from the previous iteration cycle to obtain the first similarity score; where the target mask image from the previous iteration cycle in the first iteration cycle is the target mask image from the previous frame. The target mask image of the previous iteration cycle is registered based on the current frame's mask image to obtain the target mask image of the current iteration cycle. Calculate the similarity between the current frame's mask image and the target mask image of the current iteration period to obtain a second similarity. Based on the first similarity and the second similarity, determine whether the iterative registration has ended.
4. The image subtraction method of claim 3, wherein, The step of determining whether the iterative registration has ended based on the first similarity and the second similarity includes: When the second similarity is greater than the first similarity and the number of iterations is less than a preset value, the next iteration registration is performed based on the target mask image of the current iteration cycle and the full-screen image of the current frame.
5. The image subtraction method of claim 3, wherein, The step of determining whether the iterative registration has ended based on the first similarity and the second similarity includes: When the second similarity is less than or equal to the first similarity, the iterative registration is determined to be over; and the target mask image of the previous iteration cycle is determined to be the target mask image of the current frame.
6. The image subtraction method of claim 3, wherein, The step of determining whether the iterative registration has ended based on the first similarity and the second similarity includes: When the second similarity is greater than the first similarity and the number of iterations is greater than a preset value, the iterative registration is determined to be completed, and the target mask image of the current iteration period is determined to be the target mask image of the current frame.
7. The image subtraction method of claim 3, wherein, After the iterative registration is completed, the method further includes: Obtain target mask images for multiple iterations of iterative registration; Based on the second similarity of multiple iteration cycles, the corresponding weighted values of the target mask images of the multiple iteration cycles are determined; the weighted values are directly proportional to the second similarity. The target mask images of the current frame are generated by superimposing the target mask images of the multiple iteration cycles based on the corresponding weighted values of the target mask images of the multiple iteration cycles.
8. The image subtraction method according to claim 3, characterized in that, The step of registering the target mask image of the previous iteration period with the full-frame image of the current frame to obtain the target mask image of the current iteration period includes: Determine the target control points based on the target mask image from the previous iteration cycle; Based on the current frame's mask image and the target control point, the target mask image of the previous iteration cycle is registered to obtain the target mask image of the current iteration cycle.
9. An image subtraction device, characterized in that, The device includes: The first determining module is used to register the current frame's film image and the previous frame's target mask image to determine the current frame's target mask image; wherein, when it is the first frame, the first frame's film image is registered with a preset mask image to determine the target mask image corresponding to the first frame's film image. The second determining module is used to determine the subtraction image of the current frame based on the target mask image of the current frame and the overlay image of the current frame.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the image subtraction method according to any one of claims 1 to 8.