An x-ray data processing method based on a timepix3 detector

By using the data processing method of the Timepix3 detector, the time evolution of X-ray signal energy spectrum, intensity time waveform and two-dimensional image are reconstructed, which overcomes the limitations of traditional detection arrays and realizes high-precision dynamic diagnostic data acquisition.

CN121431576BActive Publication Date: 2026-02-27HEFEI INSTITUTE OF PHYSICAL SCIENCE CHINESE ACADEMY OF SCIENCES
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202512006767.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-29
Publication Date
2026-02-27
Estimated Expiration
2045-12-29

AI Technical Summary

Technical Problem

Traditional semiconductor photodiode detector arrays cannot provide information on the energy spectrum time evolution of X-ray signals, and have limitations in acquiring the temporal waveform and spatial distribution of X-ray signal intensity.

Method used

Data acquisition was performed using a Timepix3 detector, which generated high-precision timestamps and saved the original data. The X-ray signal intensity time waveform, energy spectrum time evolution, and two-dimensional X-ray image were reconstructed through preprocessing. The pixel clusters were restored using the two-dimensional coordinate information of the hit event, and the center coordinates of the count value were calculated.

Benefits of technology

It achieves high-precision reconstruction of the time evolution of X-ray signal energy spectrum, the time waveform of signal intensity, and two-dimensional X-ray images, overcoming the shortcomings of traditional detection arrays and providing multi-dimensional, high-precision dynamic diagnostic data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121431576B_ABST
    Figure CN121431576B_ABST
Patent Text Reader

Abstract

The application discloses an X-ray data processing method based on a Timepix3 detector and belongs to the technical field of plasma diagnosis, and comprises the following steps: the Timepix3 detector collects data; an external clock signal is connected to the Timepix3 detector, and when the Timepix3 detector detects a rising edge or a falling edge of the clock signal, a high-precision timestamp is generated and saved in original data; the Timepix3 detector saves the original data and images; the saved original data is preprocessed; and X-ray signal intensity time waveform reconstruction, X-ray signal energy spectrum time evolution reconstruction and two-dimensional X-ray image reconstruction are carried out based on the preprocessed original data. Through processing of original data captured by the Timepix3 detector, the application realizes reconstruction of X-ray signal energy spectrum time evolution, X-ray signal intensity time waveform and a two-dimensional X-ray image.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of plasma diagnosis, and particularly relates to an X-ray data processing method based on a Timepix3 detector. BACKGROUND

[0002] The current tokamak device has selected tungsten as the first wall material, and long pulse operation will inevitably cause tungsten impurities to exist in the plasma core. If tungsten and other high-Z impurities are seriously aggregated in the core, not only the core turbulence and electron heat transport will be affected, but also the plasma may even be broken. The tungsten and other high-Z impurities aggregated in the core will lose energy through strong radiation, causing local cooling of the plasma, thereby changing the plasma profile and directly affecting the strength and characteristics of the turbulence, which will be reflected in the changes in the spatial and temporal distribution of the X-ray signal. Therefore, it is very important to obtain the spatial distribution, intensity and energy spectrum time evolution information of the X-ray signal.

[0003] The traditional semiconductor photodiode array can only respond to X-rays in a certain energy range, and cannot provide the time evolution information of the energy spectrum. The semiconductor photodiode array has limitations in obtaining the X-ray signal intensity time waveform, and has deficiencies in obtaining the spatial distribution of the X-ray signal within a limited time range. SUMMARY

[0004] To solve the above technical problems, the application adopts the following technical solutions:

[0005] An X-ray data processing method based on a Timepix3 detector, comprising:

[0006] Step 1, the Timepix3 detector performs data acquisition, including: connecting an external clock signal to the Timepix3 detector, and when the Timepix3 detector detects a rising edge or a falling edge of the clock signal, generating a high-precision time stamp and saving it in the original data; the Timepix3 detector saves the original data and images;

[0007] Step 2, preprocessing the original data saved in step 1;

[0008] Step 3, based on the original data preprocessed in step 2, reconstructing the X-ray signal intensity time waveform, the X-ray signal energy spectrum time evolution and the two-dimensional X-ray image.

[0009] The application has the following beneficial effects:

[0010] The application provides an X-ray data processing method based on a Timepix3 detector, which comprises the following steps: calibrating the arrival time of each hit event by using the high-precision timestamp in the original data; restoring the coordinates of the hit event in the total pixel matrix by using the coordinates of the hit event in the sub-pixel matrix; restoring the pixel cluster by using the two-dimensional coordinate information of the hit event and calculating the accurate position of the center coordinate of the count value of the pixel cluster; and performing regional count value merging and mean filtering on the superposition result of the pixel cluster. The original data captured by the Timepix3 detector is processed, the time evolution of the X-ray signal spectrum, the time waveform of the X-ray signal intensity and the reconstruction of the two-dimensional X-ray image are realized, and the problems that the semiconductor photodiode detection array cannot give the time evolution information of the energy spectrum, has limitations in obtaining the time waveform of the X-ray signal intensity and has defects in obtaining the spatial distribution of the X-ray signal within a limited time range are solved. BRIEF DESCRIPTION OF DRAWINGS

[0011] Figure 1 A flowchart of the X-ray data processing method based on the Timepix3 detector of the application;

[0012] Figure 2a An X-ray signal intensity time waveform reconstruction result graph;

[0013] Figure 2b An X-ray signal spectrum time evolution reconstruction result graph. DETAILED DESCRIPTION

[0014] In order to make the purpose, technical scheme and advantages of the application clearer, the application is further described in detail below in combination with the drawings and examples. It should be understood that the specific examples described herein are only used to explain the application and do not limit the application. In addition, the technical features involved in each embodiment of the application described below can be combined with each other as long as they do not conflict with each other.

[0015] Firstly, the meanings of some important concepts involved in the application are given below:

[0016] Hit event: when X-ray photons are incident on a semiconductor crystal, electron-hole pairs are generated. Under the action of an external electric field, the electrons or holes are collected by the pixel electrode to generate a pulse signal. When the pulse signal intensity is higher than a set threshold, the counter will count once, representing that a hit event is recorded by the pixel electrode.

[0017] Time-over-threshold (ToT): When the intensity of the pulse signal generated by the incident X-ray photon exceeds the set threshold, the counter continues to count according to the external clock frequency. When the intensity of the pulse signal is lower than the set threshold, the counter stops counting. The higher the count value of the counter represents the higher the energy of the incident X-ray photon, and the count value is called time-over-threshold.

[0018] Raw data: The raw data is composed of different types of data packets. Among them, the main types are hit event data packets and timestamp data packets.

[0019] In the hit event data packet, the Time of Arrival (ToA) of each hit event, the time-over-threshold, and the two-dimensional coordinate information are included. The total pixel matrix of the Timepix3 detector is composed of 4 sub-pixel matrices, each of which corresponds to a Timepix3 readout chip. The chip number corresponding to the hit event is contained in the packet header of the hit event data packet. The two-dimensional coordinates of the hit event saved in the hit event data packet represent its position in the sub-pixel matrix, so it is necessary to map the coordinates of the sub-pixel matrix to the total pixel matrix.

[0020] In the timestamp data packet, high-precision timestamps obtained by capturing the rising edge or falling edge of the external clock signal are included. The user sets the timestamp to be triggered based on the rising edge or falling edge of the external clock.

[0021] As shown in Figure 1 The present application provides an X-ray data processing method based on a Timepix3 detector (a third-generation time pixel detector, a hybrid pixel detector capable of simultaneously measuring particle arrival time and energy deposition), which comprises:

[0022] Step 1, the Timepix3 detector performs data acquisition (wherein the data includes raw data and images). During plasma discharge, the Timepix3 detector works in trigger mode. The trigger signal is provided by a signal generator, and the trigger signal period is 10-100 ms. At the same time, the external clock signal is connected to the Timepix3 detector, and when the rising edge or falling edge of the clock signal is detected, a high-precision timestamp is generated and saved in the raw data. The exposure time of the Timepix3 detector is set to be less than or equal to the trigger signal period. The Timepix3 detector saves the raw data and the image. The saved raw data includes all hit event data packets captured by the Timepix3 detector within the exposure time and high-precision timestamp data packets generated by the detected rising edge or falling edge of the external clock signal. In the saved image, the count value of each point represents the number of hit events recorded by the pixel at that position within the exposure time. The image is used to verify whether there is loss in the raw data.

[0023] Step 2, pre-processing the original data saved in step 1.

[0024] In the original data, the coordinates of each hit event only represent its position in the sub-pixel matrix. Therefore, it is necessary to map the coordinates of the hit event in the sub-pixel matrix to the total pixel matrix before processing the hit event. The total pixel matrix of the Timepix3 detector is composed of 4 sub-pixel matrices, each of which corresponds to a Timepix3 readout chip. The 4 sub-pixel matrices are numbered as Chip0, Chip1, Chip2 and Chip3 respectively. Each sub-pixel matrix has a size of 256x256, and the total pixel matrix has a size of 512x512.

[0025] x, y represent the row and column coordinates of the hit event in the sub-pixel matrix respectively. m, n represent the coordinates of the hit event in the total pixel matrix. The mapping relationship from the sub-pixel matrix to the total pixel matrix is as follows:

[0026] Chip0: m = 256 - y + 256, n = x + 1 + 256;

[0027] Chip1: m = y + 1, n = 256 - x + 256;

[0028] Chip2: m = y + 1, n = 256 - x;

[0029] Chip3: m = 256 - y + 256, n = x + 1;

[0030] In the original data, the arrival time of the hit event is generated by the internal clock of the Timepix3 detector. However, the internal clock of the Timepix3 detector has inherent errors and drifts, so an external clock signal is needed for time calibration. For the arrival time of each hit event, a high-precision timestamp generated when the Timepix3 detector detects the rising or falling edge of the clock signal is used for calibration. The arrival times of all hit events are synchronized and unified to a high-precision time axis.

[0031] Step 3, X-ray signal intensity time waveform reconstruction, X-ray signal energy spectrum time evolution reconstruction and two-dimensional X-ray image reconstruction; X-ray signal intensity time waveform reconstruction, X-ray signal energy spectrum time evolution reconstruction and two-dimensional X-ray image reconstruction are performed simultaneously without any order.

[0032] For X-ray signal intensity time waveform reconstruction: To reconstruct the time waveform of X-ray signal intensity, the signal intensity at each time point is needed. The hit event information is extracted from the preprocessed raw data, and all hit events are sorted by arrival time. By setting a time window, the number of hit events in each time window is extracted. The number of hit events in the time window represents the signal intensity of that time segment, that is, the X-ray signal intensity time waveform reconstruction is performed. The smaller the time window is selected, the closer it is to the signal intensity at that time point. Considering the loss of raw data in the acquisition and transmission process, the reconstructed X-ray signal intensity time waveform needs to be checked and compensated.

[0033] For X-ray signal energy spectrum time evolution reconstruction: To reconstruct the time evolution of X-ray signal energy spectrum, the distribution of different energy photons at each time point is needed. Due to the charge sharing effect, a hit event caused by a single photon may occur in several adjacent pixels to form a pixel cluster. Therefore, the energy dispersed in adjacent pixels needs to be concentrated. That is, the count values of all pixels in the pixel cluster are summed, and the summed value is called the pixel cluster volume.

[0034] By setting a time window, the hit events in the time window are restored to pixel clusters. The pixel count values of each pixel cluster are summed to obtain the pixel cluster volume, and then the distribution of the pixel cluster volume is obtained. After energy calibration of the detector, there is a linear relationship between the pixel cluster volume and the energy. Finally, the distribution of different energy photons in the time window is obtained. The smaller the time window is selected, the closer it is to the true distribution of different energy photons at that time point.

[0035] For two-dimensional X-ray image reconstruction: To reconstruct a two-dimensional X-ray image, the precise position of each photon-induced hit event is needed. First, determine the pixel area range of the reconstructed image through the image saved by the Timepix3 detector; second, determine the time range of the reconstructed image; third, extract hit event information that meets the pixel area range and time range from the preprocessed raw data; sort all extracted hit event information by arrival time and restore it to a pixel cluster; fourth, calculate the count value center coordinates of each pixel cluster and concentrate all pixel count values to the pixel located at the coordinates. Superimpose all pixel clusters to obtain the preliminary result of the reconstructed image. Finally, perform pixel area merging and mean filtering on the preliminary result of the reconstructed image to obtain the final result of the reconstructed image.

[0036] In step 3, the X-ray signal intensity time waveform reconstruction; includes:

[0037] Step 3.1, time waveform reconstruction;

[0038] Determine the trigger signal period and the length of the time window. Initialize two N x 1 column vectors to save the time information and the intensity information of the signal respectively. Initialize a flag variable Flag and assign it an initial value of 1. The flag variable Flag represents the number of window sliding times, N = trigger signal period / time window length. For a single raw data file, first preprocess the raw data. Then extract the hit event information from the preprocessed raw data, and sort the hit events according to their arrival times to obtain the total sequence of hit events.

[0039] Extract the subsequence from the total sequence of hit events according to the set time window. Count the number of hit events in the subsequence and save the number of hit events to the intensity information column vector. At the same time, calculate Flag x time window length and save the value to the time information column vector. Then slide the time window, increase the value of the flag variable Flag by 1, and repeat the above operation until all hit events are counted.

[0040] Step 3.2, mark the data loss position;

[0041] Considering the loss of raw data during acquisition and transmission, i.e. the arrival time interval of adjacent hit events in the total sequence of hit events may be greater than the set time window length. After the time window slides, a judgment needs to be made. If there is no hit event in the time window range, continue to slide until there is a hit event in the time window range. The flag variable Flag counts increase by 1 and the time information is saved in the time information column vector. After each time window is slid, check whether there is a hit event in the current time window range. If there is no hit event in the current time window range, record the number of hit events as -1 in the corresponding position of the intensity information column vector, representing data loss in this time period.

[0042] Step 3.3, multi-file processing and vector merging;

[0043] A data acquisition may save multiple raw data files. For each raw data file, a time information column vector and an intensity information column vector are obtained after processing. When all file processing is completed, all time information column vectors are merged into a total time information column vector, and all intensity information column vectors are merged into a total intensity information column vector. In order to realize the continuity of the time axis, a global time offset needs to be applied to each time information vector before vector merging. The global time offset is determined by the high-precision timestamp generated when the Timepix3 detector detects the rising or falling edge of the clock signal.

[0044] Step 3.4, data loss interval positioning and interpolation;

[0045] In the saved image, the count value of each point represents the number of hit events recorded by the pixel at that position within the exposure time. The count values of all pixels in the image data are summed and compared with the total number of hit events in the raw data. If there is a difference, it is determined that there is a loss of hit events in the raw data. In the step of marking the data loss position (step 3.2), the position of data loss in the intensity information column vector has been marked. Traverse the intensity information column vector to find all data missing intervals and record the start and end point indexes of each interval. For each data missing interval, get the reference points before and after the interval. Based on the values of the reference points before and after the interval, linear interpolation is used for intervals with a length less than or equal to 3, and spline interpolation is used for intervals with a length greater than 3, to ensure the continuity and integrity of the time series.

[0046] In step 3, the X-ray signal energy spectrum time evolution reconstruction; including:

[0047] Step 4.1, storage structure initialization;

[0048] Determine the trigger signal period of data acquisition, the length of the main time window and the length of the slave time window. The main time window is used to extract the subsequence from the total sequence of hit events, and the slave time window is used to restore the hit events in the subsequence into pixel clusters, and its size is set to 10000ns. Initialize an N x M matrix ClusterMatrix (only the matrix name, no special meaning), which is used to save the number information of pixel clusters. N = trigger signal period / main time window length, M is the upper limit of the energy detection range of the detector. Initialize a flag variable Flag and assign the initial value to 1. The variable represents the number of sliding times of the main time window. Initialize a 512 x 512 matrix TmpMatrix (only the matrix name, no special meaning), which represents the total pixel matrix, which is used to restore the hit events into pixel clusters.

[0049] Step 4.2, pixel cluster recovery and recording;

[0050] For a single raw data file, the raw data is pre-processed first. Then the hit event information is extracted from the pre-processed raw data, and the hit event total sequence is obtained by sorting the hit events according to their arrival times. The sub-sequence is extracted from the hit event total sequence according to the set main time window. The over-threshold time and two-dimensional coordinates of the hit events are extracted from the sub-sequence according to the from time window. The over-threshold time of the hit events is filled in the corresponding positions of the matrix TmpMatrix according to the two-dimensional coordinates of each hit event. When all the hit events in the from time window are filled in the matrix TmpMatrix, the pixel clusters are searched in the matrix TmpMatrix, and the pixel cluster volume size is recorded. When a pixel cluster with a volume of V is recorded, the element count value of the Flag row and the V column of the matrix ClusterMatrix is increased by 1. When all the pixel clusters are recorded, the from time window is slid and the matrix TmpMatrix is emptied. When all the hit events in the sub-sequence are recovered into pixel clusters and recorded, the main time window is slid, and the value of the flag variable Flag is increased by 1. The above process is repeated until all the hit events in the hit event total sequence are recovered into pixel clusters and recorded.

[0051] Step 4.3, multi-file processing and matrix merging;

[0052] A single data acquisition may save multiple raw data files. All the raw data files are numbered according to the order of file saving. The raw data is pre-processed in order according to the number. After the pixel cluster recovery and recording steps are performed on each pre-processed raw data file, a matrix recording the pixel cluster quantity information is obtained. When all the file processing is completed, all the matrices are merged into a total pixel cluster quantity matrix. After the detector is energy calibrated, the pixel cluster volume can be converted into the corresponding energy.

[0053] In step 3, two-dimensional X-ray image reconstruction; including:

[0054] Step 5.1, storage structure initialization;

[0055] The size of the time window is set to 10000 ns. A matrix TmpMatrix with a size of 512x512 is initialized, representing the total pixel matrix, which is used to recover the hit events into pixel clusters. A matrix ResultMatrix with a size of, for example, 512x512 (only the matrix name, no special meaning) is initialized, which is used to save the reconstruction results.

[0056] Step 5.2, pixel cluster recovery and count value center coordinate calculation;

[0057] First, the pixel region range of the reconstructed image is determined by the saved image file. Second, the time range of the reconstructed image is determined. Third, the raw data is preprocessed, and then the hit event information meeting the pixel region range and the time range is extracted from the preprocessed raw data. The hit events are sorted according to the arrival time of each hit event to obtain a total sequence of hit events. The threshold crossing time and the two-dimensional coordinates of the hit events are extracted from the total sequence of hit events according to the time window. The threshold crossing time information of the hit events is filled in the corresponding position of the matrix TmpMatrix according to the two-dimensional coordinates of each hit event. When all the hit events in the time window are filled in the matrix TmpMatrix, the pixel clusters are searched in the matrix TmpMatrix. For each pixel cluster, the count value center coordinates are calculated, and all the pixel count values are concentrated to the pixel located at the count value center coordinates. The count value center coordinates are designed as (x, y) = (0, 0), and the calculation formula is as follows:

[0058]

[0059]

[0060]

[0061] After all the pixel clusters in the current time window are processed, the pixel count values in the corresponding positions of the matrix TmpMatrix and the matrix ResultMatrix are added, and the result is saved in the matrix ResultMatrix. The time window is slid, and the matrix TmpMatrix is emptied. The above operations are repeated until all the hit events in the subsequence are processed. Finally, the matrix ResultMatrix obtained is the superposition result of all the pixel clusters.

[0062] Step 5.3, pixel region merging and mean filtering

[0063] The pixel values in the same intensity region are discontinuous and non-uniform. Therefore, the count values of each 4x4 pixel region in the matrix ResultMatrix are merged. After the merging is completed, 5x5 mean filtering is performed. The uniformity and continuity of the pixel values in the same intensity region are realized, and the distribution of the X-ray signal intensity in different regions is better represented.

[0064] Figure 2a is the X-ray signal intensity time waveform reconstruction result image, indicating the number of hit events per 1ms; Figure 2b ​​​​​​​​The X-ray signal energy spectrum time evolution reconstruction result map shows the distribution of photons of different energies in each 1ms. Figure 2a , The time window of the X-ray signal energy spectrum time evolution reconstruction result map is set to 1ms. Figure 2b The time window of the X-ray signal energy spectrum time evolution reconstruction result map is set to 1ms.

[0065] The X-ray signal energy spectrum time evolution reconstruction result map shows the distribution of photons of different energies in each 1ms.

[0066] Those skilled in the art will understand that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk memory, CD-ROM, optical memory, etc.) containing computer-usable program code. The solutions in the embodiments of the present application can be implemented in various computer languages.

[0067] The present application is described with reference to flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing apparatus to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing apparatus produce a device that implements the flow Figure 1 The device that implements the function specified in one flow or multiple flows and / or blocks. Figure 1 The device that implements the function specified in one flow or multiple flows and / or blocks.

[0068] These computer program instructions can also be stored in a computer-readable memory that can direct the computer or other programmable data processing apparatus to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including instruction devices that implement the flow Figure 1 The device that implements the function specified in one flow or multiple flows and / or blocks. Figure 1 The device that implements the function specified in one flow or multiple flows and / or blocks.

[0069] These computer program instructions can also be loaded into a computer or other programmable data processing devices, so that a series of operational steps are performed on the computer or other programmable data processing devices, to generate a computer implemented process, so that the instructions executed on the computer or other programmable data processing devices provide the function of implementing the flow Figure 1 one or more flows and / or blocks Figure 1 one or more blocks or steps of the function specified in the flow

[0070] Although the preferred embodiments of the application have been described, those skilled in the art will be able to make additional modifications and variations to these embodiments without departing from the spirit and scope of the application. Accordingly, the appended claims are intended to encompass within their scope all such modifications and variations as fall within the scope of the application.

[0071] Obviously, various modifications and changes can be made to the present application by those skilled in the art without departing from the spirit and scope of the present application. Accordingly, the present application intends to include all such modifications and changes as fall within the scope of the claims and their equivalents.

[0072] The above description is merely illustrative of the application and is not intended to limit the scope of the application. Any equivalent structure or equivalent processes that directly or indirectly serve the same function are also intended to be encompassed by the protection scope of the application.

[0073] The contents not described in detail in the specification of the present application are the prior art known to those skilled in the art.

Claims

1. A method for processing X-ray data based on a Timepix3 detector, characterized in that, include: Step 1: The Timepix3 detector acquires data, including: connecting an external clock signal to the Timepix3 detector; when the Timepix3 detector detects the rising or falling edge of the clock signal, it generates a high-precision timestamp and saves it in the raw data; the Timepix3 detector saves the raw data and images. Step 2: Preprocess the raw data saved in Step 1; calibrate the arrival time of each hit event using a high-precision timestamp generated when the Timepix3 detector detects the rising or falling edge of the clock signal. Step 3: Based on the raw data preprocessed in Step 2, perform X-ray signal intensity time waveform reconstruction, X-ray signal energy spectrum time evolution reconstruction, and two-dimensional X-ray image reconstruction. X-ray signal intensity time waveform reconstruction includes: extracting hit event information from preprocessed raw data and sorting all hit events according to arrival time; extracting the number of hit events within each time window by setting time windows, and using the number of hit events within a time window to represent the signal intensity within that time window; and checking and compensating the reconstructed X-ray signal intensity time waveform. X-ray signal energy spectrum temporal evolution reconstruction includes: setting a time window, restoring the hit events within the time window into pixel clusters; summing the pixel count values ​​for each pixel cluster to obtain the pixel cluster volume, and then obtaining the distribution of pixel cluster volume; finally obtaining the distribution of photons with different energies within the time window; Two-dimensional X-ray image reconstruction includes: First, determining the pixel region range of the reconstructed image using images stored with a Timepix3 detector; second, determining the time range of the reconstructed image; third, extracting hit event information that matches the pixel region range and time range from the preprocessed raw data; sorting all extracted hit event information according to arrival time and restoring them into pixel clusters; fourth, calculating the center coordinates of the count value for each pixel cluster and concentrating the count values ​​of all pixels at the pixel located at the center coordinates of the count value; superimposing all pixel clusters to obtain a preliminary result of the reconstructed image; finally, performing pixel region merging and mean filtering on the preliminary result of the reconstructed image to obtain the final result of the reconstructed image.

2. The X-ray data processing method based on the Timepix3 detector according to claim 1, characterized in that, In step 1, the raw data saved by the Timepix3 detector includes all hit event data packets captured by the Timepix3 detector during the exposure time and high-precision timestamp data packets generated by the rising or falling edge of the detected external clock signal; in the saved image, the count value of each point represents the number of hit events recorded by the pixel at the point's location during the exposure time; the image is used to verify whether the raw data is missing.

3. The X-ray data processing method based on the Timepix3 detector according to claim 2, characterized in that, In step 1, the hit event data packet includes: the arrival time, threshold time, and two-dimensional coordinate information of each hit event.

4. The X-ray data processing method based on the Timepix3 detector according to claim 1, characterized in that, Step 2 includes: The Timepix3 detector's total pixel matrix consists of four sub-pixel matrices, each corresponding to a Timepix3 readout chip. These four sub-pixel matrices are numbered Chip0, Chip1, Chip2, and Chip3. x and y represent the row and column coordinates of the hit event within the sub-pixel matrix, respectively; m and n represent the coordinates of the hit event within the total pixel matrix. The mapping from the sub-pixel matrix to the total pixel matrix is ​​as follows: Chip0: m=256-y+256, n=x+1+256; Chip1: m=y+1, n=256-x+256; Chip2: m = y + 1, n = 256 - x; Chip3: m=256-y+256, n=x+1; For the arrival time of each hit event, a high-precision timestamp generated when the clock signal rises or falls is detected by the Timepix3 detector for calibration; the arrival times of all hit events are synchronized and unified onto a high-precision timeline.

5. The X-ray data processing method based on the Timepix3 detector according to claim 1, characterized in that, Step 3, the reconstruction of the X-ray signal intensity time waveform includes: Step 3.1, Time Waveform Reconstruction; The trigger signal period and time window length for data acquisition are determined. Two N×1 column vectors are initialized to store the signal time and intensity information, respectively. A flag variable Flag is initialized and assigned an initial value of 1. This flag variable Flag represents the number of window slides, where N = trigger signal period / time window length. For a single raw data file, the raw data is preprocessed first, and then the hit event information is extracted from the preprocessed raw data. The data is then sorted according to the arrival time of each hit event to obtain the total sequence of hit events. Step 3.2, mark the locations where data was lost; After sliding the time window, a check is performed. If there is no hit event within the time window, the sliding continues until a hit event is found within the time window. Each time the time window slides, the flag variable Flag is incremented by 1, and the time information is stored in the time information column vector. After each time window slide, it is checked whether there is a hit event within the current time window. If there is no hit event within the current time window, the hit event count is recorded as -1 at the corresponding position in the intensity information column vector. Step 3.3, Multi-file processing and vector merging; For each original data file, after processing, a time information column vector and an intensity information column vector are obtained. After all files have been processed, all time information column vectors are merged into a total time information column vector, and all intensity information column vectors are merged into a total intensity information column vector. A global time offset needs to be applied to each time information vector before the vector merging is performed. Step 3.4, Locating and interpolating missing data intervals; The count values ​​of all pixels in the image data are summed and compared with the total number of hit events in the original data. If there is a difference, it is determined that there are missing hit events in the original data. The intensity information column vector is traversed to find all missing data intervals and the start and end point indices of each interval are recorded. For each missing data interval, the reference points before and after the missing data interval are obtained. Based on the values ​​of the reference points before and after the missing data interval, linear interpolation is used for missing data intervals with a length of less than or equal to 3, and spline interpolation is used for missing data intervals with a length greater than 3.

6. The X-ray data processing method based on the Timepix3 detector according to claim 1, characterized in that, Step 3, the reconstruction of the X-ray signal energy spectrum time evolution includes: Step 4.1, storage structure initialization; Determine the trigger signal period, main time window length, and slave time window length for data acquisition; initialize an N×M matrix ClusterMatrix to store the number of pixel clusters, where N = trigger signal period / main time window length, and M is the upper limit of the detector's energy detection range; initialize a flag variable Flag and assign it an initial value of 1, which represents the number of slides in the main time window; initialize the total pixel matrix TmpMatrix to reconstruct the hit event into a pixel cluster; Step 4.2, pixel cluster recovery and recording; For a single raw data file, the raw data is first preprocessed, and then hit event information is extracted from the preprocessed raw data. The data is then sorted according to the arrival time of each hit event to obtain a total hit event sequence. Subsequences are extracted from the total hit event sequence according to a set main time window. Threshold-crossing times and 2D coordinates of the hit events are extracted from the subsequences according to the secondary time window. The threshold-crossing times of each hit event are filled into the corresponding position in the matrix TmpMatrix according to the 2D coordinates of each hit event. After all hit events in the secondary time window have been filled into the matrix TmpMatrix, pixel clusters are searched in the matrix TmpMatrix, and the size of each pixel cluster is recorded. For each pixel cluster with a volume of V recorded, the element count in the Vth row and column of the matrix ClusterMatrix is ​​incremented by 1. After all pixel clusters have been recorded, the secondary time window is slid and the matrix TmpMatrix is ​​cleared. After all hit events in the subsequences have been restored to pixel clusters and recorded, the main time window is slid, and the flag variable Flag is incremented by 1. Step 4.3, Multi-file processing and matrix merging; All raw data files are numbered according to the order in which they are saved, and the raw data is preprocessed sequentially according to the number. After pixel cluster recovery and recording steps are performed on each preprocessed raw data file, a matrix recording the number of pixel clusters is obtained. After all files are processed, all matrices are merged into a total pixel cluster number matrix. After the detector is calibrated by energy, the pixel cluster volume is converted into the corresponding energy.

7. The X-ray data processing method based on the Timepix3 detector according to claim 1, characterized in that, In step 3, the two-dimensional X-ray image reconstruction includes: Step 5.1, storage structure initialization, including: setting the time window size, initializing the total pixel matrix TmpMatrix, and initializing the matrix ResultMatrix used to store the reconstruction results; Step 5.2: Pixel cluster recovery and calculation of the center coordinates of the count value; Pixel cluster restoration and count center coordinate calculation include: First, determining the pixel region range of the reconstructed image using the saved image file; second, determining the time range of the reconstructed image; third, preprocessing the raw data, and then extracting hit event information that conforms to the pixel region range and time range from the preprocessed raw data; sorting according to the arrival time of each hit event to obtain the total sequence of hit events; extracting the threshold time and two-dimensional coordinates of the hit events from the total sequence of hit events according to the time window; filling the threshold time information of the hit events into the corresponding position of the matrix TmpMatrix according to the two-dimensional coordinates of each hit event; after all hit events in the time window have been filled into the matrix TmpMatrix, searching for pixel clusters in the matrix TmpMatrix; for each pixel cluster, calculating the count center coordinates, and concentrating the count values ​​of all pixels to the pixel located at the count center coordinates; designing the numerical center coordinates as ( ): ; ; in, , For pixel coordinates, This is the pixel count value. The number of pixels in each pixel cluster; After all pixel clusters in the current time window have been processed, the pixel count values ​​at the corresponding positions in matrix TmpMatrix and matrix ResultMatrix are added together, and the result is stored in matrix ResultMatrix; slide the time window and clear matrix TmpMatrix; repeat the above pixel cluster recovery and count value center coordinate calculation until all hit events in the subsequence have been processed, and the final matrix ResultMatrix is ​​the superposition result of all pixel clusters; Step 5.3, Pixel region merging and mean filtering: Merge the count values ​​of each 4×4 pixel region in the ResultMatrix matrix, and then perform 5×5 mean filtering.

Citation Information

Patent Citations

  • Self-adaptive energy calibration method of Timepix3 detector

    CN120762086A

  • Apparatus and method for medical imaging

    US20100078569A1