Spectrum / mass spectrum imaging data processing method and detection device
By using spectral/mass spectrometry imaging data processing methods, the mechanical motion delay and trailing noise are automatically corrected, and the delay correction parameters and filtering noise reduction are optimized. This solves the problems of image distortion and noise interference in mass spectrometry imaging technology, and achieves efficient and high-precision imaging results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- QINGDAO PANSI TECH CO LTD
- Filing Date
- 2025-12-08
- Publication Date
- 2026-04-17
AI Technical Summary
Existing mass spectrometry imaging techniques suffer from poor imaging results due to mechanical motion delays and trailing noise, leading to image distortion and noise interference, and reduced detection efficiency and accuracy.
The data processing methods for spectral/mass spectrometry imaging include time delay correction, trailing point marking, and filtering noise reduction. The mechanical motion delay and trailing noise are automatically corrected. The time delay correction parameters are optimized using an image fracture evaluation model. The data is processed by combining Fourier transform and nearest neighbor interpolation.
It achieves high-precision, low-noise spectral/mass spectrometry imaging data, improves detection accuracy and efficiency, reduces the number of adjustments and detections, and simplifies the data processing workflow.
Smart Images

Figure CN121883293A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of sample detection, specifically to spectral and mass spectrometry imaging data, and more specifically to a spectral / mass spectrometry imaging data processing method and detection device. Background Technology
[0002] Mass spectrometry imaging is an in-situ detection solution integrating mass spectrometry analysis and spatial positioning technology. Its core principle is to ionize target substances at different spatial coordinates on the sample surface into charged ions using a dedicated ionization source. The mass-to-charge ratio of these ions is then separated and signals are acquired by a mass spectrometry unit. By establishing a mapping relationship between ion signals and spatial positions, a two-dimensional or three-dimensional distribution image of the target substance is output. This technology combines the high specificity and sensitivity of mass spectrometry with the spatial positioning capabilities of imaging, enabling integrated qualitative, quantitative, and spatial distribution characterization of target substances. It supports in-situ minimally invasive or non-destructive testing, simplifies sample pretreatment procedures, and is adaptable to various analytes. It has wide applications in fields such as biology, pharmaceuticals, materials science, cultural relics, and forensics, and can overcome the limitations of traditional mass spectrometry in capturing the spatial heterogeneity of samples.
[0003] However, existing mass spectrometry imaging technology has the following drawbacks: Since the scanning imaging process relies on the mechanical movement of the moving mechanism, the mechanical movement will affect the imaging effect. In particular, when there is a delay in the mechanical movement, the matching relationship between the acquired data and the measured position of the analyte will be affected, resulting in image distortion and making it impossible to perform high-precision imaging of the analyte. In addition, in some cases, ion residues may exist during the sample scanning process, resulting in trailing noise, which further reduces the imaging effect.
[0004] In response to the aforementioned shortcomings, the applicant found that currently only a few single error correction methods exist. On the one hand, this leads to cumbersome data processing, and on the other hand, it requires separate adjustments for different errors to achieve a better overall detection effect, resulting in a significant reduction in detection effectiveness and efficiency.
[0005] The information disclosed in the background section is only intended to enhance the understanding of the background of the present invention, and therefore may contain information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0006] To correct for mechanical motion delay and trailing noise, this invention first provides a spectral / mass spectrometry imaging data processing method, characterized by comprising: S000: Detects the analyte and acquires the first data for spectral / mass spectrometry imaging; S200: The first data is processed by a first process to obtain the second data, wherein the dynamic range of the second data is smaller than the dynamic range of the first data; S400: At least the second data is delayed by a delay correction parameter, the image breakage of the corrected image is calculated using an image breakage evaluation model that responds to the scanning path mode of the object under test, and the second data is adjusted with the delay correction parameter when the image breakage is less than a second threshold or is the minimum value to obtain the third data, the third data being an image; S600: Mark the trailing point in the third data at least through the scanning path of the object under test, calculate the neighbor interpolation with the value around the trailing point in the third data to replace the value at the trailing point, and obtain the fourth data; S800: Filter and reduce noise on the fourth data to obtain the fifth data; S1000: Output the fifth data.
[0007] According to one embodiment of this application, the delay correction includes: S401: Perform background subtraction on the second data using the second preset parameters to obtain secondary second data; S402: Select delay correction parameters; S403: Adjust the data and position matching relationship of the secondary second data according to the delay correction parameter, and convert the secondary second data into a second image; S404: Calculate the image breakage of the second image; S405: Adjust the delay correction parameter and repeat S403-S405 to reduce the image fragmentation; if the image fragmentation is less than the second threshold or is the minimum value, adjust the second data with the corresponding delay correction parameter to form the third data.
[0008] According to one embodiment of this application, in steps S402 and S405, the delay correction parameter is selected from a preset parameter library.
[0009] According to one embodiment of this application, the image fracture evaluation model includes: selecting a preset convolution kernel according to the scanning path pattern of the object under test, convolving the corrected image with the convolution kernel to obtain a convolution feature map, and calculating the image fracture based on the convolution feature map.
[0010] According to one embodiment of this application, the image fragmentation evaluation model includes image connectivity detection.
[0011] According to one embodiment of this application, in step S405, the delay correction parameter is adjusted using gradient descent and grid search methods.
[0012] According to one embodiment of this application, the first process includes: S201: Perform baseline subtraction on the first data to obtain the second-level first data; S202: Obtain the maximum and minimum values of the second-level first data. If the minimum value is negative, compensate the second-level first data so that the minimum value is not less than 0. S203: Convert the secondary first data to a preset target dynamic range; S204: Use the converted data as the second data.
[0013] According to one embodiment of this application, the data processing method further includes: matching the first data and / or the second data with the spatial position based on the scanning spatial coordinate information of the instrument used to detect the object under test.
[0014] According to one embodiment of this application, marking the trailing point in the third data through at least the scanning path of the object under test in S600 specifically includes: S600a: Create an empty marker diagram based on the graph of the third data; S600b: Select one pixel from the third data as the pixel to be analyzed; select a square area centered on the pixel to be analyzed and calculate whether the pixel to be analyzed is the edge of the object under test and whether there is a trailing effect. If both are true, mark the position of the pixel to be analyzed in the marking diagram; traverse each pixel of the third data and mark it in the marking diagram. S600c: If the marker positions in the marker map are distributed along the path of the corresponding pixel, then the pixel point corresponding to the marker position is recorded as the trailing point.
[0015] According to one embodiment of this application, in S600b, if the values of the pixel to be analyzed and its adjacent pixels satisfy a unidirectional decreasing condition, it is determined that the pixel to be analyzed has a trailing effect.
[0016] According to one embodiment of this application, S600c further includes: removing the marker position of isolated individual pixels.
[0017] According to one embodiment of this application, S800 includes: S801: Perform a fast Fourier transform on the fourth data to the frequency domain to obtain the second-level fourth data; S802: Clip the frequency domain space of the second-level fourth data; S803: Perform an inverse Fourier transform on the cropped second-level fourth data to obtain the fifth data.
[0018] According to one embodiment of this application, the method further includes: S500: Perform intensity correction on at least one row of the third data.
[0019] According to one embodiment of this application, S500 includes: S501: Select one row of the third data as the row to be corrected; S502: Correct the row to be corrected so that the mean of the row to be corrected is between the mean values of two adjacent rows of the row to be corrected.
[0020] Another aspect of this application provides a detection apparatus, characterized in that: the analyte is scanned and imaged using either spectroscopy or mass spectrometry, and a spectral / mass spectrometry imaging data processing method as described in any of the preceding claims is used.
[0021] Compared with the prior art, the present invention has at least the following beneficial effects: it can reduce instrument noise, perform automatic delay correction at a relatively fast speed without human intervention, accurately locate the trailing point and perform data correction, and suppress vertical high-frequency noise to obtain high-precision, low-noise spectral / mass spectrometry imaging data; in addition, in the aforementioned process, only a single detection data is needed to complete all noise reduction and correction, without the need for multiple adjustments of detection parameters and multiple detections, the correction speed is fast, and it can perform efficient and high-precision correction of mechanical motion delay and trailing noise.
[0022] This application also provides a detection device that, using the aforementioned data processing method, can efficiently and accurately correct mechanical motion delay and trailing noise, is easy to use, and significantly improves detection accuracy. Attached Figure Description
[0023] Figure 1 A flowchart illustrating one implementation of a spectral / mass spectrometry imaging data processing method; Figure 2 This is a diagram illustrating the usage effect of the S200; Figure 3 This is a flowchart illustrating one implementation of S400; Figure 4 This is a diagram illustrating the usage effect of the S400; Figure 5 This is a flowchart illustrating one implementation of S600; Figure 6 This is a diagram illustrating the usage process and effects of the S600; Figure 7 This is a schematic diagram illustrating the usage effect of the S800.
[0024] Figure 8 This is a schematic diagram illustrating the implementation effect of one embodiment of the spectral / mass spectrometry imaging data processing method. Detailed Implementation
[0025] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0026] This application first provides a method for processing spectral / mass spectrometry imaging data, characterized by comprising: S000: Detect the analyte and acquire the first data from spectral / mass spectrometry imaging. The detection of the analyte can be performed using spectral imaging, mass spectrometry imaging, or a combination of both. Those skilled in the art can select and adjust the method according to actual needs. The first data is typically recorded using a data matrix with dimensions x×y×n, where x and y are the length and width of the image, respectively, and n is the number of channels. Specifically, n can be set by the number of mass spectra or spectra detected. In some cases, the data matrix can also be 1×n, and the data matrix can be divided into rows using the x and y values of the image for subsequent analysis.
[0027] S200: The first data is processed to obtain the second data, wherein the dynamic range of the second data is smaller than that of the first data. Specifically, the first processing can be performed by linear scaling, low-frequency compression, and minimum-maximum normalization. Alternatively, the first processing method provided in this application can be used, which will be described in detail below. As an optional implementation, the dynamic range of the second data can be adjusted to the low-frequency feature space [0, K], where K ≤ 20. For example, the first data with a dynamic range of 16 bits is processed to form the second data with a dynamic range of [0, 20], thereby preserving the sample detection signal while eliminating instrument noise.
[0028] S400: The second data is delayed at least by using a delay correction parameter. It should be noted that the delay correction parameter can be optimized and adjusted according to actual needs or detection conditions. Specifically, the delay correction parameter can be evaluated by assessing the image quality of the second data after correction using the delay correction parameter, thus optimizing the parameter. For image quality, the image breakage of the corrected image can be calculated using an image breakage evaluation model responding to the scanning path pattern of the object under test, to evaluate image quality. In particular, higher image quality indicates better image performance, at least in terms of continuity. If the image continuity is better and the image breakage is lower, the second data can be adjusted using a delay correction parameter where the image breakage is less than a second threshold or at its minimum value, thereby obtaining the third data. In some cases, the third data can be image data. Specifically, when the scanned image is x×y, the third data can be at least one x×y image, or multiple x×y images, or even an x×y×n image. It should be noted that in some cases, the third data may also be stored or represented in other forms. When the third data can be represented in the form of an image, it is the third data described in this application that is an image.
[0029] S600: At least the trailing point in the third data is marked by the scanning path of the object under test. Specifically, the scanning path of the object under test is used in the process of marking the trailing point in the third data. The neighbor interpolation is calculated using the values around the trailing point in the third data to replace the value at the trailing point, thus obtaining the fourth data.
[0030] S800: Filter and reduce noise on the fourth data to obtain the fifth data, in order to further suppress vertical high-frequency noise.
[0031] S1000: Output the fifth data for analysis of the analyte.
[0032] By using the aforementioned method, instrument noise is reduced via S200. Using the noise-reduced data, delay correction is performed via S400, and trailing points are processed via S600. Subsequently, filtering and noise reduction are further performed via S800 to reduce data noise, resulting in corrected data. During this process, S400 can optimize the delay correction parameters multiple times to improve the delay correction effect, achieving a better or even optimal effect. This process can be automated by a corresponding computer program without operator intervention. Furthermore, because the dynamic range of the data after noise reduction by S200 is significantly reduced, instrument noise is minimized, and the detection data of the measured object is preserved, the computational load of the delay correction process in S400 is greatly reduced. Even with multiple rounds of optimization, a fast data processing speed can still be maintained. Through the combined use of S200 and S400, instrument noise is reduced, and automatic delay correction can be performed quickly without human intervention, greatly improving the efficiency of the equipment. After delay correction via S400, the correspondence between the scanning path of the analyte and the data can be determined more accurately. This allows for precise location and processing of the trailing point during the marking process via S600, further improving the data correction for the trailing point. Furthermore, after completing delay correction and trailing point data correction, the positional and numerical accuracy of each point in the analyte's detection data is significantly improved. Combined with S800 for filtering and noise reduction to suppress vertical high-frequency noise, comprehensive noise removal is achieved from the spectral / mass spectrometry imaging data of the analyte, resulting in high-precision, low-noise spectral / mass spectrometry imaging data. Moreover, the entire noise reduction and correction process can be completed using only a single detection data set, eliminating the need for multiple adjustments to detection parameters and multiple detections. The overall computational load is small, allowing for rapid completion and efficient, high-precision correction of mechanical motion delays and trailing noise.
[0033] This application also provides a detection device that uses the aforementioned data processing method. It has the beneficial effects of the aforementioned data processing method, and can efficiently and accurately correct mechanical motion delay and trailing noise. It is easy for operators to use and the detection accuracy is greatly improved.
[0034] In some cases, both spectroscopy and mass spectrometry can use continuous bow-shaped scanning of the sample surface to collect characteristic emission lines of elements or mass-to-charge ratio (m / z) intensity data of target molecules for detection.
[0035] In some cases, the first data and / or the second data can be matched with the spatial position based on the scanning spatial coordinate information of the instrument used to detect the object under test. Specifically, the actual position corresponding to each data of the first data and / or the second data can be obtained. As a feasible implementation method, the first data and / or the second data can be converted into two-dimensional data or spatial data.
[0036] Regarding S200, as a feasible implementation method, this application provides a first processing method, specifically, the following scheme can be adopted: S201: Perform baseline subtraction on the first data to obtain the second-level first data. Baseline subtraction refers to subtracting each data point in a channel of the first data from the background baseline, and using the difference as the second-level first data. The background baseline is a component of the first data, and can be calculated using methods such as global statistical analysis, blank area sampling, and signal peak-valley analysis, as needed. More specifically, when the first data contains n channels, the background baseline can be calculated using data from channels other than the channel to be processed, and then used for baseline subtraction of the channel to be processed. When there is only one channel, the original data of the channel to be processed can be used to calculate the background baseline.
[0037] S202: Obtain the maximum and minimum values of the secondary first data. If the minimum value is negative, compensate the secondary first data so that the minimum value is not less than 0, thereby preventing truncation distortion during subsequent dynamic range conversion.
[0038] S203: Convert the secondary first data to a preset target dynamic range. Based on the maximum and minimum values of the compensated secondary first data, and combined with the preset target dynamic range, divide the secondary first data into several equally spaced segments, the number of segments equal to the preset target dynamic range, thereby mapping the secondary first data to each interval. For example, if the preset target dynamic range is [0, 20], then the secondary first data is divided into 20 equally spaced segments, and based on the segment in which each value in the secondary first data is located, it is mapped to the range [0, 20], thus completing the dynamic range conversion.
[0039] S204: Use the converted data as the second data.
[0040] In other words, in some cases, the first data contains n channels, and S200 processes the data from at least one channel of the first data to obtain the second data. In some cases, steps S200, S400, S600, etc., of this scheme can be run multiple times to process different channels of the first data.
[0041] Please see Figure 2The image shows the corresponding images for different value ranges. The image with a value range of [0, 65535] is the first data, and the images with value ranges of [0, 20], [0, 10], and [0, 5] are the second images for different dynamic ranges. It can be seen that the images retain most of the information of the measured object, while instrument noise is effectively eliminated.
[0042] As a feasible implementation method, the image fragmentation evaluation model includes image connectivity detection. Specifically, image connectivity detection can employ methods such as neighborhood search-based labeling, Tarjan's algorithm, image recognition, boundary connectivity analysis, r-square grid sampling, and other image connectivity detection methods not covered here.
[0043] The applicant has proposed an image connectivity detection method applicable to the use cases covered in this application. For details, please refer to... Figure 3 This illustrates a feasible implementation of S400, which will be described below with reference to... Figure 3 The S400 will be explained.
[0044] As a possible implementation method, the aforementioned delay correction includes: S401: Perform background subtraction on the second data using the second preset parameters to obtain secondary second data. Since the dynamic range of the second data is small, and the background interference in the detection process of the measured object is usually located in a small numerical range in the second data, the background interference can be eliminated by removing data in the small numerical range of the second data. For example, in some cases, the dynamic range of the first data is [0, 65535], and the dynamic range of the second data is compressed to [0, 20]. At this time, the background interference is usually located in the range of [0, 1], and all data in the range of [0, 1] in the second data can be eliminated. More specifically, as a feasible method, specific values can be used to fill the data in the second data located in the range of [0, 1].
[0045] S402: Select delay correction parameters.
[0046] S403: Adjust the data and position matching relationship of the secondary second data using the delay correction parameter, and convert the secondary second data into a second image. It is understood that different delay correction parameters will result in different second images, especially since a data point may be located in different rows or different positions within the same row. In some cases, the image can be further compressed by setting an image segmentation threshold to highlight the main subject of the test object, thereby facilitating the calculation of image fracture degree.
[0047] S404: Calculate the image breakage of the second image.
[0048] S405: Adjust the delay correction parameters and repeat S403-S405 to reduce the image fragmentation. If the image fragmentation is less than the second threshold or is the minimum value, adjust the second data with the corresponding delay correction parameters to form the third data. In some cases, the delay correction parameters can be adjusted using gradient descent or grid search methods. The step size, offset, scaling factor, and other parameters can be adjusted as needed. In some cases, the global minimum value can also be obtained or verified through the image fragmentation curve.
[0049] As a feasible implementation method, in steps S402 and S405, the delay correction parameter can be selected from a preset parameter library. Accordingly, a preset parameter library needs to be set in advance, or multiple delay correction parameters can be set in advance by the operator to form a preset parameter library for use in selecting delay correction parameters.
[0050] As a feasible implementation method, image breakage can be calculated in the following way, or in other words, the aforementioned image breakage evaluation model may include the following: selecting a preset convolution kernel according to the scanning path pattern of the object under test, convolving the corrected image with the convolution kernel to obtain a convolution feature map, and calculating the image breakage based on the convolution feature map. Specifically, the convolution kernel can output 0 when the convolution region is a continuous image and output a value greater than 0 when the convolution region is a non-continuous image. The image is scanned using the convolution kernel to form a convolution feature map. The convolution feature maps are summed to obtain the corresponding value, which is used as the image breakage. The larger the value, the greater the image breakage.
[0051] Furthermore, the convolution kernel can be selected based on the scanning path pattern. For example, a convolution kernel sensitive to the continuity of the vertical image can be constructed to improve the delay correction effect on data scanned along a continuous path. As a feasible implementation, when the detection instrument adopts a zigzag reciprocating scanning path, the corresponding convolution kernel form can conform to the following form: {A1, A2, A3, B1, B2, B3 C1, C2, C3}, Where, A1+A2+A3+C1+C2+C3=2(B1+B2+B3).
[0052] For N-shaped up-and-down reciprocating scans, the matrix should be transposed. Other scanning methods can be configured according to actual needs, and will not be elaborated upon here.
[0053] For delay correction parameters, they can be uniform across the entire image, different for each row, or set according to the image or data position. Alternatively, a correction parameter matrix can be constructed. As a feasible approach, a correction parameter matrix can be constructed, and its size can be the same as or approximately the same as that of the second data. This allows delay correction to be applied to the corresponding positions of the second data using the uncorrected parameter matrix.
[0054] In some cases, the second data is processed data from a single channel. Delay correction parameters can be used to correct the delay in the second data as follows: In some cases, delay correction can be performed by moving the data position within the second data and filling in the correction data, based on the delay correction parameters. Specifically, the delay correction parameter can be the distance the data at the corresponding position is moved. In this case, the position of the data in the second data can be moved according to the delay correction parameters, and the original position can be filled. The filled data can be calculated using surrounding pixels, for example, by interpolation; it can also be filled using background data, for example, by determining the background data using the background subtraction reference in S401; in some cases, a fixed value can also be used for filling. The fixed value can be set as needed, and it can also be included as part of the delay correction parameters for optimization.
[0055] Please see Figure 4 The following demonstrates the effects of two implementations using the aforementioned S400 for delay correction. Among them, Figure 4 A1、 Figure 4 A2 shows the second data corresponding to two different test objects. Figure 4 B1, Figure 4 B2 shows the distribution of image tearing before delay correction parameter optimization. Figure 4 C1, Figure 4 C2 shows the distribution of image tearing after optimization of the delay correction parameters. Figure 4 D1、 Figure 4 D2 shows the image of the third data after delay correction. It can be seen that the S400 method provided in this application can significantly reduce image tearing, thereby significantly eliminating delay problems such as ghosting in the repaired third data.
[0056] Please see Figure 5 The S600 will now be explained in more detail.
[0057] As a possible implementation, the step S600, which marks the trailing points in the third data at least through the scanning path of the object under test, specifically includes: S600a: Create an empty marker diagram based on the graph of the third data. Specifically, the size of the marker diagram can be the same as the size of the graph of the third data. S600b: Select a pixel from the third data as the pixel to be analyzed; select a square region centered on the pixel to be analyzed and calculate whether the pixel to be analyzed is an edge of the object under test and whether there is a trailing effect. If both are true, mark the position of the pixel to be analyzed in the marking map; traverse each pixel of the third data and mark it in the marking map. To determine whether the pixel to be analyzed is an edge, edge analysis can be performed using the data of multiple pixels within the selected square region to determine whether the pixel to be analyzed is an edge. To determine whether there is a trailing effect, it can be determined as follows: if the value of the current pixel is greater than 120% of the average value of the adjacent rows, there is an upstream point with a sudden drop in value in the scanning path direction, and the regions with similar values are connected by more than 5 pixels, then it is determined that the pixel to be analyzed has a trailing effect. The criteria for judging a sudden drop in value can be set according to the detection requirements, or according to the maximum and minimum values of the third data, or according to the value distribution of the third data. The square region can be either a square or a rectangle. For example, pixels corresponding to a 3x3 row and n column region centered on the pixel to be analyzed can be selected for analysis.
[0058] S600c: If the positions in the marker map are distributed along the corresponding pixel path, then the pixel point corresponding to the marker position is recorded as the trailing point. Specifically, based on the scanning path of the object under test, the trailing point can be scanned along the scanning path in the marker map to remove the marker positions of isolated single pixels in the scanning path, especially single marker positions where the adjacent pixels along the path are not marker positions.
[0059] Please see Figure 6 This illustrates a correction process for trailing points in a fingerprint image using the aforementioned method, wherein... Figure 6 A shows the first data point with a trailing effect. Figure 6 B shows the second data after processing using the aforementioned S200. Figure 6 C shows a trailing marker map obtained using the aforementioned S600, where bright spots represent trailing points. Figure 6 The image is then interpolated using nearest neighbor interpolation to replace the values at the trailing points, as marked by C, to obtain the following result: Figure 6 The fourth data shown in D, compared to Figure 6 A, Figure 6 D shows that Figure 6 The tailing along the lateral path in D is significantly reduced. Figure 6 The continuity of the main body of the fingerprint in D is improved.
[0060] In some cases, the third data can be further processed between S400 and S600. For example, the value range of the third data can be compressed and rounded to obtain new third data for processing in S600.
[0061] As one possible implementation, S800 includes: S801: Perform a fast Fourier transform on the fourth data to the frequency domain to obtain the second-level fourth data.
[0062] S802: The frequency domain space of the second-level fourth data is cropped, especially the filter intensity in the vertical direction is adjusted to address the significant problems existing in the vertical space of spectral / mass spectrometry imaging. In some cases, a vertical enhancement mask can be further constructed. Specifically, the distribution area of vertical high-frequency noise can be marked in the frequency domain, and the signal energy in this area can be suppressed by the mask to specifically weaken the global interference of vertical high-frequency noise. In some cases, effective components can be further retained and redundant noise, especially random high-frequency interference in non-vertical directions, to achieve effective frequency domain noise reduction.
[0063] S803: Perform an inverse Fourier transform on the cropped second-level fourth data to obtain the fifth data. In some cases, further, after completing the inverse Fourier transform, perform wavelet decomposition in the vertical direction on the spatial data obtained after the inverse Fourier transform to obtain multi-scale sub-bands in the vertical direction, such as high-frequency sub-bands and mid-frequency sub-bands. Based on this, denoising can be performed on the sub-bands of the corresponding scales as needed to eliminate the corresponding local noise in the vertical direction. As a feasible implementation method, a soft thresholding denoising algorithm can be used for the high-frequency sub-bands in the vertical direction to eliminate the residual local high-frequency noise in the vertical direction in one step. After the aforementioned wavelet decomposition and corresponding denoising processing, a fifth data with both global stationarity and local clarity can be obtained.
[0064] Please see Figure 7 This paper presents fourth data points, before and after processing, of a mass spectrometry image of steroid m / z 315 in mouse liver obtained using the aforementioned S800. Figure 7 A is the image before processing. Figure 7 B is the processed image, and it can be seen that... Figure 7 The horizontal stripe noise in B is significantly reduced, and the processed image is better able to reflect the actual position of the measured object.
[0065] In some cases, the data processing method provided in this application may also include: S500: Perform intensity correction on at least one row of the third data. This method can address the problem of uneven intensity between rows caused by signal loss (V-lose phenomenon) due to excitation energy decay in even-numbered rows, thereby reducing the intensity difference between rows.
[0066] As one possible implementation, the aforementioned S500 may include: S501: Select one row of the third data as the row to be corrected; S502: Correct the row to be corrected so that the mean of the row to be corrected is between the mean values of two adjacent rows of the row to be corrected.
[0067] For S502, as a feasible implementation method, it can be implemented in the following way: the mean of the row mean of the row above and below the row to be corrected is used as the row correction parameter, and the data of the row to be corrected is corrected so that the row mean of the row to be corrected is equal to the row correction parameter; or, all rows are iteratively adjusted as rows to be corrected, and the change in the mean of the row to be corrected is equal to the sum of the changes in the mean of its two adjacent rows; or, the mean of the row to be corrected is located between the mean of the two adjacent rows of the row to be corrected through other methods.
[0068] The background baseline can be calculated using the first data. Specifically, it can be calculated using methods such as global statistical analysis, blank area sampling, and signal peak-valley analysis, depending on the needs.
[0069] After completing the aforementioned S500 adjustments, the background baseline can be recalculated for use in subsequent steps.
[0070] This application also relates to a computer storage medium for storing a program, wherein the program, when running, controls the device where the computer storage medium is located to execute the spectral / mass spectrometry imaging data processing method as described above.
[0071] This application also relates to an electronic device, including a memory and a processor, characterized in that the memory stores a computer program, and the processor is configured to execute the spectral / mass spectrometry imaging data processing method as described above through the computer program.
[0072] The processor contains a kernel, which retrieves the corresponding program unit from memory. One or more kernels can be configured, and adjusting kernel parameters can address the problems of high equipment cost and low measurement accuracy in related technologies when measuring the magnetic properties of magnetic samples.
[0073] Please see Figure 5This paper demonstrates the implementation effect of a data processing method using peppermint leaves as the analyte. The detection device employs a spectrometer with a zigzag scanning mode, detecting the emission intensity of CN (cyano) at 386.1 nm. The raw data obtained from the experiment is used as the first data, which has one channel corresponding to a wavelength of 386.1 nm.
[0074] like Figure 8 The original data for A shows obvious vertical breaks, which is an imaging deviation caused by time delay artifacts; at the same time, Figure 8 The signal strength in even-numbered rows of A shows significant attenuation; furthermore... Figure 8 Signals at certain locations in A exhibit a right-side tailing characteristic; additionally... Figure 8 High-frequency noise interference also exists in A.
[0075] The effects of using this application for each step of spectral / mass spectrometry imaging data processing are as follows: Figure 8 B to Figure 8 As shown in E. Wherein, Figure 8 B shows Figure 8 The third data obtained from the image shown in A after the delay correction provided by S400 shows that the imaging deviation has been significantly eliminated. Figure 8 C is Figure 8 The image obtained after the third data shown in B is processed by S500 to perform intensity correction on the even-numbered rows shows that the brightness difference between adjacent rows is reduced. Figure 8 D is the fourth data obtained after further using S600 to correct the even-numbered rows of the image. It can be seen that the tailing effect is significantly reduced, especially the tailing effect at the edge of the object being measured disappears significantly. Figure 8 E is a pair Figure 8 The fourth data shown in Figure D, and the fifth data after further filtering and noise reduction using S800, demonstrate a significant reduction in noise in the vertical direction. By using the spectral / mass spectrometry imaging data processing method provided in this application, instrument motion delay noise can be significantly reduced, trailing can be corrected, and inter-line differences can be eliminated.
[0076] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0077] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0078] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory. Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0079] Computer-readable media, including both permanent and non-permanent, removable and non-removable media, can store information using any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.
[0080] Of course, the present invention may have other various embodiments. Without departing from the spirit and essence of the present invention, those skilled in the art can make corresponding changes and modifications according to the present invention, but these corresponding changes and modifications should all fall within the protection scope of the appended claims.
Claims
1. A method for processing spectral / mass spectrometry imaging data, characterized in that, include: S000: Detects the analyte and acquires the first data for spectral / mass spectrometry imaging; S200: The first data is processed by a first process to obtain the second data, wherein the dynamic range of the second data is smaller than the dynamic range of the first data; S400: At least the second data is delayed by a delay correction parameter, the image breakage of the corrected image is calculated using an image breakage evaluation model that responds to the scanning path mode of the object under test, and the second data is adjusted with the delay correction parameter when the image breakage is less than a second threshold or is the minimum value to obtain the third data, the third data being an image; S600: Mark the trailing point in the third data at least through the scanning path of the object under test, calculate the neighbor interpolation with the value around the trailing point in the third data to replace the value at the trailing point, and obtain the fourth data; S800: Filter and reduce noise on the fourth data to obtain the fifth data; S1000: Output the fifth data.
2. The spectral / mass spectrometry imaging data processing method as described in claim 1, characterized in that, The delay correction includes: S401: Perform background subtraction on the second data using the second preset parameters to obtain secondary second data; S402: Select delay correction parameters; S403: Adjust the data and position matching relationship of the secondary second data according to the delay correction parameter, and convert the secondary second data into a second image; S404: Calculate the image breakage of the second image; S405: Adjust the delay correction parameter and repeat S403-S405 to reduce the image fragmentation; if the image fragmentation is less than the second threshold or is the minimum value, adjust the second data with the corresponding delay correction parameter to form the third data.
3. The spectral / mass spectrometry imaging data processing method as described in claim 2, characterized in that: In steps S402 and S405, the delay correction parameter is selected from the preset parameter library.
4. The spectral / mass spectrometry imaging data processing method as described in claim 1, characterized in that, The image fracture evaluation model includes: selecting a preset convolution kernel according to the scanning path pattern of the object under test, convolving the corrected image with the convolution kernel to obtain a convolution feature map, and calculating the image fracture based on the convolution feature map.
5. The spectral / mass spectrometry imaging data processing method as described in claim 1, characterized in that: Image fragmentation evaluation models include image connectivity detection.
6. The spectral / mass spectrometry imaging data processing method as described in claim 2, characterized in that: In step S405, the delay correction parameter is adjusted using gradient descent and grid search methods.
7. The spectral / mass spectrometry imaging data processing method as described in claim 1, characterized in that, The first process includes: S201: Perform baseline subtraction on the first data to obtain the second-level first data; S202: Obtain the maximum and minimum values of the second-level first data. If the minimum value is negative, compensate the second-level first data so that the minimum value is not less than 0. S203: Convert the secondary first data to a preset target dynamic range; S204: Use the converted data as the second data.
8. The spectral / mass spectrometry imaging data processing method as described in claim 1, characterized in that, The data processing method further includes: matching the first data and / or the second data with the spatial position according to the scanning spatial coordinate information of the instrument used to detect the object under test.
9. The spectral / mass spectrometry imaging data processing method as described in claim 1, characterized in that, In S600, marking at least the trailing points in the third data through the scan path of the object under test specifically includes: S600a: Create an empty marker diagram based on the graph of the third data; S600b: Select one pixel from the third data as the pixel to be analyzed; select a square area centered on the pixel to be analyzed and calculate whether the pixel to be analyzed is the edge of the object under test and whether there is a trailing effect. If both are true, mark the position of the pixel to be analyzed in the marking diagram; traverse each pixel of the third data and mark it in the marking diagram. S600c: If the marker positions in the marker map are distributed along the path of the corresponding pixel, then the pixel point corresponding to the marker position is recorded as the trailing point.
10. The spectral / mass spectrometry imaging data processing method as described in claim 9, characterized in that: In S600b, if the values of the pixel to be analyzed and its adjacent pixels satisfy a unidirectional decreasing condition, then it is determined that the pixel to be analyzed has a trailing effect.
11. The spectral / mass spectrometry imaging data processing method as described in claim 9, characterized in that, The S600c also includes: removing the marker position of isolated individual pixels.
12. The spectral / mass spectrometry imaging data processing method as described in claim 1, characterized in that: The S800 includes: S801: Perform a fast Fourier transform on the fourth data to the frequency domain to obtain the second-level fourth data; S802: Clip the frequency domain space of the second-level fourth data; S803: Perform an inverse Fourier transform on the cropped second-level fourth data to obtain the fifth data.
13. The spectral / mass spectrometry imaging data processing method as described in claim 1, characterized in that, The method further includes: S500: Perform intensity correction on at least one row of the third data.
14. The spectral / mass spectrometry imaging data processing method as described in claim 13, characterized in that, The S500 includes: S501: Select one row of the third data as the row to be corrected; S502: Correct the row to be corrected so that the mean of the row to be corrected is between the mean values of two adjacent rows of the row to be corrected.
15. A detection device, characterized in that: The analyte is subjected to scanning imaging detection using either spectroscopy or mass spectrometry, and a spectral / mass spectrometry imaging data processing method as described in any one of claims 1 to 14 is used.