Scanning magnet beam calibration method and related equipment
By employing a scanning magnet calibration method using feature point grids and bilinear interpolation algorithms in the particle radiotherapy system, the problems of time-consuming and uneven accuracy in scanning magnet calibration have been solved, achieving high-precision and rapid beam positioning across the entire field, and improving the reliability and adaptability of radiotherapy equipment.
Patent Information
- Application Number
- CN202511592546.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-03
- Publication Date
- 2026-02-03
AI Technical Summary
Existing scanning magnet calibration methods rely on point-by-point measurements, which are time-consuming and make it difficult to guarantee consistent accuracy across the entire field. This results in inaccurate irradiation accuracy in particle radiotherapy systems, affecting treatment efficacy and safety.
By employing a method that combines a small number of precise measurements with intelligent interpolation calculations, a regular grid is constructed by selecting feature points within the target firing field. The control current is calculated using a bilinear interpolation algorithm, and combined with a linear calibration model and iterative correction, high-precision calibration across the entire field is achieved.
It achieves sub-millimeter positioning accuracy across the entire field, shortens calibration time, improves the clinical throughput and availability of radiotherapy equipment, ensures treatment safety and accuracy consistency, and adapts to changes in different equipment and conditions.
Smart Images

Figure CN121454583A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of radiotherapy technology, and in particular to a scanning magnet beam calibration method and related equipment. Background Technology
[0002] In particle radiotherapy systems, the scanning magnet, as a key component of the beam delivery system, utilizes the physical property of charged particles being deflected in a magnetic field to achieve precise control of the beam's position within the radiation field plane. A scanning magnet typically comprises two sets of coils arranged perpendicularly to each other. By adjusting the excitation current of each set of coils, corresponding magnetic field components can be generated in the X and Y directions, thereby deflecting the beam and positioning it to any preset target point within the radiation field. However, due to manufacturing limitations, certain tolerances are unavoidable in the actual manufacturing of scanning magnets. Furthermore, differences exist between different radiotherapy devices in terms of mechanical installation and electromagnetic characteristics. These factors collectively lead to deviations between the actual magnetic field response of the scanning magnet and the ideal theoretical model. Specifically, after inputting a set of set current values (Ix, Iy), there is an error between the actual position (X, Y) reached by the beam and the theoretically expected position. If this deviation is not effectively corrected, it will directly affect the irradiation accuracy of radiotherapy, leading to substandard dose distribution in the target area or, in severe cases, unnecessary irradiation of surrounding normal tissues, affecting treatment efficacy and safety.
[0003] Currently, commonly used scanning magnet calibration methods typically rely on point-by-point measurement and correction of a limited number of locations, a process that is cumbersome and time-consuming. While some methods achieve high accuracy at a small number of points, they struggle to guarantee consistent accuracy across the entire radiation field, easily leading to calibration blind spots or uneven accuracy distribution. Therefore, achieving rapid, accurate, and full-field coverage scanning magnet calibration while ensuring calibration accuracy has become a pressing issue for improving the precision of particle radiotherapy systems. Summary of the Invention
[0004] Based on the above problems, the purpose of this invention is to provide a scanning magnet beam calibration method and related equipment, which can quickly achieve high-precision and high-uniformity beam calibration of the scanning magnet across the entire field by combining a small number of precise measurements with intelligent interpolation calculations.
[0005] In a first aspect, the present invention provides a method for calibrating a scanning magnet beam, the method comprising: Multiple feature points are selected within the target firing field, and the feature points together form a regular grid covering the firing field; the regular grid includes at least one grid cell; For each feature point, obtain the current value pair for that feature point that makes the deviation between the actual beam position and the theoretical position within a preset range; For any target point within the firing field, the control current of the target point is calculated using a bilinear interpolation algorithm based on the current value pairs of the feature points.
[0006] Preferably, the regular grid comprises M rows × N columns of feature points, where M and N are both integers greater than or equal to 3; the feature points serve as grid vertices, dividing the field of fire into multiple consecutive rectangular grid units.
[0007] Preferably, the regular grid is a rectangular grid with an equal center as the origin.
[0008] Preferably, obtaining the current value pair that ensures the deviation between the actual and theoretical beam positions is within a preset range includes: The power supply current applied to the two sets of coils of the scanning magnet is iteratively adjusted, and the actual position fed back by the beam detector is obtained in real time until the deviation between the actual position and the theoretical position is less than the preset deviation threshold. At this time, the corresponding power supply current value is recorded as the current value pair of the feature point; the beam detector is located in the isocenter plane.
[0009] Preferably, the step of calculating the control current of the target point using a bilinear interpolation algorithm based on the current value pairs of the feature points includes: Based on the coordinates of the target point, determine the grid cell to which it belongs in the regular grid; wherein, the grid cell is a rectangular area defined by four adjacent feature points; The bilinear interpolation calculation is performed based on the current value pairs of the vertex feature points of the mesh cells.
[0010] Preferably, the method further includes: Based on the theoretical positions of the feature points and the corresponding current value pairs, linear calibration models are established for the X-axis and Y-axis coils of the scanning magnet, respectively. The current value of each feature point is substituted into the corresponding linear calibration model for verification. If the deviation between the measured current value of any feature point and the current value calculated by the linear calibration model based on its theoretical position exceeds a preset current deviation threshold, then the current value pair of that feature point is reacquired.
[0011] Preferably, after calculating the control current for the entire field, i.e., the target firing range, using the bilinear interpolation algorithm, the following verification steps are performed: The beam is controlled to scan along one or more theoretical diagonal paths of the field of view; the path is composed of multiple non-featured diagonal verification points; the actual position of the verification point is obtained, and the maximum and / or average deviation between the actual position and the theoretical position among all diagonal verification points is used as the evaluation index. And / or, The controlled beam sequentially irradiates a uniform verification array covering the radiation field; the array consists of multiple non-feature points; the actual positions of the non-feature points are obtained, and the maximum deviation between the actual and theoretical positions of all non-feature points and / or the maximum deviation between the distance between any two adjacent actual positions and the theoretical distance are used as evaluation indicators.
[0012] Preferably, when any of the evaluation indicators exceeds its corresponding preset threshold, a correction process is triggered. The correction process executes a corresponding correction strategy based on the evaluation indicator that exceeds the preset threshold, including: When the maximum deviation between the actual position and the theoretical position of the verification point exceeds its preset threshold, a new feature point is added in the grid cell corresponding to the verification point with the largest position deviation, and the current value pair of the new feature point is reacquired. When the maximum deviation between the actual location of two adjacent verification points and the theoretical distance exceeds its preset threshold, a new feature point is added in the regular grid within the rectangular area formed by the two adjacent verification points as geometric diagonals, and the current value pair of the new feature point is reacquired. When the average deviation of multiple verification points exceeds a preset threshold, the actual location data and theoretical location of all verification points or multiple randomly sampled verification points are used as new data points to refit the linear calibration model.
[0013] In a second aspect, the present invention provides a scanning magnet beam calibration device, the device comprising: The feature point selection module is used to select multiple feature points within the target firing field, the feature points collectively forming a regular grid covering the firing field; the regular grid includes at least one grid cell; The feature point current value acquisition module acquires, for each feature point, the current value pair of that feature point that makes the deviation between the actual position and the theoretical position of the beam within a preset range. The calibration module is used to calculate the control current of any target point within the firing field using a bilinear interpolation algorithm based on the current value pairs of the feature points.
[0014] Thirdly, the present invention provides a radiotherapy system, comprising: The scanning magnet beam calibration device described in this embodiment of the invention.
[0015] Fourthly, the present invention provides an electronic device, the electronic device including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of any of the methods of the present invention or the functions of the apparatus of the present invention.
[0016] Fifthly, the present invention provides a computer-readable storage medium storing computer instructions, wherein when a computer reads the computer instructions, the computer executes the steps of any of the methods described in the present invention.
[0017] Compared with existing technologies, the beneficial effects of this invention include at least the following: This invention employs a hierarchical strategy of precise feature point calibration and full-field model interpolation coverage. By achieving extremely high local accuracy at a limited number of feature points and utilizing a bilinear interpolation algorithm for patch correction, it effectively overcomes the inherent nonlinearity and cross-coupling effects of scanning magnets, solving the problem of uneven calibration accuracy in edge and central regions in traditional methods. This ensures that any point within the entire radiation field achieves sub-millimeter-level positioning accuracy. Through closed-loop calibration of a small number of feature points combined with efficient mathematical interpolation, it replaces the traditional cumbersome point-by-point measurement and correction process, significantly reducing calibration time from several hours and enabling rapid and frequent equipment calibration and verification, greatly improving the clinical throughput and availability of radiotherapy equipment. This invention, through linear model verification, is independent of ideal magnet theoretical models and can automatically compensate for the unique manufacturing tolerances, installation errors, and magnetic field nonlinear distortions of each device. It exhibits strong adaptability and fault tolerance for different types of scanning magnets and changing operating states, ensuring the consistency and reliability of calibration results across different clinical centers and different devices. By scanning independent paths such as diagonals and uniform dot matrix, the accuracy of the entire field of view is objectively verified through data-driven methods. Based on the evaluation indicators that exceed the limits, targeted correction strategies can be intelligently triggered, providing full-process protection for treatment safety from initial calibration and online verification to automatic optimization, thus raising the system reliability to a new level. Attached Figure Description
[0018] Figure 1 This is a schematic diagram of the scanning magnet beam calibration method according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the scanning magnet beam calibration device according to an embodiment of the present invention; Figure 3 This is a schematic diagram of the scanning magnet, beam, and beam detector in an embodiment of the present invention; Figure 4 This is a schematic diagram of the beam spot position detected by the beam detector in an embodiment of the present invention. Detailed Implementation
[0019] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein; rather, they are provided to make the invention more comprehensive and complete, and to fully convey the concept of the exemplary embodiments to those skilled in the art. The same reference numerals in the drawings denote the same or similar structures, and therefore repeated descriptions of them will be omitted.
[0020] The terms used to express position and direction in this invention are illustrated with reference to the accompanying drawings, but changes can be made as needed, and all such changes are included within the scope of protection of this invention.
[0021] Example 1: This example provides a scanning magnet beam calibration method, the method comprising: Multiple feature points are selected within the target firing field, and the feature points together form a regular grid covering the firing field; the regular grid includes at least one grid cell; For each feature point, obtain the current value pair for that feature point that makes the deviation between the actual beam position and the theoretical position within a preset range; For any target point within the firing field, the control current of the target point is calculated using a bilinear interpolation algorithm based on the current value pairs of the feature points.
[0022] The working principle of the above technical solution is as follows: First, feature points that define the contour and internal region of the target radiation field are selected. These feature points form a regular grid (e.g., the simplest 2x2 grid contains four corner points). Then, for each feature point, the beam position and the excitation current pair (Ix, Iy) of the scanning magnet at that position are monitored in real time. The target radiation field is the physical planar area that needs to be covered by the scanning beam, defined in the beam delivery system according to the shape and size of the patient's tumor target area.
[0023] In actual treatment, when it is necessary to guide the beam to a target location that is not a feature point within the radiation field, spatial interpolation calculations are performed using data from the calibrated feature points. Specifically, firstly, the grid cell containing the target point is located, and the precise current value pairs of the four vertices of that cell (i.e., the four neighboring feature points) are obtained. Then, a bilinear interpolation algorithm is used to calculate the required control currents in the X and Y directions based on the relative coordinates of the target point within this grid cell.
[0024] The working principle of the above technical solution is as follows: It achieves extremely high local accuracy on a small number of feature points, and then smoothly extends the accuracy to the entire firing field through bilinear interpolation, effectively solving the problem of uneven accuracy across the entire field in traditional methods and ensuring the irradiation accuracy at any position within the target area.
[0025] Since it eliminates the need for time-consuming and precise calibration of hundreds or thousands of points within the radiation field, only a limited number of feature points need to be finely adjusted, thus greatly shortening the calibration time and improving the efficiency and availability of radiotherapy equipment.
[0026] This method does not rely on an absolutely ideal linear model of the scanning magnet. Its interpolation algorithm can automatically compensate for nonlinear deviations caused by factors such as manufacturing tolerances and electromagnetic saturation. Therefore, it has good adaptability and robustness to different equipment and different field sizes.
[0027] In one possible implementation, the feature points include at least the four corner points of the shooting field.
[0028] In one possible implementation, the regular grid comprises M rows × N columns of feature points, where M and N are both integers greater than or equal to 3; the feature points serve as grid vertices, dividing the field of view into multiple consecutive rectangular grid cells.
[0029] In one possible implementation, the regular grid is a rectangular grid with an isocentric origin.
[0030] When both M and N are not less than 3, it means that there are at least three reference points in the X and Y directions of the radiation field, ensuring that the entire radiation field is divided into multiple (at least 2x2=4) continuous rectangular grid cells. Within each grid cell, the nonlinear variation of the scanning magnetic field is restricted to a very small range. The subsequent bilinear interpolation algorithm is then performed within the local region formed by these four adjacent, precisely calibrated feature points (i.e., grid vertices). This approach is equivalent to using multiple simple local linear models to infinitely approximate a complex global nonlinear system, thereby greatly improving the fitting accuracy of the calibration model across the entire radiation field and effectively correcting nonlinear distortions of the magnetic field (such as pincushion or barrel distortion).
[0031] The core of the rectangular grid with the isocenter as its origin is "precise coordinate system alignment." In particle radiotherapy systems, the mechanical isocenter of the treatment room serves as the common spatial reference for patient positioning, image guidance, and beam delivery. Aligning the origin of the regular grid with the isocenter means unifying the coordinate system used for calibration with the coordinate system relied upon for clinical treatment. This establishes a direct and offset-free correspondence between the current commands (Ix, Iy) of the scanning magnet and the physical position (X, Y) of the beam within the patient's target area. Regardless of where the beam needs to be directed within the radiation field, its coordinates are absolute coordinates with the isocenter as the reference origin, avoiding systematic errors caused by misaligned coordinate systems.
[0032] In one possible implementation, acquiring a pair of current values that ensures the deviation between the actual and theoretical beam positions is within a preset range includes: Iteratively adjust the power supply current values applied to the coils of two different directions of the scanning magnet, and obtain the actual position feedback by the beam detector in real time until the deviation between the actual position and the theoretical position is less than the preset deviation threshold. At this time, record the corresponding power supply current value as the current value pair of the feature point; the beam detector is located on the isocenter plane; wherein, different directions include the X direction and the Y direction; the current values of the two directions are Ix and Iy respectively, and Ix and Iy form a set of current value pairs.
[0033] Parameter Figure 3 And Figure 4 In a specific implementation process, place the beam detector on the isocenter plane to detect the actual position of the beam (such as Figure 4 the position of the black dot on the detector in a) Apply a set of power supply current values (Ix, Iy) to the scanning magnet; b) Obtain the actual position of the beam through the beam detector located on the isocenter plane; c) Calculate the deviation between the actual position and the theoretical position; d) If the deviation is greater than or equal to the preset deviation threshold, adjust the power supply current values (Ix, Iy) and repeat steps a) to c); wherein, the preset deviation threshold can be 0.1 mm; e) If the deviation is less than the preset deviation threshold, determine the current power supply current values (Ix, Iy) as the current value pair of this feature point.
[0034] The effects of the above technical solutions are as follows: By directly measuring and correcting the actual position of the beam, which is the ultimate goal, the comprehensive deviation caused by all factors such as the manufacturing tolerance of the scanning magnet, the magnetic field nonlinearity, and the installation error is eliminated at the source; the finally obtained current value pair is the true value verified by practice, laying a solid and reliable data foundation for subsequent full-field interpolation. Through the forced convergence of the iterative algorithm, the calibration accuracy of each feature point has reached the ultra-high requirements of clinical treatment; the whole process is automatically completed, avoiding the subjectivity and instability brought by manual operation. It not only greatly improves the calibration efficiency, but also ensures the high consistency of the calibration process of all feature points with the standard, eliminating the errors introduced by individual differences of operators; this closed-loop system does not depend on a perfect initial theoretical model. Even if the initial current value differs greatly from the true value, the iterative algorithm can gradually guide the beam to the target point through continuous feedback, showing good robustness and reliability.
[0035] In a possible implementation manner, calculating the control current of the target point through the bilinear interpolation algorithm according to the current value pair of the feature point includes: Based on the coordinates of the target point P, determine the grid cell to which it belongs in the regular grid; wherein, the grid cell is a rectangular region defined by four adjacent feature points Q11=(x1,y1), Q12=(x1,y2), Q21=(x2,y1), and Q22=(x2,y2), and satisfies x1≤xp≤x2, y1≤yp≤y2; xp,yp are the coordinates of the target point P; Based on the current value pairs of the four vertex feature points, the X-direction control current Ix and Y-direction control current Iy of the target point are calculated respectively using a bilinear interpolation algorithm.
[0036] The bilinear interpolation formula is: I(P)=[(x2-xp)(y2-yp)*I(Q11)+(xp-x1)(y2-yp)*I(Q21)+(x2-xp)(yp-y1)*I(Q12)+(xp-x1)(yp-y1)*I(Q22)] / [(x2-x1)(y2-y1)] Where P(xp,yp) is the target point, Q11=(x1,y1), Q12=(x1,y2), Q21=(x2,y1), Q22=(x2,y2) are the four vertices of the grid cell, and I(Q11), I(Q12), I(Q21), I(Q22) are the current values corresponding to the vertices.
[0037] In the specific implementation, for any target point P(xp,yp) within the firing field, the required control current is calculated through the following steps: Establish a planar coordinate system with the isocenter (0,0) as the origin; Based on the coordinates of the target point P, determine the rectangular grid cell in which it resides; this cell consists of four adjacent, precisely labeled feature points as vertices, denoted as: The top left vertex Q11 = (x1, y1), the bottom left vertex Q12 = (x1, y2), the top right vertex Q21 = (x2, y1), and the bottom right vertex Q22 = (x2, y2); and satisfy x1 ≤ xp ≤ x2, y1 ≤ yp ≤ y2; The above formulas need to be applied to the current Ix of the X-direction coil and the current Iy of the Y-direction coil, respectively; (x1,y1) and (x2,y2) are the boundary coordinates of the grid cells.
[0038] First, perform two linear interpolations in the X direction, and then perform one linear interpolation in the Y direction. The final result is equivalent to a hyperbolic paraboloid, which can smoothly fit the current changes between the four vertices.
[0039] The calculated current pair (Ix, Iy) is output as a control command to the power supply system of the scanning magnet, which can accurately guide the beam to the target point P.
[0040] This algorithm allows for high-precision calibration of only a limited number of grid vertices, enabling the interpolation calculation of the optimal control current at any point within a grid cell. This significantly improves calibration efficiency while ensuring overall calibration accuracy.
[0041] The effects of the above technical solution are as follows: By performing high-precision closed-loop calibration on only the vertices (feature points) of a finite grid, the accuracy can be smoothly transferred to the entire firing field through rigorous mathematical interpolation. This greatly reduces the number of time-consuming precision calibration operations and improves calibration efficiency by an order of magnitude while ensuring overall field accuracy.
[0042] The bilinear interpolation algorithm constructs a hyperbolic parabolic response model within each grid cell, which can accurately fit the nonlinear magnetic field changes (such as pincushion or barrel distortion) that occur when scanning magnets in actual operation. This overcomes the shortcomings of simple linear models in terms of uneven accuracy across the entire field, ensuring that the beam positioning accuracy remains at a consistently high level, whether in the center or edge regions of the beam field.
[0043] In one possible implementation, the method further includes: Based on the theoretical positions of the feature points and the corresponding current value pairs, linear calibration models are established for the X-axis and Y-axis coils of the scanning magnet, respectively. The current value of each feature point is substituted into the corresponding linear calibration model for verification. If the deviation between the measured current value of any feature point and the current value calculated by the linear calibration model based on its theoretical position exceeds a preset current deviation threshold, then the current value pair of that feature point is reacquired.
[0044] In one possible implementation, establishing the linear calibration model for the scanning magnet includes: Linear calibration models are established for the X-axis and Y-axis coils of the scanning magnet, respectively; The linear calibration model is as follows: I = Slope * P + Offset Where I is the current value after iterative adjustment, Slope is the slope, Offset is the offset; P is the theoretical position coordinate; the X-direction coil model is based on the theoretical X-direction position of each feature point and the Ix current value, and obtains the slope Slope_x and offset Offset_x through linear fitting; the Y-direction coil model is based on the theoretical Y-direction position of each feature point and the Iy current value, and obtains the slope Slope_y and offset Offset_y through linear fitting.
[0045] The working principle of the above technical solution is as follows: For the X-direction: using the theoretical X-coordinates of each feature point as the independent variable P and the corresponding precise X-direction current Ix (the iteratively adjusted current) as the dependent variable I, the global slope Slope_x and offset Offset_x are calculated using linear fitting algorithms such as the least squares method.
[0046] For the Y direction: Similarly, by fitting the theoretical Y coordinates and the precise Y-direction current Iy, we can obtain Slope_y and Offset_y.
[0047] Substitute the theoretical location of each feature point into its corresponding linear model to calculate a model-predicted current value.
[0048] Compare this predicted value with the accurate measured current value obtained through the time-consuming and labor-intensive closed-loop calibration.
[0049] If the deviation between the two current values at a certain feature point exceeds the preset current deviation threshold, it indicates that the calibration data at that point may be abnormal (for example, due to unstable beam current state, instantaneous detector error, or external interference). In this case, the recalibration of the abnormal point will be automatically triggered to ensure that the data of each feature point used for full-field bilinear interpolation is reliable and consistent.
[0050] The effects of the above technical solution are as follows: The linear model provides a fast and automated method for checking the reasonableness of data, which can effectively identify and filter out outliers or bad points in the calibration process, prevent the calibration error of individual points from polluting the entire interpolation dataset, and improve the reliability of the final full-field calibration results from the source.
[0051] This step adds a fault-tolerant layer to the high-precision calibration system. Even if unexpected errors occur during the initial calibration of certain feature points, the system can automatically detect and initiate a repair process, reducing the stringent requirement for the calibration process to succeed on the first attempt and improving the stability and automation of the method.
[0052] The established linear model parameters (Slope and Offset) can themselves serve as macroscopic indicators of the scanning magnet's performance. By observing the differences between these parameters and theoretical values, or their variations during multiple calibrations, engineers can qualitatively assess the magnet's health and system stability, providing a reference for equipment maintenance.
[0053] In one possible implementation, the current deviation threshold is determined based on the control accuracy of the scanning magnet power supply and / or the fitting residual of the linear calibration model.
[0054] If the current value deviation of the same feature point still exceeds the preset current threshold after a predetermined number of remeasurements and acquisitions, a new feature point will be automatically added within a preset range around the feature point, and the step of acquiring the current value pair will be executed to expand the regular grid.
[0055] The current deviation threshold is not set as an arbitrary empirical value, but is based on a deep understanding of the inherent performance of the system.
[0056] First, consider control accuracy: the threshold must be greater than the current control accuracy and noise level of the scanning magnet power supply itself. For example, if the minimum stable adjustment step or fluctuation range of the power supply is ±0.01A, then the threshold should be greater than this value to avoid misjudging system noise as calibration error.
[0057] Secondly, consider model error: the threshold should refer to the fitting residuals of the linear calibration model. The fitting residuals reflect the average deviation of all data points from the global linear trend; a reasonable threshold should match these residuals to sensitively capture outliers that significantly deviate from the overall trend.
[0058] The current deviation threshold ensures that the threshold is neither too sensitive (leading to false alarms) nor too lenient (leading to missed alarms), making it a scientific and objective judgment criterion.
[0059] When a feature point fails to converge to an acceptable threshold after repeated calibrations, it is diagnosed as having a persistent problem. This usually suggests that the local magnetic field at that point may have significant nonlinear distortion or interference, to the point that a single current value cannot be consistent between the global linear model and the precise local location.
[0060] At this point, instead of unnecessary retries, an adaptive mesh optimization mechanism is activated. New feature points are intelligently added around the anomaly. The underlying logic of this operation is that by increasing the sampling density of the local region, a large, difficult-to-handle mesh cell is divided into multiple smaller sub-mesh cells with more linear magnetic field responses. Under the new, finer mesh, the bilinear interpolation algorithm can more accurately describe and compensate for complex magnetic field variations within these smaller regions, thereby bypassing or taming the local nonlinear region.
[0061] In one possible implementation, prior to performing bilinear interpolation calculations, a grid cell evaluation and pre-optimization step is included, comprising: For each grid cell in the regular grid, calculate the current gradient at its four vertices; include: Gradient of current in the X direction ; Gradient of current in the X direction in the Y direction ; Gradient of current in the Y direction in the X direction ; Gradient of current in the Y direction ; If any gradient value exceeds a preset gradient threshold, the grid cell is marked as a nonlinear cell. For mesh elements marked as nonlinear, perform at least one of the following operations: Check points are added inside to generate sub-grids, and subsequent interpolation calculations will be based on these sub-grids. Establish a compensation function for this grid cell.
[0062] In one possible implementation, the compensation function is configured such that, for any target point falling into the unit, after calculating its initial current value through bilinear interpolation, the compensation function is called to calculate the compensation amount, and the initial current value is corrected to obtain the final control current.
[0063] The compensation function is a functional relationship determined by the second-order gradient of the current in the grid cell and the relative position of the target point within the cell.
[0064] Taking the X-direction current Ix as an example, the compensation amount is:
[0065] For the X-direction compensation term, k is the empirical gain coefficient obtained by fitting experimental data; , The gradient is second-order and can be estimated using the current values at the grid vertices. , This represents the coordinate difference between the target point and the center point of the grid.
[0066] The second-order gradient reflects the curvature of the current change, and this compensation term can effectively model and correct the nonlinear response within the mesh cells. Similarly, a corresponding compensation function can be constructed for the Y-direction current.
[0067] The effects of the above technical solution are as follows: Compared to bilinear interpolation, which can only fit linear changes, this method can actively identify and compensate for high-order nonlinear errors (curvature) caused by magnetic field saturation, cross-coupling, etc., improving the interpolation accuracy to a new order of magnitude, especially significantly improving the positioning accuracy of the center region of the grid cell. Once the gradient is calculated from the existing feature point data and the gain coefficient k is fitted, it can take effect. This means that it can achieve a leap in overall accuracy without adding additional calibration points or significantly extending the calibration time, and has extremely high cost performance.
[0068] The compensation model is built in units, with each problem grid having its own unique compensation function. This allows the system to adaptively target and strengthen the weakest links in the magnetic field response that are most complex within the equipment, ensuring uniform accuracy across the entire field without any local weaknesses. Although a compensation model is introduced, its computational load is controllable, involving only simple arithmetic operations. The calculation of the compensation amount can be completed instantaneously after interpolation, fully meeting the stringent real-time requirements of particle radiotherapy systems for control speed.
[0069] In one possible implementation, after calculating the control current for the entire field, i.e., the target firing range, using the bilinear interpolation algorithm, the following verification steps are performed: The beam is controlled to scan along one or more theoretical diagonal paths of the field of view; the path is composed of multiple non-featured diagonal verification points; the actual position of the verification point is obtained, and the maximum and / or average deviation between the actual position and the theoretical position among all diagonal verification points is used as the evaluation index. And / or, The controlled beam sequentially irradiates a uniform verification array covering the radiation field; the array consists of multiple non-feature points; the actual positions of the non-feature points are obtained, and the maximum deviation between the actual and theoretical positions of all non-feature points and / or the maximum deviation between the distance between any two adjacent actual positions and the theoretical distance are used as evaluation indicators.
[0070] When any of the evaluation indicators exceeds its corresponding preset threshold, a correction process is triggered. The correction process executes a corresponding correction strategy based on the evaluation indicator that exceeds the preset threshold, including: When the maximum deviation between the actual position and the theoretical position of the verification point exceeds its preset threshold, a new feature point is added in the grid cell corresponding to the verification point with the largest position deviation, and the current value pair of the new feature point is reacquired. When the maximum deviation between the actual location of two adjacent verification points and the theoretical distance exceeds its preset threshold, a new feature point is added in the regular grid within the rectangular area formed by the two adjacent verification points as geometric diagonals, and the current value pair of the new feature point is reacquired. When the average deviation of multiple verification points exceeds a preset threshold, the actual location data and theoretical location of all verification points or multiple randomly sampled verification points are used as new data points to refit the linear calibration model.
[0071] The working principle and effects of the above technical solution are as follows: It can efficiently evaluate the limit accuracy of the four corner areas of the firing field by diagonal scanning and can capture symmetry deviations.
[0072] The uniformity of accuracy within the entire field of view is comprehensively evaluated by uniform dot matrix scanning, and local nonlinear distortions (such as the distortion of specific grid cells) can be effectively diagnosed by analyzing the deviation between adjacent points.
[0073] By acquiring the actual location of these verification points in real time, quantitative indicators of multiple dimensions such as maximum deviation, average deviation, and deviation between adjacent points are calculated, thereby forming a three-dimensional and accurate inspection report on the overall accuracy.
[0074] The above medical examination report is compared with the preset acceptable thresholds, and based on the type of abnormal indicator, the system intelligently diagnoses the potential root cause of the problem and executes a targeted treatment plan. If the maximum positional deviation exceeds the limit, it indicates the presence of a sharp local error. In this case, the grid cell containing the point with the largest error is located, and new feature points are added to that cell for local refinement to enhance the model accuracy in that area.
[0075] If the deviation between adjacent points exceeds the limit, it indicates the presence of local nonlinear distortion or gradient anomaly. In this case, feature points will be added to the rectangular area formed by the problem point pair, and the complex response of the area will be better fitted by subdividing the grid.
[0076] If the average deviation exceeds the limit, it indicates the existence of a global systematic error (such as overall translation, scaling, or rotation). In this case, all the collected validation point data are treated as new sampling points, and the global linear calibration model is refitted to correct the systematic deviation from a macroscopic perspective.
[0077] In one possible implementation, the method further includes: Record the grid cell identifier and its spatial coordinates each time a feature point is added due to exceeding the deviation limit; When performing initial calibration on a new firing field, the frequency of problems occurring in each grid cell in the historical record is counted. Grid cells that occur more frequently than a preset threshold are marked as high-frequency problem grid cells; When constructing the initial regular grid for this calibration, feature point density is pre-increased in each high-frequency problem grid cell and all its adjacent grid cells.
[0078] The working principle of the above technical solution is as follows: In each verification and optimization phase after calibration, not only is the current error corrected, but also detailed information about all problem points, including their spatial coordinates and the grid cell identifier, is consciously recorded. This is equivalent to giving each problem point a clear geographical location label, making subsequent statistical analysis possible.
[0079] When faced with a new field calibration task, the system does not start from scratch. Instead, it first queries and analyzes the historical database. The database counts the frequency of problems for each grid cell in history. By using an objective, preset frequency threshold, it can automatically and accurately identify those high-frequency problematic grid cells that have long-term and recurring nonlinear distortions. This is similar to an experienced doctor who can quickly locate a patient's recurring problem from their medical records.
[0080] Based on the above identification results, a differentiated strategy was adopted when constructing the initial regular grid for this calibration. The density of feature points was pre-increased in each "high-frequency problem grid cell" and all its adjacent grid cells.
[0081] The underlying logic of this design is that the nonlinear region of a magnetic field often has spatial continuity; a problem cell and its adjacent cells are likely to be within the edge influence range of the same anomalous magnetic field; through this coverage strategy of the core problem area and the surrounding influence area, a non-uniform, pre-optimized initial grid is constructed before calibration begins, and computing resources are deployed in advance to the most needed locations.
[0082] The effects of the above technical solution are as follows: By pre-encrypting the calibration points, which would otherwise need to be added passively and iterated multiple times in subsequent verification stages, the calibration points are moved to the initial setup stage and completed all at once. This greatly reduces the time spent on repeated verification and correction in the later stages, achieving optimization from the start and significantly shortening the cycle of the entire calibration process.
[0083] By increasing the sampling density in areas with historical problems in advance, it is equivalent to reinforcing the weak links in advance. This makes the initially established calibration model have higher basic accuracy and consistency across the entire field, reducing the risk of local accuracy depressions from the source and providing a more reliable guarantee of overall consistency for subsequent treatment.
[0084] Example 2: This example provides a scanning magnet beam calibration device, the device comprising: The feature point selection module is used to select multiple feature points within the target firing field, the feature points collectively forming a regular grid covering the firing field; the regular grid includes at least one grid cell; The feature point current value acquisition module acquires, for each feature point, the current value pair of that feature point that makes the deviation between the actual position and the theoretical position of the beam within a preset range. The calibration module is used to calculate the control current of any target point within the firing field using a bilinear interpolation algorithm based on the current value pairs of the feature points.
[0085] In one possible implementation, the regular grid comprises M rows × N columns of feature points, where M and N are both integers greater than or equal to 3; the feature points serve as grid vertices, dividing the field of view into multiple consecutive rectangular grid cells.
[0086] In one possible implementation, the regular grid is a rectangular grid with an isocentric origin.
[0087] In one possible implementation, the execution steps of the feature point current value acquisition module include: The power supply current values (Ix, Iy) applied to the two sets of coils in different directions of the scanning magnet are iteratively adjusted, and the actual position fed back by the beam detector is obtained in real time until the deviation between the actual position and the theoretical position is less than the preset deviation threshold. At this time, the corresponding power supply current value is recorded as the current value pair of the feature point; the beam detector is located in the isocenter plane.
[0088] In one possible implementation, the calibration module includes: A grid cell determining unit is used to determine the grid cell to which the target point belongs in the regular grid based on the coordinates of the target point; wherein the grid cell is a rectangular region defined by four adjacent feature points; The calibration execution unit is used to perform the bilinear interpolation calculation based on the current value pairs of the vertex feature points of the mesh cell.
[0089] In one possible implementation, the apparatus includes a linear calibration model building module, comprising: The calibration model establishment unit is used to establish linear calibration models for the X-axis and Y-axis coils of the scanning magnet based on the theoretical positions of the feature points and the corresponding current value pairs. The feature point verification unit substitutes the current value of each feature point into the corresponding linear calibration model for verification. The first determination unit is used to reacquire the current value pair of any feature point when the deviation between the measured current value of any feature point and the current value calculated by the linear calibration model based on its theoretical position exceeds a preset current deviation threshold.
[0090] In one possible implementation, the execution steps of the calibration model building unit include: Linear calibration models of the form I=Slope*P+Offset are established for the X-coil and Y-coil of the scanning magnet, respectively. The X-axis coil model is based on the theoretical X-axis position of each feature point and the Ix current value, and the slope Slope_x and offset Offset_x are obtained through linear fitting; the Y-axis coil model is based on the theoretical Y-axis position of each feature point and the Iy current value, and the slope Slope_y and offset Offset_y are obtained through linear fitting.
[0091] In one possible implementation, the current deviation threshold is determined based on the control accuracy of the scanning magnet power supply and / or the fitting residual of the linear calibration model.
[0092] In one possible implementation, the linear calibration model building module also includes: The second determination unit is used to automatically add new feature points within a preset range around the feature point and execute the step of acquiring current value pairs to expand the regular grid when the current value deviation of the same feature point still exceeds the preset current threshold after a predetermined number of remeasurements and acquisitions.
[0093] In one possible implementation, a grid cell evaluation and pre-optimization module is included before performing bilinear interpolation calculations, which performs the following steps: For each grid cell in the regular grid, calculate the current gradient at its four vertices; If any gradient value exceeds a preset gradient threshold, the grid cell is marked as a nonlinear cell. For mesh elements marked as nonlinear, perform at least one of the following operations: Check points are added inside to generate sub-grids, and subsequent interpolation calculations will be based on these sub-grids. Establish a compensation function for this grid cell.
[0094] In one possible implementation, the compensation function is configured such that, for any target point falling into the unit, after calculating its initial current value through bilinear interpolation, the compensation function is called to calculate the compensation amount, and the initial current value is corrected to obtain the final control current.
[0095] The compensation function is a functional relationship determined by the second-order gradient of the current in the grid cell and the relative position of the target point within the cell.
[0096] Taking the X-direction current Ix as an example, the compensation amount is:
[0097] For the X-direction compensation term, k is the empirical gain coefficient obtained by fitting experimental data; , The gradient is second-order and can be estimated using the current values at the grid vertices. , This represents the coordinate difference between the target point and the center point of the grid.
[0098] The second-order gradient reflects the curvature of the current change, and this compensation term can effectively model and correct the nonlinear response within the grid cell; the compensation function for the Y-direction current can be constructed in the same way.
[0099] In one possible implementation, after the calibration module, the device further includes a verification module for performing the following verification steps: The beam is controlled to scan along one or more theoretical diagonal paths of the field of view; the path is composed of multiple non-featured diagonal verification points; the actual position of the verification point is obtained, and the maximum and / or average deviation between the actual position and the theoretical position among all diagonal verification points is used as the evaluation index. And / or, The controlled beam sequentially irradiates a uniform verification array covering the radiation field; the array consists of multiple non-feature points; the actual positions of the non-feature points are obtained, and the maximum deviation between the actual and theoretical positions of all non-feature points and / or the maximum deviation between the distance between any two adjacent actual positions and the theoretical distance are used as evaluation indicators.
[0100] When any of the evaluation indicators exceeds its corresponding preset threshold, a correction process is triggered. The correction process executes a corresponding correction strategy based on the evaluation indicator that exceeds the preset threshold, including: When the maximum deviation between the actual position and the theoretical position of the verification point exceeds its preset threshold, a new feature point is added in the grid cell corresponding to the verification point with the largest position deviation, and the current value pair of the new feature point is reacquired. When the maximum deviation between the actual location of two adjacent verification points and the theoretical distance exceeds its preset threshold, a new feature point is added in the regular grid within the rectangular area formed by the two adjacent verification points as geometric diagonals, and the current value pair of the new feature point is reacquired. When the average deviation of multiple verification points exceeds a preset threshold, the actual location data and theoretical location of all verification points or multiple randomly sampled verification points are used as new data points to refit the linear calibration model.
[0101] In one possible implementation, the apparatus further includes a pre-optimization module for: Record the grid cell identifier and its spatial coordinates each time a feature point is added due to exceeding the deviation limit; When performing initial calibration on a new firing field, the frequency of problems occurring in each grid cell in the historical record is counted. Grid cells that occur more frequently than a preset threshold are marked as high-frequency problem grid cells; When constructing the initial regular grid for this calibration, feature point density is pre-increased in each high-frequency problem grid cell and all its adjacent grid cells.
[0102] The working principle and effect of the above technical solution are the same as those in Example 1, and will not be repeated here.
[0103] This invention also provides a radiotherapy system, including the scanning magnet beam calibration device described in embodiment 2.
[0104] This invention also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps of the method or the function of the device in any embodiment of this invention.
[0105] This invention also provides a computer-readable storage medium for storing a computer program. When the computer program is executed, it implements the steps of the method in this invention. The specific implementation method is consistent with the implementation method and the technical effect achieved in the above method embodiments, and some contents will not be repeated.
[0106] In this invention, a readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. The program product can take the form of any combination of one or more readable media. A readable medium can be a readable signal medium or a readable storage medium. A readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof.
[0107] Computer-readable storage media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The readable storage medium may also be any readable medium capable of sending, propagating, or transmitting a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, or any suitable combination thereof. Program code for performing operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, as well as conventional procedural programming languages such as C or similar programming languages. The program code may be executed entirely on a user computing device, partially on an associated device, as a standalone software package, partially on a user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing devices can be connected to user computing devices via any type of network, including local area networks (LANs) or wide area networks (WANs), or they can be connected to external computing devices (e.g., via the Internet using an Internet service provider).
[0108] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the invention without departing from the principles and spirit of the invention, and all such changes should fall within the protection scope of the claims of the present invention.
Claims
1. A method for calibrating a scanning magnet beam, characterized in that, The method includes: Multiple feature points are selected within the target firing field, and the feature points together form a regular grid covering the firing field; the regular grid includes at least one grid cell; For each feature point, obtain the current value pair for that feature point that makes the deviation between the actual beam position and the theoretical position within a preset range; For any target point within the firing field, the control current of the target point is calculated using a bilinear interpolation algorithm based on the current value pairs of the feature points.
2. The scanning magnet beam calibration method according to claim 1, characterized in that, The regular grid comprises M rows × N columns of feature points, where M and N are both integers greater than or equal to 3; the feature points serve as grid vertices, dividing the field of fire into multiple consecutive rectangular grid units.
3. The scanning magnet beam calibration method according to claim 1, characterized in that, The regular grid is a rectangular grid with an equal center as the origin.
4. The scanning magnet beam calibration method according to claim 1, characterized in that, The acquisition of the current value pair at the feature point that ensures the deviation between the actual and theoretical beam positions is within a preset range includes: The power supply current applied to the two sets of coils of the scanning magnet is iteratively adjusted, and the actual position fed back by the beam detector is obtained in real time until the deviation between the actual position and the theoretical position is less than the preset deviation threshold. At this time, the corresponding power supply current value is recorded as the current value pair of the feature point; the beam detector is located in the isocenter plane.
5. The scanning magnet beam calibration method according to claim 1, characterized in that, The step of calculating the control current of the target point based on the current value pairs of the feature points using a bilinear interpolation algorithm includes: Based on the coordinates of the target point, determine the grid cell to which it belongs in the regular grid; wherein, the grid cell is a rectangular area defined by four adjacent feature points; The bilinear interpolation calculation is performed based on the current value pairs of the vertex feature points of the mesh cells.
6. The scanning magnet beam calibration method according to claim 1, characterized in that, The method further includes: Based on the theoretical positions of the feature points and the corresponding current value pairs, linear calibration models are established for the X-axis and Y-axis coils of the scanning magnet, respectively. The current value of each feature point is substituted into the corresponding linear calibration model for verification. If the deviation between the measured current value of any feature point and the current value calculated by the linear calibration model based on its theoretical position exceeds a preset current deviation threshold, then the current value pair of that feature point is reacquired.
7. The scanning magnet beam calibration method according to claim 1, characterized in that, After calculating the full-field control current using the bilinear interpolation algorithm, the following verification steps are performed: The beam is controlled to scan along one or more theoretical diagonal paths of the field of view; the path is composed of multiple non-featured diagonal verification points; the actual position of the verification point is obtained, and the maximum and / or average deviation between the actual position and the theoretical position among all diagonal verification points is used as the evaluation index. And / or, The controlled beam sequentially irradiates a uniform verification array covering the radiation field; the array consists of multiple non-feature points; the actual positions of the non-feature points are obtained, and the maximum deviation between the actual and theoretical positions of all non-feature points and / or the maximum deviation between the distance between any two adjacent actual positions and the theoretical distance are used as evaluation indicators.
8. The scanning magnet beam calibration method according to claim 7, characterized in that, When any of the evaluation indicators exceeds its corresponding preset threshold, a correction process is triggered. The correction process executes a corresponding correction strategy based on the evaluation indicator that exceeds the preset threshold, including: When the maximum deviation between the actual position and the theoretical position of the verification point exceeds its preset threshold, a new feature point is added in the grid cell corresponding to the verification point with the largest position deviation, and the current value pair of the new feature point is reacquired. When the maximum deviation between the actual location of two adjacent verification points and the theoretical distance exceeds its preset threshold, a new feature point is added in the regular grid within the rectangular area formed by the two adjacent verification points as geometric diagonals, and the current value pair of the new feature point is reacquired. When the average deviation of multiple verification points exceeds a preset threshold, the actual location data and theoretical location of all verification points or multiple randomly sampled verification points are used as new data points to refit the linear calibration model.
9. A scanning magnet beam calibration device, characterized in that, The device includes: The feature point selection module is used to select multiple feature points within the target firing field, the feature points collectively forming a regular grid covering the firing field; the regular grid includes at least one grid cell; The feature point current value acquisition module acquires, for each feature point, the current value pair of that feature point that makes the deviation between the actual position and the theoretical position of the beam within a preset range. The calibration module is used to calculate the control current of any target point within the firing field using a bilinear interpolation algorithm based on the current value pairs of the feature points.
10. A radiotherapy system, characterized in that, include: The scanning magnet beam calibration device according to claim 9.
11. An electronic device, characterized in that, The electronic device includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps of the method according to any one of claims 1-8 or to perform the function of the device according to claim 9.
12. A computer-readable storage medium, characterized in that, The storage medium stores computer instructions, and when the computer reads the computer instructions, the computer implements the steps of the method as described in any one of claims 1-8 or performs the function of the apparatus as described in claim 9.
Citation Information
Patent Citations
Beam controlling method, apparatus, proton radiotherapy system and storage medium
CN110267709A
Pencil beam scanning calibration method for proton therapy
CN118403300A
Pen beam scanning magnet scanning method based on irradiation point calibration
CN118662792A
Magnet power supply control system
CN120578112A
Method and apparatus for ion implantation
JP1997027462A