A method for calibrating a physical location of a gamma event and related apparatus
By constructing frame data images and segmenting them using the watershed algorithm, and combining point modulus parameters to calculate the actual and theoretical physical locations of gamma events, the problems of cumbersome and time-consuming gamma event calibration and misjudgment in existing technologies are solved, achieving efficient and accurate automated calibration.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SPARTICLE HEALTHCARE CO LTD
- Filing Date
- 2025-11-06
- Publication Date
- 2026-06-26
AI Technical Summary
In existing technologies, the physical location calibration process for gamma events is cumbersome, time-consuming, and prone to misjudgment, resulting in poor calibration accuracy and efficiency.
By acquiring the original physical location and energy value of the gamma event collected by the detector, a frame data image is constructed. The image is segmented using the watershed algorithm, the actual and theoretical physical locations are calculated, and calibration is performed in combination with the parameters of the preset point model to achieve fully automated calibration.
This improved the accuracy and efficiency of physical location calibration for gamma events, avoided misjudgments caused by human intervention, and achieved precise physical location calibration.
Smart Images

Figure CN121454585B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of nuclear medicine gamma photon detection technology, and in particular to a calibration method and related apparatus for the physical location of gamma events. Background Technology
[0002] Gamma photons are fundamental signal carriers in nuclear medicine imaging, released by the decay of radioactive tracers in the body, and carrying functional metabolic information. When a gamma photon is absorbed by a detector crystal, it triggers a series of physical responses, forming an electrical signal pulse that can be recorded by the electronic system—a gamma event. Due to differences in hardware characteristics and non-uniform detector responses, the original physical location of detected gamma events exhibits systematic biases and nonlinear distortions, affecting subsequent analysis. Therefore, calibrating the physical location of gamma events is particularly important.
[0003] Currently, the primary method is to manually calibrate the original physical location of gamma events collected by the detector through a preset point model based on experience.
[0004] However, the manual intervention process is cumbersome and time-consuming, and when there are complex distortions in the physical location of the gamma event, misjudgments are prone to occur, resulting in poor accuracy and efficiency in calibrating the physical location of the gamma event. Summary of the Invention
[0005] In view of the above problems, this application provides a method and related apparatus for calibrating the physical location of gamma events. To improve the accuracy and efficiency of calibrating the physical location of gamma events, the specific solution is as follows:
[0006] The first aspect of this application provides a method for calibrating the physical location of a gamma event, comprising:
[0007] The original physical location and energy value of the gamma event are obtained by the detector through a preset point model;
[0008] Based on the original physical location and energy value of the γ event, a frame data image of the γ event is constructed;
[0009] The frame data image of the γ event is segmented using the watershed algorithm to obtain the segmented frame data image of the γ event, and the adjusted frame data image of the γ event is obtained after adjusting the segmented frame data image of the γ event. The number of grids in the adjusted frame data image of the γ event is consistent with the number of dots in the preset dot matrix.
[0010] The actual physical location of the γ event is calculated based on the pixel positions of each grid in the adjusted frame data image of the γ event and the pixel values of each grid in the adjusted frame data image of the γ event.
[0011] The theoretical physical location of the γ event is calculated based on the pixel position of each grid in the adjusted frame data image of the γ event, the pixel value of each grid in the adjusted frame data image of the γ event, the number of dot matrix rows of the preset dot matrix, the number of preset dot arrays of the preset dot matrix, and the dot matrix spacing of the preset dot matrix.
[0012] Based on the theoretical physical location and the actual physical location of the γ event, the physical location deviation of the γ event is calculated, and the original physical location of the γ event is calibrated based on the physical location deviation of the γ event.
[0013] In one possible implementation, constructing the frame data image of the γ event based on the original physical location and energy value of the γ event includes:
[0014] The peak energy value of the γ event is obtained from the energy value of the γ event, and the energy window range of the γ event is calculated based on the preset energy window threshold and the peak energy value of the γ event.
[0015] The energy value of each γ event within the energy window range of the γ event is determined as the effective energy value of the γ event, and the effective energy value of the γ event is determined as the pixel value of the γ event;
[0016] Based on the original physical location of each γ event corresponding to the pixel value of the γ event, the preset image resolution and preset image size, the pixel position corresponding to the pixel value of the γ event is calculated;
[0017] Based on the pixel value of the γ event and the pixel position corresponding to the pixel value of the γ event, a frame data image of the γ event is constructed.
[0018] In one possible implementation, segmenting the frame data image of the γ event using the watershed algorithm to obtain the segmented frame data image of the γ event includes:
[0019] The frame data image of the γ event is analyzed to obtain the energy gradient amplitude image of the γ event and the energy brightness marker points of the γ event;
[0020] Based on the energy gradient magnitude image and the energy brightness markers of the γ event, the frame data image of the γ event is segmented using the watershed algorithm to obtain the segmented frame data image of the γ event.
[0021] In one possible implementation, the calculation of the actual physical location of the γ event based on the pixel positions of each grid in the adjusted frame data image of the γ event and the pixel values of each grid in the adjusted frame data image of the γ event includes:
[0022] Based on the pixel positions of each grid in the adjusted frame data image of the γ event and the pixel values of each grid in the adjusted frame data image of the γ event, the centroid positions of the pixels in each grid of the adjusted frame data image of the γ event are calculated.
[0023] The actual physical location of the γ event is calculated based on the pixel centroid positions of each grid in the adjusted frame data image of the γ event, the preset image resolution, and the preset image size.
[0024] In one possible implementation, the theoretical physical location of the γ event is calculated using the pixel positions of each grid in the adjusted frame data image based on the γ event, the pixel values of each grid in the adjusted frame data image based on the γ event, the number of dot matrix rows of the preset dot matrix, the number of preset dot arrays of the preset dot matrix, and the dot matrix spacing of the preset dot matrix, including:
[0025] Based on the pixel positions of each grid in the adjusted frame data image of the γ event and the pixel values of each grid in the adjusted frame data image of the γ event, the centroid positions of the pixels in each grid of the adjusted frame data image of the γ event are calculated.
[0026] Based on the pixel centroid position of each grid in the adjusted frame data image of the γ event, the number of dot matrix rows of the preset dot matrix, and the number of preset dot arrays, a corresponding index is assigned to each grid in the adjusted frame data image of the γ event.
[0027] The theoretical physical location of the γ event is calculated based on the index of each grid in the adjusted frame data image of the γ event, the number of rows of the preset dot matrix, the number of preset dot arrays of the preset dot matrix, and the dot spacing of the preset dot matrix.
[0028] In one possible implementation, after segmenting the frame data image of the γ event using the watershed algorithm to obtain the segmented frame data image of the γ event, and obtaining the adjusted frame data image of the γ event after adjusting the segmented frame data image of the γ event, the method further includes:
[0029] The number of pixels in each grid of the adjusted frame data image based on the γ event is greater than the preset number of pixels;
[0030] The target grid of the adjusted frame data image of the γ event is determined from each grid of the adjusted frame data image of the γ event, wherein the number of pixels in the target grid of the adjusted frame data image of the γ event is greater than a preset number of pixels;
[0031] Update each grid of the adjusted frame data image of the γ event to the target grid of the adjusted frame data image of the γ event.
[0032] In one possible implementation, after calculating the physical position deviation of the γ event based on its theoretical physical position and actual physical position, the method further includes:
[0033] The physical position deviation of the γ event is supplemented based on the preset boundary deviation to obtain the supplemented physical position deviation of the γ event;
[0034] A cubic interpolation algorithm is used to spatially interpolate the supplemented physical position deviation of the γ event to obtain the interpolated physical position deviation of the γ event.
[0035] The physical position deviation of the γ event is updated to the interpolated physical position deviation of the γ event.
[0036] A second aspect of this application provides a computer program product including computer-readable instructions that, when executed on an electronic device, cause the electronic device to implement a calibration method for the physical location of a γ event as described in the first aspect or any implementation thereof.
[0037] A third aspect of this application provides an electronic device, comprising at least one processor and a memory connected to the processor, wherein:
[0038] The memory is used to store computer programs;
[0039] The processor is used to execute the computer program to enable the electronic device to implement the calibration method for the physical location of the γ event in the first aspect or any implementation thereof.
[0040] A fourth aspect of this application provides a computer storage medium carrying one or more computer programs that, when executed by an electronic device, enable a method for calibrating the physical location of a γ event in the electronic device as described in the first aspect or any implementation thereof.
[0041] By employing the above technical solution, this application provides a method and related apparatus for calibrating the physical location of a gamma event. The method includes: constructing a frame data image based on the original physical location and energy value of the gamma event acquired by a detector under preset point model conditions, transforming the discrete event into a visualized spatial distribution. The frame data image is segmented using a watershed algorithm, and adjustments are made to ensure that the number of segmented grids matches the number of points in the point model, effectively avoiding misjudgments caused by over-segmentation or under-segmentation. Based on this, the precise actual physical location of the gamma event is calculated by combining the pixel position and pixel value of each grid. Simultaneously, the precise theoretical physical location of the gamma event is calculated based on the pixel position and pixel value of each grid, as well as the number of rows, columns, and spacing of the point model. Finally, the deviation between the theoretical and actual physical locations is calculated, and the original physical location is calibrated accordingly. This achieves fully automated calibration without manual intervention, significantly improving the accuracy and efficiency of calibrating the physical location of gamma events. Attached Figure Description
[0042] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.
[0043] Figure 1 A flowchart illustrating a method for calibrating the physical location of a gamma event, provided in an embodiment of this application;
[0044] Figure 2 A schematic diagram of a frame data image of a gamma event provided in an embodiment of this application;
[0045] Figure 3 A segmented frame data image of a gamma photon event provided in an embodiment of this application;
[0046] Figure 4 A frame data image of a gamma photon event before adjustment, provided as an embodiment of this application;
[0047] Figure 5 An adjusted frame data image of a gamma photon event provided in an embodiment of this application;
[0048] Figure 6 A frame data image before the allocation index of a gamma photon event is provided in an embodiment of this application;
[0049] Figure 7 A frame data image of a gamma photon event after allocation indexing, provided for an embodiment of this application;
[0050] Figure 8This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0051] The embodiments of this application are described below with reference to the accompanying drawings. The terminology used in the implementation section of this application is for explaining specific embodiments only and is not intended to limit the scope of this application.
[0052] The embodiments of this application will now be described with reference to the accompanying drawings. Those skilled in the art will recognize that, with technological advancements and the emergence of new scenarios, the technical solutions provided in the embodiments of this application are equally applicable to similar technical problems.
[0053] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of elements is not necessarily limited to those elements, but may include other elements not explicitly listed or inherent to those processes, methods, products, or apparatuses.
[0054] To improve the accuracy and efficiency of calibrating the physical location of gamma events, this application provides a method for calibrating the physical location of gamma events. The method for calibrating the physical location of gamma events provided in this application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0055] Please see the appendix Figure 1 , Figure 1 This is a flowchart illustrating a method for calibrating the physical location of a gamma event, provided in an embodiment of this application. The method may include the following steps:
[0056] Step S101: Obtain the original physical location and energy value of the γ event collected by the detector through the preset point module.
[0057] It should be noted that γ refers to the process by which the detector detects an incident γ photon and forms a complete record. After the γ photon is absorbed by the crystal, the system collects the light signal through a photomultiplier tube, processes it through electronic circuits, and finally outputs a set of data containing information such as spatial position, energy, and time. This data record is called a γ event, which is the basic data unit for subsequent image reconstruction and calibration. The raw physical position refers to the two-dimensional coordinates of the γ event on the detector plane calculated by the detector's positioning circuit based on the relative intensity distribution of the signals from each photomultiplier tube (such as using the centroid method or the maximum likelihood method), usually expressed as (raw...). x raw y The value is in millimeters (mm). This position is uncorrected for any nonlinear distortion and reflects the detector's actual response in its current state. The energy value refers to the numerical value obtained by measuring the total pulse height generated by the detector's energy circuit for the gamma event, usually expressed as E, with the unit being kiloelectron volts (keV). A preset point phantom is a standard phantom used for detector performance calibration, typically made of high-density materials (such as lead or tungsten) with multiple small holes arranged in a precise pattern, allowing only gamma photons from specific directions to pass through.
[0058] In this application, a preset point model is first placed in front of the detector, and its regular aperture structure is used to spatially constrain gamma rays, so that each aperture corresponds to a specific theoretical incident direction and ideal response position. Under these conditions, radioactive nuclides (such as...) 99m The gamma photons released during the decay of Tc (transient charge) pass through a small aperture and enter the detector, interacting with the scintillation crystal and producing visible light scintillation. Multiple photomultiplier tubes receive this light signal and output corresponding voltage pulses. The positioning circuit calculates the location of this interaction, i.e., the original physical location (raw) of the gamma event, based on the relative intensity distribution of the signals from each photomultiplier tube using algorithms such as the centroid method. x raw y Simultaneously, the energy circuit sums all photomultiplier tube signals and measures their total pulse height to obtain the energy value E of the event. These data reflect the space response characteristics of the detector under actual operating conditions.
[0059] To facilitate understanding, consider the following example: In actual calibration, a lead-based pre-set dot pattern with 55 rows × 42 columns of regularly arranged small holes is used. 99m The Tc radiation source is placed behind the point model. Gamma photons sequentially pass through small holes into the detector crystal. When a gamma photon strikes the crystal, it triggers a flash emission, and the resulting light signal is received by multiple photomultiplier tubes and converted into voltage pulses. Based on the relative intensity distribution of these photomultiplier tube signals, the positioning circuit uses the centroid method to calculate the raw physical location of the event. x raw y) = (-148.6mm, -162.4mm), and its energy value E = 139.2keV.
[0060] Step S102: Construct a frame data image of the γ event based on the original physical location and energy value of the γ event.
[0061] In this application, the peak energy value of the gamma event is first obtained, and the energy window range of the gamma event is calculated based on a preset energy window threshold and the peak energy value of the gamma event. Then, the energy values of each gamma event within the energy window range of the gamma event are determined as the effective energy values of the gamma event, and the effective energy values of the gamma event are determined as the pixel values of the gamma event.
[0062] Then, based on the original physical location of each γ event corresponding to its pixel value, the preset image resolution, and the preset image size, the pixel position corresponding to the pixel value of the γ event can be calculated. Finally, based on the pixel value of the γ event and the pixel position corresponding to its pixel value, the frame data image of the γ event can be constructed.
[0063] Specifically, the peak energy of a gamma event is the maximum energy deposited for each gamma event, determined by the pulse height output by the photomultiplier tube. 99m Taking Tc as an example of a radioactive source, the gamma photons emitted by this nuclide have a characteristic energy peak of 140.5 keV. This means that, ideally, all gamma photons emitted by Tc can reach a peak energy peak of 140.5 keV. 99m A gamma event emitted by Tc and recorded by a detector should have an energy value close to 140.5 keV. However, in practice, the actual energy of a gamma event may deviate due to factors such as scattering and differences in detector efficiency. To filter out the data most likely representing the true gamma event, we calculate an energy window range based on the energy peak and a preset energy window threshold. This energy window range is used to filter out non-target events that may be caused by scattering or noise, ensuring that only the energy values of gamma events falling within this energy window range are determined as valid gamma event energy values. For example, for 99m Tc is set with an energy window threshold of ±10%, meaning it fluctuates around 10% of 140.5 keV, resulting in an energy window range of 126-154 keV. The original physical location of the γ event is raw. x =-148.6mm, raw y =162.4mm, its energy value E=139.2keV. Since this energy value is within the set energy window range, the energy value of this gamma event is the effective energy value.
[0064] You can first calculate the center pixel of the image based on the image dimensions (including image length and image width). Refer to the following formula for details: x center_px=(image length - 1) / 2 and y center_px =(image width - 1) / 2, the image center pixel corresponds to the physical coordinate origin (0, 0) mm, and the image center pixel can be used as the center pixel offset. Then, based on the center pixel offset and the image resolution (resolution / raw), the original physical position (raw) of the γ event can be obtained through simple mathematical transformations. x raw y The gamma event can be converted into pixel positions (row, col) in an image, meaning the raw physical location of the gamma event can be converted into a pixel position (row, col). x and raw y Divide each value by the pixel resolution and add the corresponding center pixel offset to obtain the pixel position of the γ event in the image. The specific formula can be found in the following formula: and For ease of understanding, consider the following example: A pixel resolution of 2.0 mm / pixel, an image size of 500 × 500 pixels, and a center pixel of x. center_px =(500-1) / 2=249.5 and y center_px =(500-1) / 2=249.5, the image center pixel (249.5, 249.5) corresponds to the physical coordinate origin (0, 0) mm. The image center pixel (249.5, 249.5) can be used as the center pixel offset. Then, the original physical position of the γ event (-148.6mm, -162.4mm) can be transformed to obtain the pixel position in the image. .
[0065] The effective energy value of a gamma event not only indicates the magnitude of the gamma event's energy but also serves as the basis for constructing a frame data image in subsequent steps. Each effective energy value of a gamma event contributes a certain grayscale value to the pixels in the frame data image. For each effective event, its corresponding energy value (i.e., pixel value) can be accumulated at the corresponding position in the image array. This means that if multiple events map to the same pixel or adjacent pixel regions, the grayscale values of these pixels will increase, reflecting a higher energy density or count rate. This process is repeated until all effective events are processed, ultimately forming a frame data image. For easier understanding, consider the following example: In this 55x42 image, there are 2310 bright spots. Each bright spot corresponds to a response area of a dot aperture, and its brightness reflects the total energy or count rate of gamma events within that area. Accumulating multiple 139.2 keV values at position (175, 168) in the image array will result in a very high grayscale value for this pixel, reaching approximately 5000 keV, due to the large concentration of gamma events there, forming a significant bright spot. This bright spot not only demonstrates the detector's spatial response characteristics but also provides a high-quality data foundation for subsequent watershed segmentation algorithms, facilitating accurate image segmentation and position calibration. For details, please refer to... Figure 2 , Figure 2 This is a schematic diagram of a frame data image of a gamma event provided in an embodiment of this application. Through the above steps, discrete gamma events are converted into a structured two-dimensional frame data image, laying a solid foundation for further analysis.
[0066] Step S103: Use the watershed algorithm to segment the frame data image of the γ event to obtain the segmented frame data image of the γ event, and obtain the adjusted frame data image of the γ event after adjusting the segmented frame data image of the γ event. The number of grids in the adjusted frame data image of the γ event is consistent with the number of dots in the preset dot matrix.
[0067] In this application, the frame data image of a gamma event can be analyzed to obtain the energy gradient magnitude image and energy brightness markers of the gamma event. Based on the energy gradient magnitude image and energy brightness markers of the gamma event, the watershed algorithm can be used to segment the frame data image of the gamma event to obtain the segmented frame data image of the gamma event.
[0068] Energy frame images are maps of photon distribution emitted after gamma rays interact with matter, captured by a detector. The grayscale value of each point reflects the energy deposition level at that location. These images typically contain noise, overlapping regions, and other interference, thus requiring processing to extract useful information.
[0069] To identify boundaries or edges between different regions, which are typically areas of most dramatic energy changes, gradient operators (such as the Sobel operator, Prewitt operator, etc.) are applied to the original energy frame image. This step calculates the rate of energy change along the x and y axes at each pixel. Based on these rates of change, a combined gradient vector can be calculated, whose magnitude (i.e., gradient magnitude) represents the degree of energy change at that point. The gradient direction provides additional information about the boundaries, but in this scenario, the primary focus is on the gradient magnitude image. Potential seed points are then found for initial segmentation in the watershed algorithm. These points should correspond to local maxima with the highest energy, as they are likely located at the center of the point aperture. Peak detection algorithms (such as non-maximum suppression techniques) can be used to find local maxima in the energy frame image. This process may include smoothing to reduce noise. Each candidate point is validated to ensure it meets certain threshold conditions, such as a minimum energy intensity, thus eliminating false positives caused by noise. The resulting energy gradient magnitude image is used as input, and the previously determined energy brightness markers are used as seed points to execute the watershed algorithm. This stage may lead to oversegmentation, generating too many small regions (e.g., 2350 regions). The generated label_map[x][y] is a two-dimensional array, where each element represents the segmentation region number corresponding to the position (x, y) on the image. label_map[x][y]=k (k=1~2350) means that the pixel belongs to the region corresponding to the k-th aperture position, while label_map[x][y]=0 indicates a background pixel. Finally, the segmented frame data image of the γ-photon event is obtained; for details, please refer to [reference needed]. Figure 3 , Figure 3 This application provides a segmented frame data image of a gamma photon event. Based on the energy gradient magnitude image and energy brightness markers of the gamma event, the watershed algorithm is used to segment the frame data image of the gamma event to obtain the segmented frame data image of the gamma event.
[0070] Since initial segmentation may lead to oversegmentation (i.e., a single actual point aperture location is incorrectly segmented into multiple small regions), further processing is required. This typically involves merging smaller regions (potentially incorrect segmentations caused by noise) and using morphological operations (such as closing operations) to correct region boundaries. To ensure the grid size of the segmented frame data matches the preset point aperture size, a precise alignment step is necessary. This means determining the correspondence between each segmented region and a specific point in the preset point aperture. This can be achieved through: Geometric transformation: If the layout of the point aperture locations is known, appropriate geometric transformations (such as translation, rotation, and scaling) can be applied to align the segmentation results with the preset point aperture. Template matching: Template matching techniques are used to find the optimal alignment, ensuring the segmented regions correspond as accurately as possible to the point aperture locations. After correct alignment, a grid matching the preset point aperture size can be created. Each grid cell represents a point aperture location and contains energy deposition information for that location. For cases where there are no directly corresponding segmented regions, interpolation or assignment can be performed based on information from neighboring regions. Finally, the adjusted frame data image is verified to ensure that its grid number is exactly consistent with the preset dot matrix number. This involves checking whether each grid cell is correctly associated with a specific dot matrix aperture, and whether all expected dot matrix apertures are properly represented in the final image. At this point, label_map[x][y]=k (k=1~2310) means that the pixel belongs to the region corresponding to the k-th dot matrix aperture. A clear and accurate dot matrix response pattern was extracted from the frame data image of the complex gamma photon event, resulting in the adjusted frame data image of the gamma photon event. For details, please refer to [reference needed]. Figure 4 and Figure 5 , Figure 4 This application provides an example of a frame data image of a gamma photon event before adjustment. Figure 4 An adjusted frame data image of a gamma photon event provided in an embodiment of this application.
[0071] Furthermore, the adjustment can be based on the fact that the number of pixels in each grid of the adjusted frame data image for the γ event is greater than a preset number of pixels. The target grid of the adjusted frame data image for the γ event is determined from each grid of the adjusted frame data image for the γ event, where the number of pixels in the target grid is greater than a preset number of pixels. The grids of the adjusted frame data image for the γ event are then updated to match the target grid of the adjusted frame data image for the γ event.
[0072] To further optimize and validate the gamma photon event-adjusted frame data image, a series of meticulous processing steps are required. These steps include selecting target grids based on pixel count, updating grids, and ensuring the connectivity of segmentation lines and identifying valid regions. The following is a detailed explanation: First, a preset pixel count threshold is set, which can be determined based on the actual application scenario. For example, assuming we set the preset pixel count to 50 pixels, only grids containing more than 50 pixels will be considered valid target grids. For each grid (i.e., the region corresponding to a dot-matrix aperture), the total number of pixels it contains is calculated. This can be achieved by iterating through the `label_map` array and counting all pixels corresponding to each label. For example, if `label_map[x][y] = k`, then count all pixels equal to k. The pixel count of each grid is compared with the preset pixel count threshold. If the pixel count of a grid is greater than or equal to the preset value, it is marked as a target grid. These target grids represent valid gamma event clusters, which may correspond to actual dot-matrix aperture responses. All grids in the adjusted frame data image are updated to target grids. This means that non-target meshes (i.e., those with fewer pixels than a preset value) may be ignored or merged into adjacent target meshes to ensure that the final result only contains significant γ event clusters.
[0073] To ensure the quality of segmentation results, it is necessary to ensure that each pixel on each segmentation line has at least two adjacent pixels (in the top, bottom, left, and right directions). This avoids discontinuous boundaries caused by isolated noise points, thereby improving segmentation accuracy. Each pixel on the segmentation line can be traversed, checking if there are other pixels belonging to the same segmentation line in the top, bottom, left, and right directions. If no adjacent pixels meet the criteria, the pixel is considered isolated, possibly due to incorrect segmentation caused by noise. Once an isolated pixel is detected, it can be reassigned to its nearest larger neighboring region, or techniques such as morphological closing operations can be used to fill small gaps and enhance the coherence of the segmentation lines.
[0074] Attribute analysis is performed on each segmented region, primarily focusing on area size. By setting an area threshold, spurious regions that are too small and may be caused by noise can be effectively removed. Based on a pre-set area threshold (e.g., a minimum area of 100 pixels), valid regions that meet the criteria are selected. Any small regions smaller than this threshold are removed, while the remaining regions are the valid regions that truly reflect the aggregation of gamma events. After screening, the remaining regions should accurately reflect the detector's response to different point aperture positions. These regions not only contribute to subsequent physical analysis but can also be used to evaluate the detector's performance metrics such as spatial resolution and uniformity.
[0075] Step S104: Based on the pixel positions of each grid in the adjusted frame data image of the γ event and the pixel values of each grid in the adjusted frame data image of the γ event, calculate the actual physical location of the γ event.
[0076] In this application, the centroid position of each grid in the adjusted frame data image of the γ event can be calculated based on the pixel position and pixel value of each grid in the adjusted frame data image of the γ event. The actual physical position of the γ event can be calculated based on the centroid position of each grid in the adjusted frame data image of the γ event, a preset image resolution, and a preset image size.
[0077] After image segmentation and validity screening, each retained target grid represents a gamma event response region corresponding to a point aperture position. Due to nonlinear distortion or positioning errors in the detector, the center of these response regions may not fall precisely at the theoretical grid position. Therefore, the actual response center, i.e., the pixel centroid position, of each response region can be accurately estimated by weighted averaging.
[0078] The centroid of a pixel is the spatial center point obtained by weighting the average of all pixels within a connected region based on their grayscale values (here, energy deposition values, i.e., pixel values). It reflects the true centroid of energy distribution more accurately than a simple geometric center, and is particularly suitable for situations with non-uniform response intensity. For the k-th effective grid, let Ω be the set of all pixels it contains. k Each pixel i has a pixel position (x) i y i ) and pixel value I i Then the centroid position of the pixels in this grid (C) x k C y k Calculate using the following formula:
[0079] C x k =[∑(x i ×I i )] / ∑I i
[0080] C y k =[∑(y i ×I i )] / ∑I i
[0081] Among them, C x k C represents the weighted average position of the centroid along the column direction (unit: pixels). yk This represents the weighted average position of the centroid along the row direction (unit: pixel). The denominator is the sum of all pixel values in the region, representing the total energy; the numerator is the position-weighted sum of energy.
[0082] For ease of understanding, consider the following example: A grid contains three pixels involved in the calculation: pixel position (x...) i y i )=(168,175), pixel value I i =1300keV; pixel position (x i y i )==(169, 175), pixel value I i =1200keV; pixel position (x i y i )==(168, 176), pixel value I i =500keV, total energy = 1300 + 1200 + 500 = 3000keV. C x =(175×1300+175×1200+176×500) / 3000≈175.17px, C y =(168×1300+169×1200+168×500) / 3000≈168.40px, finally obtaining the pixel centroid of the grid as (C x k C y k = (175.17, 168.40) pixels.
[0083] Obtaining pixel coordinates alone is insufficient; they must also be converted into actual physical positions (x_actual, y_actual) on the detector plane, in millimeters (mm), for comparison with the theoretical positions of preset point models. This allows for assessment of system bias and correction. This requires the image center pixel coordinates and image resolution. Subtracting the image center offset from the pixel position yields the offset in pixels relative to the image center; multiplying this by the resolution converts to the physical position. Refer to the following formula for details: x actual =(C x -xcenter_px)×resolution and y actual =(C y -y center_px )×resolution. For ease of understanding, an example is given below: (C x k C y k When the pixel value is (175.17, 168.40), the physical location is x. actual=(175.17−249.5)×2.0=−148.66mm and y actual =(168.40−249.5)×2.0=−162.20 mm, therefore, the actual physical location of this γ photon event is (-148.66,-162.20) mm.
[0084] Step S105: Based on the pixel position of each grid in the adjusted frame data image of the γ event, the pixel value of each grid in the adjusted frame data image of the γ event, the number of rows of the preset dot matrix, the number of preset dot arrays of the preset dot matrix, and the dot matrix spacing of the preset dot matrix, the theoretical physical position of the γ event is calculated.
[0085] In this application, firstly, the centroid position of each grid in the adjusted frame data image of the γ event can be calculated based on the pixel position and pixel value of each grid. Then, based on the centroid position of each grid, the number of rows and the number of arrays of the preset dot matrix, a corresponding index can be assigned to each grid in the adjusted frame data image of the γ event. Finally, the theoretical physical location of the γ event can be calculated based on the index of each grid, the number of rows, the number of arrays, and the spacing between the grids.
[0086] For each effective gamma-photon event response region after segmentation, filtering, and centroid calculation—that is, each grid in the adjusted frame data image—its theoretical physical location in an ideal distortion-free detection system is determined. This process does not rely on the response deviation of the actual detector but constructs an ideal coordinate reference system based on the geometric design parameters of the preset point modulus. This reference system is then used for comparison with the actual physical location to achieve spatial distortion correction.
[0087] First, for each valid segmented region (i.e., a connected region labeled k), its center position in the image is calculated using the weighted centroid method, i.e., the pixel centroid position (C). x C y Because detectors may exhibit nonlinear distortions (such as edge stretching, rotation, tilt, etc.), their row and column cannot be directly determined based on the physical location of their centroid. Therefore, an automatic sorting method based on relative spatial distribution must be used to assign a unique logical number (i,j) to each response region, indicating that it corresponds to the hole in the i-th row and j-th column of the point model. A one-to-one mapping relationship is established from "response regions detected in the image" to "the logical grid of the preset point model".
[0088] Because in the image coordinate system, C ySmaller values indicate higher positions, so the arrangement starts from the topmost response area. For a 2310 response area and a 55×42 logical grid, the centroids of all 2310 grid pixels can be arranged according to their C... y Sort the values (row direction coordinates) from smallest to largest. Then divide the sorted list into 55 groups, each containing 2310 / 55=42 grids, with each group corresponding to one row of the point modulus. Assign row indices i=0,1,2,...,54 to each group, increasing sequentially from top to bottom. First group (top): i=0; middle row: i=27; bottom group: i=54. Even if the response area of a row in the actual image is slightly skewed or misaligned, as long as the overall trend is arranged from top to bottom, this grouping method can still correctly identify the row structure. For each row, assign the pixel centroids of its 42 grids to C... x Sort the values (column direction coordinates) from smallest to largest. C x Smaller values indicate leftward placement. Column indices j = 0, 1, 2, ..., 41 are assigned sequentially from left to right. Ultimately, each grid cell now has a unique logical coordinate (i, j), representing its theoretical placement within the point array. For a clearer understanding, please refer to [reference needed]. Figure 6 and Figure 7 , Figure 6 This application provides a frame data image before the allocation index for a gamma photon event, as shown in the embodiments of this application. Figure 7 A frame data image with an assigned index for a gamma photon event provided in an embodiment of this application.
[0089] Once each response region is assigned a logical index (i,j), the physical coordinates of that location in an ideal detection system can be calculated based on the point matrix design parameters. The preset grid spacing (grid_spacing) is 10.0mm. At this point, the center index (i...j) of the logical grid... center , j center ) for i center =(row-1) / 2 and j center =(col-1) / 2, with the logical center as the origin (0,0), construct an ideal coordinate system: x theory =(jj center ×grid_spacing and y theory =(ii center ×grid_spacing, x theory Theoretical lateral physical position (unit: mm); y theory This represents the theoretical vertical physical location (unit: mm). For ease of understanding, an example is given below: For the grid assignment corresponding to index (10,5), i center =(55-1) / 2=27, j center =(42-1) / 2=20.5, xtheory =(5-20.5)×10.0=-155.0mm, y theory =(10-27)×10.0=-170.0mm, the theoretical longitudinal physical position is (-155.170.0)mm. This means that in an ideal detector, the (10,5)th point model aperture should produce a response on the detector plane, located 155.0mm to the left and 170.0mm above the center. The theoretical physical position is an ideal, distortion-free position calculated based on the geometric design of the point model.
[0090] Step S106: Based on the theoretical physical position and the actual physical position of the γ event, calculate the physical position deviation of the γ event, and calibrate the original physical position of the γ event based on the physical position deviation of the γ event.
[0091] In this application, for each effective segmented region (i.e., each identified point aperture response), its positioning error in two directions is calculated, namely the physical position deviation (Δx, Δy) of the γ event, which can be referred to in the following formula: Δx = x actual -x theory and Δy=y actual -y theory A positive deviation indicates that the detector response is biased to the right or lower; a negative deviation indicates that the response is biased to the left or upper. Taking a grid of (i=10, j=5) as an example, Δx=-148.6-(-155.0)=+6.4mm, Δy=-162.8-(-170.0)=+7.2mm. There is a significant positive offset in this area, meaning that the detector incorrectly recorded the response that should have appeared in (-155.0, -170.0) as being further to the right and lower.
[0092] The deviation at a single point is insufficient to represent the overall performance of the detector. The above calculations need to be repeated for all 2310 valid response regions to construct a complete two-dimensional distortion field. Each (x) can be used to construct this field. theory ,y theory The (Δx, Δy) and its corresponding values are stored as key-value pairs, which are suitable for subsequent interpolation or fast retrieval. Alternatively, since detector distortion is usually continuous and smooth (such as radial stretching, tangential twisting, etc.), mathematical functions can be used to model the overall deviation trend.
[0093] Furthermore, after calculating the physical position deviation of the γ event based on its theoretical and actual physical positions, a supplementary physical position deviation can be obtained by using a preset boundary deviation. A cubic interpolation algorithm is then used to spatially interpolate the supplementary physical position deviation of the γ event, resulting in the interpolated physical position deviation. Finally, the physical position deviation of the γ event is updated to its interpolated form.
[0094] In this application, after calculating the physical position deviation based on the theoretical and actual physical positions of gamma photon events, a boundary constraint mechanism is introduced to further improve the integrity and stability of spatial correction. Since the effective response area of the detector is typically slightly larger than the point model coverage, especially at the edges and corners of the imaging plane, measured deviation data is sparse or even missing. Direct spatial interpolation may lead to inaccurate extrapolation, amplified boundary distortion, or artifacts in the corrected image. Therefore, the system supplements the original physical position deviation based on preset boundary deviations. A set of virtual deviation points is added to the outer boundary of the detector's imaging area, with deviation values set according to the system's prior characteristics, such as using zero deviation, gradual transition, or mirror extension strategies to ensure that the deviation distribution within the entire effective area has reasonable boundary conditions. Through this supplementation process, the original discrete deviation data is expanded into an enhanced deviation set covering the entire field of view, including not only internal measured points but also peripheral constraint points, thus providing complete spatial support for subsequent high-precision interpolation.
[0095] Based on this, a cubic interpolation algorithm is used to spatially interpolate the supplemented physical position deviation. Cubic interpolation, with its second-order continuous differentiability, generates a smooth, abrupt deviation field function, effectively avoiding gradient discontinuities and local oscillations that may be caused by lower-order interpolation methods. The algorithm uses the supplemented deviation data as input, constructs a high-resolution two-dimensional interpolation grid across the entire detector plane, calculates the predicted deviation value at each location point-by-point, and finally generates a continuous and fine-grained interpolated physical position deviation field. This deviation field accurately reflects the spatial distortion trend of the detector at any location, exhibiting excellent generalization ability, especially in the unsampled areas at the edges and center. Subsequently, the discrete physical position deviation originally obtained based on the point modulus response is updated to this interpolated continuous deviation field. This allows subsequent calibration of gamma photon events to no longer be limited to the measured point location, but to achieve high-precision, consistent deviation compensation across the entire field of view, significantly improving the accuracy of spatial positioning and imaging quality.
[0096] In summary, this application provides a method for calibrating the physical location of a gamma event. This method includes: constructing a frame data image based on the original physical location and energy value of the gamma event acquired by a detector under preset point model conditions, transforming discrete events into a visualized spatial distribution. The frame data image is segmented using a watershed algorithm, and adjustments are made to ensure that the number of segmented grids matches the number of points in the point model, effectively avoiding misjudgments caused by over-segmentation or under-segmentation. Based on this, the precise actual physical location of the gamma event is calculated by combining the pixel position and pixel value of each grid. Simultaneously, the precise theoretical physical location of the gamma event is calculated based on the pixel position and pixel value of each grid, as well as the number of rows, columns, and spacing of the point model. Finally, the precise physical location deviation of the gamma event is calculated by comparing the theoretical physical location and the actual physical location, and the original physical location is calibrated accordingly. This achieves fully automated calibration without manual intervention, significantly improving the accuracy and efficiency of calibrating the physical location of gamma events.
[0097] This application also provides an electronic device in its embodiments. (See reference...) Figure 8 The diagram illustrates a structural schematic suitable for implementing the electronic device in the embodiments of this application. The electronic device in the embodiments of this application may include, but is not limited to, fixed terminals such as mobile phones, laptops, PDAs (personal digital assistants), PADs (tablet computers), desktop computers, etc. Figure 8 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0098] like Figure 8 As shown, the electronic device may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage device 808 into a random access memory (RAM) 803. When the electronic device is powered on, the RAM 803 also stores various programs and data required for the operation of the electronic device. The processing unit 801, ROM 802, and RAM 803 are interconnected via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0099] Typically, the following devices can be connected to I / O interface 805: input devices 806 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 807 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 808 including, for example, memory cards, hard drives, etc.; and communication devices 809. Communication device 809 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 8Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have alternatively.
[0100] This application also provides a computer program product including computer-readable instructions, which, when executed on an electronic device, cause the electronic device to implement a calibration method for the physical location of any gamma event provided in this application.
[0101] This application also provides a computer-readable storage medium carrying one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device is able to implement any of the calibration methods for the physical location of a gamma event provided in this application.
[0102] It should also be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the device embodiment drawings provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.
[0103] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware, or it can be implemented by special-purpose hardware including application-specific integrated circuits, special-purpose CPUs, special-purpose memory, special-purpose components, etc. Generally, any function performed by a computer program can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for this application, software program implementation is more often the preferred implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, training equipment, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0104] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product.
[0105] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, training device, or data center to another website, computer, training device, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).
Claims
1. A method for calibrating the physical location of a gamma event, characterized in that, include: The original physical location and energy value of the gamma event are obtained by the detector through a preset point model; Based on the original physical location and energy value of the γ event, a frame data image of the γ event is constructed; The frame data image of the γ event is segmented using the watershed algorithm to obtain the segmented frame data image of the γ event, and the adjusted frame data image of the γ event is obtained after adjusting the segmented frame data image of the γ event. The number of grids in the adjusted frame data image of the γ event is consistent with the number of dots in the preset dot matrix. The actual physical location of the γ event is calculated based on the pixel positions of each grid in the adjusted frame data image of the γ event and the pixel values of each grid in the adjusted frame data image of the γ event. The theoretical physical location of the γ event is calculated based on the pixel position of each grid in the adjusted frame data image of the γ event, the pixel value of each grid in the adjusted frame data image of the γ event, the number of dot matrix rows of the preset dot matrix, the number of preset dot arrays of the preset dot matrix, and the dot matrix spacing of the preset dot matrix. Based on the theoretical physical location and the actual physical location of the γ event, the physical location deviation of the γ event is calculated, and the original physical location of the γ event is calibrated based on the physical location deviation of the γ event. The construction of the frame data image of the gamma event based on its original physical location and energy value includes: The peak energy value of the γ event is obtained from the energy value of the γ event, and the energy window range of the γ event is calculated based on the preset energy window threshold and the peak energy value of the γ event. The energy value of each γ event within the energy window range of the γ event is determined as the effective energy value of the γ event, and the effective energy value of the γ event is determined as the pixel value of the γ event; Based on the original physical location of each γ event corresponding to the pixel value of the γ event, the preset image resolution and preset image size, the pixel position corresponding to the pixel value of the γ event is calculated; Based on the pixel value of the γ event and the pixel position corresponding to the pixel value of the γ event, a frame data image of the γ event is constructed; The actual physical location of the γ event is calculated by using the pixel positions of each grid in the adjusted frame data image based on the γ event and the pixel values of each grid in the adjusted frame data image based on the γ event, including: Based on the pixel positions of each grid in the adjusted frame data image of the γ event and the pixel values of each grid in the adjusted frame data image of the γ event, the centroid positions of the pixels in each grid of the adjusted frame data image of the γ event are calculated. The actual physical location of the γ event is calculated based on the pixel centroid positions of each grid in the adjusted frame data image of the γ event, the preset image resolution, and the preset image size.
2. The calibration method for the physical location of a gamma event according to claim 1, characterized in that, The step of segmenting the frame data image of the γ event using the watershed algorithm to obtain the segmented frame data image of the γ event includes: The frame data image of the γ event is analyzed to obtain the energy gradient amplitude image of the γ event and the energy brightness marker points of the γ event; Based on the energy gradient magnitude image and the energy brightness markers of the γ event, the frame data image of the γ event is segmented using the watershed algorithm to obtain the segmented frame data image of the γ event.
3. The method for calibrating the physical location of a gamma event according to claim 1, characterized in that, The theoretical physical location of the γ event is calculated using the pixel positions of each grid in the adjusted frame data image based on the γ event, the pixel values of each grid in the adjusted frame data image based on the γ event, the number of dot matrix rows of the preset dot matrix, the number of preset dot matrix arrays of the preset dot matrix, and the dot matrix spacing of the preset dot matrix, including: Based on the pixel positions of each grid in the adjusted frame data image of the γ event and the pixel values of each grid in the adjusted frame data image of the γ event, the centroid positions of the pixels in each grid of the adjusted frame data image of the γ event are calculated. Based on the pixel centroid position of each grid in the adjusted frame data image of the γ event, the number of dot matrix rows of the preset dot matrix, and the number of preset dot arrays, a corresponding index is assigned to each grid in the adjusted frame data image of the γ event. The theoretical physical location of the γ event is calculated based on the index of each grid in the adjusted frame data image of the γ event, the number of rows of the preset dot matrix, the number of preset dot arrays of the preset dot matrix, and the dot spacing of the preset dot matrix.
4. The method for calibrating the physical location of a gamma event according to claim 1, characterized in that, After segmenting the frame data image of the γ event using the watershed algorithm to obtain the segmented frame data image of the γ event, and obtaining the adjusted frame data image of the γ event after adjusting the segmented frame data image of the γ event, the method further includes: The number of pixels in each grid of the adjusted frame data image based on the γ event is greater than the preset number of pixels; The target grid of the adjusted frame data image of the γ event is determined from each grid of the adjusted frame data image of the γ event, wherein the number of pixels in the target grid of the adjusted frame data image of the γ event is greater than a preset number of pixels; Update each grid of the adjusted frame data image of the γ event to the target grid of the adjusted frame data image of the γ event.
5. The method for calibrating the physical location of a gamma event according to claim 1, characterized in that, After calculating the physical position deviation of the γ event based on its theoretical physical position and actual physical position, the method further includes: The physical position deviation of the γ event is supplemented based on the preset boundary deviation to obtain the supplemented physical position deviation of the γ event; A cubic interpolation algorithm is used to spatially interpolate the supplemented physical position deviation of the γ event to obtain the interpolated physical position deviation of the γ event. The physical position deviation of the γ event is updated to the interpolated physical position deviation of the γ event.
6. A computer program product, characterized in that, Includes computer-readable instructions that, when executed on an electronic device, cause the electronic device to implement the calibration method for the physical location of a gamma event as described in any one of claims 1 to 5.
7. An electronic device, characterized in that, It includes at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is configured to execute the computer program to enable the electronic device to implement the calibration method for the physical location of the gamma event as described in any one of claims 1 to 5.
8. A computer storage medium, characterized in that, The storage medium carries one or more computer programs that, when executed by an electronic device, enable the electronic device to implement the calibration method for the physical location of a gamma event as described in any one of claims 1 to 5.