Position processing method and apparatus

By constructing a lightweight coordinate reference dataset and utilizing the crystal centroid coordinates and row and column average coordinates, the resource consumption and compactness issues of position mapping in gamma radiation imaging equipment were resolved, achieving high-speed, low-resource crystal positioning.

CN122110191APending Publication Date: 2026-05-29CHENGDU NOVEL MEDICAL EQUIPMENT CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHENGDU NOVEL MEDICAL EQUIPMENT CO LTD
Filing Date
2026-03-20
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

In existing gamma radiation imaging equipment, position mapping methods are difficult to achieve low resource consumption and compact design while ensuring processing speed. Traditional methods have a contradiction between throughput speed, resource consumption and hardware cost.

Method used

By determining the pixel position coordinates and coordinate reference data of gamma events, including crystal centroid coordinates, row average coordinates, and column average coordinates, a lightweight coordinate reference dataset is constructed and stored in the processor's internal memory. This dataset is used to quickly narrow down the search range and accurately match the target crystal.

Benefits of technology

It achieves reduced hardware resource consumption and power consumption without adding external storage devices, improves processing speed and positioning accuracy, and supports parallel operation of multiple modules.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122110191A_ABST
    Figure CN122110191A_ABST
Patent Text Reader

Abstract

Embodiments of the present specification provide a position processing method and device, wherein the method comprises: determining a pixel position coordinate of a gamma event in a detection imaging space, and coordinate reference data corresponding to the detection imaging space, wherein the coordinate reference data comprises a crystal gravity center coordinate of each imaging crystal in a crystal imaging array, a row average coordinate and a column average coordinate of the crystal imaging array; determining a candidate crystal set in the crystal imaging array according to the pixel position coordinate, the row average coordinate and the column average coordinate; and determining a target acting crystal of the gamma event in the candidate crystal set according to the crystal gravity center coordinate of each crystal in the candidate crystal set and the pixel position coordinate. The method achieves fast positioning of the acting crystal of the gamma event, which is compact, low in power consumption and cost, and supports multi-module parallel processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments in this specification relate to the field of radiation imaging technology, and in particular to a position processing method and apparatus. Background Technology

[0002] In gamma-ray imaging devices, the detector uses a scintillation crystal array to convert gamma events into output images. Due to factors such as optical diffusion and circuit response, there is a nonlinear deformation between the crystal position in the output image and the actual crystal array. Position mapping is needed to map the output pixel positions to the actual active crystal. Existing position mapping methods face a trade-off between processing speed, storage resource consumption, and system compactness when achieving fast lookup. Different mapping table storage methods have limitations in throughput, resource consumption, and hardware cost, making it difficult to simultaneously meet the requirements of high-speed processing, low resource consumption, and compact design. Therefore, how to achieve low-resource-consumption and compact crystal position lookup while ensuring processing speed is a pressing problem that needs to be solved. Summary of the Invention

[0003] In view of the above, embodiments of this specification provide a location processing method. One or more embodiments of this specification also relate to a location processing apparatus, a computing device, a computer-readable storage medium, and a computer program product, to address the technical deficiencies existing in the prior art.

[0004] According to a first aspect of the embodiments of this specification, a position processing method is provided, comprising: Determine the pixel position coordinates of the gamma event in the detection imaging space, and the coordinate reference data corresponding to the detection imaging space, wherein the coordinate reference data includes the crystal centroid coordinates of each imaging crystal in the crystal imaging array, the row average coordinates and column average coordinates of the crystal imaging array; Based on the pixel position coordinates, the average row coordinates, and the average column coordinates, a candidate crystal set is determined in the crystal imaging array; Based on the crystal centroid coordinates of each crystal in the candidate crystal set and the pixel position coordinates, the target crystal for the gamma event is determined in the candidate crystal set.

[0005] According to a second aspect of the embodiments of this specification, a position processing apparatus is provided, comprising: The first determining module is configured to determine the pixel position coordinates of the gamma event in the detection imaging space, and the coordinate reference data corresponding to the detection imaging space, wherein the coordinate reference data includes the crystal centroid coordinates of each imaging crystal in the crystal imaging array, the row average coordinates and column average coordinates of the crystal imaging array. The second determining module is configured to determine a candidate crystal set in the crystal imaging array based on the pixel position coordinates, the row average coordinates, and the column average coordinates. The third determining module is configured to determine the target crystal for the gamma event in the candidate crystal set based on the crystal centroid coordinates of each crystal in the candidate crystal set and the pixel position coordinates.

[0006] According to a third aspect of the embodiments of this specification, a computing device is provided, comprising: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions, which, when executed by the processor, implement the steps of the above-described location processing method.

[0007] According to a fourth aspect of the embodiments of this specification, a computer-readable storage medium is provided that stores computer-executable instructions that, when executed by a processor, implement the steps of the above-described position processing method.

[0008] According to a fifth aspect of the embodiments of this specification, a computer program product is provided, including a computer program or instructions that, when executed by a processor, implement the steps of the above-described position processing method.

[0009] One embodiment of this specification implements a method to determine the pixel position coordinates of a gamma event in the detection imaging space and coordinate reference data in the detection program space. Subsequently, it allows for rapid comparison between the pixel position coordinates and the average row and column coordinates from the coordinate reference data. This requires only a small amount of logical operations to narrow the search range from the entire crystal imaging array to a set of candidate crystals in a localized area, significantly reducing the computational load for subsequent fine-tuning and effectively improving overall processing speed. Then, by comparing the crystal centroid coordinates of each crystal in the candidate crystal set with the pixel position coordinates, the target crystal that actually caused the gamma event is precisely matched within the narrowed candidate crystal set. This ensures positioning accuracy while further reducing resource consumption. Attached Figure Description

[0010] Figure 1 A flowchart of a position processing method according to an embodiment of this specification is shown; Figure 2 A schematic diagram of a detection imaging space provided according to one embodiment of this specification is shown; Figure 3 This is a flowchart illustrating the processing procedure of a position processing method provided in one embodiment of this specification. Figure 4This is a schematic diagram of the structure of a position processing device provided in one embodiment of this specification; Figure 5 This is a structural block diagram of a computing device provided in one embodiment of this specification. Detailed Implementation

[0011] Many specific details are set forth in the following description to provide a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this specification. Therefore, this specification is not limited to the specific implementations disclosed below.

[0012] The terminology used in one or more embodiments of this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the one or more embodiments of this specification. The singular forms “a,” “described,” and “the” as used in one or more embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.

[0013] It should be understood that although the terms first, second, etc., may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first may also be referred to as second without departing from the scope of one or more embodiments of this specification, and similarly, second may also be referred to as first. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to a determination."

[0014] Furthermore, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties. Moreover, the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.

[0015] First, the terms and concepts used in one or more embodiments of this specification will be explained.

[0016] Gamma event: A gamma event refers to an interaction process in which a gamma photon is incident on a detector and recorded. In PET (Positron Emission Tomography) or SPECT (Single Photon Emission Computed Tomography) imaging, each interaction between a gamma photon and a scintillation crystal is a gamma event, and the system needs to record and process the location, time, and energy of this event.

[0017] Scintillation crystals: Scintillation crystals are radiation detection materials capable of converting high-energy gamma photons into visible light photons. Common scintillation crystals include lutetium yttrium silicate, bismuth germanate, and sodium iodide. When a gamma photon is incident, the scintillation crystal absorbs its energy and emits scintillation light, achieving the conversion from high-energy radiation to visible light. A scintillation crystal array refers to a two-dimensional array structure composed of multiple scintillation crystals arranged according to a certain pattern, such as 13×13 or 8×8. Each crystal is independently packaged but optically isolated, used to determine the specific incident position of a gamma event in the detector.

[0018] Field-overlapping image: A field-overlapping image is an image acquired by uniformly illuminating the detector, used to determine the response position of each crystal in the output image. By analyzing the light spot corresponding to each crystal in the field-overlapping image, positioning reference data such as the crystal's centroid coordinates can be extracted.

[0019] In gamma radiation imaging equipment (such as positron emission tomography (PET) and single-photon emission computed tomography (SPECT), the detector typically uses a scintillation crystal array to convert the incident gamma event into a scintillation light signal, which is then converted into an electrical signal by a photoelectric converter (such as a photomultiplier tube (PMT) or silicon photomultiplier tube (SiPM). Finally, the electronic system processes and outputs the event location information. Ideally, the image output by the electronic system should correspond one-to-one with the crystal array. For example, for a 13×13 scintillation crystal array, when a gamma event occurs in the crystal in the first row and first column, the electronics should directly output the position [1,1]. However, the actual image output by the electronics (usually called a flood map or flood image) exhibits significant diffusion and distortion. Each crystal no longer corresponds to a single pixel, but rather a diffuse spot of light, and the entire crystal array shows nonlinear distortion in the output image, making it impossible to directly determine the crystal that was actually hit by the event from the pixel position.

[0020] To address this issue, existing technologies typically employ the following steps to pre-establish a position mapping table: First, the acquired over-field image is smoothed and filtered. Then, a centroid extraction algorithm is used to find the center position of the light spot corresponding to each crystal. Finally, the segmentation boundaries between crystals are determined based on these center positions, generating a lookup table that maps the pixel positions of the output image to crystal numbers. During normal operation, the corresponding crystal number is obtained by looking up this mapping table based on the pixel position coordinates output by the electronics. In the actual data acquisition and processing process of the device, a compact, high-throughput, low-cost, and low-power lookup table mechanism is required. Currently, there are three main implementation methods: The first method is to use the internal RAM (Random Access Memory) of the FPGA (Field-Programmable Gate Array) to store the mapping table. This method has the fastest throughput, but internal RAM resources are limited, typically only able to store the lookup table of one detector module, making it difficult to support multiple modules working simultaneously; at the same time, the mapping table occupies a significant amount of internal storage resources. The second method is to use external FLASH to store the mapping table. This method offers a large storage capacity, capable of storing lookup tables for multiple modules, but its read speed is moderate, throughput is limited, and it requires additional components. The third method uses external DRAM (Dynamic Random Access Memory) to store the mapping table. This method offers large storage capacity and high speed, but it requires external dynamic memory chips and associated circuitry, resulting in a large circuit area, high power consumption, and increased cost, making it difficult to meet the design requirements of compact devices.

[0021] The methods described above all present a trade-off between speed, resource consumption, and compactness. Therefore, how to achieve low resource consumption and compact crystal location lookup while ensuring processing speed is a pressing problem that needs to be solved.

[0022] Based on this, a location processing method is provided in this specification. This specification also relates to a location processing device, a computing device, a computer-readable storage medium, and a computer program product, which will be described in detail in the following embodiments.

[0023] See Figure 1 , Figure 1 A flowchart of a position processing method according to an embodiment of this specification is shown, which specifically includes the following steps.

[0024] Step 102: Determine the pixel position coordinates of the gamma event in the detection imaging space, and the coordinate reference data corresponding to the detection imaging space, wherein the coordinate reference data includes the crystal centroid coordinates of each imaging crystal in the crystal imaging array, the row average coordinates and column average coordinates of the crystal imaging array.

[0025] A gamma event can be understood as an interaction process in which a gamma photon is incident on the detector crystal and recorded; it is the basic unit of gamma imaging. Each gamma event triggers the detector to generate a signal, which is then processed electronically to output position information.

[0026] The detector imaging space can be understood as the output image space after processing by the detector's electronics system, often referred to as a flood map or flood image. This space uses pixels as the coordinate unit, and due to factors such as optical diffusion and circuit response, it exhibits nonlinear deformation compared to the physical space of the actual crystal array. See also... Figure 2 , Figure 2 This diagram illustrates a detection imaging space according to one embodiment of the present specification, showing the key elements and their interrelationships in the detection imaging space after coordinate reference data has been established. The diagram primarily consists of a dot matrix, where all white dots represent the centroid coordinates of each imaging crystal. These dots collectively constitute a crystal imaging array. The space includes the deformation output corresponding to an 8×8 crystal array.

[0027] Pixel position coordinates can be understood as the location of a gamma event in the detection imaging space. They are typically obtained by the electronic system through energy weighting and centrifugation of the photoelectric sensor signal, and are represented as two-dimensional coordinates (x, y). For example... Figure 2 The black dots in the graph represent the pixel coordinates of a gamma event.

[0028] Coordinate reference data can be understood as a pre-stored set of data used to map pixel position coordinates to the actual crystal. This includes crystal centroid coordinates, row-average coordinates, and column-average coordinates. The crystal centroid coordinates can be understood as the coordinates obtained by performing an energy-weighted calculation (centroid method) on the response spot corresponding to each crystal in the field-overlapping image, representing the average position of that crystal in the detection imaging space. For example... Figure 2 Each white dot represents the centroid coordinates of the imaging crystal. The row average coordinate can be understood as the average of the centroid coordinates of all crystals in the same row, representing the average position of the crystals in that row within the detection imaging space. It is mainly used for comparing pixel ordinates during coarse localization. The column average coordinate can be understood as the average of the centroid coordinates of all crystals in the same column, representing the average position of the crystals in that column within the detection imaging space. It is mainly used for comparing pixel abscissas during coarse localization. The crystal imaging array can be understood as a virtual array in the detection imaging space composed of the response light spots of each crystal. It corresponds one-to-one with the physical crystal array, but its position is deformed. Figure 2 The dots in the array constitute the crystal imaging array.

[0029] In practical applications, the pixel position coordinates output by the electronic system in gamma imaging devices cannot be directly mapped to the physical crystal due to deformation. To achieve accurate crystal localization, a reference data set needs to be pre-established to describe the precise position of each crystal in the detection imaging space. Traditional methods use complete pixel-level lookup tables, such as mapping each pixel to a crystal number, resulting in a massive amount of data. For example, a 64×64 pixel table requires 4096 entries, which cannot be stored internally and must rely on external memory, thus increasing system area, power consumption, and cost. This step aims to solve how to construct reference data that can be used for rapid localization with a minimal amount of data, providing a precise benchmark for subsequent coarse and fine localization, while meeting the requirements of compact design.

[0030] In specific implementation, such as Figure 2 As shown, each point in the detection imaging space represents the centroid coordinates of a crystal, and these points together constitute the crystal imaging array. The black dots in the figure represent the pixel position coordinates of the current gamma event, which are acquired in real time. The coordinate reference data determined in this step is precisely... Figure 2 This forms the basis for all points and their statistical information. This data is pre-stored in the processor, providing the necessary input for subsequent coarse localization (determining the dashed bounding box) and fine localization (calculating the distance between the black point and adjacent white points).

[0031] In a specific embodiment of this specification, a 3×3 scintillation crystal array is assumed. First, the detector is uniformly illuminated to acquire a field-effect image. In the field-effect image, each crystal corresponds to a diffuse light spot. Using an image processing algorithm, each light spot is identified and its weighted energy center is calculated, yielding the centroid coordinates of the nine crystals. Then, the row average coordinates and column average coordinates are calculated. These nine crystal centroid coordinates, three row average coordinates, and three column average coordinates are stored as coordinate reference data in the processor's internal memory, such as the Block RAM of an FPGA. For a 13×13 array, only 169 centroid coordinates and 26 row and column average coordinates need to be stored, totaling approximately 195 coordinate points. Storing these using 16-bit fixed-point tables requires only about 3.9Kb (kilobit), far less than a traditional lookup table.

[0032] Based on this, a lightweight coordinate reference dataset was constructed by pre-storing the crystal barycenter coordinates and row and column average coordinates. Its data volume is only one-thousandth that of a traditional pixel-level lookup table, and it can be directly stored in the processor's internal memory without any external storage devices. This significantly reduces hardware resource consumption, circuit board area, and power consumption, enabling a compact and low-cost system design. Simultaneously, this data accurately describes the position of each crystal in the detection imaging space, providing a reliable benchmark for subsequent hierarchical localization strategies (coarse localization + fine localization), ensuring that subsequent steps can efficiently complete accurate matching within a very small area.

[0033] Furthermore, the generation of coordinate reference data corresponding to the detection imaging space includes: determining a crystal imaging array corresponding to the crystal array in the detection imaging space based on the crystal array of the detector, wherein the crystal imaging array includes a crystal response spot corresponding to each imaging crystal; performing energy weighted calculation based on the crystal response spot corresponding to each imaging crystal to obtain the crystal barycenter coordinates of each imaging crystal; calculating the row average coordinates and column average coordinates of the crystal imaging array according to the array position of the crystal imaging array and the crystal barycenter coordinates of each imaging crystal; and determining the coordinate reference data corresponding to the detection imaging space based on the crystal barycenter coordinates of each imaging crystal, the row average coordinates, and the column average coordinates.

[0034] The crystal array refers to the arrangement of scintillation crystals in physical space, consisting of multiple independent scintillation crystals arranged according to a certain pattern, such as 13×13. This is the physical basis of the detector; the actual location of a gamma event is within this array. The crystal imaging array refers to a virtual array in the detection imaging space, composed of the response light spots corresponding to each crystal. It corresponds one-to-one with the physical crystal array, but its position undergoes nonlinear deformation due to factors such as optical diffusion and circuit response. The crystal imaging array serves as the spatial carrier of coordinate reference data.

[0035] A crystal response spot refers to the signal distribution area corresponding to a single crystal in a field-over-field diagram. When a gamma event strikes a crystal, the resulting scintillation light spreads to multiple pixels, forming a diffuse spot. The shape and size of this spot are affected by factors such as optical diffusion and electronic response. Energy-weighted calculation refers to a method of calculating the weighted average of the coordinates of all pixels within the spot area, using the pixel's energy value (grayscale value) as the weight.

[0036] The crystal's barycenter coordinates are the coordinates obtained through energy-weighted calculations, representing the statistically average position of the crystal in the detection imaging space. It is the "representative point" for each crystal in the imaging space and also the benchmark for Euclidean distance calculations in the subsequent fine-positioning stage. For example... Figure 2 Each white dot in the array represents the centroid coordinates of the corresponding crystal. The row-averaged coordinate is the average of the centroid coordinates of all crystals in the same row of the crystal imaging array. This coordinate represents the average position of the crystals in that row within the detection imaging space and is used for row orientation determination in the coarse localization stage. The column-averaged coordinate is the average of the centroid coordinates of all crystals in the same column of the crystal imaging array. This coordinate represents the average position of the crystals in that column within the detection imaging space and is used for column orientation determination in the coarse localization stage.

[0037] In practical applications, two key issues need to be addressed before generating coordinate reference data: first, how to accurately extract the position of each crystal in the imaging space from the original field-view data; and second, how to transform this positional information into a data structure that can be used for rapid localization. Traditional methods directly generate complete pixel-level lookup tables, such as mapping 64×64 pixels to crystal numbers, which requires processing massive amounts of data and incurs huge storage costs. This step aims to obtain the precise centroid coordinates of each crystal through energy-weighted calculations, and based on this, to calculate the row and column average coordinates, transforming the original image data into a concise, physically meaningful set of coordinate points, providing a data foundation for subsequent rapid localization.

[0038] In practice, Figure 2 The result after this step is completed is shown. Multiple points are distributed in the detection imaging space, each point representing the centroid coordinates of a crystal. These points together constitute the crystal imaging array. Figure 2 Although the row and column average coordinates are not directly marked in the text, these row and column average coordinates can be obtained by analyzing... Figure 2 The values ​​are obtained through statistical calculations of the midpoint matrix. For example, the average coordinates of points in the same row (points arranged horizontally) are obtained by averaging them; the average coordinates of points in the same column (points arranged vertically) are obtained by averaging them. Figure 2 The black dots, representing the pixel coordinates of the gamma events, will be compared and matched with these reference data in subsequent steps. Therefore, this step is... Figure 2 The entire positioning process shown provides the necessary data foundation.

[0039] In a specific embodiment of this specification, taking an 8×8 scintillation crystal array as an example, the process of generating coordinate reference data is described in detail. The detector is uniformly illuminated to acquire a field-effect image. However, due to deformation, these light spots are not arranged in a regular grid but exhibit diffusion and distortion. In the field-effect image, an image processing algorithm identifies the response light spot corresponding to each crystal. For an 8×8 array, a total of 64 light spots need to be identified. Each light spot covers a pixel area. Energy-weighted calculations are performed on each light spot to obtain the barycenter coordinates of the 64 crystals. For example, for the crystal in row 3, column 4, its light spot may cover the area of ​​rows 20-25 and columns 30-35 in the output image. The barycenter coordinates of this crystal are obtained through energy-weighted calculations. This process is repeated for all 64 crystals to obtain a complete set of crystal barycenter coordinates. Based on the row number (rows 1-8) of the crystal in the physical array, the barycenter coordinates of the 8 crystals in the same row are averaged to obtain the average coordinates of the 8 rows. Similarly, based on the column numbers (columns 1-8), the average coordinates of the 8 crystal barycenters in the same column are taken to obtain 8 column average coordinates. The 64 crystal barycenter coordinates, the 8 row average coordinates, and the 8 column average coordinates are combined to form a coordinate reference dataset.

[0040] Based on this, the original over-field image data is transformed into a simplified coordinate reference dataset through energy-weighted calculation and statistical averaging. This allows for the storage of only the crystal centroid coordinates and row and column average coordinates, which can be directly stored in the processor's internal memory without the need for external storage devices. Energy-weighted calculation preserves the precise positional information of each crystal in the imaging space, providing a high-precision benchmark for subsequent fine-tuning. The structured organization of crystal positions using row and column average coordinates provides a rapid indexing method for the coarse-tuning stage, enabling subsequent hierarchical localization strategies.

[0041] Furthermore, after generating the coordinate reference data corresponding to the detection imaging space, the method further includes storing the coordinate reference data in the internal memory of the imaging processor.

[0042] The imaging processor can be understood as the core processing chip responsible for processing gamma event signals and executing location-finding algorithms. In gamma imaging systems, the imaging processor is typically an FPGA (Field-Programmable Gate Array), DSP (Digital Signal Processor), or MCU (Microcontroller). FPGAs are the most commonly used due to their parallel processing capabilities and abundant internal storage resources. The imaging processor undertakes multiple tasks, including signal acquisition, location calculation, and data packaging. In the embodiments of this specification, an FPGA is used as the hardware platform for implementation.

[0043] Internal memory can be understood as the storage resources integrated within the imaging processor chip, rather than an external, independent storage chip. For FPGAs, internal memory refers to Block RAM; for MCUs, it refers to built-in SRAM or Flash. Internal memory has advantages such as fast access speed, low power consumption, and no need for additional circuitry, but its capacity is relatively limited. The embodiments in this specification utilize these characteristics of internal memory to achieve a compact design.

[0044] In practical applications, coordinate reference data in gamma imaging devices must be stored in some medium for real-time access. Traditional solutions present a dilemma: using the processor's internal memory to store the complete lookup table results in an excessively large data volume, making it impossible to accommodate the mapping tables of multiple modules; using external memory (DRAM, FLASH, SRAM) requires additional chips and supporting circuitry, leading to increased board area, power consumption, and cost, while also limiting external bus access speed. This step aims to solve the problem of reliably storing coordinate reference data in the system without adding external components, ensuring fast access without consuming excessive resources.

[0045] In a specific embodiment of this specification, taking a system using an FPGA as the imaging processor as an example, for a 13×13 crystal array, the coordinate reference data includes: 169 crystal barycenter coordinates (each coordinate has two values, x and y), 13 row average coordinates, and 13 column average coordinates, totaling 195 coordinate points. Each coordinate value is represented by a 16-bit fixed-point number, and the total data volume is 195×2×2=780 bytes (if each coordinate value uses 16 bits, that is, 2 bytes). In the FPGA, these data can be directly defined as constant arrays and automatically stored in Block RAM during synthesis. These arrays occupy Block RAM resources inside the FPGA. For common medium-sized FPGAs, the Block RAM capacity is usually in the range of several Mb (Megabit), so the occupation of 780 bytes (approximately 6.24Kb) is negligible.

[0046] In one specific embodiment of this specification, if the system needs to process 16 detector modules simultaneously, each module corresponds to a set of independent coordinate reference data (approximately 780 bytes per set), the total data volume is 780 × 16 = 12.48 KB (kilobytes), approximately 99.84 KB. This is still within the internal storage capacity of most FPGAs, therefore, no additional external storage devices are needed to support parallel operation of multiple modules. When the device is powered on, the pre-generated coordinate reference data can be loaded from an external read-only memory (such as the SPI Flash used for system configuration) into the FPGA's internal Block RAM in one go. After loading, the FPGA can run independently, and the subsequent table lookup process does not rely on external memory at all, achieving high-speed, low-power real-time processing.

[0047] Based on this, this step stores the coordinate reference data in the imaging processor's internal memory, eliminating the need for any external storage chips and associated circuitry. This significantly reduces the circuit board area, facilitating device miniaturization and multi-module integration. Reducing external components and connections lowers the risk of system failures due to poor contact, electromagnetic interference, and other factors.

[0048] Step 104: Determine a candidate crystal set in the crystal imaging array based on the pixel position coordinates, the average row coordinates, and the average column coordinates.

[0049] In this system, the pixel position coordinates represent the location of the gamma event in the detection imaging space, calculated by the electronics system, and are two-dimensional coordinate values. The row average coordinates are the pre-calculated average of the crystal barycenter coordinates for each row, reflecting the average position of the crystals in that row within the imaging space. The column average coordinates are the pre-calculated average of the crystal barycenter coordinates for each column, reflecting the average position of the crystals in that column within the imaging space. The crystal imaging array is a virtual dot matrix formed by the barycenter coordinates of all crystals in the detection imaging space, with each dot corresponding to one crystal. The candidate crystal set refers to a small number of crystals that may contain the actual active crystals, selected through coarse localization. In the embodiments described in this specification, this is typically 2 rows and 2 columns, totaling 4 crystals, much smaller than the entire array.

[0050] In practical applications, after obtaining the pixel coordinates of a gamma event, it is necessary to find which crystal it corresponds to. Directly traversing the entire crystal array (e.g., a 13×13 array with 169 crystals) to calculate the distance would be computationally intensive, failing to meet the requirements of high-speed real-time processing. This step aims to narrow the search range from the entire array to a very small local area through rapid comparison, thereby significantly reducing the computational burden of subsequent fine-tuning.

[0051] In specific implementation, such as Figure 2 As shown, the detection imaging space contains many points, namely the crystal barycenter coordinates, and the black dots represent the pixel positions of the current gamma event. By comparing the ordinate of the black dots with the average ordinate of each row and the x-coordinate with the average x-coordinate of each column, we find the two rows and two columns whose ordinates are closest to the black dots. The area enclosed by the intersection of these two sets of rows and columns is the dashed box in the figure. The number of points within the dashed box, i.e., the barycenter coordinates of the candidate crystals, is very small; subsequent calculations only need to be performed within this small box.

[0052] In a specific embodiment of this specification, assume a 13×13 crystal array, where the average coordinates of each row and column have been pre-calculated and stored. Now, consider a gamma event with pixel coordinates (152.3, 78.6). First, compare its ordinate 78.6 with the average ordinate of all rows. We find that 78.6 is closest to the average ordinate of row 5 (78.8), and second closest to the average ordinate of row 6 (92.3). Therefore, the candidate row range is determined to be rows 5 and 6. Next, compare its abscissa 152.3 with the average abscissa of all columns. We find that 152.3 is closest to the average abscissa of column 5 (153.6), and second closest to the average abscissa of column 6 (166.4). Therefore, the candidate column range is columns 5 and 6. Thus, the candidate crystal set consists of the four crystals intersecting rows 5 and 6, and columns 5 and 6, namely (5,5), (5,6), (6,5), and (6,6). If the gamma event is near the edge, for example, if the y-coordinate is very small, it is possible to find only the closest row. In this case, the candidate row range will only include that row, and the candidate column range will still be two columns, resulting in a final candidate set of two crystals. Thus, in either case, the candidate set is extremely small.

[0053] Based on this, the search range can be quickly narrowed down through simple numerical comparisons. This process requires only a few comparison operations, consumes almost no logic resources, and can be completed in a very short time, laying a key foundation for achieving high throughput and low resource consumption in crystal positioning.

[0054] Furthermore, determining the candidate crystal set in the crystal imaging array based on the pixel position coordinates, the row average coordinates, and the column average coordinates includes: comparing the pixel position coordinates with the row average coordinates and the column average coordinates respectively to obtain a candidate row range and a candidate column range; and selecting a candidate crystal set in the crystal imaging array based on the candidate row range and the candidate column range.

[0055] The candidate row range can be understood as a range of rows of crystals selected by comparing the ordinate of the pixel's position coordinate with the ordinate of all pre-stored average row coordinates. This range typically includes two rows of crystals, namely the two rows corresponding to the two average row coordinates that are numerically closest to the pixel's ordinate. The candidate row range is the output of coarse positioning in the row direction, used together with the candidate column range to define the set of candidate crystals.

[0056] The candidate column range can be understood as a range of crystals selected by comparing the x-coordinate of a pixel's position with the x-coordinate of all pre-stored average column coordinates. This range typically includes two columns of crystals, namely the two columns corresponding to the average column coordinates that are numerically closest to the pixel's x-coordinate. The candidate column range is the output of coarse positioning in the column direction, and its intersection with the candidate row range forms a set of candidate crystals.

[0057] In practical applications, the goal of "narrowing the search range" needs to be translated into specific, executable steps during the coarse localization stage. This step addresses how to accurately filter out a few rows and columns from the entire crystal array that may contain the target crystal through simple and standardized comparison operations. This process must meet two requirements: first, the filtering results must be accurate enough to ensure the target crystal always falls within the candidate range; second, the filtering process must be fast enough to avoid introducing excessive computational burden. This step decomposes the two-dimensional search problem into two independent one-dimensional search problems by comparing pixel coordinates with the average row and column coordinates, thus completing the range filtering with minimal computational cost.

[0058] In specific implementation, such as Figure 2 As shown, the lattice in the detection imaging space represents the barycentric coordinates of all crystals. This step involves comparing the ordinate of the black dots (pixel positions) with the average ordinate of each row to find the two rows where the black dots are closest in the vertical direction; the area between these two rows is the candidate row range. Then, by comparing the abscissa of the black dots with the average abscissa of each column, we find the two columns where the black dots are closest in the horizontal direction; the area between these two columns is the candidate column range. The intersection of these two sets of ranges forms the dashed box in the figure. The boundary of the dashed box is determined by the combined results of these two comparisons.

[0059] In a specific embodiment of this specification, taking a 13×13 array as an example, the pixel coordinates of the gamma event are (152.3, 78.6). First, the ordinate 78.6 is compared one by one with the ordinates of the 13 pre-stored average row coordinates to find the two row average coordinates that are closest to 78.6. Assuming that the average ordinate of row 5 (78.8) is the closest, and row 6 (92.3) is the closest, then the candidate row range is rows 5 and 6. Similarly, the abscissa 152.3 is compared with the abscissas of the 13 column average coordinates to find the two closest ones, such as column 5 (153.6) and column 6 (166.4). Then the candidate column range is columns 5 and 6. This yields the candidate row range and candidate column range.

[0060] Based on this, by specifying the coarse localization target into two simple comparison operations, the algorithm logic becomes clear and easy to implement. By comparing the row and column directions separately, the two-dimensional search problem is decomposed into two one-dimensional search problems, significantly reducing the complexity of the comparison. This comparison method requires only a small number of numerical comparisons, does not involve complex calculations, has extremely low resource consumption, and can be completed in a very short time. At the same time, the design of comparing rows and columns separately allows the algorithm to handle array edges flexibly, ensuring applicability across the entire array.

[0061] Furthermore, the step of comparing the pixel position coordinates with the average row coordinates and the average column coordinates respectively to obtain the candidate row range and the candidate column range includes: comparing the pixel position coordinates with the average sub-row coordinates corresponding to each row in the average row coordinates, and determining the candidate row range based on the comparison results; comparing the pixel position coordinates with the average sub-column coordinates corresponding to each column in the average column coordinates, and determining the candidate column range based on the comparison results.

[0062] Here, the sub-row average coordinates refer to the row average coordinates corresponding to each row in the crystal imaging array. Since the crystal imaging array has several rows, each row has a row average coordinate, and these row average coordinates are called the "sub-row average coordinates" for that row. Each sub-row average coordinate contains the average of the centroid coordinates of all crystals in that row, including both the x-coordinate and y-coordinate values. For example, for a 13-row crystal array, there are 13 sub-row average coordinates, corresponding to rows 1 through 13 respectively.

[0063] Sub-column average coordinates refer to the average coordinates of each column in a crystal imaging array. Since a crystal imaging array has several columns, each column has a column average coordinate, and these column average coordinates are called the "sub-column average coordinates" for that column. Each sub-column average coordinate contains the average of the centroid coordinates of all crystals in that column, including both the x-coordinate and y-coordinate values. For example, for a 13-column crystal array, there are 13 sub-column average coordinates, corresponding to columns 1 through 13 respectively.

[0064] Determining the candidate row range based on the comparison results involves comparing the y-coordinate of the pixel position coordinate with the y-coordinate of the average coordinate of all sub-rows one by one, and selecting several rows as the candidate row range based on the similarity of the compared values. The selected rows are typically the two rows whose y-coordinate values ​​are closest to the pixel's y-coordinate. Determining the candidate column range based on the comparison results involves comparing the x-coordinate of the pixel position coordinate with the x-coordinate of the average coordinate of all sub-columns one by one, and selecting several columns as the candidate column range based on the similarity of the compared values. The selected columns are typically the two columns whose x-coordinate values ​​are closest to the pixel's x-coordinate.

[0065] In practical applications, the coarse positioning comparison operation requires a clear definition of the specific objects being compared and how the comparison results are applied. This step addresses how to concretize the statement "comparing with the average row coordinates and average column coordinates" into an executable operation: that is, clarifying that the objects being compared are the average coordinates of each specific sub-row and sub-column, and clarifying how the comparison results are transformed into candidate row and column ranges. This refinement ensures the algorithm's feasibility and avoids implementation difficulties caused by vague wording.

[0066] In specific implementation, such as Figure 2 As shown, the lattice in the detection imaging space is composed of the centroid coordinates of all crystals. Figure 2 Although the average coordinates of sub-rows and sub-columns are not directly drawn, these coordinates are implicitly present. The average position of all points in each row is the average coordinate of the sub-row for that row, and the average position of all points in each column is the average coordinate of the sub-column for that column. The processor compares the ordinate of the black point (pixel position coordinates) with the average ordinate of the sub-row for each row one by one, which is equivalent to measuring the distance between the black point and the average position of each row in the vertical direction; it also compares the abscissa of the black point with the average abscissa of the sub-column for each column one by one, which is equivalent to measuring the distance between the black point and the average position of each column in the horizontal direction. Through these two sets of comparisons, the processor finds the two rows and the two columns that are closest to the ordinate of the black point and the two columns that are closest to the abscissa of the black point, thus determining the upper and lower boundaries and the left and right boundaries of the dashed box. The formation of the dashed box is based on the results of the comparison of the average coordinates of all sub-rows and sub-columns.

[0067] In a specific embodiment of this specification, a 13×13 crystal array is used as the background, and the pixel position coordinates are (152.3, 78.6). First, row-wise comparisons are performed. The processor retrieves the average coordinates of the first row from internal memory, compares its ordinate of 25.3 with the pixel's ordinate of 78.6, and records the difference as 53.3. Next, it retrieves the average coordinates of the second row, compares its ordinate of 38.7 with 78.6, and records the difference as 39.9. This process is repeated row by row, comparing the third row (52.1), the fourth row (65.4), the fifth row (78.8), the sixth row (92.3), and so on, until the thirteenth row (186.4). After all 13 comparisons are completed, all differences are sorted. It is found that the difference of 0.2 in the fifth row is the smallest, and the difference of 13.7 in the sixth row is the second smallest. Therefore, based on the comparison results, the candidate row range is determined to be the fifth and sixth rows. Next, column-wise comparisons are performed. Similarly, the average coordinates of the first sub-column are retrieved from memory, and its horizontal coordinate of 102.5 is compared with the pixel's horizontal coordinate of 152.3, recording a difference of 49.8. The comparisons are then made sequentially for the second column (115.2), the third column (128.1), the fourth column (140.9), the fifth column (153.6), the sixth column (166.4), and so on, up to the thirteenth column (256.3). After all 13 comparisons, the smallest difference (1.3) is found in the fifth column, and the smallest difference (14.1) is found in the sixth column. Therefore, based on the comparison results, the candidate column range is determined to be columns 5 and 6. Thus, by comparing row by row and column by column, the candidate row and column ranges have been successfully obtained.

[0068] Based on this, by clearly defining the comparison objects as the average coordinates of each specific sub-row and sub-column, and by specifying that the comparison results are used to determine the candidate range, the coarse positioning comparison operation is made clearly feasible. The row-by-row and column-by-column comparison ensures the comprehensiveness of the screening, ensuring that all rows and columns are taken into consideration and no possible targets are missed.

[0069] Furthermore, the step of comparing the pixel position coordinates with the average row coordinates and the average column coordinates respectively to obtain the candidate row range and the candidate column range includes: when the pixel position coordinates are located at the array edge of the crystal imaging array, comparing the pixel position coordinates with the average row coordinates and the average column coordinates respectively to obtain the initial candidate row range and the initial candidate column range; adjusting the initial candidate row range and the initial candidate column range using the array edge to obtain the candidate row range and the candidate column range.

[0070] In this context, the array edge of a crystal imaging array can be understood as the boundary region of the crystal imaging array in the row or column direction. Specifically, in the row direction, the array edge includes the first and last rows; in the column direction, the array edge includes the first and last columns. When the pixel position coordinates of a gamma event are close to these boundary rows or boundary columns, they are said to be located in the array edge region.

[0071] The initial candidate row range can be understood as a preliminary set of candidate rows selected by comparing the y-coordinate of a pixel's position with the y-coordinate of the average coordinate of all rows, without considering array boundary constraints. This set typically contains one or two rows that are closest to the pixel's y-coordinate. For example, when the pixel's y-coordinate is located in the middle of the array, the initial candidate row range contains two rows; when the pixel's y-coordinate is near the edge, it may contain only one row.

[0072] The initial candidate column range can be understood as a preliminary set of candidate columns selected by comparing the x-coordinate of a pixel's position with the x-coordinate of the average coordinate of all columns, without considering array boundary constraints. This set typically contains one or two columns that are closest to the pixel's x-coordinate. For example, when the pixel's x-coordinate is located in the middle region of the array, the initial candidate column range contains two columns; when the pixel's x-coordinate is near the edge, it may contain only one column.

[0073] Adjusting the candidate range involves revising the initial candidate row and column ranges using the actual boundaries of the crystal imaging array (i.e., minimum row number, maximum row number, minimum column number, and maximum column number). The goal of this adjustment is to ensure that the final determined candidate row and column ranges do not exceed the actual range of the array, while maintaining the reasonableness of the candidate ranges as much as possible. For example, they should still contain at least two rows or two columns in the edge regions, if the array size allows. Common adjustment methods include: when the initial candidate row range contains only one row, if that row is not a boundary row, then add its adjacent rows; if that row is already a boundary row, then add its inner adjacent rows; when the initial candidate row range is empty, directly use the boundary rows as the candidate range. The same applies to column directions.

[0074] In practical applications, when gamma events occur in the edge region of a crystal imaging array, conventional comparison methods may fail to obtain the complete candidate row or column range. For example, if the pixel's ordinate is less than the average ordinate of the first row, only the closest row can be found, not the other row; similarly, if the pixel's ordinate is greater than the average ordinate of the last row, only the last row can be found. In this case, directly using the initial candidate row range as the final result may result in an excessively small candidate crystal set, or even prevent the formation of an effective candidate set. This step aims to solve the coarse localization problem of pixels in edge regions, ensuring that the algorithm can stably and accurately determine the candidate row and column ranges across the entire array, thereby guaranteeing the smooth progress of subsequent fine localization.

[0075] In a specific embodiment of this specification, taking a 13×13 crystal array as an example, the average ordinate of the rows is assumed to be as follows: row 1 25.3, row 2 38.7, row 3 52.1, row 4 65.4, row 5 78.8, row 6 92.3, ..., row 13 186.4. The average abscissa of the columns is similar.

[0076] Near the top edge: Consider a gamma event with pixel coordinates (152.3, 20.1). When comparing row coordinates, the ordinate 20.1 is compared to the average ordinate of all rows. It's found that 20.1 is less than the average ordinate of the first row (25.3), and the difference between 20.1 and the first row (5.2) is the smallest, while the differences with other rows are larger. Therefore, the initial candidate row range only includes the first row. Since the pixel is located at the top edge, the initial candidate row range is less than two rows. Edge adjustment is then performed: the first row is already the first row and cannot be expanded outwards. Therefore, the adjacent row inside it, the second row, is added, adjusting the candidate row range to include the first and second rows.

[0077] Near the bottom edge: Another gamma event with pixel coordinates (152.3, 195.7). When comparing rows, the ordinate 195.7 is greater than the 13th row's 186.4, and the difference between it and the 13th row is the smallest at 9.3, while the differences with other rows are larger. Therefore, the initial candidate row range only includes the 13th row. Since the pixel is located at the bottom edge, the initial candidate row range is less than two rows. Edge adjustment: Since the 13th row is the last row, its inner adjacent row, the 12th row, is added, adjusting the candidate row range to include the 12th and 13th rows.

[0078] Near the left edge: For the horizontal coordinate, assuming the pixel's horizontal coordinate is 95.2, which is less than 102.5 in the first column, the initial candidate column range only includes the first column. After edge adjustment, a second column is added, resulting in a candidate column range including both the first and second columns.

[0079] Near the right edge: If the pixel's horizontal coordinate is 260.1, which is greater than 256.3 in column 13, the initial candidate column range only includes column 13. After edge adjustment, column 12 is added, resulting in a candidate column range including columns 12 and 13.

[0080] Corner region: If a pixel is simultaneously close to the top and left, i.e., coordinates (95.2, 20.1), the initial candidate range in the row direction is row 1, which is adjusted to rows 1 and 2; the initial candidate range in the column direction is column 1, which is adjusted to columns 1 and 2. The final candidate crystal set consists of 4 crystals intersecting rows 1 and 2 and columns 1 and 2.

[0081] Through the above adjustments, even in the edge regions, it can be ensured that the candidate row range contains two rows and the candidate column range contains two columns, thereby forming a complete candidate crystal set.

[0082] Based on this, by introducing an edge adjustment mechanism, the integrity and robustness of the algorithm across the entire array are guaranteed. Regardless of whether the gamma event occurs in the middle or at the edge of the array, the candidate row range and candidate column range can be correctly determined, avoiding positioning failures caused by boundaries.

[0083] Step 106: Based on the crystal centroid coordinates of each crystal in the candidate crystal set and the pixel position coordinates, determine the target crystal for the gamma event in the candidate crystal set.

[0084] Each crystal in the candidate crystal set has its corresponding crystal barycenter coordinates, which serve as the reference points for distance calculations during the fine-positioning stage. For example... Figure 2 Each white dot inside the dashed box represents the centroid coordinates of each crystal in the candidate crystal set. The target crystal refers to the crystal that was actually struck by the gamma event. The core objective of this step is to select a crystal from the candidate crystal set as the target crystal for the gamma event. After determining the target crystal, its corresponding crystal number can be used for subsequent imaging reconstruction, completing the mapping from the detection imaging space to the crystal physical space. The selection criterion for the target crystal is that it is geometrically closest to the pixel position coordinates.

[0085] Euclidean distance refers to the straight-line distance between two points in a two-dimensional plane, used to measure the spatial proximity of the two points. In this step, Euclidean distance is used to quantify the proximity between the pixel position coordinates of a gamma event and the centroid coordinates of each crystal in the candidate crystal set. The smaller the distance, the closer the centroid of the crystal is to the location where the gamma event occurred, and the greater the likelihood that the crystal is the actual active crystal. In actual hardware implementations, to simplify calculations and save resources, the square of the distance is usually compared instead of the actual distance, because the magnitude of the square value is exactly the same as the actual distance, but this avoids the complexity and resource consumption caused by square root calculations.

[0086] In practical applications, the coarse localization steps described above have successfully narrowed the search range from the entire crystal array to a very small set of candidate crystals. However, the candidate set still contains multiple crystals, and it is necessary to accurately select one as the actual crystal responsible for the gamma event. The core problem to be solved in this step is: how to accurately select the crystal that matches the pixel position coordinates from the candidate crystal set with minimal computational cost. This problem directly determines the final accuracy of the entire localization scheme. If an incorrect selection is made, the gamma event will be incorrectly assigned to adjacent crystals, affecting image quality. At the same time, since gamma imaging devices need to process a large number of events in real time, the selection algorithm must be fast enough and have extremely low resource consumption, without introducing complex calculations.

[0087] In specific implementation, such as Figure 2 As shown, numerous white dots are distributed in the detection imaging space. These white dots represent the barycentric coordinates of all crystals, collectively forming a crystal imaging array. The black dots in the figure represent the pixel position coordinates of the current gamma event. The dashed box covers the area determined by coarse localization of the candidate crystal set, containing several white dots, which are the barycentric coordinates of each crystal in the candidate crystal set. First, all white dots within the dashed box, i.e., the barycentric coordinates of the candidate crystals, are extracted. Then, the straight-line distance between each black dot and each white dot is calculated. Finally, all straight-line distances are compared, and the shortest one is found. This shortest distance represents the barycentric coordinates of the crystal closest to the black dot, and the crystal corresponding to this white dot is the target crystal determined in this step.

[0088] In a specific embodiment of this specification, it is assumed that the candidate crystal set determined by coarse positioning includes four crystals, namely the crystals in the 5th row and 5th column, the 5th row and 6th column, the 6th row and 5th column, and the 6th row and 6th column. The centroid coordinates of these four crystals are pre-stored in the processor's internal memory as (153.2, 78.5), (166.1, 78.9), (153.8, 92.0), and (166.5, 92.3), respectively. The pixel position coordinates of the current gamma event are (152.3, 78.6).

[0089] First, the Euclidean distances between the pixel position coordinates and the centroid coordinates of the four crystals were calculated. The calculations revealed that the distance between the pixel coordinates and the crystal in the 5th row, 5th column is approximately 0.9; the distance to the crystal in the 5th row, 6th column is approximately 13.8; the distance to the crystal in the 6th row, 5th column is approximately 13.5; and the distance to the crystal in the 6th row, 6th column is approximately 19.7. Then, these four distance values ​​were compared, and the smallest one was identified. The comparison showed that the distance of 0.9 to the crystal in the 5th row, 5th column is significantly smaller than the other three distance values. Therefore, the crystal in the 5th row, 5th column was determined to be the target crystal for this gamma event.

[0090] Based on this, the accuracy of positioning is ensured by calculating the Euclidean distance and comparing the minimum value within the candidate crystal set. As a direct measure of the proximity between two points, the Euclidean distance can accurately reflect the spatial relationship between the pixel position coordinates and the crystal centroid coordinates, thereby ensuring that the selected target crystal is geometrically closest to the actual location of the gamma event, providing a reliable guarantee for high-quality imaging.

[0091] Furthermore, determining the target crystal for the gamma event in the candidate crystal set based on the crystal centroid coordinates and pixel position coordinates of each crystal in the candidate crystal set includes: calculating the Euclidean distance of each crystal in the candidate crystal set based on the crystal centroid coordinates and pixel position coordinates of each crystal in the candidate crystal set; sorting each crystal in the candidate crystal set according to the Euclidean distance of each crystal in the candidate crystal set; and selecting the target crystal for the gamma event in the candidate crystal set according to the sorting result.

[0092] Sorting by Euclidean distance refers to arranging multiple calculated Euclidean distance values ​​in ascending or descending order. The purpose of this sorting step is to find the smallest Euclidean distance value, thereby identifying the crystal closest to the pixel's location coordinates. Sorting can be a complete sort of all distance values, or a comparison method can be used to directly find the minimum value without sorting the others. In actual hardware implementations, a comparison method is typically used to compare distance values ​​one by one, recording the current minimum value and its corresponding crystal. This method is more efficient and consumes fewer resources than a full sort.

[0093] The sorting result refers to the sequence of distance values ​​obtained after sorting and their corresponding crystal information. In this step, the core of the sorting result is determining which crystal has the smallest Euclidean distance, because the crystal corresponding to the smallest distance is the target crystal. Although other distance values ​​are also sorted, only the minimum value and its corresponding crystal are ultimately considered. Selecting the target crystal refers to the process of choosing a single crystal from the candidate crystal set as the actual crystal impacting the gamma event, based on the sorting result. The selection criterion is the smallest Euclidean distance, because the smallest distance means that the crystal's center of gravity is geometrically closest to the pixel's coordinates, and this crystal has the highest probability of actually being hit by the gamma event. After selection, the crystal's number can be used for subsequent imaging reconstruction.

[0094] In practical applications, coarse localization has narrowed the search range to a very small set of candidate crystals. However, the candidate set still contains multiple crystals, and it is necessary to accurately select one as the actual crystal acting on the gamma event. The core problem to be solved in this step is: how to select the crystal that best matches the pixel position coordinates from the candidate crystal set using a clear and operable method. This problem needs to be addressed from two aspects: first, what metric should be used to measure the degree of matching; and second, what algorithm should be used to select the optimal one from multiple candidates. This step explicitly uses Euclidean distance as the metric for the degree of matching and selects the crystal with the smallest distance by sorting or finding the minimum value. This transforms the functional objective of "determining the target crystal" into a specific and executable operation, ensuring the clarity and feasibility of the algorithm.

[0095] In a specific embodiment of this specification, it is assumed that the candidate crystal set contains four crystals with the following centroid coordinates: Crystal A: (153.2, 78.5), Crystal B: (166.1, 78.9), Crystal C: (153.8, 92.0), and Crystal D: (166.5, 92.3). The pixel position coordinates of the gamma event are (152.3, 78.6). First, the Euclidean distance between the pixel position coordinates and the centroid coordinates of each crystal is calculated. The calculated distances are: approximately 0.9 for crystal A, approximately 13.8 for crystal B, approximately 13.5 for crystal C, and approximately 19.7 for crystal D. Sorted from smallest to largest, the results are: 0.9 (crystal A), 13.5 (crystal C), 13.8 (crystal B), and 19.7 (crystal D). According to the sorting results, the smallest distance value is 0.9, corresponding to crystal A. Therefore, crystal A is selected as the target crystal.

[0096] In practical hardware implementations, it's usually unnecessary to fully sort all distance values. Instead, a comparison method is used: first, assume crystal A has the smallest distance, then compare it sequentially with the distances of crystals B, C, and D. Whenever a smaller distance is encountered, update the minimum value and its corresponding crystal. This method only requires one traversal to find the minimum value, making it more efficient.

[0097] Based on this, by explicitly adopting Euclidean distance calculation and sorting selection methods, a quantitative standard for the degree of matching is clearly defined. Euclidean distance, as a direct measure of the closeness between two points in geometric space, can objectively and accurately reflect the spatial relationship between pixel position coordinates and crystal centroid coordinates, avoiding vague qualitative judgments and providing a clear mathematical basis for the selection results. The sorting operation or minimum value search ensures the uniqueness and determinism of the selection. Regardless of the number of crystals in the candidate crystal set, the sorting result can always uniquely determine a minimum value, thus selecting a clear target crystal and avoiding multiple solutions or no solution.

[0098] This specification provides a location processing method, including determining the pixel position coordinates of a gamma event in a detection imaging space, and coordinate reference data corresponding to the detection imaging space. The coordinate reference data includes the crystal centroid coordinates of each imaging crystal in the crystal imaging array, the row average coordinates, and the column average coordinates of the crystal imaging array. Based on the pixel position coordinates, the row average coordinates, and the column average coordinates, a candidate crystal set is determined in the crystal imaging array. Based on the crystal centroid coordinates of each crystal in the candidate crystal set and the pixel position coordinates, the target crystal of the gamma event is determined from the candidate crystal set. This method enables rapid comparison between the pixel position coordinates of the gamma event in the detection imaging space and the coordinate reference data in the detection program space, using the row average coordinates and column average coordinates in the coordinate reference data. Only a small amount of logical operations are required to narrow the search range from the entire crystal imaging array to a small local candidate crystal set, greatly reducing the computational load for subsequent fine-tuning and effectively improving the overall processing speed. Then, by comparing the crystal centroid coordinates and pixel position coordinates of each crystal in the candidate crystal set, the target crystal that actually acts on the gamma event is accurately matched within the narrowed candidate crystal set, thereby further reducing resource consumption while ensuring positioning accuracy.

[0099] The following is in conjunction with the appendix Figure 3 Taking the application of the location processing method provided in this specification in the field of security inspection as an example, the location processing method will be further explained. Figure 3 A flowchart illustrating the processing steps of a location processing method according to an embodiment of this specification is shown, specifically including the following steps.

[0100] In the field of security inspection, suppose a gamma-ray security screening device is used to scan a suitcase. Inside the device is a detector array composed of many small crystals, each responsible for detecting gamma rays coming from a specific direction. Because the rays diffuse and deform within the detector, the image output by the device is equivalent to a "detection imaging space," not a neat grid, but rather a distorted pattern of light spots. To accurately determine which crystal each gamma ray struck, the following steps are required: Step 302: Based on the crystal array of the detector, determine the crystal imaging array corresponding to the crystal array in the detection imaging space, wherein the crystal imaging array includes the crystal response spot corresponding to each imaging crystal; perform energy weighted calculation based on the crystal response spot corresponding to each imaging crystal to obtain the crystal barycenter coordinates of each imaging crystal.

[0101] In one embodiment, the detector is first illuminated with a uniform X-ray source to acquire a field-effect image. In this image, each crystal corresponds to a blurred spot of light. By calculating the energy center of each spot, the precise position of each crystal on the image, i.e., the "crystal barycentric coordinates," is obtained. These coordinates reflect the actual landing point of the crystal in the distorted image.

[0102] Step 304: Calculate the row average coordinates and column average coordinates of the crystal imaging array according to the array position of the crystal imaging array and the crystal barycenter coordinates of each imaging crystal; determine the coordinate reference data corresponding to the detection imaging space based on the crystal barycenter coordinates, row average coordinates and column average coordinates of each imaging crystal.

[0103] In one embodiment, all crystals are grouped according to their physical arrangement by rows and columns. The average value of the centroid coordinates of all crystals in each row is calculated to obtain the "row average coordinates". Similarly, the average value of each column is calculated to obtain the "column average coordinates". These average values ​​are equivalent to the "baseline" of each row and each column on the image, which is used to help with subsequent rapid positioning.

[0104] Step 306: Store the coordinate reference data in the internal memory of the imaging processor.

[0105] In one embodiment, the centroid coordinates, as well as the row average and column average coordinates of each crystal, are all stored in the internal memory of the security inspection device's processor (such as the on-chip memory of an FPGA). This data forms the "map" for subsequent real-time positioning.

[0106] Step 308: Determine the pixel position coordinates of the gamma event in the detection imaging space.

[0107] In one embodiment, when a suitcase passes through security, a gamma ray strikes a crystal, and the detector outputs a signal. After electronic processing, the coordinates (pixel position coordinates) of the ray on the image are obtained. This point is the starting point for localization.

[0108] Step 310: Compare the pixel position coordinates with the average row coordinates and average column coordinates respectively to obtain the candidate row range and candidate column range.

[0109] Specifically, the pixel position coordinates are compared with the average coordinates of the sub-rows corresponding to each row in the row average coordinates, and the candidate row range is determined based on the comparison results; the pixel position coordinates are compared with the average coordinates of the sub-column corresponding to each column in the column average coordinates, and the candidate column range is determined based on the comparison results.

[0110] Specifically, when the pixel position coordinates are located at the edge of the crystal imaging array, the pixel position coordinates are compared with the average row coordinates and the average column coordinates to obtain the initial candidate row range and the initial candidate column range. The initial candidate row range and the initial candidate column range are then adjusted using the array edge to obtain the candidate row range and the candidate column range.

[0111] In one embodiment, this real-time coordinate is compared with the previously stored average coordinates of each row and each column. First, its ordinate is compared to the average ordinates of the rows it is closest to, and the two closest rows are selected as the "candidate row range". Then, its x-coordinate is compared to the average x-coordinates of the columns it is closest to, and the two closest columns are selected as the "candidate column range". If this real-time coordinate is close to the edge of the image, such as near the top row, adjacent inner rows or columns are automatically added to ensure that there are at least two rows / columns for each candidate row / column, preventing the range from being too small.

[0112] Step 312: Select a set of candidate crystals from the crystal imaging array based on the candidate row range and candidate column range.

[0113] In one embodiment, the candidate row range and the candidate column range intersect to obtain a small region, and the crystals contained in this region are called the "candidate crystal set". For example, if the candidate rows are the 5th and 6th rows, and the candidate columns are the 5th and 6th columns, then the candidate crystals are these four crystals (5,5), (5,6), (6,5), and (6,6). This narrows the search range from the entire array.

[0114] Step 314: Calculate the Euclidean distance of each crystal in the candidate crystal set based on the crystal centroid coordinates and pixel position coordinates of each crystal in the candidate crystal set.

[0115] In one embodiment, for each crystal in the candidate set, its centroid coordinates are compared with its real-time coordinates using a linear distance calculation. This step only applies to those few candidate crystals, resulting in minimal computational cost.

[0116] Step 316: Sort each crystal in the candidate crystal set according to the Euclidean distance of each crystal in the candidate crystal set, and select the target crystal from the candidate crystal set according to the sorting result.

[0117] In one embodiment, the distances to all candidate crystals are compared, and the closest one is selected as the crystal that the gamma ray actually struck. This result will be used for subsequent imaging, such as marking the location of the ray source on an image of luggage.

[0118] Based on this, through this "coarse-to-refined" approach, the security inspection equipment can respond quickly (processing millions of events per second) without requiring a large external storage capacity. The entire system is compact and low-power, making it very suitable for use in airports and other places where efficient security inspections are required.

[0119] Corresponding to the above method embodiments, this specification also provides embodiments of a position processing device. Figure 4 A schematic diagram of a position processing device according to one embodiment of this specification is shown. Figure 4 As shown, the device includes: The first determining module 402 is configured to determine the pixel position coordinates of the gamma event in the detection imaging space, and the coordinate reference data corresponding to the detection imaging space, wherein the coordinate reference data includes the crystal centroid coordinates of each imaging crystal in the crystal imaging array, the row average coordinates and column average coordinates of the crystal imaging array. The second determining module 404 is configured to determine a candidate crystal set in the crystal imaging array based on the pixel position coordinates, the row average coordinates, and the column average coordinates. The third determining module 406 is configured to determine the target crystal for the gamma event in the candidate crystal set based on the crystal centroid coordinates of each crystal in the candidate crystal set and the pixel position coordinates.

[0120] Optionally, the first determining module 402 is further configured to: determine a crystal imaging array corresponding to the crystal array in the detection imaging space based on the crystal array of the detector, wherein the crystal imaging array includes a crystal response spot corresponding to each imaging crystal; perform energy weighted calculation based on the crystal response spot corresponding to each imaging crystal to obtain the crystal centroid coordinates of each imaging crystal; calculate the row average coordinates and column average coordinates of the crystal imaging array according to the array position of the generalized crystal imaging array and the crystal centroid coordinates of each imaging crystal; and determine the coordinate reference data corresponding to the detection imaging space based on the crystal centroid coordinates of each imaging crystal, the row average coordinates and column average coordinates of the crystal imaging array.

[0121] Optionally, the device further includes a storage module configured to store the coordinate reference data in the internal memory of the imaging processor.

[0122] Optionally, the second determining module 404 is further configured to compare the pixel position coordinates with the average row coordinates and the average column coordinates respectively to obtain a candidate row range and a candidate column range; and select a candidate crystal set in the crystal imaging array based on the candidate row range and the candidate column range.

[0123] Optionally, the second determining module 404 is further configured to compare the pixel position coordinates with the average coordinates of the sub-rows corresponding to each row in the average row coordinates, and determine the candidate row range based on the comparison result; and to compare the pixel position coordinates with the average coordinates of the sub-column corresponding to each column in the average column coordinates, and determine the candidate column range based on the comparison result.

[0124] Optionally, the second determining module 404 is further configured to, when the pixel position coordinates are located at the array edge of the crystal imaging array, compare the pixel position coordinates with the average row coordinates and the average column coordinates respectively to obtain an initial candidate row range and an initial candidate column range; and adjust the initial candidate row range and the initial candidate column range using the array edge to obtain a candidate row range and a candidate column range.

[0125] Optionally, the third determining module 406 is further configured to calculate the Euclidean distance of each crystal in the candidate crystal set based on the crystal centroid coordinates and the pixel position coordinates of each crystal in the candidate crystal set; sort each crystal in the candidate crystal set according to the Euclidean distance of each crystal in the candidate crystal set; and select the target action crystal in the candidate crystal set according to the sorting result.

[0126] The above is a schematic scheme of a position processing device according to this embodiment. It should be noted that the technical solution of this position processing device and the technical solution of the position processing method described above belong to the same concept. For details not described in detail in the technical solution of the position processing device, please refer to the description of the technical solution of the position processing method described above.

[0127] Figure 5 A structural block diagram of a computing device 500 according to one embodiment of this specification is shown. The components of the computing device 500 include, but are not limited to, a memory 510 and a processor 520. The processor 520 is connected to the memory 510 via a bus 530, and a database 550 is used to store data.

[0128] The computing device 500 also includes an access device 540, which enables the computing device 500 to communicate via one or more networks 560. Examples of these networks include Public Switched Telephone Network (PSTN), Local Area Network (LAN), Wide Area Network (WAN), Personal Area Network (PAN), or combinations of communication networks such as the Internet. The access device 540 may include one or more of any type of wired or wireless network interface (e.g., a network interface card (NIC)), such as an IEEE 802.11 Wireless Local Area Network (WLAN) wireless interface, a Wi-MAX (Worldwide Interoperability for Microwave Access) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, or a Near Field Communication (NFC) interface.

[0129] In one embodiment of this specification, the above-described components of the computing device 500 and Figure 5 Other components, not shown, can also be connected to each other, for example, via a bus. It should be understood that... Figure 5 The block diagram of the computing device shown is for illustrative purposes only and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.

[0130] The computing device 500 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or personal computers (PCs). The computing device 500 can also be a mobile or stationary server.

[0131] The processor 520 is configured to execute the following computer-executable instructions, which, when executed by the processor, implement the steps of the above-described location processing method.

[0132] The above is an illustrative scheme of a computing device according to this embodiment. It should be noted that the technical solution of this computing device and the technical solution of the position processing method described above belong to the same concept. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solution of the position processing method described above.

[0133] An embodiment of this specification also provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of the above-described location processing method.

[0134] The above is an illustrative scheme of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium and the technical solution of the location processing method described above belong to the same concept. For details not described in detail in the technical solution of the storage medium, please refer to the description of the technical solution of the location processing method described above.

[0135] An embodiment of this specification also provides a computer program product, including a computer program or instructions that, when executed by a processor, implement the steps of the above-described location processing method.

[0136] The above is an illustrative scheme of a computer program product according to this embodiment. It should be noted that the technical solution of this computer program product and the technical solution of the position processing method described above belong to the same concept. For details not described in detail in the technical solution of the computer program product, please refer to the description of the technical solution of the position processing method described above.

[0137] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0138] The computer instructions include computer program code, which may be in the form of source code, object code, executable file, or certain intermediate forms. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium may be appropriately added or removed according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media may not include electrical carrier signals and telecommunication signals.

[0139] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments in this specification are not limited to the described order of actions, because according to the embodiments in this specification, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the embodiments in this specification.

[0140] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0141] The preferred embodiments disclosed above are merely illustrative of this specification. Optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the embodiments described in this specification. These embodiments are selected and specifically described in this specification to better explain the principles and practical applications of the embodiments, thereby enabling those skilled in the art to better understand and utilize this specification.

Claims

1. A position processing method, characterized in that, include: Determine the pixel position coordinates of the gamma event in the detection imaging space, and the coordinate reference data corresponding to the detection imaging space, wherein the coordinate reference data includes the crystal centroid coordinates of each imaging crystal in the crystal imaging array, the row average coordinates and column average coordinates of the crystal imaging array; Based on the pixel position coordinates, the average row coordinates, and the average column coordinates, a candidate crystal set is determined in the crystal imaging array; Based on the crystal centroid coordinates of each crystal in the candidate crystal set and the pixel position coordinates, the target crystal for the gamma event is determined in the candidate crystal set.

2. The method according to claim 1, characterized in that, The generation of coordinate reference data corresponding to the detection imaging space includes: Based on the crystal array of the detector, a crystal imaging array corresponding to the crystal array is determined in the detection imaging space, wherein the crystal imaging array includes a crystal response spot corresponding to each imaging crystal; Based on the energy-weighted calculation of the crystal response spot corresponding to each imaging crystal, the crystal centroid coordinates of each imaging crystal are obtained. Based on the array position of the crystal imaging array and the crystal centroid coordinates of each imaging crystal, calculate the row average coordinates and column average coordinates of the crystal imaging array. The coordinate reference data corresponding to the detection imaging space is determined based on the crystal centroid coordinates of each imaging crystal, the row average coordinates, and the column average coordinates.

3. The method according to claim 2, characterized in that, After generating the coordinate reference data corresponding to the detection imaging space, the method further includes: The coordinate reference data is stored in the internal memory of the imaging processor.

4. The method according to claim 1, characterized in that, The step of determining a candidate crystal set in the crystal imaging array based on the pixel position coordinates, the average row coordinates, and the average column coordinates includes: The pixel position coordinates are compared with the average row coordinates and the average column coordinates to obtain the candidate row range and the candidate column range; A candidate crystal set is selected from the crystal imaging array based on the candidate row range and the candidate column range.

5. The method according to claim 4, characterized in that, The step of comparing the pixel position coordinates with the average row coordinates and the average column coordinates to obtain the candidate row range and candidate column range includes: The pixel position coordinates are compared with the average coordinates of the sub-rows corresponding to each row in the average row coordinates, and the candidate row range is determined based on the comparison results. The pixel position coordinates are compared with the average coordinates of the sub-columns corresponding to each column in the column average coordinates, and the candidate column range is determined based on the comparison results.

6. The method according to claim 4, characterized in that, The step of comparing the pixel position coordinates with the average row coordinates and the average column coordinates to obtain the candidate row range and candidate column range includes: When the pixel position coordinates are located at the edge of the crystal imaging array, the pixel position coordinates are compared with the average row coordinates and the average column coordinates to obtain the initial candidate row range and the initial candidate column range. The initial candidate row range and the initial candidate column range are adjusted using the array edges to obtain the candidate row range and the candidate column range.

7. The method according to claim 1, characterized in that, The step of determining the target crystal for the gamma event from the candidate crystal set based on the crystal centroid coordinates of each crystal in the candidate crystal set and the pixel position coordinates includes: The Euclidean distance of each crystal in the candidate crystal set is calculated based on the crystal centroid coordinates and the pixel position coordinates of each crystal in the candidate crystal set. Each crystal in the candidate crystal set is sorted according to its Euclidean distance, and the target crystal is selected from the candidate crystal set according to the sorting result.

8. A position processing device, characterized in that, include: The first determining module is configured to determine the pixel position coordinates of the gamma event in the detection imaging space, and the coordinate reference data corresponding to the detection imaging space, wherein the coordinate reference data includes the crystal centroid coordinates of each imaging crystal in the crystal imaging array, the row average coordinates and column average coordinates of the crystal imaging array. The second determining module is configured to determine a candidate crystal set in the crystal imaging array based on the pixel position coordinates, the row average coordinates, and the column average coordinates. The third determining module is configured to determine the target crystal for the gamma event in the candidate crystal set based on the crystal centroid coordinates of each crystal in the candidate crystal set and the pixel position coordinates.

9. A computing device, characterized in that, include: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions, which, when executed by the processor, implement the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, It stores computer-executable instructions that, when executed by a processor, implement the steps of the method according to any one of claims 1 to 7.

11. A computer program product, characterized in that, It includes a computer program or instructions that, when executed by a processor, implement the steps of the method according to any one of claims 1 to 7.