Self-adaptive beam spot calibration method and system based on small-angle X-ray scattering equipment
Through the adaptive beam spot calibration method, the Ni filter and pinhole combination is optimized using Monte Carlo simulation and closed-loop feedback mechanism, solving the calibration stability and accuracy problems of small-angle X-ray scattering equipment, achieving efficient and automated beam spot calibration, and improving the overall performance and reliability of the equipment.
Patent Information
- Application Number
- CN202510741137.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-05
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2045-06-05
AI Technical Summary
During the beam spot calibration process, existing small-angle X-ray scattering equipment has problems such as extensive optimization of the collimation system, lack of dynamic calibration capabilities, and insufficient environmental anti-interference, resulting in insufficient reliability and stability of experimental data.
Adaptive beam spot calibration method is adopted to optimize the Ni filter thickness and pinhole combination through Monte Carlo simulation, combined with a closed-loop feedback mechanism and an adaptive PID controller to realize the initial calibration of the detector and light source stability control, and conduct all-round automatic calibration to improve calibration accuracy and stability.
It improves the calibration accuracy and stability of small-angle X-ray scattering equipment in complex environments, reduces manual intervention, and improves calibration efficiency and equipment performance.
Smart Images

Figure CN120253914A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of small-angle X-ray scattering, and specifically to an adaptive beam spot calibration method and system based on a small-angle X-ray scattering device. Background Art
[0002] A small-angle X-ray scattering device characterizes the internal microstructure of a material, such as shape, particle size, interlayer state, porosity, etc., by detecting the electron density fluctuations of the material, and is one of the important means for studying the nanostructure of substances.
[0003] Beam spot calibration is a key process in small-angle scattering instruments. It mainly enables the instrument's X-ray beam to meet ideal characteristic requirements in terms of spatial position, shape, size, and energy distribution through a series of detection and adjustment means, to ensure that high-precision and high-quality scattering data can be obtained in small-angle scattering experiments. This process runs through all aspects of the design, manufacturing, installation, commissioning, daily use, and maintenance of small-angle scattering instruments.
[0004] However, current small-angle X-ray scattering devices (SAXS) have significant technical bottlenecks in the field of beam spot calibration, mainly reflected in three aspects: the rough optimization method of the collimation system, the lack of dynamic calibration ability, and insufficient environmental anti-interference ability, which seriously restricts the reliability of experimental data. Specifically: (1) Restricted by the static collimation system, resulting in mismatched beam characteristics: The design of existing collimation systems is mostly based on ideal geometric assumptions (such as infinitely small pinholes and uniform beam distribution), without dynamically optimizing in combination with actual photon energy spectra and spatial divergence characteristics. For example, Patent CN118329943A (Huazhong University of Science and Technology, discloses a calibration device and calibration method for a small-angle X-ray measurement device) proposes to locate the sample stage position through fluorescence labeling, but its collimation parameters (such as pinhole diameter, filter thickness) still rely on preset values and do not integrate Monte Carlo photon tracking simulations (such as Geant4 or MCNP tools), resulting in a significant deviation between the beam divergence (typical value) and the theoretical model. In the experiment, taking a certain nanoparticle system (particle size 10 nm) as an example, when using a fixed 0.2 mm pinhole, due to the failure to dynamically match the X-ray energy (Cu-Kα), the energy spectrum broadening after the beam penetrates the filter reaches 15%, and the low-q value scattering signal is covered by high-energy stray light.
[0005] (2) Subject to the calibration process, lacking a closed-loop feedback and real-time compensation mechanism: The existing calibration technologies generally lack closed-loop feedback, resulting in the gradual amplification of errors under environmental disturbances. For example, in Patent CN222704521U (Jinan Hanjiang Optoelectronics, which discloses an integrated microscopic observation device for small-angle X-ray scattering experiments), the micron-level positioning of the sample stage is achieved through microscopic imaging, but the real-time monitoring of the beam spot morphology (such as CMOS high-speed imaging or photon counting feedback) is not integrated. During the experiment, the beam spot offset caused by the light source power fluctuation or the thermal expansion of the sample cannot be dynamically corrected.
[0006] (3) Subject to the weak anti-interference design of the environment, resulting in insufficient long-term stability and adaptability of the device: SAXS devices are extremely sensitive to temperature drift and vibration, and the existing technologies lack a systematic anti-interference design. Taking Patent CN118329943A as an example, although its high-precision sample stage uses a rotating shaft drive (usually a piezoelectric ceramic drive), the high-precision light source displacement stage and metal frame relied on for calibration lack a thermal expansion compensation design, resulting in the drift of the calibrated sample-detector distance (SDD) and beam alignment parameters. At the same time, the proposed calibration process is a static one-time adjustment without an embedded closed-loop feedback mechanism. The calibration of the center of the beam baffle depends on the initial ring fitting. If the temperature drift causes the deformation of the baffle support, the position of the baffle cannot be dynamically adjusted through real-time image analysis, resulting in deviations in the calculation of the scattering angle, affecting the spatial analysis accuracy of the nanostructure sample, and further causing fluctuations in the entropy value of the beam spot morphology, requiring manual intervention to restart the calibration process, seriously affecting the high-throughput experiment efficiency. Summary of the Invention
[0007] Aiming at the deficiencies of the existing technology, the purpose of the present invention is to provide an adaptive beam spot calibration method and system based on a small-angle X-ray scattering device. To achieve the above purpose, the present invention is realized through the following technical solutions: An adaptive beam spot calibration method based on a small-angle X-ray scattering device includes obtaining a ray light source, irradiating a detector with the ray light source, extracting detector response characteristics, and completing the initial calibration operation of the detector; outputting a stable light source to irradiate a sample, and collecting an image signal representing the scattering characteristics of the sample based on the detector; performing binarization processing on the image signal, using a threshold algorithm based on local entropy to perform block processing on the ROI region of the image, calculating the Shannon entropy within each block, and determining an adaptive threshold according to the Shannon entropy to convert the image into a binary beam spot image to separate the foreground and background. Secondly, morphological enhancement processing is performed. First, a cross-shaped kernel is used to erode the binary beam spot image to remove isolated points and noise therein, and then a diamond-shaped kernel is used for dilation operation to connect the possibly broken beam spot contours. Subsequently, opening and closing operation cycles are performed, and during the operation process, the shape of the structural elements in the cross-shaped kernel and the diamond-shaped kernel is dynamically adjusted according to the local gradient direction to ensure isotropic smoothing, and beam spot morphological feature data is output; finally, a coarse adjustment and / or fine adjustment dual-mode adjustment strategy is used to iteratively optimize the collimation parameters and the light source power, and the calibration is determined to be completed through multi-index statistical tests.
[0008] As a second aspect of the present invention, an adaptive beam spot calibration system based on a small-angle X-ray scattering device is proposed, including: a memory; a processor; and a light source module, a collimation module, a sample stage module, and a detector module respectively electrically connected to the processor; the memory includes an adaptive beam spot calibration program, and when the adaptive beam spot calibration program is executed by the processor, the adaptive beam spot calibration method based on the small-angle X-ray scattering device is realized.
[0009] Compared with the existing technology, the beneficial effects of the present invention are as follows: 1. To solve the problem that the existing small-angle X-ray scattering device is vulnerable to temperature drift and vibration interference during the calibration process, the present invention realizes a highly stable calibration process through the coordinated action of the collimation module and the data synchronization unit. Specifically, first, based on the processor, the parameters of the sample stage moving motor are compensated, and the physical coordinate compensation of the detector installation inclination angle is performed to reduce the calibration interference caused by the equipment's own parameter errors. Secondly, based on the collimation module, the thickness of the Ni filter and the pinhole combination are optimized by Monte Carlo simulation. While improving the spectral purity and spatial collimation of the X-ray beam, the stray light interference is reduced to ensure the accuracy of the calibration signal. Finally, based on the data synchronization unit, a data bus is used to achieve real-time interaction, construct a complete closed-loop process, and set up a three-level protection mechanism to handle abnormal situations to ensure that the calibration process is not interfered by the outside world. Thus, different from the existing technology, it has the advantages of high stability and anti-interference ability, ensuring that the calibration accuracy can be reliably guaranteed in a complex environment; 2. Aiming at the problems of complex, time-consuming calibration process and dependence on manual experience in the prior art, the present invention realizes full - range automatic calibration through detector calibration, light source calibration and closed - loop output control. Specifically, first, the detector module is responsible for checking the light source stability, collecting dark current to establish a temperature model, collecting flat - field images and extracting base images and weight coefficients to complete the initial calibration operation, laying a foundation for subsequent calibration. Secondly, the light source module controls the water - cooling mechanism and performs power - level loading to ensure the stable operation of the light source module and provide stable calibration light source conditions. Finally, a hierarchical adjustment strategy is adopted. First, the spiral search algorithm is used to quickly locate the position with better beam spot quality in the coarse - tuning stage, and then the adaptive PID controller is used for fine - tuning in the fine - tuning stage. The calibration is determined to be completed through multi - index statistical tests, ensuring the stability and sensitivity of the system, greatly improving the calibration efficiency and accuracy, reducing manual intervention, achieving fast and accurate calibration effects, and enhancing the overall performance and reliability of the equipment. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] The disclosure of the present invention will be described with reference to the accompanying drawings. It should be understood that the drawings are only for illustrative purposes and are not intended to limit the scope of protection of the present invention. In the drawings, the same reference numerals are used to refer to the same components. Among them: Figure 1 It is a schematic diagram of the beam spot calibration system module framework of a small - angle X - ray scattering device with high precision proposed in an embodiment of the present invention; Figure 2 It is a schematic diagram of the optical path system of the optical path model of a small - angle scattering instrument constructed based on a collimation module in an embodiment of the present invention; Figure 3 is Figure 2 a schematic diagram of the test results of simulating and optimizing the thickness of the Ni filter in Figure 1 ; Figure 4 is Figure 2 a schematic diagram of the test results of simulating and optimizing the pinhole combination in Figure 2 ; Figure 5 It is a schematic diagram of the process of small - angle experimental testing based on a small - angle X - ray scattering device after completing adaptive beam spot calibration in an embodiment of the present invention; Figure 6 It is a schematic diagram of the overall structure of a small - angle X - ray scattering device with high precision proposed in an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0011] It is easy to understand that according to the technical solution of the present invention, without changing the essential spirit of the present invention, those of ordinary skill in the art can propose various interchangeable structural ways and implementation ways. Therefore, the following specific embodiments and drawings are only exemplary descriptions of the technical solution of the present invention, and should not be regarded as the whole of the present invention or as a limitation or restriction on the technical solution of the present invention.
[0012] The present invention will be further described in detail below with reference to the drawings, but it is not intended to limit the present invention.
[0013] For the understanding of the technical concept of the present invention, it should be noted that the proposed small-angle X-ray scattering device includes a light source mechanism, a collimation mechanism, a sample environment testing mechanism, a detector mechanism, and an external shielding housing arranged in sequence along the optical path direction. Among them, the light source mechanism generates an X-ray light source, provides the X-ray light source required for the experiment, and is connected to the external water cooling mechanism to ensure the long-term stable operation of the X-ray tube. The collimation mechanism transmits the X-ray light source and integrates a filtering unit at the exit light port of the X-ray light source to filter out Cu-Kβ generated by the Cu target light source and leave pure Cu-Kα, while controlling the beam divergence angle. The sample environment testing mechanism fixes the sample to be tested and provides an in-situ testing environment, and controls the movement of the sample to be tested in the position along the Y-axis direction of the optical path and in the XZ two-dimensional plane perpendicular to the optical path based on the standard XYZ three-axis movement. The detector mechanism realizes the data acquisition for characterizing the scattering characteristics of the sample. The shielding housing ensures the radiation safety of the entire system.
[0014] As Figure 1 、 Figure 5 and Figure 6 shown, as an embodiment of the present invention, an adaptive beam spot calibration system based on a small-angle X-ray scattering device is first proposed, including a memory, a processor, a light source module, a collimation module, a sample stage module, and a detector module. Among them, the processor includes a data synchronization unit, and the data synchronization unit is electrically connected to the light source module, the collimation module, the sample stage module, and the detector module respectively. The data synchronization unit is used to realize real-time interactive processing among the various modules through a data bus. Specifically, when implemented, the memory includes an adaptive beam spot calibration program, and when the adaptive beam spot calibration program is executed by the processor, the following adaptive beam spot calibration method based on a small-angle X-ray scattering device is realized.
[0015] When the device powers on for self-check, the moving motor in the sample stage module is electrically connected through the processor, the parameters of the sample stage moving motor are set and the micro-step error is compensated. Meanwhile, the dual-axis inclinometer sensor in the detector module is electrically connected through the processor, the installation inclination of the detector is measured and physical coordinate compensation is performed to establish the device physical parameters representing the accurate reference of the detector, thereby completing the calibration of the sample stage motion parameters and the correction of the detector installation inclination. The physical parameters include the positioning parameters that promote the improvement of the sample stage positioning accuracy and the coordinate data after physical coordinate compensation.
[0016] Based on the collimation module: Through the Monte Carlo principle, the thickness of the Ni filter and the combination of pinholes are simulated and optimized to improve the spectral purity and spatial collimation of the ray light source output based on the light source module, and the optimized ray light source (light beam) is obtained.
[0017] Based on the detector module: By collecting the dark current under different temperature conditions, a temperature model representing the relationship between the detector dark current and temperature is established. Using diffused tungsten lamp wide-field illumination and single-energy beam spot scanning, and combining with the optimized ray light source after the improvement of the ray spectral purity, multi-frame flat-field images of different positions of the detector are collected. After extracting the basis images and weight coefficients through non-negative matrix factorization, the flat-field images representing the response characteristics of the detector are obtained, and the initial calibration operation of the detector is completed. It should be noted that the dark current is a key issue restricting the further development of the detector because the introduction of impurity energy bands forms a dark current conduction path between the conduction band and valence band of the detector, that is, impurity conduction.
[0018] Based on the light source module: After the above calibration steps are completed, a stable light source is output to provide a standardized illumination environment. Based on this stable light source irradiating the sample placed on the sample stage module, the image signal representing the scattering characteristics of the sample is collected.
[0019] Based on the processor, the collected image signal is systematically preprocessed to eliminate noise interference and optimize the data structure, the image signal data is output, and after its adaptive binary processing and morphological enhancement processing, the beam spot morphological feature data is output. Then, the collimation parameters and the light source power are iteratively optimized by adopting the coarse adjustment and / or fine adjustment dual-mode adjustment strategy, and the calibration is determined to be completed through multi-index statistical tests to ensure the stability and sensitivity of this calibration system.
[0020] In an embodiment of the present invention, the calibration process during the device power-on self-check is divided into two parts: sample stage calibration and detector installation compensation. Among them, the processor controls the sample stage moving motor, and the calibration process of the sample stage is as follows: The micro-step subdivision parameters are set for the sample stage Y-axis moving motor, and combined with the gear transmission ratio, the laser rangefinder is used for several round-trip calibrations, and the mean and standard deviation of the moving motor step error are calculated through the following formula to determine the actual physical step , , and a step compensation table is established: , to achieve compensation for the micro-step error of the moving motor and ensure that the moving accuracy of the sample to be measured meets the requirements. In the formula, represents the Y-axis position of the sample stage after compensation, is the average value of the step error, and n is the number of steps of the moving motor. It should be noted that the lead screw pitch is a fixed parameter of the sample stage moving motor, which is used to convert the rotational motion of the motor into a linear motion, and its value is determined during the design and manufacture of the small-angle X-ray scattering equipment. n is the number of steps of the moving motor, that is, the number of steps the motor has traveled according to the set micro-step subdivision parameter. It is a key parameter for controlling the moving distance of the sample stage and is set by the control system of the equipment according to the experimental requirements. For example, when the sample stage needs to move a certain distance for scanning, the control system will calculate the corresponding number of steps n to drive the moving motor.
[0021] It can be understood that during the installation of the small-angle X-ray scattering equipment, the detector will have a certain installation inclination angle, which will cause the physical coordinates of the pixels in the subsequent acquired image to shift, affecting the geometric accuracy of the image. Therefore, in this embodiment, the detector installation compensation process is as follows: Measure the actual installation inclination angle θ of the detector through a preset biaxial inclination sensor to achieve inclination compensation for the pixel values of the detector pixel array, eliminate the influence of the installation inclination angle on the coordinates, ensure the geometric accuracy of the image, and thus accurately represent the spatial position coordinates of each pixel point in the detector pixel array: , where θ = 0.01°, is the detector installation inclination angle, x p and x y are the compensated pixel physical coordinates, x and y are the original pixel coordinates, x0 and y0 are the pixel coordinate origins, p x and p yis the pixel size. It can be understood that by performing rotation compensation on the original pixel coordinates, the influence of the installation inclination on the coordinates can be eliminated, thereby ensuring the geometric accuracy of the image. During specific implementation, assume that the detector pixel array causes shear distortion of the acquired image due to installation tilt. Then, the corrected formula eliminates the influence of the inclination through reverse rotation to ensure the geometric fidelity of subsequent image analysis (such as beam spot positioning and scattered signal extraction). When θ = 0, the matrix is the identity matrix and the coordinates remain unchanged. When θ ≠ 0, the matrix cancels the influence of the detector tilt through reverse rotation. It should be noted that the pixel values of the detector pixel array are derived from the spatial sampling of the X-ray signal by the detector, representing the relative value of the X-ray intensity at each pixel position. The detector converts the received X-ray signal into an electrical signal, which forms a digital signal after analog-to-digital conversion (ADC), that is, the pixel value. These pixel values constitute the basic data of the image, reflecting the spatial distribution information of the sample under X-ray irradiation. The pixel coordinates are the position information of the pixel in the detector pixel array, usually represented by row and column numbers, such as (x, y). It is used to define the relative position of the pixel in the two-dimensional array and to identify the spatial distribution of the pixel values. The pixel coordinates and pixel values together constitute the image data, where the pixel coordinates provide spatial position information and the pixel values provide the signal intensity information at that position.
[0022] In an embodiment of the present invention, the process of optimizing the thickness of the Ni filter is as follows: First, based on the Monte Carlo principle, a large number of random samplings are used to simulate the behavior of X-ray (beam) photons in the filter to statistically obtain the transmittance at different thicknesses. Among them, the transmittance is calculated based on the X-ray attenuation law: , where is the mass absorption coefficient, and the of X-ray Cu-Kα in the Ni filter is 2 / g, and the of X-ray Cu-Kβ in the Ni filter is 2 / g, ρ = 8.9 g / cm 3 is the density of the Ni filter, and d = 10 μm is the thickness of the Ni filter. Secondly, an initial setting is made for the X-ray photons: Assume that the photons emitted by the X-ray source have a certain energy distribution (in this embodiment, mainly Cu-Kα and Cu-Kβ rays). For each simulated photon, its position and initial direction on the incident surface of the Ni filter are randomly generated. When the photon propagates in the Ni filter, according to the mass absorption coefficient corresponding to its energy, it is judged whether the photon is absorbed through a random number: Let the generated random number be , if , then it is determined that the photon is absorbed. Otherwise, the photon continues to propagate. In the formula, is the thickness of the filter through which photons pass during this propagation step; again, perform transmittance statistics: perform N simulations (N is a large number, such as ), count the number of photons n passing through the Ni filter, and obtain the estimated transmittance value at this thickness as ; from this, construct an optimization objective function: for different Ni filter thicknesses d, calculate the estimated transmittance values of X-ray Cu-Kα and Cu-Kβ respectively and , and then construct the optimization objective function ; finally, traverse the preset thickness range (such as 5 - 20 μm, step size 1 μm), calculate the value of the objective function F at each thickness, and select the thickness that maximizes F as the optimal Ni filter thickness to improve the detection accuracy of the scattered signal. It should be noted that the collimation module plays a key role in the performance of the small-angle X-ray scattering device, and the Ni filter thickness directly affects the spectral purity of the X-ray beam. To improve the spectral purity and reduce the interference of stray light, Monte Carlo simulation is introduced to optimize the Ni filter thickness and improve the detection accuracy of the scattered signal.
[0023] Based on the above technical concept, the process of optimizing the pinhole combination is as follows: First, perform simulation calculations of the geometric divergence angle of the pinhole: The pinhole includes at least a single pinhole and a double pinhole. For a single pinhole, based on the pinhole diameter and the distance from the pinhole to the light source, use geometric relationships to determine the theoretical geometric divergence angle: Based on Monte Carlo simulation, when a large number of photons randomly generated from the light source propagate to the pinhole, judge whether they pass according to the pinhole size, count the landing distribution of the photons passing through the pinhole on the detector, and estimate the actual geometric divergence angle by calculating the standard deviation of the landing distribution , where d1 is the diameter of the single pinhole and L is the distance from the pinhole to the light source; for a double pinhole: consider the diameters of the front pinhole and the rear pinhole and the pinhole spacing, and use the cascade collimation effect to determine the theoretical geometric divergence angle. Similarly, based on Monte Carlo simulation, when a large number of photons randomly generated from the light source propagate to the pinhole, track their propagation paths, count the landing distribution of the photons passing through the double pinhole on the detector, and calculate the actual geometric divergence angle , where d1 is the diameter of the rear pinhole, which is used to determine whether photons can pass through the pinhole in the calculation of the geometric divergence angle and affects the landing distribution of photons on the detector, d2 is the diameter of the front pinhole, which together with the diameter of the rear pinhole determines the geometric divergence angle of the double pinhole combination and affects the propagation characteristics of photons after passing through the double pinhole, L is the distance from the pinhole to the light source, and L sep is the pinhole spacing. Second, perform simulation calculations of the signal-to-noise ratio: Based on the ROI area set on the detector surface (such as 20 mm × 20 mm), count the number of photons received in this area through Monte Carlo simulation, and calculate the estimated value of the signal intensity , meanwhile, count the equivalent number of photons generated by noise (such as detector dark current, environmental interference, etc.) in this area, and calculate the estimated value of the noise intensity , and obtain the estimated value of the signal-to-noise ratio as . Finally, compare the geometric divergence angles and the simulated signal-to-noise ratio results under different pinhole combinations, and select the pinhole combination with a lower geometric divergence angle and a higher signal-to-noise ratio as the optimal solution. During specific implementation, it is preferred that the double pinholes are made of stainless steel, with a hole diameter accuracy of ±1μm, a hole spacing tolerance of ±5μm, and are calibrated by a laser collimator during installation to ensure that the coaxiality error of the two pinholes is <10μm.
[0024] In an embodiment of the present invention, since the detector dark current will change with temperature, if not corrected, it will cause an increase in image noise. Therefore, it is necessary to perform an initial data calibration operation on the detector: First, continuously collect the dark current in a constant temperature environment preferably at 22°C, collect it once every 10 minutes, and continuously collect it for 2 hours to establish a dark current temperature model: , where is the dark current value of the detector at temperature T, T represents the temperature variable, with the unit of degree Celsius (°C), and is used in the model to represent the difference between the current temperature and the reference temperature (22°C), is the reference temperature in the constant temperature environment at time the dark current collected at the position is the temperature coefficient, obtained by linear regression fitting, and reflects the sensitivity of the dark current at this position to temperature changes; Secondly, according to the real-time temperature sensor data calculate the corrected dark current to eliminate the influence of detector temperature drift and ensure the data reliability of long-term experiments: .
[0025] Based on the above technical concept, in order to solve the problem of correcting the non-uniformity of the detector response, it is also necessary to perform flat-field calibration using a diffused tungsten light source (color temperature 2856K). Due to the spatial non-uniformity of the light source, 20 frames of flat-field images at different positions are collected to fully cover each area of the detector; use non-negative matrix factorization (NMF) to extract the basis images characterizing the detector response characteristics and the weight coefficients characterizing the spatial positions of each flat-field image and / or the positions of each pixel on the detector, and calculate the flat-field response rate to reflect the response characteristics of each pixel point of the detector: , , where is the response attenuation coefficient of the detector edge region, automatically identified by an edge detection algorithm and obtained by fitting, is a flat-field image, representing the light intensity received by the detector at the position (x, y), comprehensively reflecting the non-uniformity of the light source and the response characteristics of the detector. is a weight coefficient, a set of coefficients obtained through non-negative matrix factorization (NMF), used to measure the contribution ratio of the corresponding basis image in the flat-field image. is the k-th basis image, extracted through NMF, characterizing the main feature pattern of the detector response, and used to construct the flat-field image. is the average value of the flat-field image, used to normalize the flat-field response rate. is the dark current, referring to the current generated by the detector at the position (x, y) in the absence of light, and its value changes with temperature. 65535 is the maximum digital count value of a 16-bit ADC; the value range that a 16-bit ADC can represent is from 0 to 65535, where 65535 corresponds to the strongest signal or saturated signal. It can be understood that using 65535 as a reference value to normalize the dark current term aims to standardize the influence of the dark current to a range equivalent to the maximum value of the ADC, thereby ensuring the accuracy and consistency of the response rate calculation.
[0026] It should be noted that during the acquisition process of the flat-field image, the spatial position of the flat-field image is as follows: in flat-field calibration, to consider the spatial non-uniformity of the light source, 20 frames of flat-field images at different positions are acquired, which refers to the image positions acquired by the detector when the diffuser is at different spatial positions. These positions cover the entire imaging area of the detector, used to comprehensively characterize the influence of the spatial non-uniformity of the light source on the detector response, so as to provide sufficient information for subsequent image correction. And the pixel positions on the detector are as follows: for the basis image and the weight coefficient , as well as when calculating the flat-field response rate R(x, y), at different pixel positions (x, y) on the detector, each pixel position has corresponding response characteristics. Through these calculations, the correction parameters for each pixel position can be obtained, used to eliminate the influence of the non-uniformity of the detector response on the image, and improve the uniformity and accuracy of the image.
[0027] In an embodiment of the present invention, the process of the light source module outputting a stable light source is divided into two parts: water-cooling mechanism control and power loading control. Specifically, in implementation, the water-cooling mechanism control part preferably adopts a three-layer closed-loop control strategy: the outer layer uses the PID algorithm to adjust the water temperature, the middle layer stabilizes the water flow rate through the PI algorithm, and the inner layer controls the rotational speed of the pump motor carried by the water-cooling mechanism with the Fuzzy algorithm. At the same time, to ensure the stable operation of the light source module, it is preferred to incorporate an anti-saturation mechanism into the water-cooling mechanism, that is, set the water temperature set value to be automatically adjusted when the refrigerator in the water-cooling mechanism reaches the maximum power, and the signal of the flow sensor carried by the water-cooling mechanism needs to be processed by Kalman filtering , so as to ensure that the flow rate fluctuation is controlled within a very small range. In the formula, is the value of the flow rate estimate after Kalman filtering at time t, representing the more accurate and smooth flow rate estimate output by the filtering algorithm. is the flow rate estimate after Kalman filtering at the previous moment (time t - 1). is the actual flow rate value measured at time t, representing the original flow rate data directly collected by the flow sensor, which contains noise and interference.
[0028] In specific implementation, the outer layer uses the PID control algorithm to precisely adjust the water temperature, and the target temperature is set to 22°C. The middle layer uses the PI control algorithm to ensure that the water flow rate is stable at 5 L / min. The inner layer uses the Fuzzy control algorithm to adjust the pump motor speed. When the refrigerator reaches its maximum power, the system adjusts the water temperature set value to 22.5°C to avoid the integral saturation phenomenon. At the same time, the signal collected by the preset flow sensor is processed by Kalman filtering to ensure that the flow rate fluctuation is strictly controlled within 0.05 L / min. Provide a stable and reliable heat dissipation guarantee for the light source module to ensure that the light source operates stably at the ideal working temperature, thereby ensuring the stable output of X-rays.
[0029] The purpose of power loading control is to prevent the rapid change of the output light source power from causing thermal shock to the equipment. The process is as follows: First, adopt a power ramping strategy for power loading, and set the anode temperature gradient of the phototube power supply to be monitored synchronously during each stage of loading. When the temperature gradient exceeds the set threshold, that is, the system automatically extends the stable time of this stage of power to 20 seconds. Secondly, set the power loading sequence to meet the conditions: In the above conditions, when loading each stage of power, the voltage increases by 5 kV, the current increases by 5 mA, and calculate the power of the next stage to ensure that it does not exceed 1800 W, and ensure that the anode temperature increases by no more than 5°C for each stage; after each stage of loading, the X-ray intensity is monitored in real time through the photodiode carried by the light source module, and calculate the intensity fluctuation coefficient where and are the maximum and minimum values of the X-ray intensity monitored by the photodiode during the monitoring time period respectively. If the fluctuation coefficient exceeds the allowable range, , then immediately step back two levels of power and reload. It can be understood that this progressive power boost method, combined with real-time monitoring and feedback control of the anode temperature gradient and X-ray intensity, effectively avoids instability of the light source module due to rapid power changes, ensuring stable output of high-quality X-ray beams by the light source and providing a stable radiation source for subsequent image acquisition. Based on the above technical concept, since the ripple noise of the X-ray tube power supply will significantly affect the radiation intensity and image quality, and to ensure the stability of the light source, it is also necessary to perform frequency domain analysis on the X-ray tube power supply: set multiple acquisition points (1000 points), and collect the X-ray tube power supply voltage data V(t) at each acquisition point, calculate its power spectral density PSD, and focus on obtaining the integral value of PSD in the frequency band of 10 Hz - 1 kHz. When this integral value is reached, it is determined that the power supply is stable, thereby further ensuring the uniformity of X-ray intensity.
[0030] In an embodiment of the present invention, due to the existence of various random noise interferences in the operating environment of the scattering device, such as micro-vibrations of the motor and fluctuations in the dark current of the detector, these noises will reduce the image quality. Therefore, to suppress such noises, based on the processor, it is necessary to adopt a median-mean hybrid filtering technique to process the collected image signals in order to extract high-quality, high-contrast, low-noise, and clearly characterized image data, which performs the following operations: First, perform 3×3 median filtering on K = 5 consecutive frames of images representing the characteristics of the X-ray beam spot to effectively remove salt-and-pepper noise; Secondly, set the weight function , and perform weighted averaging on the filtered images to ensure that among the K consecutive frames of images representing the characteristics of the X-ray beam spot, the weight of the middle frame is the largest (0.45), and the weights of the front and back frames decrease in turn. To further reduce the influence of random noise, the regions with energy values lower than 1 / 3 of the global mean are automatically excluded by means of ROI pre-screening, reducing the amount of invalid data and improving the data processing efficiency, and the quality and usability of the processed images are significantly improved, which helps to more accurately extract the beam spot feature information.
[0031] It can be understood that since the background noise will mask the beam spot signal and affect the accuracy of subsequent analysis, therefore, background subtraction needs to be continued. In this embodiment, it is preferably to use the watershed algorithm to dynamically divide the background region. The specific operation is as follows: First, perform Gaussian blur on the averaged image (in this embodiment, let the standard deviation σ of the Gaussian blur be 5 pixels) to reduce the influence of image noise; secondly, use the marked detector edge region as the background seed point, and obtain the background mask through the watershed algorithm transformation , and introduce the spatial autocorrelation function to calculate the background value : , In the formula, is a 500×500 pixel neighborhood centered at (x, y), which is used to define the range of the region participating in background calculation. d(i, j) is the distance, which is used to suppress the abnormal influence of distant pixels. is the background mask, which represents the value at the position (i, j) and is used to identify whether the pixels in this image belong to the background region (usually a binary matrix, 1 represents the background, and 0 represents non-background). is the average image intensity, which represents the value at the position (i, j) and is used to provide the basic signal intensity at this position. is the exponential decay factor, which is used to weight the distance so that the contribution of distant pixels decreases rapidly as the distance increases. It can be understood that the spatial autocorrelation function can quantify the correlation between the pixel value and the pixel values in its neighborhood, thus effectively characterizing the uniformity and consistency of the detector edge region. Therefore, in this step, by introducing the spatial autocorrelation function, the spatial relationship between pixels is fully considered, and the background value within a 500×500 pixel neighborhood centered on each pixel is calculated. Again, the abnormal influence of distant pixels is suppressed by the distance decay factor. Finally, logarithmic transformation is performed to enhance the image contrast. The specific process of performing logarithmic transformation to enhance the image contrast is as follows: , In the formula, is the corrected image intensity, which represents the value at the position (x, y) and is used to reflect the signal intensity after enhanced contrast. In is the natural logarithm function, which is used to perform logarithmic transformation to map the signal intensity to a new intensity range and enhance the contrast. 65535 is the maximum digital count value of a 16-bit ADC, which represents the maximum gray value of a 16-bit image and is used to normalize the result of the logarithmic transformation to ensure that the output value is within the effective range. Finally, data window partitioning is performed to ensure effective suppression of background noise and more prominent beam spot signals. The specific process is as follows: Regularized least squares (ridge regression) is used to suppress overfitting, ensure the smoothness of the first derivative of the fitting curve, and match the signal change rate (≤200 gray values / ms) corresponding to the maximum acceleration (50 mm / s²) of the aforementioned sample stage. Local minimum values of the fitted (ray beam spot signal) signal curve are screened through extreme point detection, and non-maximum suppression calculation is performed to ensure that the interval between adjacent low points of the signal curve is not less than 10 s (corresponding to the sample stage moving 2 mm) to avoid window overlap. It can be understood that data window partitioning is to divide the scattering data sequence (the scattering data sequence is a sequence characterizing the beam spot signal characteristics) into multiple representative windows to achieve the purpose of accurately analyzing the stability characteristics of the beam spot signal. The beam spot signal characteristics mainly include: intensity distribution, noise level, contrast, and stability, as shown in Table 1 below: Table 1:
[0032] In an embodiment of the present invention, when simulating and optimizing the pinhole combination based on the collimation module, the specific process of setting the ROI region on the detector surface is as follows: Based on the improved Chan-Vese active contour model, an energy function is constructed to achieve the accurate extraction of the ROI region: = , where v is the length penalty term, which is used to control the influence of the contour length on the energy function, prevent the contour from overfitting, and maintain the smoothness of the contour. is the energy function, which is used to measure the quality of the segmentation result. The goal of its segmentation is to find the beam spot contour that minimizes this energy function. c1 is the gray level mean of the inner region (inside the contour), which reflects the gray level characteristics of the inner region, and c2 is the gray level mean of the outer region (outside the contour), which reflects the gray level characteristics of the outer region. is the level set function, and its zero level set corresponds to the segmentation contour. is the Heaviside function parameter, which is used to convert the level set function into a piecewise constant function. Its value is 1 inside the contour and 0 outside. is the weight coefficient of the inner region, which is used to balance the contribution of the gray level difference in the inner region to the energy function. is the weight coefficient of the outer region, which is used to balance the contribution of the gray level difference in the outer region to the energy function. is the length of the beam spot contour, which is calculated by the level set function and is used to measure the smoothness of the contour. I is the gray level value reflecting the position of each pixel in the ROI region contour (the above gray level values are used to jointly depict the shape and intensity distribution of the beam spot). It can be understood that by introducing the inner and outer region means c 1, c2, the level set function Φ, and the Heaviside function parameter , the beam spot contour can be adaptively captured, and the accurate beam spot contour can be obtained by solving with the variational method.
[0033] Based on the above technical concept, after obtaining the beam spot contour, expand it by 300 pixels towards the periphery to form the ROI region to ensure that all scattered halo information is included. The purpose of this process is to focus on the specific region related to the detection of scattered signals on the detector during the simulation, so as to more accurately count the number of signal photons and noise photons received in this region. Effectively evaluate the signal-to-noise ratio performance under different pinhole combinations, while reducing the calculation amount and improving the simulation efficiency. It helps to quickly screen out those pinhole combinations that can provide a cleaner and stronger signal in a specific region during the optimization process, thereby improving the detection accuracy of the final scattered image signal.
[0034] In an embodiment of the present invention, to clearly separate the beam spot region and the background region in the image, in this embodiment, based on the processor, the process of binarizing the image signal is as follows: The formed ROI region is block-processed using a threshold algorithm based on local entropy. Preferably, the block size is 8×8. Within each block, its Shannon entropy is calculated respectively , to measure the complexity or uncertainty of the image gray level in the ROI region, , where, is the probability density of gray level i. An adaptive threshold is determined according to the Shannon entropy, , k = 0.8, thus realizing the binarization process of the image. Where, is the dynamic threshold. The threshold at position (x, y) is determined by the difference between the local mean and the information entropy, and is used for image segmentation, is the local information entropy at position (x, y), reflecting the texture complexity of this region, is the local mean at position (x, y), reflecting the average gray value of this region, is the maximum information entropy, usually the maximum entropy value of all possible gray levels in the image. It can be understood that to handle the discontinuity problem at the block boundaries, bicubic interpolation also needs to be used to smooth the threshold map, and a hysteresis threshold is added to the final binarization function to handle the discontinuity problem at the block boundaries: .
[0035] Based on the above technical concept, "8-neighborhood 255 pixels" means that among the 8 adjacent pixels (i.e., the pixels in the up, down, left, right, and four diagonal directions) of the pixel point in the current ROI region, at least one pixel has a value of 255. A pixel value of 255 usually indicates that the pixel belongs to the white or highlighted region in the image, which is often used to represent the foreground or the region of interest in the binary image. Thus, through the adaptive binarization processing method, the situation of uneven gray distribution in the image can be effectively dealt with, and the beam spot region can be accurately separated from the background.
[0036] Example: If the corrected image intensity is greater than or equal to the dynamic threshold th(x, y), then the background value B(x, y) at this position is set to 255 (white), indicating that this position belongs to the foreground; if is between th(x, y) - 10 and th(x, y), and at least one pixel among the 8 adjacent pixels at this position has a value of 255, then the background value B(x, y) at this position is also set to 255. Otherwise, the background value B(x, y) at this position is set to 0 (black), indicating that this position belongs to the background. By combining the image intensity and the neighborhood information, the foreground region can be more accurately identified while reducing the influence of isolated pixels.
[0037] Based on the above technical concept, when analyzing the binarized image, it is also necessary to perform multi-level morphological operation to optimize the beam spot contour in the image. The operation sequence follows: first, perform erosion operation using an m×n cross-shaped kernel to remove isolated points in the image; then, perform dilation operation using an n×p diamond-shaped kernel to connect the possibly broken beam spot contours; subsequently, perform 10 opening and / or closing operation cycles. Among them, it is set that the structural elements in the cross-shaped kernel and the diamond-shaped kernel are dynamically adjusted according to the local gradient direction to ensure isotropic smoothing. The morphological operation expression is: , where ε is the erosion operator, is the dilation operator, and the rotation angle of the structural element for each iteration , which is used to ensure isotropic smoothing. It can be understood that through a series of morphological operations, the integrity and smoothness of the beam spot contour are significantly improved.
[0038] In an embodiment of the present invention, considering the characteristic that the scattering signal presents a non-Gaussian distribution, therefore, after ensuring the isotropic smoothing of the image signal, it is also necessary to output the beam spot morphological feature data through the method of clustering analysis. The process is as follows: use the ISODATA clustering analysis method based on kernel density estimation (KDE) to classify and analyze the beam spot features.
[0039] First, determine the initial clustering centers by finding the local maxima of the KDE curve: , where is the kernel density estimation value at position S, which is used to reflect the density of the data points at position S, is the value of the i-th data point, n is the total number of data points, and σ is the bandwidth or standard deviation, which is used to control the width of the kernel function and affect the smoothing degree; compared with the traditional random initialization method, the convergence speed of this method is increased by 40%. Secondly, introduce the autocorrelation coefficient of the time series into the standardized Euclidean distance metric for weighting to enhance the influence of time correlation in the clustering analysis: , where is the autocorrelation value of the signal at times a and b, which is used to enhance the influence of time correlation on clustering, is the distance metric between sample a and sample b, which is used to measure their similarity, and are the signal intensities or feature values of sample a and sample b respectively, and are the maximum and minimum values of all sample signal intensities, respectively, and are used to normalize the distance. It can be understood that the use of ISODATA cluster analysis can effectively classify and analyze the characteristics of the beam spot. In this embodiment, the sample refers to the measurement data point of the beam spot signal at different time points or different positions. The sample contains the characteristic information of the beam spot, such as signal intensity, time series changes or spatial distribution characteristics. By analyzing these samples, the quality and stability of the beam spot can be evaluated as a whole. Again, perform iterative optimization of cluster analysis. The specific process is: according to the standard deviation within the class With the current class mean The proportion Dynamically adjust the splitting rules to adapt to the clustering needs of different signal strengths; Measuring the similarity between classes and dynamically adjusting the merging rules: , where is the distance between category c1 (the grayscale mean of the inner area (inside the contour)) and c2 (the grayscale mean of the outer area (outside the contour)). The smaller the distance value, the more similar the two categories are. is the probability density of category c1 on the kth feature dimension, is the probability density of category c2 on the kth feature dimension, L is the number of dimensions in the feature space; when the distance between classes Less than the set threshold of 0.5, and the amount of data within the class meets When the conditions are met, the merging operation between classes is triggered. So far, through the above iterative optimization process, ISODATA clustering analysis can more accurately classify and analyze the beam spot characteristics. is the number of data points in the jth cluster, reflecting the size or number of members of the cluster. Finally, the feature calculation is performed on each cluster obtained by ISODATA cluster analysis, and the geometric features (such as area, perimeter, major axis, minor axis, etc.) and statistical features (such as grayscale mean, standard deviation, etc.) of the beam spot are extracted. These features are combined to form the beam spot morphological feature data, and then standardized to unify the data scale and eliminate the dimension effect, and then the feature data is organized into a structured data format for output.
[0040] In one embodiment of the present invention, in order to quickly locate a position with relatively good beam spot quality, in this embodiment, based on the processor, the process of implementing coarse adjustment is as follows: The signal-to-noise ratio (SN) and the main axis direction (angle θ with the reference direction) in the beam spot morphology feature data are used as core indicators to construct the beam spot quality factor Q, and the spiral search algorithm is used to quickly locate the high-quality beam spot area in a large range. The specific process is as follows: Centered at the current position (the position of the current sample stage / detector in the XY plane), 8 search points are generated in the XY plane with a set step size of 500 μm. For each search point, based on the beam spot morphological feature data, the beam spot quality factor Q of each point is calculated. , where SN is the signal-to-noise ratio, which directly reflects the purity of the beam spot signal, and θ is the angle between the main axis of the beam spot and the reference direction, characterizing the spatial orientation of the beam spot. By comparing the Q values of each search point, the direction with the largest Q value is selected as the next movement direction. Among them, if the Q value shows a downward trend in 3 consecutive searches, the random search mode is switched to avoid falling into a local optimal solution.
[0041] It can be understood that this coarse adjustment strategy can efficiently search for a position with better beam spot quality within a large range, provide a good initial position for the subsequent fine adjustment stage, effectively reduce the search time, and improve the adjustment efficiency. In this embodiment, the current position specifically refers to the current position of the sample stage or detector on the XY plane during the beam spot calibration process. This position is the starting point of the beam spot calibration algorithm. Centered at this point, new search points will be generated according to the set step size and rules to evaluate the beam spot quality factor Q, so as to determine the next movement direction. Specifically, the current position is the position of the sample stage or detector that is currently being evaluated or adjusted during the calibration process.
[0042] Based on the above technical concept, on the basis of the initial position determined in the coarse adjustment stage, combined with the dynamic changes of the real-time morphological features of the beam spot (such as position offset, size fluctuation, energy concentration), the process of entering the fine adjustment stage through the processor to achieve more accurate beam spot calibration is as follows: First, an adaptive PID controller is used to introduce a feedforward compensation mechanism, and a prediction model is constructed based on the Kalman filter algorithm. , predict the defocus amount at the next moment , and calculate the feedforward coefficient F (set to 0.5) accordingly. In the formula, is the output control signal of the controller at time t, which is used to adjust the system to reach the desired state. is the proportional gain, which is the coefficient of the proportional control part. is the current error, which is usually defined as the difference between the expected value and the current actual value of the system. In beam spot calibration, it is the difference between the expected beam spot position and the actually detected beam spot position. is the integral gain, which is the coefficient of the integral control part and affects the system's response to the past cumulative error, used to eliminate the static error of the system and improve the control accuracy. is the error integral term, which represents the accumulation of all errors from the start of the system operation to the current time t, used to eliminate the deviation in the system. is the differential gain, which is the coefficient of the differential control part. It determines the system's response to the rate of change of the error, and is used to improve the system's stability and response speed, and reduce overshoot. is the rate of change of the error, that is, the rate at which the error changes over time. The derivative term can predict the changing trend of the error, so as to adjust the control signal in advance.
[0043] Secondly, by dynamically adjusting the control period, when the beam spot position error occurs, the control period is shortened from 20 ms to 5 ms, thereby improving the response sensitivity of the system. It can be understood that through the above-mentioned adaptive PID control strategy combining feed-forward compensation and feedback control, the movement of the sample stage or the light source can be controlled more precisely, making the beam spot more accurately aligned with the focal plane. At the same time, in the fine-tuning stage, the parameters of the collimation module are further optimized, and the Ni filter thickness and the pinhole combination are synchronously fine-tuned in combination with the energy concentration (the gray-scale ratio of the ROI area) and the geometric divergence angle (output by Monte Carlo simulation of the pinhole combination) in the beam spot morphological characteristics. Thus, through the synergistic effect of spectral purification and spatial collimation, the quality of the X-ray beam can be further improved, the interference of scattered signals can be reduced, the clarity and resolution of the image can be improved, providing a better X-ray beam for subsequent sample image acquisition and analysis, and ensuring that the stability and sensitivity of the system reach the best state.
[0044] After completing the above series of calibration operations, to ensure that the entire calibration process achieves the expected effect and avoid misjudging the completion of the calibration due to a single indicator meeting the standard, in this embodiment, a multi-index statistical test method is introduced for comprehensive determination. The specific indicators include the size stability, position repeatability, shape consistency, and energy concentration of the beam spot.
[0045] Specifically, when implementing, for the size stability of the beam spot, it is evaluated by calculating the coefficient of variation after 5 measurements. , where CV is the coefficient of variation, which is a dimensionless quantity representing the ratio of the standard deviation to the mean value , and is used to measure the relative dispersion degree of the data. It can be understood that in beam spot calibration, CV is used to evaluate the size stability of the beam spot. CV < 2% means that the coefficient of variation of the beam spot size should be less than 2%, that is, the fluctuation of the beam spot size should be very small relative to its average value, so as to ensure that the stability of the beam spot meets the requirements of high-precision experiments.
[0046] For position repeatability, calculate whether the radius of the 95% confidence interval of its centroid coordinates is less than 0.2 pixels. It can be understood that the centroid coordinates are based on the beam spot image and are calculated through geometric features in the beam spot feature extraction process. The centroid calculation needs to consider the spatial distribution weight of the pixel gray scale and introduce the distance-weighted centroid: . Specifically, taking the distance d(x, y) from the pixel to the center of the ROI region as the weight factor, the weight of the edge pixels gradually decays, thereby highlighting the contribution of the pixels in the central region. In the formula, is the characteristic length, which controls the attenuation rate of distance weighting, and takes pixels. x is the coordinate vector of the pixel point, representing the position of the current pixel in the image. is the corrected image intensity. is the distance weighting factor, which is used to weight the gray value of the pixel point. is the distance from the pixel point (x, y) to the center of the ROI region, which is used to measure the position of the pixel point relative to the center. Thus, the centroid position obtained by calculation can more accurately reflect the center position of the beam spot.
[0047] For shape consistency, it is determined based on the statistical characteristics of the ellipse parameters. It can be understood that the ellipse parameters are also obtained by using the least squares ellipse fitting method during the beam spot feature extraction process. The specific calculation process is as follows: Based on the beam spot image after binarization processing and morphological enhancement processing, the least squares ellipse fitting algorithm is used to determine the geometric parameters of the ellipse. In this embodiment, the best fitting ellipse is found by minimizing the sum of the squares of the distances from the contour points to the ellipse, so as to accurately calculate parameters such as the major axis length, minor axis length, and major axis angle of the ellipse to describe the shape characteristics of the beam spot.
[0048] For energy concentration, it is determined by calculating whether the ratio of the sum of the gray values in the ROI region to the sum of the gray values of the entire image is greater than 95%. Only when all the above indicators meet the corresponding conditions, the calibration process is determined to be completed. Thus, through this comprehensive determination method, the quality and position of the beam spot can be comprehensively and accurately evaluated, ensuring that it meets the requirements of high-precision ray beam spot analysis, thereby guaranteeing the measurement accuracy and reliability of the equipment during long-term operation.
[0049] In an embodiment of the present invention, specifically in implementation, to achieve efficient and reliable communication between the modules in the system, it is preferred that the data synchronization unit uses the TCP / IP communication protocol to transmit data with the above-mentioned modules.
[0050] In an embodiment of the present invention, based on the above-mentioned collimation module, in actual use, the parameters of the collimation module can be flexibly adjusted according to the test requirements of the target sample. The following is a preferred simulation design scheme for the collimation module parameters: As Figure 2 shown, first, using simulation software, an optical path model of the small-angle scattering instrument is constructed, including a light source, a collimator tube, a pinhole, and a detector. By adjusting the components, positions, and parameters, a complete optical path system is formed. Secondly, based on the Monte Carlo principle, the energies of the light tube light sources are set to 8048 eV and 8905 eV, and the relative ratio of their intensities (I1:I2) is 6:1. At the same time, according to the X-ray absorption limit theory, a nickel sheet is selected for energy monochromatization, and the different absorption coefficients μ1 and μ2 of the Ni sheet for the two energies are set, and the thickness of the Ni sheet is d: ; Thirdly, several simulated reference values are given for d: 2 μm, 4 μm, 6 μm, 8 μm, 10 μm, 12 μm, and 14 μm. According to the simulation results, three Ni sheets with thicknesses of 8 μm, 10 μm, and 12 μm are selected for experimental tests, as Figure 3 shown ( Figure 3 The left part is the test result of the sample without adding the Ni sheet, Figure 3 and the right part is the test result of the sample with a 10-μm Ni sheet added). The test results show that the Ni sheet with a thickness of 10 μm has the best effect; Next, according to the optical path geometry principle, probability statistics, and the size limitation of the overall system, different collimator lengths (40 mm, 60 mm, 80 mm, 100 mm, 120 mm) and the sizes of the pinhole (0.1 mm, 0.2 mm, 0.3 mm, 0.4 mm, 0.5 mm) are set, and the beam divergence angle, spot size, and light flux ratio under different parameter configurations are simulated. At the same time, considering the requirements of the actual small-angle scattering test for the beam quality, the simulation results are used as a reference for the actual configuration parameters; as Figure 4 shown ( Figure 4 The left part is the test result of the sample with a 40-mm collimator and a 0.2-mm pinhole, Figure 4 and the right part is the test result of the sample with a 60-mm collimator and a 0.2-mm pinhole). According to the simulation results, two collimator lengths of 40 mm and 60 mm and two pinhole sizes of 0.2 mm and 0.3 mm are selected, and the collimator and pinhole are randomly matched for experimental tests. The results show that the scattering signal resolution and signal-to-noise ratio of the 60-mm collimator with a 0.2-mm pinhole before and after and a 0.3-mm pinhole are relatively high, and the test effect is significantly better than other experimental results; Finally, through repeated simulations and combined with the experimental test data, a 60-mm-long collimator, a 0.2-mm-sized pinhole, and an additional 0.3-mm pinhole are finally selected after the second pinhole to remove the large divergence angle beam and fluorescence.
[0051] The technical scope of the present invention is not limited to the content described above. Those skilled in the art can make various deformations and modifications to the above embodiments without departing from the technical idea of the present invention, and these deformations and modifications should all fall within the protection scope of the present invention.
Claims
1. An adaptive beam spot calibration method based on a small-angle X-ray scattering device, characterized in that: Obtain a ray light source, use the ray light source to irradiate a detector, extract the detector response characteristics, and complete the initial calibration operation of the detector; Output a stable light source to irradiate the sample, and collect image signals representing the scattering characteristics of the sample based on the detector; Perform binarization processing on the image signal, use a threshold algorithm based on local entropy to perform block processing on the ROI region of the image, calculate the Shannon entropy within each block, and determine the adaptive threshold according to the Shannon entropy to convert the image into a binary beam spot image to separate the foreground and background. Secondly, perform morphological enhancement processing. First, use a cross-shaped kernel to erode the binary beam spot image to remove isolated points and noise therein, and then use a diamond-shaped kernel for dilation operation to connect the possibly broken beam spot contours. Subsequently, perform open and close operation loops, and during the operation process, dynamically adjust the shape of the structural elements in the cross-shaped kernel and the diamond-shaped kernel according to the local gradient direction to ensure isotropic smoothing, and output the beam spot morphological feature data. Finally, use a coarse adjustment and / or fine adjustment dual-mode adjustment strategy to iteratively optimize the collimation parameters and the light source power, and determine the completion of calibration through multi-index statistical tests.
2. The adaptive beam spot calibration method based on a small-angle X-ray scattering device according to claim 1, characterized in that: The process of obtaining the ray light source is as follows: Use the Monte Carlo principle to calculate the transmittance of Ni filter sheets with different thicknesses to optimize the energy spectrum of the ray light source and enhance its spectral purity. The steps include: First, based on this principle, the behavior of X-ray photons in the filter is simulated by random sampling to statistically obtain the transmittance at different thicknesses: , where μ(λ) is the mass absorption coefficient, ρ is the density of the Ni filter, and d is the thickness of the Ni filter; Secondly, the X-ray photons are initially set: for each simulated photon, its position and initial direction on the incident surface of the Ni filter are randomly generated. When the photon propagates in the Ni filter, according to the mass absorption coefficient corresponding to its energy, it is judged whether the photon is absorbed by a random number: Let the generated random number be r. If , it is determined that the photon is absorbed. Otherwise, the photon continues to propagate, where is the thickness of the filter traversed by the photon in this propagation step; Thirdly, N simulations are carried out, and the number of photons n passing through the Ni filter is statistically obtained. The estimated value of the transmittance at this thickness is ; Fourthly, for different Ni filter thicknesses d, the estimated transmittance values of X-ray Cu-Kα and Cu-Kβ and are calculated respectively, and then the optimization objective function is constructed; Finally, the preset thickness range is traversed, the value of the objective function F at each thickness is calculated, and the thickness that makes F reach the maximum value is selected as the optimal Ni filter thickness.
3. The adaptive beam spot calibration method based on a small-angle X-ray scattering device according to claim 2, characterized in that: On the basis of determining the optimal thickness of the Ni filter sheet, it is also necessary to optimize the pinhole combination to improve the spatial collimation of the ray light source, so as to finally obtain an optimized ray light source. The process is as follows: First, perform simulation calculations on the geometric divergence angle of the pinhole: For a single pinhole, based on Monte Carlo simulation, when a large number of photons randomly generated from the light source propagate to the pinhole, judge whether they pass according to the pinhole size, and count the landing distribution of the photons passing through the pinhole on the detector. Estimate the actual geometric divergence angle by calculating the standard deviation of the landing distribution; For a double pinhole: Similarly based on Monte Carlo simulation, when a large number of photons randomly generated from the light source propagate to the pinhole, track their propagation paths, count the landing distribution of the photons on the detector after passing through the double pinhole, and calculate the actual geometric divergence angle; Secondly, based on the ROI region set on the detector surface, statistically count the number of photons received in this region through Monte Carlo simulation, calculate the estimated value of the signal intensity. At the same time, statistically count the equivalent number of photons generated by noise in this region, calculate the estimated value of the noise intensity, and obtain the estimated value of the signal-to-noise ratio; Finally, compare the simulation results of the geometric divergence angle and the signal-to-noise ratio under different pinhole combinations, and select the pinhole combination with a lower geometric divergence angle and a higher signal-to-noise ratio as the optimal solution.
4. The adaptive beam spot calibration method based on a small-angle X-ray scattering device according to claim 1, characterized in that: After ensuring the isotropic smoothing of the image signal, it is also necessary to output the beam spot morphological feature data through cluster analysis. The process is as follows: First, determine the initial cluster centers by finding the local maxima of the KDE curve; Second, introduce the autocorrelation coefficient of the time series for weighting in the standardized Euclidean distance metric to enhance the influence of time correlation in cluster analysis; Thirdly, the splitting rule is dynamically adjusted according to the ratio of the within-class standard deviation to the current class mean to meet the clustering requirements of different signal strengths, and the similarity between classes is measured by the distance D B to dynamically adjust the merging rule. When the distance D B between classes is less than the set threshold and the amount of data within the class meets the preset conditions, the merging operation between classes is triggered; Finally, calculate the features for each obtained cluster, extract the geometric and statistical features of the beam spot image to form the beam spot morphological feature data, and perform standardization processing to organize the feature data into a structured data format for output.
5. The adaptive beam spot calibration method based on a small-angle X-ray scattering device according to claim 1 or 4, characterized in that: The process of the coarse adjustment strategy is as follows: Construct a beam spot quality factor Q with the signal-to-noise ratio and the main axis direction in the beam spot morphological feature data as indicators. With the current position as the center, generate a number of search points in the XY plane at a set step size. For each search point, calculate the beam spot quality factor Q. By comparing the Q values of each search point, select the direction with the largest Q value as the next moving direction. Among them, if the Q value shows a downward trend in three consecutive searches, switch to the random search mode to avoid falling into a local optimal solution; The process of the fine adjustment strategy is as follows: First, introduce a feedforward compensation mechanism using an adaptive PID controller, and construct a prediction model based on the Kalman filter algorithm to adjust the control signal in advance; Second, improve the system response sensitivity by dynamically adjusting the control period.
6. The adaptive beam spot calibration method based on a small-angle X-ray scattering device according to claim 1 or 4, characterized in that: After collecting the image signal and before performing the isotropic smoothing of the image signal, it is also necessary to preprocess the image signal to extract clear feature image data. The process is as follows: First, irradiate the sample with a stable light source, and perform median filtering on the obtained continuous K-frame images; Second, set a weight function, and perform weighted averaging on the filtered images to ensure that among the continuous K-frame images, the weight of the middle frame is the largest, and the weights of the front and rear frames decrease in turn; Third, perform Gaussian blur on the averaged image to reduce the influence of image noise; Subsequently, using the marked detector edge region as the background seed points, a background mask is obtained through the watershed algorithm transformation, and the spatial autocorrelation function is introduced to calculate the background value. , the influence of abnormal pixels at a long distance is suppressed by the distance attenuation factor, and logarithmic transformation is performed to enhance the image contrast: , wherein, is the corrected image intensity, and 65535 is the maximum digital count value of a 16-bit ADC; Finally, use the regularized least squares method to suppress overfitting, ensure that the first derivative of the fitting curve is smooth, and match the image signal change rate corresponding to the maximum acceleration of the sample stage. Perform local minimum screening on the fitted signal through extreme point detection, and perform non-maximum suppression calculation to ensure the interval between adjacent trough points of the image signal and avoid window overlap.
7. The adaptive beam spot calibration method based on a small-angle X-ray scattering device according to claim 1, characterized in that: By collecting the flat-field images F of the detector at multiple different positions flat (x, y), and using non-negative matrix factorization to extract the detector response characteristics, calculating the flat-field response rate R(x, y) of the detector, and completing the initial calibration operation of the detector, where the calculation formula for the flat-field response rate R(x, y) is: , Wherein, is the response attenuation coefficient of the detector edge region, μ flat is the average value of the flat-field image, I d (x, y) is the dark current of the detector module.
8. The adaptive beam spot calibration method based on a small-angle X-ray scattering device according to claim 1, characterized in that: The multiple indicators include the size stability, position repeatability, shape consistency, and energy concentration of the beam spot image.
9. An adaptive beam spot calibration system based on a small-angle X-ray scattering device, characterized in that: Comprising: A memory; A processor; And a light source module, a collimation module, a sample stage module, and a detector module respectively electrically connected to the processor; The memory includes an adaptive beam spot calibration program, and when the adaptive beam spot calibration program is executed by the processor, it implements the adaptive beam spot calibration method based on a small-angle X-ray scattering device according to any one of claims 1 to 8.
Citation Information
Patent Citations
Optimization method for structure parameters of collimation system of small-angle X-ray scattering instrument
CN117113561A
Method for simulating rubber material
JP2013108800A
ROI selection in image registration
US20060002631A1
Radiographic system, radiographic method and computer readable medium
US20110243305A1
Cited By
Line laser 3D contourgraph working method integrating multiple stray light suppression algorithms
CN121169727A
Integral active spectrum stabilization system and method of desktop high-resolution X-ray emission spectrometer
CN121703161A
Integrated Active Spectrum Stabilization System and Method for Desktop High-Resolution X-ray Emission Spectrometer
CN121703161B
