Image processing method and device, equipment and storage medium

By generating dose images from the scanned images of the radiochromic film and extracting the target area, determining the beam axis position information, the problem of insufficient extraction of the PDD curve of the radiotherapy equipment is solved, and higher accuracy and accuracy are achieved.

CN120014082APending Publication Date: 2025-05-16ZHONGJIU FLASH MEDICAL TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411846878.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-16
Publication Date
2025-05-16

AI Technical Summary

Technical Problem

When extracting the percentage depth dose (PDD) curve of the radiotherapy device, the curve extracted in the prior art is not accurate enough.

Method used

By generating a dose image from the scanned image of the radiochromic film, the target area that meets the preset dose threshold is extracted, the beam axis position information is determined, and the PDD curve is generated based on this information.

Benefits of technology

Improve the accuracy of the PDD curve, avoid error accumulation by manually selecting the beam axis or relying on low-precision methods, and ensure data representation and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120014082A_ABST
    Figure CN120014082A_ABST
Patent Text Reader

Abstract

The invention provides an image processing method and device, equipment and a storage medium. According to the invention, the second image is used for representing the beam dose value distribution of the radiotherapy equipment, so that the precision loss caused by directly processing the original image is avoided; the target area meeting the preset dose threshold value is extracted and analyzed, and it is ensured that data used for beam axis positioning has representativeness and accuracy; the PDD curve is generated by combining the beam axis position information and the depth distribution of the dose image, so that error accumulation caused by manual beam axis selection or dependence on a low-precision method is avoided. According to the whole method, the accuracy of the PDD curve is greatly improved while the integrity of a data processing chain is kept, and the technical problem that the PDD curve is not accurately extracted in the related technology is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to an image processing method, device, equipment and storage medium. Background Art

[0002] The percent depth dose (PDD) curve is an important parameter for evaluating the beam characteristics of radiotherapy equipment. It describes the change in dose when the radiation passes through the medium at different depths. For traditional radiotherapy equipment, the PDD curve is usually measured by the water tank method, that is, an ionization chamber or other detector placed in the water tank is used to record the dose values ​​at different depths. However, with the development of radiotherapy technology, especially the emergence of electron beam flash equipment, this fast radiotherapy technology requires the beam to be able to complete irradiation within a few milliseconds, which makes the traditional water tank method no longer applicable. In this case, radiochromic film has become an effective alternative measurement tool. Radiochromic film is a special film that changes color when exposed to radiation, and the degree of this change is proportional to the radiation dose received.

[0003] In the related art, when extracting a percent depth dose (PDD) curve of a radiotherapy device, there is a technical problem that the extracted percent depth dose (PDD) curve is not accurate enough. Summary of the invention

[0004] The purpose of the present invention is to overcome the above-mentioned technical deficiencies and provide an image processing method, device, equipment and storage medium to solve the technical problem in the related art that the extracted percentage depth dose (PDD) curve is not accurate enough in the scenario of extracting the percentage depth dose (PDD) curve of the radiotherapy equipment.

[0005] In order to achieve the above technical objectives, the present invention adopts the following technical solutions:

[0006] In a first aspect, the present invention provides an image processing method, the method comprising:

[0007] Receive a first image; wherein the first image is an image obtained by scanning at least one film, and the film is a film irradiated by a radiotherapy device;

[0008] Based on the first image, a corresponding second image is generated; wherein the second image is a dose image used to characterize the distribution of beam dose values ​​of the radiotherapy device;

[0009] Determine the beam axis position information in the second image according to the target area carried in the second image; wherein the target area is used to represent the area in the second image that meets a preset dose threshold;

[0010] A percentage depth dose curve is generated based on the beam axis position information and the second image.

[0011] In a second aspect, the present invention provides an image processing device, the device comprising:

[0012] A receiving module, which is used to receive a first image; wherein the first image is an image obtained by scanning at least one film, and the film is a film irradiated by a radiotherapy device;

[0013] A first generating module, which is used to generate a corresponding second image based on the first image; wherein the second image is a dose image used to characterize the distribution of beam dose values ​​of the radiotherapy device;

[0014] A determination module, which is used to determine the beam axis position information in the second image according to the target area carried in the second image; wherein the target area is used to represent the area in the second image that meets a preset dose threshold;

[0015] The second generating module is used to generate a percentage depth dose curve based on the beam axis position information and the second image.

[0016] In a third aspect, the present invention provides an electronic device comprising: a memory, and one or more processors communicatively connected to the memory; the memory stores instructions executable by the one or more processors, and the instructions are executed by the one or more processors so that the one or more processors implement the above-mentioned method.

[0017] In a fourth aspect, the present invention provides a computer-readable storage medium, wherein the computer program is stored in the computer-readable storage medium, and the computer program implements the above method when executed by a processor.

[0018] Beneficial effects:

[0019] The present invention effectively solves the problem of insufficient precision in extracting the percentage depth dose (PDD) curve scenario by introducing steps such as generating a dose image (second image) from a first image, extracting the target area, and positioning the beam axis. The present invention uses the second image to characterize the distribution of dose values ​​of the radiotherapy equipment beam, avoiding the loss of precision caused by directly processing the original image; by extracting and analyzing the target area that meets the preset dose threshold, it ensures that the data used for beam axis positioning is representative and accurate; combining the beam axis position information with the depth distribution of the dose image to generate a PDD curve, thereby avoiding the error accumulation of manually selecting the beam axis or relying on low-precision methods. While maintaining the integrity of the data processing chain, the overall method greatly improves the accuracy of the PDD curve, solving the technical problem of inaccurate extraction of the PDD curve in related technologies. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 is a schematic diagram of a scenario example provided by an embodiment of the present invention;

[0021] Figure 2 is a flow chart of an image processing method provided by an embodiment of the present invention;

[0022] Figure 3 is a flow chart of an image processing method provided by an embodiment of the present invention;

[0023] Figure 4 is a flow chart of an image processing method provided by an embodiment of the present invention;

[0024] Figure 5 is a schematic diagram of a first image provided by an embodiment of the present invention;

[0025] Figure 6 is a schematic diagram of a second image provided by an embodiment of the present invention;

[0026] Figure 7 is a schematic diagram of a 50% equal measurement area and its minimum circumscribed rectangle provided by an embodiment of the present invention;

[0027] Figure 8 is a schematic diagram of a 50% equal measurement area and its minimum circumscribed rectangle provided by an embodiment of the present invention;

[0028] Fig. 9 : is a schematic diagram of a depth dose curve diagram provided by an embodiment of the present invention; wherein the X-axis represents the specific depth, and the Y-axis represents the percentage of the dose;

[0029] Fig.10 is a schematic diagram of a circle and its center obtained by fitting on a 50% isodose region provided in an embodiment of the present invention;

[0030] Fig.11 It is a schematic diagram of the straight line fitting of the radiation field when the imaging angle is 15° provided by an embodiment of the present invention;

[0031] Fig.12 It is a schematic diagram of the straight line fitting of the radiation field when the imaging angle is 30° provided by an embodiment of the present invention;

[0032] Fig.13 is a block diagram of an image processing device used in an embodiment of the present invention;

[0033] Fig.14 It is a block diagram of an electronic device used in an embodiment of the present invention. DETAILED DESCRIPTION

[0034] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0035] In the related art, the Percentage Depth Dose (PDD) curve is an important parameter for evaluating the beam characteristics of radiotherapy equipment. It describes the change in dose when the rays pass through media at different depths, and is an important basis for analyzing beam distribution uniformity, dose transfer capability, and beam energy characteristics. The traditional PDD curve is usually measured by the water tank method, that is, placing detectors such as ionization chambers in a water tank to record the dose values ​​when the beam passes through different depths of water. However, with the rapid development of radiotherapy technology, especially the emergence of high-dose rate electron beam flash radiotherapy equipment, the water tank measurement method in the related art is no longer applicable.

[0036] In the water tank method in the related art, the basic process of measuring the PDD curve includes the following steps: setting an ionization chamber detector in the water tank, adjusting the depth of the detector, and recording the beam dose distribution in layers. Drawing a curve of dose versus depth based on the measurement results to generate a PDD curve.

[0037] This method relies on stable beam output and a long measurement time, and is suitable for radiotherapy equipment with conventional dose rates. However, with the introduction of electron beam flash radiotherapy technology, this measurement method is no longer applicable. Electron beam flash equipment completes high-dose radiation output in a very short time (usually a few milliseconds), far exceeding the time range that the traditional water tank method can respond to.

[0038] To meet the measurement needs of Flash radiotherapy, radiochromic film is an alternative tool in related technologies. Radiochromic film can directly record the beam dose distribution through color changes and collect complete dose distribution data in one beam process, providing a method for the evaluation of high-dose rate beams.

[0039] In the related art, on the one hand, the beam axis usually relies on manual marking or estimation in the film image. Since the placement or scanning of the film may be offset, the position of the beam axis is difficult to accurately align. The subjectivity of manual operation easily leads to the accumulation of deviations, which directly affects the reference point of the PDD curve. Secondly, the beam axis positioning and dose distribution extraction process of the related art relies on manual adjustment and lacks standardized automated methods. The operations of different experimenters may lead to inconsistent results. Especially in complex dose distribution scenarios, the target area may contain noise or abnormal points. In the absence of an iterative optimization method, it is difficult to dynamically adjust the dose reference value or optimize the target area, resulting in the amplification of the beam axis positioning error.

[0040] Therefore, in the related art, when extracting the percentage depth dose (PDD) curve of the radiotherapy equipment, there is a technical problem that the extracted percentage depth dose (PDD) curve is not accurate enough.

[0041] Therefore, this embodiment effectively solves the problem of insufficient precision in extracting the percentage depth dose (PDD) curve scenario by introducing steps such as generating a dose image (second image) from the first image, extracting the target area, and positioning the beam axis. This embodiment uses the second image to characterize the distribution of beam dose values ​​of the radiotherapy equipment, avoiding the loss of precision caused by directly processing the original image; by extracting and analyzing the target area that meets the preset dose threshold, it ensures that the data used for beam axis positioning is representative and accurate; the PDD curve is generated by combining the beam axis position information with the depth distribution of the dose image, thereby avoiding the error accumulation of manually selecting the beam axis or relying on low-precision methods. While maintaining the integrity of the data processing chain, the overall method greatly improves the accuracy of the PDD curve, solving the technical problem of inaccurate extraction of the PDD curve in related technologies.

[0042] Figure 1 As shown, before describing the embodiments of the present invention in detail, a specific scenario example is used to reveal the scenario in which the technical solution of the present invention can be used. The method of the present invention can be configured in Figure 1 In the server, the server can communicate with the client and the scanning device.

[0043] First, the server may receive a first image from a scanning device; wherein the first image is an image obtained by scanning at least one film, and the film is a film irradiated by a radiotherapy device. It is understandable that the first image may include digitized content of one or more films, recording the dose distribution after the radiotherapy device beam acts on the film.

[0044] Then, the server generates a corresponding second image based on the first image; wherein the second image is a dose image used to characterize the distribution of the dose value of the radiation therapy device beam. It is understandable that the user can observe the second image through the client. The server can generate a dose image used to characterize the distribution of the dose value of the radiation therapy device beam, i.e., the second image, based on the first image and in combination with the mapping relationship between the pixel value of the film and the dose value.

[0045] Next, the server determines the beam axis position information in the second image based on the target area carried in the second image; wherein the target area is used to represent the area in the second image that meets the preset dose threshold. The server further processes the second image to extract the target area. The target area is a dose distribution area that meets the preset dose threshold, such as a 50% isodose area. Through the iterative algorithm preset in the server, the server can locate the position information of the beam axis based on the target area.

[0046] Finally, the server generates a percentage depth dose curve based on the beam axis position information and the second image. It is understandable that the user can observe the percentage depth dose curve through the client.

[0047] like Figure 2 As shown, this embodiment provides an image processing method, the execution subject of the method may be a server, and the method may include:

[0048] Step S12: receiving a first image; wherein the first image is an image obtained by scanning at least one film, and the film is a film irradiated by a radiotherapy device.

[0049] In this embodiment, the receiving action may indicate that the server receives the first image from a scanning device or a data storage device. The server may be connected to the scanning device by wire or wirelessly, and the server may directly obtain the first image generated by scanning the film from the scanning device. The server may obtain the stored first image by accessing a data storage device (e.g., cloud storage, network file system, local storage device, etc.). The scanning device may be a dedicated medical imaging scanner, a high-resolution flatbed scanner, or a medical digital X-ray film scanner, etc.

[0050] In this embodiment, the first image may be an image obtained by scanning a film. It is understandable that the scanning device may only scan a single film, and the generated first image directly corresponds to the dose distribution record on the film. In this case, there is no need to perform region segmentation during processing, and subsequent steps (such as grayscale processing, dose value conversion, beam axis positioning, etc.) can be directly performed on the first image.

[0051] In this embodiment, the first image may be an image obtained by scanning multiple films simultaneously. It is understandable that the scanning device may scan multiple films multiple times, and the generated first image includes the dose distribution information of multiple films, and these films may be arranged on the same scanning plane. In this case, the first image may include multiple film areas, each film corresponding to a different dose distribution record. Therefore, in subsequent processing, it is necessary to first detect the film area in the first image and divide it into a single sub-image for further dose distribution calculation and beam axis positioning.

[0052] In this embodiment, the film may be a radiochromic film. It is understood that the radiochromic film has a special photosensitive material layer that undergoes a physical or chemical reaction when exposed to radiation, resulting in a visible color change. The degree of this color change is a function of the radiation dose received, such as can be quantified by a calibration curve. The radiochromic film can be placed directly in the beam output path of the radiotherapy device to detect the beam dose distribution under different treatment conditions, such as beam characteristics at different energy levels or device settings.

[0053] In this embodiment, the radiotherapy device can be an electron beam Flash device. It is understandable that the beam irradiation time of the electron beam Flash device is usually completed within a few milliseconds, and the dose rate is high (>40Gy / s), which far exceeds the irradiation time and dose rate of traditional radiotherapy equipment. The traditional PDD curve measurement method relies on the ionization chamber in the water tank to record the dose values ​​at different depths layer by layer. This method requires a long time for sampling, and the irradiation speed of the electron beam Flash device is much higher than the response speed of the water tank method, resulting in the inability of the traditional method to accurately capture its dose distribution characteristics. The high dose rate and rapid irradiation characteristics of the electron beam Flash device require that the PDD curve measurement method be able to capture the complete dose distribution in real time in order to accurately evaluate the energy penetration and dose gradient of the beam. Therefore, in this embodiment, radiochromic film or other dose recording media can be used to record the dose distribution information of the beam. Radiochromic film can fully record the dose distribution in a rapid beam irradiation, and its color change is proportional to the dose received, which adapts to the high dose rate of the Flash device. The dose distribution recorded on film has a higher spatial resolution and can more accurately reflect the beam characteristics of the electron beam flash device.

[0054] In this embodiment, the radiotherapy equipment may also be a proton radiotherapy equipment, a photon radiotherapy equipment, a heavy ion radiotherapy equipment, or the like.

[0055] It is understood that when the film is irradiated, the film can be placed parallel to the beam limiting device (e.g., a light limiting cylinder) to ensure that the film surface can completely capture the beam dose distribution passing through the beam limiting device. This placement method can make the dose distribution of the beam after passing through the shape limitation of the beam limiting device accurately recorded in a two-dimensional form on the film.

[0056] It is also understood that the beam defining device is used to define the shape and size of the beam (e.g., rectangular, circular, or any complex shape), and the parallel placement ensures that the film can faithfully record the distribution characteristics of the defined beam in the film plane, while capturing the dose gradient and boundary transition area.

[0057] In one possible and specific embodiment, the first image may be Figure 5 shown.

[0058] Step S14: Based on the first image, generate a corresponding second image; wherein the second image is a dose image used to characterize the beam dose value distribution of the radiotherapy equipment.

[0059] In this embodiment, it can be understood that the first image is a digital image obtained by scanning a radiochromic film or other film, which records the dose distribution after the radiation beam of the radiotherapy device is irradiated. The pixel values ​​(e.g., RGB values) in the image are related to the color change or optical density change of the film after the radiation beam is irradiated. In other words, these pixel values ​​are essentially the raw data of the indirect inversion beam dose distribution.

[0060] In this embodiment, the second image is a dose image, which can directly represent the two-dimensional distribution of the dose value of the radiation therapy device beam. Each pixel value in the image represents the radiation dose at the corresponding position, and the unit can be Gy or other dose units.

[0061] In this implementation, the step of generating a corresponding second image based on the first image may include:

[0062] First, preprocessing is performed on the first image to remove unnecessary color information interference. For example, Gaussian filtering, median filtering, etc. can be performed on the first image to remove the influence of some noise.

[0063] Then, using a preset mapping relationship between pixel values ​​and dose values ​​(for example, it can be a film scale curve, which is also a pre-calibrated pixel value-dose value relationship curve), the pixel values ​​of the first image are mapped point by point to corresponding dose values ​​to obtain a two-dimensional dose value matrix, in which each matrix element corresponds to a dose value.

[0064] Finally, the dose value matrix is ​​re-encoded into an image format to generate a second image.

[0065] Specifically, it can be understood that the scale curve of the film is a pre-calibrated mapping relationship used to convert the pixel value (RGB value) in the digital image into the actual radiation dose value. Each color channel (red, green, and blue) can correspond to an independent scale curve, which describes the linear or nonlinear relationship between the pixel value and the dose value. Therefore, in this embodiment, the pixel values ​​of the red channel, the green channel, and the blue channel can be converted respectively based on the scale curve of the film to generate three independent dose images. It can be understood that the dose image of each channel represents the two-dimensional dose distribution corresponding to the pixel value in the corresponding color channel. The scale curve of the red channel often has better linear characteristics (the relationship between the pixel value and the dose value is more stable and more accurate). In this embodiment, the dose image of the red channel can be preferentially selected as the basis for subsequent processing. By preferably using the red channel for subsequent calculations, the calculation accuracy of the dose distribution can be significantly improved, and the uncertainty caused by the nonlinearity of the scale curve or data errors can be reduced. At the same time, other channel data can be retained for verification or calibration to ensure the robustness of the overall method.

[0066] It can be understood that the second image is a dose image converted from the first image, and its pixel values ​​are mapped by the scale curve, directly reflecting the radiation dose deposited by the beam on the film surface. The second image can represent the beam dose distribution of the radiotherapy device in a two-dimensional form, and provide information on the spatial variation of the beam intensity at different positions. For example, Figure 6 Shown is the dose image of the R channel after being mapped by the calibration curve.

[0067] Step S16: determining the beam axis position information in the second image according to the target area carried in the second image; wherein the target area is used to represent the area in the second image that meets a preset dose threshold.

[0068] In this embodiment, the target area is used to represent an area in the second image that meets a preset dose threshold, and the area is used to locate geometric information of the beam axis.

[0069] In this embodiment, the target area may be a set of pixels selected according to a preset dose threshold, and these pixel values ​​need to be greater than or equal to the preset dose threshold. The preset dose threshold may be set based on a reference dose. For example, it may be 50%, 55% or 60% of the reference dose, etc. The reference dose may be the maximum dose value of the beam, or the average dose value of the entire dose image or other statistical values.

[0070] Specifically, the preset dose threshold may be 50% of the maximum dose value in the dose image. Therefore, the target area may be a 50% isodose area. Accordingly, the preset dose threshold may also be 40%, 55% or 60% of the maximum dose value in the dose image, etc. For example, Figure 7 and Figure 8 Shown is a schematic diagram of the 50% isodose area and its minimum circumscribed rectangle.

[0071] It is understood that the shape of the target area can reflect the distribution characteristics of the beam dose on the film surface, and the target area can be circular, Gaussian or irregular. Fig.10 As shown in the figure, specifically, first, the maximum dose in the dose image is taken as the reference dose; second, the reference dose is used to obtain the largest 50% isodose area; then, the contour point set of the 50% isodose area is taken to fit a circle, and the center of the circle is taken as the field center; finally, it is determined whether the difference between the dose value at the field center and the reference dose value is greater than the threshold. If it is greater than the threshold, the dose value at the field center is taken as the reference dose, and the process is repeated. The center of the circle obtained by fitting is the field center.

[0072] Therefore, in this embodiment, the target area can be expressed as a 50% isodose area of ​​the maximum dose value.

[0073] Accordingly, in some embodiments, the target region may also be represented as a 40% isodose region of the maximum dose value. In this embodiment, the screening range may be expanded to cover a larger dose gradient.

[0074] In this embodiment, the beam axis position information in the second image can be determined at one time based on the characteristic axis of the target area. Specifically, first, the second area is determined based on the second image. For example, the second area can be a 50% equal dose area of ​​the maximum dose value. Then, based on the second area, the characteristic axis is determined. For example, the characteristic axis can be the midline of the minimum circumscribed rectangle of the second area. The characteristic axis can be the minimum circumscribed circle of the second area or the axis of symmetry of the minimum circumscribed polygon, etc. Finally, the characteristic axis is used as the beam axis. It can be understood that the 50% equal dose area is usually close to the core area of ​​the beam, which can effectively characterize the main axis distribution of the beam. And the boundary of this area can reflect the half-attenuation area of ​​the beam, which helps to accurately locate the beam axis.

[0075] In this embodiment, the abnormal maximum value that may exist in the second image is also taken into consideration. For example, the abnormal maximum value is free from the edge of the second image, which interferes with the determination of the target area. Therefore, an iterative method can also be used to iteratively update the target area and the characteristic axis to determine the beam axis position information in a more accurate manner.

[0076] Specifically, the iterative method can be as follows:

[0077] Step 1: Initialization phase.

[0078] Step 1.1: Set an initial dose reference value. For example, the initial dose reference value may be the maximum dose value of the pixel points in the second image.

[0079] Step 1.2: Set a dose threshold and a convergence condition. The dose threshold may be 50% of the dose reference value. The convergence condition may be to determine whether the difference is less than the difference threshold.

[0080] Step 2: First round of calculations.

[0081] 2.1: Determine the initial target area

[0082] According to the initial dose reference value, a dose threshold (eg, 50% threshold) is calculated. Pixel points that meet the threshold condition in the second image are extracted to form an initial target area.

[0083] 2.2: Calculate the initial feature axis

[0084] Based on the initial target area, its characteristic axis is determined. For example, its minimum circumscribed rectangle is calculated and the midline of the rectangle is taken as the characteristic axis. Alternatively, based on the minimum circumscribed circle, the diameter of the circle is taken as the characteristic axis.

[0085] 2.3: Update of dose reference values

[0086] On the characteristic axis, the corresponding maximum dose value is calculated as the updated dose reference value.

[0087] 2.4: Determine whether it converges

[0088] Compare the difference between the updated dose reference value and the initial dose reference value. If the difference is less than or equal to the set difference threshold, the iteration ends. If the difference is greater than the difference threshold, the next iteration begins.

[0089] Step 3: Subsequent iterations

[0090] Step 3.1: Iteratively update the target area

[0091] First, the dose threshold is recalculated using the updated dose reference value. Current dose threshold = updated dose reference value × 50%. Then, pixels that meet the new threshold condition are extracted to update the target area.

[0092] Step 3.2: Iteratively update feature axes

[0093] Recalculate the characteristic axis based on the new target area. If the target area changes, calculate the minimum circumscribed rectangle midline or other characteristic axis of the new target area.

[0094] Step 3.3: Iteratively update the dose reference value

[0095] The maximum dose value is calculated on the new characteristic axis and the dose reference value is updated again.

[0096] Step 3.4: Determine whether it converges

[0097] The difference between the current dose reference value and the previous round reference value is compared again. If the difference is less than or equal to the difference threshold, the iteration ends. If the difference is still greater than the difference threshold, return to step 3.1 and continue the iteration.

[0098] It can be understood that in each round of iteration, the target area and characteristic axis are re-determined according to the updated dose reference value, and the deviation is continuously reduced until it converges to a beam axis that meets the accuracy requirements.

[0099] Step S18: Generate a percentage depth dose curve based on the beam axis position information and the second image.

[0100] In this embodiment, the percentage depth dose curve is a curve describing the change of dose value with depth when the beam passes through the medium. It can reflect the dose deposition characteristics of the beam at different depths and is a parameter for evaluating the beam characteristics of the radiotherapy device. For example, Fig. 9 As shown, Fig. 9 In the figure, the X-axis represents the specific depth and the Y-axis represents the percentage of dose.

[0101] In this embodiment, first, the dose distribution data can be intercepted along the beam axis direction according to the beam axis position information (for example, the center line) determined in the previous step. Along the beam axis direction, the corresponding dose values ​​are read point by point from the second image. Each depth position can correspond to a dose value to form a dose distribution on the beam axis. Then, the dose value is standardized. In the extracted dose distribution data, the maximum dose value and its corresponding depth position can be found, and then the dose values ​​of all depth positions are standardized as a percentage relative to the maximum dose value. Next, the depth and dose value pairs are recorded. That is, a set of "depth-relative dose value" data points are generated for drawing a percentage depth dose curve. The depth can represent the penetration distance of the beam from the film surface. The relative dose value can represent the percentage of the dose intensity at the corresponding depth position. Finally, the depth and relative dose value pairs are used to draw the PDD curve.

[0102] In this embodiment, the generating action can be represented as the server automatically generating the percentage depth dose curve by calling tools such as NumPy, Pandas or MATLAB.

[0103] This embodiment effectively solves the problem of insufficient precision in extracting the percentage depth dose (PDD) curve scenario by introducing steps such as generating a dose image (second image) from the first image, extracting the target area, and positioning the beam axis. This embodiment uses the second image to characterize the distribution of dose values ​​of the radiotherapy equipment beam, avoiding the loss of precision caused by directly processing the original image; by extracting and analyzing the target area that meets the preset dose threshold, it ensures that the data used for beam axis positioning is representative and accurate; the PDD curve is generated by combining the beam axis position information with the depth distribution of the dose image, thereby avoiding the error accumulation of manually selecting the beam axis or relying on low-precision methods. While maintaining the integrity of the data processing chain, the overall method greatly improves the accuracy of the PDD curve, solving the technical problem of inaccurate extraction of the PDD curve in related technologies.

[0104] like Figure 3 As shown, in some implementations, the step of generating a corresponding second image based on the first image may include:

[0105] Step S142: for the first image, detecting a film area in the first image; wherein the film area is used to represent an area in the first image where a single film image is located.

[0106] In this embodiment, the object detection model may be used to detect the film area in the first image.

[0107] The target detection model can be a pre-trained target detection model, such as YOLO, FasterR-CNN, or SSD.

[0108] In this embodiment, the film area in the first image can also be detected by using an edge detection algorithm combined with a clustering algorithm. Specifically, first, Gaussian filtering is performed on the first image to reduce the interference of color information. Then, the edge detection algorithm is applied to extract edge information in the image. Next, the clustering algorithm is used to cluster the edge points into multiple film areas. Finally, the minimum circumscribed rectangle or circumscribed polygon is fitted for each cluster to calibrate the boundary of the film.

[0109] In this implementation, the edge detection algorithm may be a Canny edge detection algorithm.

[0110] In this implementation, the edge detection algorithm may be a Sobel edge detection algorithm.

[0111] In this implementation, the edge detection algorithm may also be a Laplacian edge detection algorithm.

[0112] In this embodiment, the clustering algorithm may be a DBSCAN (Density-Based Spatial Clustering of Applications with Noise) algorithm, that is, a density-based clustering algorithm, which can identify clusters of any shape.

[0113] In this implementation, the clustering algorithm may be a K-Means clustering algorithm.

[0114] In this implementation, the clustering algorithm may be a Mean-Shift clustering algorithm.

[0115] In this embodiment, a method based on threshold segmentation can also be used to detect the film area in the first image. For example, the characteristics of image grayscale distribution can be used to set a global or local threshold to separate the film area from the background.

[0116] In this embodiment, the film area in the first image may also be detected by using template matching. For example, a predefined film shape template may be used to slide the matching template in the first image to find the area most similar to the template.

[0117] Step S144: extracting at least one first sub-image from the first image based on the film area;

[0118] In this implementation, the film area may be segmented from the first image based on the film area, thereby obtaining at least one first sub-image.

[0119] Specifically, based on the boundary information of the film area obtained in the previous step, the corresponding area content in the first image can be cropped out as a separate first sub-image. For example, if the boundary is a rectangle, the image is directly cropped using coordinate slicing.

[0120] Step S146: Generate a corresponding second image according to at least one first sub-image.

[0121] In this embodiment, first, pre-processing is performed on the first sub-image to remove unnecessary color information interference. For example, filtering processing can be performed on the first sub-image.

[0122] Then, using a preset mapping relationship between pixel values ​​and dose values ​​(for example, it can be a film scale curve, which is also a pre-calibrated pixel value-dose value relationship curve), the pixel values ​​of the first sub-image are mapped point by point to corresponding dose values ​​to obtain a two-dimensional dose value matrix, in which each matrix element corresponds to a dose value.

[0123] Finally, the dose value matrix is ​​re-encoded into an image format to generate a second image.

[0124] This embodiment solves the image segmentation problem when the scanning device scans multiple films simultaneously by automatically detecting the film area in the first image, extracting the independent first sub-image and generating the corresponding second image. This method significantly improves the efficiency and accuracy of data processing, avoids regional overlap or data loss when scanning multiple films, and ensures that the dose distribution information of each film is fully preserved. At the same time, it provides a clear and reliable data basis for subsequent dose calculation, beam axis positioning and percentage depth dose curve generation.

[0125] In some implementations, the step of detecting a film area in the first image includes:

[0126] Step S1422: Perform grayscale processing on the first image to obtain a processed first image.

[0127] In this embodiment, graying eliminates the interference of color information, so that subsequent processing only focuses on the brightness characteristics of the image, thereby improving the robustness of edge detection and clustering.

[0128] Step S1424: Detect edge information of the processed first image using a preset edge detection algorithm.

[0129] In this embodiment, the edge detection algorithm may be a Canny edge detection algorithm. Specifically, the Canny edge detection algorithm can extract continuous edge contours in an image and suppress noise and pseudo edges through gradient calculation and non-maximum suppression.

[0130] Step S1426: Based on the edge information and a preset clustering algorithm, determine at least one film area in the first image.

[0131] In this embodiment, the input of the preset clustering algorithm is the edge information extracted by edge detection, and the preset clustering algorithm clusters the edge points to automatically identify and calibrate multiple film areas in the first image. The clustering algorithm classifies the edge points belonging to the same film area in the edge information into one category and excludes noise points, thereby determining independent film areas in the first image.

[0132] In this implementation, the preset clustering algorithm may be a density-based clustering method.

[0133] In one possible and specific embodiment, the method may be:

[0134] Step 1: Grayscale the original image to reduce the interference of color channels.

[0135] Step 2: Use the Canny edge detection algorithm to extract edge information in the image, which will be used for subsequent clustering analysis.

[0136] Step 3: Set the distance threshold and minimum number of samples for the DBSCAN algorithm. The distance threshold determines the maximum distance between neighboring points, and the minimum number of samples determines the minimum number of neighboring points required for a point to become a core point.

[0137] Step 4: Run the DBSCAN algorithm to divide the pixels in the image into different clusters according to the set parameters. Each cluster corresponds to a film area.

[0138] Step 5: Remove noise points and small clusters, retaining larger film areas.

[0139] This embodiment effectively improves the accuracy and efficiency of film area detection by performing grayscale processing, edge detection, and determining the film area based on a clustering algorithm on the first image. Grayscale processing simplifies image information, reduces interference from color channels, and provides a clearer image basis for subsequent operations; the edge detection algorithm can accurately extract the boundary features of the film area, and still has strong robustness even in the case of complex backgrounds or blurred boundaries; the area recognition method based on the clustering algorithm does not require a preset number of films or arrangement rules, and can adaptively cluster edge information into independent film areas. This step-by-step processing method not only simplifies the operating process, but also significantly reduces manual intervention, providing an accurate and stable basis for subsequent sub-image extraction and film data processing.

[0140] In some implementations, the step of generating a corresponding second image based on the first image includes:

[0141] Step S147: Detect the first image using a preset edge detection algorithm to obtain at least edge information of the outermost contour of the first image.

[0142] In this implementation, the preset edge detection algorithm may be a Canny edge detection algorithm.

[0143] In this embodiment, the edge information of the outermost contour of the first image can be obtained by a preset edge detection algorithm, and the edge information of the inner contour, the noise edge information, the edge gradient direction information, etc. can also be obtained.

[0144] Step S148: Determine feature point information of the outermost contour based on the edge information of the outermost contour.

[0145] In this embodiment, before step S148, the Douglas-Peucker algorithm may be applied to simplify the contour to reduce the number of contour points, thereby reducing the complexity of subsequent processing.

[0146] In this embodiment, the characteristic point may be an inflection point, that is, a point on the contour where the curvature changes significantly.

[0147] In this embodiment, the feature point may be a corner point, that is, a point with a sharp turning point on the contour.

[0148] In this embodiment, the characteristic point may be the point of maximum curvature, that is, the position where the contour curvature value reaches the local maximum.

[0149] In this embodiment, the feature points may be convex points or concave points, etc.

[0150] In this embodiment, the feature point information may be the position information of the feature point, such as coordinate information.

[0151] In this implementation, the Harris corner detection algorithm may be used to find key points on the contour, and the key points are used as feature points of the outermost contour.

[0152] In this embodiment, a SIFT (Scale-Invariant Feature Transform) feature point detection algorithm may also be used to determine the feature point information of the outermost contour.

[0153] In this implementation, the feature point information of the outermost contour may also be determined using a FAST (Features from Accelerated Segment Test) corner point detection algorithm.

[0154] Step S149: Generate a corresponding minimum bounding rectangle based on the feature point information and obtain the angle between the minimum bounding rectangle and the horizontal plane.

[0155] In this embodiment, the minimum bounding rectangle can be represented as a rectangle containing all feature points, which has the smallest area and can be rotated. The minimum bounding rectangle can tightly wrap the outline and describe the direction and boundary of the shape.

[0156] In this embodiment, the generated action can be represented as the server calling a preset geometric algorithm to generate a minimum circumscribed rectangle. Specifically, first, with the feature point information as input, the convex hull algorithm is applied to preprocess the feature point set, and the outer boundary of the contour is extracted to remove internal redundant points. Then, the rotating rectangle fitting algorithm is used to test all possible rotation angles in turn, calculate the area of ​​the rectangle at all rotation angles, and select the rectangle with the smallest area as the minimum circumscribed rectangle. Finally, the geometric parameters of the rectangle are output, including the coordinates of the four vertices of the rectangle, the coordinates of the center point, the lengths of the major axis and the minor axis, and the angle between the main axis of the rectangle and the horizontal plane.

[0157] In this embodiment, after the corresponding minimum enclosing rectangle is generated, the angle between the minimum enclosing rectangle and the horizontal plane can be calculated. For example, the main axis direction can be calculated by the vertex coordinates of the minimum enclosing rectangle. The main axis is the direction connecting the center of the rectangle and the two end points of the longest side. The angle is then calculated using the cosine value between the main axis vector and the horizontal axis vector.

[0158] Step S1410: Perform rotation correction on the first image according to the angle value to obtain the first image restored to a horizontal state.

[0159] In this embodiment, a rotation matrix may be generated based on the angle value, and an affine transformation may be performed to adjust the image direction with the center of the first image as the rotation center so that the main axis of the minimum circumscribed rectangle is aligned with the horizontal line.

[0160] Step S1411: Based on the first image restored to a horizontal state, generate a corresponding second image.

[0161] In this embodiment, first, pre-processing is performed on the first image restored to a horizontal state to remove unnecessary color information interference. For example, filtering processing can be performed on the first image restored to a horizontal state.

[0162] Then, using a preset mapping relationship between pixel values ​​and dose values ​​(for example, it can be a film scale curve, which is also a pre-calibrated pixel value-dose value relationship curve), the pixel values ​​of the first image restored to the horizontal state are mapped point by point to corresponding dose values ​​to obtain a two-dimensional dose value matrix, in which each matrix element corresponds to a dose value.

[0163] Finally, the dose value matrix is ​​re-encoded into an image format to generate a second image.

[0164] In one possible and specific embodiment, the method may include:

[0165] Step 1: Use the Canny edge detection algorithm to extract the outermost contour of the film.

[0166] Step 2: Apply the Douglas-Peucker algorithm to simplify the contour and reduce the number of contour points to reduce the complexity of subsequent processing.

[0167] Step 3: Use the Harris corner detection algorithm to find the key points on the contour.

[0168] Step 4: Calculate the minimum circumscribed rectangle of these key points and get the angle of the rectangle.

[0169] Step 5: According to the angle of the minimum circumscribed rectangle, the image is rotated and corrected to restore the film to a horizontal state.

[0170] This embodiment detects the edge information of the outermost contour of the first image, combines feature point extraction and calculation of the minimum circumscribed rectangle, accurately obtains the tilt angle of the film area, and uses rotation correction to adjust it to a horizontal state, thereby generating a corresponding second image. This method effectively solves the problem of image tilt caused by manual cropping and film placement errors. Specifically, by extracting the edge information of the outermost contour, the calculation accuracy of the feature points and tilt angles is ensured; the overall tilt angle of the image is quickly determined through the geometric characteristics of the minimum circumscribed rectangle; and through rotation correction, the film image is restored to a horizontal state, providing high-precision and consistent input data for subsequent dose distribution analysis. This embodiment avoids the complexity and errors of the manual correction process, improves correction efficiency and processing accuracy, and is particularly suitable for scenarios where multiple film operations may introduce tilt errors, ensuring the reliability and stability of subsequent analysis results.

[0171] In some implementations, the step of generating a corresponding second image based on the first image may include:

[0172] Based on the first image and a preset mapping relationship between pixel values ​​and dose values, pixel values ​​of at least one color channel in the first image are mapped to dose values.

[0173] In this embodiment, the preset mapping relationship between pixel values ​​and dose values ​​may be a pre-calibrated scale curve reflecting the relationship between pixel values ​​and dose values.

[0174] In this embodiment, the preset mapping relationship between pixel values ​​and dose values ​​may be a lookup table reflecting the relationship between pixel values ​​and dose values. The lookup table may directly map pixel values ​​to dose values.

[0175] In this embodiment, the preset mapping relationship between pixel values ​​and dose values ​​may also be a mapping model based on machine learning.

[0176] In this embodiment, the mapping relationship between pixel value and dose value can be established in advance for the red, green and blue channels, respectively. For example, the scale curves reflecting the relationship between pixel value and dose value can be calibrated in advance for the red, green and blue channels, respectively.

[0177] In this embodiment, the following method may be used to pre-calibrate a scale curve reflecting the relationship between pixel values ​​and dose values.

[0178] First, a series of known doses (e.g., 1 Gy, 2 Gy, 5 Gy, 10 Gy) are applied to the film using a standard radiation source. Then, the film is scanned after each irradiation, and the pixel values ​​(RGB values) of the corresponding color channels are recorded. Next, the corresponding data of the dose values ​​and the pixel values ​​are obtained. Finally, the obtained dose values ​​and pixel values ​​can be fitted into a mathematical function, such as a linear function or a polynomial function, etc.

[0179] Based on the dose values, a corresponding second image of the at least one color channel is generated.

[0180] In this embodiment, a corresponding second image may be generated for each of the three channels, red, green, and blue, or only for the red channel. It is understood that in the dose response characteristics of the film, the relationship between the pixel value and the dose value of the red channel is usually closer to a linear relationship than that of the green and blue channels. The linear relationship is easy to fit, reducing the error caused by the nonlinear transformation.

[0181] This embodiment converts the color channel pixel values ​​in the image into corresponding dose values ​​based on the mapping relationship between the first image and the preset pixel values ​​and dose values, and generates a second image, thereby achieving accurate mapping from image data to physical dose distribution. This method effectively utilizes the color change characteristics of the film and combines it with the pre-calibrated dose curve to automate and standardize the dose value extraction process. Compared with manual measurement or empirical estimation, this method significantly improves the accuracy and reliability of dose distribution, ensures that the second image can truly reflect the beam dose characteristics of the radiotherapy equipment, and provides high-quality basic data for subsequent dose analysis.

[0182] In some embodiments, the step of determining the beam axis position information in the second image according to the first target area carried in the second image includes:

[0183] Step S162: Setting an initial dose reference value. For example, the initial dose reference value may be the maximum dose value of the pixels in the second image.

[0184] Step S164: Based on the initial dose reference value, determine a preset dose threshold and a target area corresponding to the preset dose threshold.

[0185] In this embodiment, the preset dose threshold may be 50% of the initial dose reference value.

[0186] In this embodiment, the target area may be an area consisting of points whose dose values ​​are greater than or equal to a preset dose threshold value among all pixels in the second image. Therefore, when the preset dose threshold value is 50% of the initial dose reference value (maximum dose value), the target area includes all pixels whose dose values ​​are greater than or equal to 50% of the initial dose reference value. The target area may be one or more irregular connected areas, and the specific shape is determined by the dose distribution.

[0187] In this embodiment, each pixel point of the second image can be traversed to determine its dose value, and the points that meet the conditions are marked as part of the target area. Connected area analysis can be performed on the marked points to distinguish different target areas and determine the boundaries of each area.

[0188] Step S166: Determine the corresponding feature axis based on the target area.

[0189] In this implementation, a corresponding minimum circumscribed rectangle may be generated based on the target area, with the midline of the minimum circumscribed rectangle being the feature axis.

[0190] In this implementation, a corresponding minimum circumscribed circle may be generated based on the target area, with the symmetry axis of the minimum circumscribed circle being the characteristic axis.

[0191] In this embodiment, PCA can be used to perform principal direction analysis on the point set of the target area to extract the direction of the first principal component. The direction of the first principal component is used as the characteristic axis, which represents the principal direction of the point distribution in the target area.

[0192] In this embodiment, the centroid of the mass distribution of the target area can be calculated according to the dose value distribution of the target area, and the longest direction from the centroid to the boundary point of the target area is used as the characteristic axis.

[0193] Step S168: Taking the maximum dose value on the characteristic axis as the updated dose reference value.

[0194] Step S1610: Determine whether the difference between the updated dose reference value and the initial dose reference value is greater than a difference threshold.

[0195] In this embodiment, the difference threshold may be an absolute difference threshold, for example, 0.5 Gy.

[0196] In this implementation, the difference threshold may be a relative difference threshold.

[0197] Step S1612: When the difference is less than or equal to the difference threshold, the position information of the characteristic axis is used as the position information of the beam axis.

[0198] Step S1614: when the difference is greater than the difference threshold, iterate the above steps until the difference is less than or equal to the difference threshold, and use the position information of the corresponding characteristic axis of the current target area as the position information of the beam axis.

[0199] In this embodiment, when the difference is greater than the difference threshold, the dose reference value obtained in step S168 is brought into step S164 to perform iteration, that is, based on the dose reference value obtained in step S168, the preset dose threshold of a new round and the target area of ​​a new round are determined. Then, based on the target area of ​​the new round, the characteristic axis of the new round is determined. Next, the maximum dose value on the characteristic axis of the new round is used as the updated dose reference value. Finally, it is determined whether the difference between the current (that is, the new round) dose reference value and the dose reference value of the previous round (that is, the dose reference value in step S168) is greater than the difference threshold. If it is less than or equal to the difference threshold, the position information of the characteristic axis of the new round is used as the position information of the beam axis. If it is greater than the difference threshold, another round of iteration is performed until the difference is less than or equal to the difference threshold.

[0200] In this embodiment, firstly, by setting the initial dose reference value and dynamically adjusting the target area, combined with the update of the maximum dose value of the characteristic axis and the convergence judgment, the beam axis is gradually approached, which significantly improves the accuracy of beam axis positioning. Secondly, by utilizing the geometric characteristics of the characteristic axis (for example, the midline of the minimum circumscribed rectangle), it is possible to adapt to different dose distribution forms, and the beam axis information can still be stably extracted even when the target area is irregular or the noise interference is large. In addition, the dynamic update of the dose value and the difference threshold judgment are used to avoid the error amplification caused by local abnormal dose values ​​or image noise, making the algorithm more robust to data fluctuations and abnormal points. Finally, through the iterative convergence algorithm, the precise positioning of the beam axis can be completed without human intervention, reducing human errors and improving efficiency and consistency.

[0201] like Figure 4 As shown, in some embodiments, after the step of generating a percentage depth dose curve based on the beam axis position information and the second image, the method further includes:

[0202] Step S110: Based on the target area carried in the second image, extract a contour point set of the target area.

[0203] In this embodiment, the contour point set of the 50% isodose region obtained in the previous step can be extracted. Specifically, the contour of the region can be detected by an edge detection algorithm. For example, it can be a Canny edge detection algorithm. Then, the contour point set is further accurately obtained using a contour extraction algorithm.

[0204] Step S112: Perform straight line fitting on the contour point set using Hough transform to generate multiple straight lines.

[0205] Step S114: traverse the plurality of straight lines, calculate the number of intersections between each straight line and the contour point set, and retain the straight line that intersects the most with the contour point set.

[0206] Step S116: Calculate the imaging angle based on the slope of the retained straight line.

[0207] Step S118: Based on the imaging angle and the angle of the preset beam limiting device, the difference between the two is calculated to obtain an imaging angle error; wherein the imaging angle error is used to evaluate the credibility of the percentage depth dose curve.

[0208] In this embodiment, the light beam limiting device may be a light limiting cylinder.

[0209] In this embodiment, a contour point set is extracted based on the target area of ​​the second image, a straight line is fitted using the Hough transform, and the straight line that intersects the contour point set the most is selected, and the imaging angle is further calculated, and the angle is compared with the angle of the preset beam limiting device (light limiting tube) (specifically, Fig.11 and Fig.12 The method quantifies the imaging angle error between the two to evaluate the credibility of the PDD curve. This method effectively solves the problem of imaging deviation caused by the inconsistency between the film cutting angle and the light-limiting tube angle. By quantifying the imaging angle error, the possible deviation range of the PDD curve is clarified, providing an objective credibility reference indicator for the experimenter. This method achieves accurate quantification of imaging errors, helps to improve the scientificity and reliability of PDD curve evaluation, and provides a more accurate basis for radiotherapy data analysis.

[0210] According to an embodiment of the present invention, an image processing device is provided. Fig.13 , the device may include:

[0211] A receiving module, which is used to receive a first image; wherein the first image is an image obtained by scanning at least one film, and the film is a film irradiated by a radiotherapy device;

[0212] A first generating module, which is used to generate a corresponding second image based on the first image; wherein the second image is a dose image used to characterize the distribution of beam dose values ​​of the radiotherapy device;

[0213] A determination module, which is used to determine the beam axis position information in the second image according to the target area carried in the second image; wherein the target area is used to represent the area in the second image that meets a preset dose threshold;

[0214] The second generating module is used to generate a percentage depth dose curve based on the beam axis position information and the second image.

[0215] According to an embodiment of the present invention, an electronic device is provided. Fig.14 The electronic device in this embodiment may include one or more of the following components: a processor, a network interface, a memory, a non-volatile memory, and one or more applications, wherein the one or more applications may be stored in the non-volatile memory and configured to be executed by one or more processors, and the one or more programs are configured to execute the method described in the aforementioned method embodiment.

[0216] According to an embodiment of the present invention, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a computer, the computer executes the method described in any of the above embodiments.

[0217] According to an embodiment of the present invention, a computer program product including instructions is also provided. When the instructions are executed by a computer, the computer executes a method in any one of the above embodiments.

[0218] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0219] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment will not be described in detail here.

[0220] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0221] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0222] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. An image processing method, characterized in that: The method comprises: Receive a first image; wherein the first image is an image obtained by scanning at least one film, and the film is a film irradiated by a radiotherapy device; Based on the first image, a corresponding second image is generated; wherein the second image is a dose image used to characterize the distribution of beam dose values ​​of the radiotherapy device; Determine the beam axis position information in the second image according to the target area carried in the second image; wherein the target area is used to represent the area in the second image that meets a preset dose threshold; A percentage depth dose curve is generated based on the beam axis position information and the second image.

2. The method according to claim 1, characterized in that The step of generating a corresponding second image based on the first image comprises: For the first image, detecting a film area in the first image; wherein the film area is used to represent an area in the first image where a single film image is located; extracting at least one first sub-image from the first image based on the film area; Based on at least one first sub-image, a corresponding second image is generated.

3. The method according to claim 2, characterized in that The step of detecting the film area in the first image comprises: Performing grayscale processing on the first image to obtain a processed first image; Detecting edge information of the processed first image using a preset edge detection algorithm; At least one film region in the first image is determined based on the edge information and a preset clustering algorithm.

4. The method according to claim 1, characterized in that The step of generating a corresponding second image based on the first image comprises: Detecting the first image using a preset edge detection algorithm to obtain at least edge information of the outermost contour of the first image; Determining feature point information of the outermost contour based on edge information of the outermost contour; Generate a corresponding minimum circumscribed rectangle according to the feature point information and obtain an angle value between the minimum circumscribed rectangle and a horizontal plane; Performing rotation correction on the first image according to the angle value to obtain the first image restored to a horizontal state; Based on the first image restored to a horizontal state, a corresponding second image is generated.

5. The method according to claim 1, characterized in that The step of generating a corresponding second image based on the first image comprises: Based on the first image and a preset mapping relationship between pixel values ​​and dose values, mapping pixel values ​​of at least one color channel in the first image to dose values; Based on the dose values, a corresponding second image of the at least one color channel is generated.

6. The method according to claim 1, characterized in that The step of determining the beam axis position information in the second image according to the first target area carried in the second image comprises: Set initial dose reference value; Based on the initial dose reference value, determining a preset dose threshold and a target area corresponding to the preset dose threshold; According to the target area, determining a corresponding characteristic axis; Taking the maximum dose value on the characteristic axis as the updated dose reference value; Determining whether the difference between the updated dose reference value and the initial dose reference value is greater than a difference threshold; When the difference is less than or equal to the difference threshold, taking the position information of the characteristic axis as the position information of the beam axis; When the difference is greater than the difference threshold, the above steps are iterated until the difference is less than or equal to the difference threshold, and the position information of the corresponding characteristic axis of the current target area is used as the position information of the beam axis.

7. The method according to claim 6, characterized in that After the step of generating a percentage depth dose curve based on the beam axis position information and the second image, the method further comprises: Based on the target area carried in the second image, extracting a contour point set of the target area; Performing straight line fitting on the contour point set using Hough transform to generate multiple straight lines; Traversing the plurality of straight lines, calculating the number of intersections between each straight line and the contour point set, and retaining the straight line that intersects the most with the contour point set; calculating an imaging angle based on the slope of the retained straight line; Based on the imaging angle and the angle of the preset beam limiting device, the difference between the two is calculated to obtain an imaging angle error; wherein the imaging angle error is used to evaluate the credibility of the percentage depth dose curve.

8. An image processing device, characterized in that: The device comprises: A receiving module, which is used to receive a first image; wherein the first image is an image obtained by scanning at least one film, and the film is a film irradiated by a radiotherapy device; A first generating module, which is used to generate a corresponding second image based on the first image; wherein the second image is a dose image used to characterize the distribution of beam dose values ​​of the radiotherapy device; A determination module, which is used to determine the beam axis position information in the second image according to the target area carried in the second image; wherein the target area is used to represent the area in the second image that meets a preset dose threshold; The second generating module is used to generate a percentage depth dose curve based on the beam axis position information and the second image.

9. An electronic device, characterized in that: include: a memory, and one or more processors communicatively coupled to the memory; Instructions executable by the one or more processors are stored in the memory. The instructions are executed by the one or more processors to enable the one or more processors to implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.