Processing method and device for cell segmentation and electronic equipment

CN119836649APending Publication Date: 2025-04-15SHENZHEN HUADA SANJIAN QIFA TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202280099770.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2022-12-05
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

Existing cell segmentation methods have high requirements for image quality and require registration of image images with gene expression maps, which affects efficiency and accuracy and increases technical costs.

Method used

Preprocessing and binarization based on gene expression maps are used, and the watershed algorithm combined with distance transformation is used to segment the connected domains of cell adhesion, and directly obtain the mask map, avoiding the registration step of the image map and the gene expression map.

Benefits of technology

It improves the efficiency and accuracy of cell segmentation, reduces operation time and technical costs, and provides more reliable cell segmentation results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119836649A_ABST
    Figure CN119836649A_ABST
Patent Text Reader

Abstract

The invention relates to a cell segmentation processing method and device and electronic equipment, and relates to the technical field of data processing.The method comprises the steps that firstly, a gene expression graph of a cell is preprocessed, and a preprocessed graph is obtained; carrying out binarization processing on the preprocessed image to obtain an initial mask image; then, according to the initial mask pattern, a distance transformation-based watershed algorithm is used for segmenting a connected domain with cell adhesion, and a segmented mask pattern is obtained; according to the technical scheme of the invention, a plurality of image processing methods are combined, and a reliable cell segmentation result can be provided. The cell segmentation does not depend on the image map, and the technology for registering the image map and the gene expression map does not need to be additionally introduced, so that the introduced additional error is eliminated, and meanwhile, the overall operation time and the technical cost are saved.
Need to check novelty before this filing date? Find Prior Art

Description

Cell segmentation processing method, device and electronic equipment Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a cell segmentation processing method, device and electronic equipment. Background Art

[0002] Cell segmentation is an important part of extracting intracellular gene expression in spatiotemporal omics technology. Segmenting cells to obtain the corresponding gene expression at the corresponding spatial position is an indispensable step in the analysis process.

[0003] Currently, existing cell segmentation methods usually use microscope images or scanned images of corresponding biological tissue sections to perform cell segmentation, supplemented by the registration of images with gene expression maps for subsequent gene extraction and analysis.

[0004] However, existing cell segmentation methods have high requirements for image quality, and for subsequent analysis, images need to be aligned with gene expression maps, which introduces additional technical requirements and potential errors, thereby affecting the efficiency and accuracy of cell segmentation processing and increasing technical costs.

[0005] Summary of the Invention

[0006] In view of this, the present application provides a cell segmentation processing method, device and electronic equipment, the main purpose of which is to improve the technical problems that the current existing cell segmentation method affects the efficiency and accuracy of cell segmentation processing and also increases the technical cost.

[0007] In a first aspect, the present application provides a method for processing cell segmentation, comprising:

[0008] Obtain gene expression profiles of cells;

[0009] Preprocessing the gene expression graph to obtain a preprocessed graph;

[0010] Binarizing the preprocessed image to obtain an initial mask image;

[0011] According to the initial mask image, a watershed algorithm based on distance transformation is used to segment the connected domains where cell adhesion exists, to obtain a segmented mask image.

[0012] In a second aspect, the present application provides a cell segmentation processing device, comprising:

[0013] an acquisition module, configured to acquire a gene expression profile of a cell;

[0014] a processing module, configured to preprocess the gene expression graph to obtain a preprocessed graph;

[0015] The segmentation module is configured to perform binarization processing on the pre-processed image to obtain an initial mask image; based on the initial mask image, use a watershed algorithm based on distance transformation to segment the connected domain where cell adhesion exists to obtain a segmented mask image.

[0016] In a third aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the cell segmentation processing method described in the first aspect.

[0017] In a fourth aspect, the present application provides an electronic device comprising a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein when the processor executes the computer program, the cell segmentation processing method described in the first aspect is implemented.

[0018] By means of the above technical solution, the present application provides a method, device and electronic device for processing cell segmentation. Compared with the currently available cell segmentation methods, the present application provides a solution for performing cell segmentation directly based on gene expression maps. Specifically, the gene expression map of the cell is first preprocessed to obtain a preprocessed map; the preprocessed map is then binarized to obtain an initial mask map; then, based on the initial mask map, a watershed algorithm based on distance transformation is used to segment the connected domains where cell adhesion exists to obtain a segmented mask map. By applying the technical solution of the present application and combining multiple image processing methods, a more reliable cell segmentation result can be provided. Cell segmentation does not rely on image maps, and does not require the additional introduction of technology for aligning image maps with gene expression maps, eliminating the introduction of additional errors, while saving overall operating time and technical costs, and improving the efficiency and accuracy of cell segmentation processing.

[0019] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0021] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0022] FIG1 is a schematic diagram showing a process flow of a cell segmentation processing method provided in an embodiment of the present application;

[0023] FIG2 is a schematic diagram showing a process flow of another cell segmentation processing method provided in an embodiment of the present application;

[0024] FIG3 shows a schematic diagram of an example process of the method according to an embodiment of the present application;

[0025] FIG4 shows an example diagram of the effect of the gene expression graph provided in an embodiment of the present application;

[0026] FIG5 shows an example of a sharpened image obtained through sharpening processing according to an embodiment of the present application;

[0027] FIG6 is a schematic diagram showing the effect of the initial mask image provided by an embodiment of the present application;

[0028] FIG7 is a schematic diagram showing the effect of an output mask image provided by an embodiment of the present application;

[0029] FIG8 shows a schematic structural diagram of a cell segmentation processing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0030] In order to more clearly understand the above-mentioned objectives, features and advantages of the present application, the scheme of the present application will be further described below. It should be noted that, in the absence of conflict, the embodiments of the present application and the features therein can be combined with each other.

[0031] In order to improve the technical problem that the existing cell segmentation method affects the efficiency and accuracy of the cell segmentation process and also increases the technical cost, this embodiment provides a cell segmentation processing method, as shown in Figure 1, the method includes:

[0032] Step 101: Obtain a gene expression profile of a cell.

[0033] A gene expression map, or gene expression atlas, can be obtained based on gene expression data.

[0034] Step 102: pre-process the gene expression map of the cell to obtain a pre-processed map.

[0035] Since the gene expression map is a scatter plot, it is not convenient for cell segmentation, so preprocessing is required to process the gene expression map of the cell to obtain a preprocessed map with enhanced boundary effect.

[0036] Step 103: Binarize the pre-processed image to obtain an initial mask image.

[0037] In this embodiment, the Otsu method may be used to perform binarization processing on the pre-processed image to obtain an initial mask image.

[0038] Step 104 : Based on the initial mask image, a watershed algorithm based on distance transformation is used to segment the connected domains where cell adhesion exists, to obtain a segmented mask image.

[0039] The watershed algorithm considers image segmentation based on the composition of the watershed.

[0040] Compared to existing cell segmentation methods, this embodiment provides a solution for cell segmentation based directly on gene expression profiles. By combining multiple image processing methods, it delivers more reliable cell segmentation results. Cell segmentation is independent of image profiles and eliminates the need for additional registration technology between image profiles and gene expression profiles, eliminating the potential for additional errors. This also reduces overall operational time and technical costs, improving the efficiency and accuracy of cell segmentation.

[0041] Furthermore, as a refinement and extension of the above embodiment, in order to fully illustrate the specific implementation process of the method of this embodiment, this embodiment provides a specific method as shown in FIG2 , which includes:

[0042] Step 201: Obtain a gene expression matrix including spatial positions.

[0043] A gene expression matrix including spatial locations is obtained from gene expression data of the cell. The gene expression data may include gene identifiers, coordinate locations, and total gene expression levels at the corresponding coordinate locations for multiple genes.

[0044] Step 202: Generate a gene expression map of the cell based on the gene expression matrix.

[0045] As an optional method, step 202 may specifically include: first obtaining the coordinate positions of the expressed genes and the total gene expression levels at the corresponding coordinate positions in the gene expression matrix; then, generating a gene expression map based on the coordinate positions of the expressed genes and the total gene expression levels at the corresponding coordinate positions, wherein the gene expression map is a grayscale map, and the grayscale value of a pixel in the gene expression map is the total gene expression level at the coordinate position corresponding to the pixel. This optional method can accurately generate a gene expression map for the cell.

[0046] For example, in the specific use of cell segmentation, a gene expression matrix containing spatial positions is input, and an expression image is generated based on the coordinate positions of the expressed genes and the total gene expression amounts at the corresponding positions. The specific form of the image is a grayscale image, and the grayscale value of the coordinate point is the total amount of gene expression at that coordinate.

[0047] As another optional method, step 202 may further include: drawing a gene expression map of the cell based on the gene expression matrix and the segmented mask map, wherein the spatial positions in the gene expression matrix correspond to the spatial positions in the segmented mask map. For example, a cell-based expression map may be drawn based on the gene expression matrix and the segmented mask map, wherein the spatial positions in the gene expression matrix correspond to the spatial positions in the segmented mask map. Through this optional method, a gene expression map of the cell can be accurately generated.

[0048] Since the generated gene expression image is a scatter plot, it is not easy to segment and needs to be processed. Specifically, the process shown in step 203 can be performed.

[0049] Step 203: pre-process the gene expression graph to obtain a median graph, and perform sharpening on the median graph to obtain a sharpened graph.

[0050] Since the gene expression graph is a scatter plot, it is not convenient for cell segmentation. Therefore, preprocessing is required. In this embodiment, the gene expression graph of the cell is first processed into a median graph. The median graph can then be sharpened using the Laplacian operator to enhance the boundary effect of the median graph, thereby obtaining a sharpened graph.

[0051] Optionally, the gene expression map is preprocessed to obtain a median map, which may specifically include: first, using a convolution kernel of a preset size (such as 13*13) to perform a convolution operation on the gene expression map so that the scattered points in the gene expression map are adhered to obtain a first convolution map; then, detecting the local maximum point of the first convolution map based on the two-dimensional grayscale peak of the image; obtaining the pth percentile of the local maximum point, where p is a preset value, such as the pth percentile can be the 98% percentile value, or the 99% percentile value, etc.; if the pth percentile is within a preset range, using a first median filter to perform median filtering on the first convolution map to obtain a median map, where the filter size of the first median filter is determined according to the preset size.

[0052] Further optionally, after obtaining the pth percentile in the local maximum point, the method of this embodiment may also include: if the pth percentile is outside the preset range, determining the new size of the convolution kernel based on the pth percentile and the preset size; using the convolution kernel of the new size to perform a convolution operation on the gene expression map so that the scattered points in the gene expression map are adhered to obtain a second convolution map; using a second median filter to perform median filtering on the second convolution map to obtain a median map, wherein the filter size of the second median filter is determined based on the new size.

[0053] Exemplarily, determining the new size of the convolution kernel based on the pth percentile and the preset size may specifically include: calculating the new size of the convolution kernel according to the formula K=N*(N / R), where K*K represents the new size of the convolution kernel, N*N represents the preset size, and R represents the pth percentile.

[0054] For example, first use a convolution kernel of size 13*13 (empirical value) to perform a convolution operation on the original image of the gene expression map to make the scatter plot stick together, and obtain the first convolution map; then detect the local maximum point of the first convolution map based on the two-dimensional grayscale peak of the image, and take out the 99% percentile value R of all the local maximum points obtained. If the R value is too different from a set empirical threshold (too high or too low, it will affect subsequent processing), it is considered that the 13*13 convolution kernel is not suitable for the original image. At this time, calculate K=13*(13 / R), change the original 13*13 convolution kernel to a K*K convolution kernel, reprocess the original image, and obtain the second convolution map; if the R value is within the allowable range, use the first convolution map. The convolution image is presented as a stack of blocks of different grayscales. The grayscale span is quite dramatic, and some images show a phenomenon of hollow centers in clusters of clusters. To eliminate this problem, a filter size of 13*2.7=35 (2.7 can be an empirical value, and the decimal is rounded down) is used (if K needs to be calculated, the kernel size here is K*2.7) to perform median filtering on the second convolution image to obtain a median image.

[0055] In order to fill the voids in the point clusters, the median filter used above is relatively large, and the grayscale boundary of the median image may be relatively blurred. The laplacian operator is used to sharpen the median image to enhance the grayscale boundary and obtain a sharpened image. After completing the preprocessing, the cell segmentation process is now performed. Specifically, the process shown in steps 204 to 207 can be executed.

[0056] Step 204: binarize the sharpened image to obtain an initial mask image.

[0057] Use Otsu's method to binarize the sharpened image obtained in the previous step to obtain the initial mask image.

[0058] Step 205: Filter the connected domains whose areas do not meet the preset conditions in the initial mask image to obtain a filtered mask image.

[0059] Optionally, step 205 may specifically include filtering connected domains in the initial mask image whose areas are greater than a first preset threshold, or whose areas are less than a second preset threshold, to obtain a filtered mask image, where the first preset threshold is greater than the second preset threshold. For example, an empirical threshold may be used to filter connected domains in the initial mask whose areas are too small or too large to obtain the filtered mask image.

[0060] Step 206 , traverse each connected domain in the filter mask image, extract the area where the connected domain is located based on the minimum circumscribed rectangle of the connected domain, and use the watershed algorithm to segment the connected domain where cell adhesion exists to obtain a segmented mask image.

[0061] Optionally, step 206 may specifically include: setting the grayscale value of each pixel point in each connected domain in the filter mask image to a first value, and setting the grayscale value of each pixel point outside the connected domain to a second value; for each target pixel point in the connected domain whose grayscale value is the first value, remapping the grayscale value of the target pixel point to the distance from the target pixel point to the pixel point with the grayscale value of the second value closest to it, to obtain a distance map of the connected domain; binarizing the distance map of the connected domain to obtain a preset number of pixels in the connected domain that are farthest from the pixel point with the grayscale value of the second value; using the preset number of pixels as injection points of the watershed algorithm, and using the watershed function to perform watershed segmentation on the original mask of the connected domain in the filter mask image to obtain a segmented target connected domain, and covering the target connected domain with the filter mask image to obtain a segmented mask image.

[0062] For example, traverse each connected domain in the filter mask image, extract the area where the connected domain is located based on the minimum bounding rectangle of the connected domain, and use the watershed algorithm based on distance transformation to further segment the connected domain where cell adhesion may exist. The specific steps are as follows:

[0063] Step a: For each connected domain area extracted, the grayscale value of the points within the target connected domain is set to 1, and the grayscale value of the points outside the connected domain is set to 0 (including background and non-target connected domains). A distance transformation is performed on each point with a value of 1, and its grayscale value is remapped to the distance from the point to the nearest point with a value of 0 (the distance between adjacent points is 1), thereby obtaining the distance map of the connected domain.

[0064] Step b: Use an empirical threshold to binarize the distance map to obtain the number of points in the connected domain that are farthest from the point with a distance value of 0 (the number of points varies due to the different conditions of each connected domain).

[0065] Step c: Use the several points obtained in the previous step as the water injection points of the watershed algorithm, use the watershed function in OpenCV to perform watershed segmentation on the original mask of the connected domain, obtain the target connected domain after segmentation, and overlay the result onto the filter mask map.

[0066] Step d: Perform the above steps on each connected domain traversed to obtain a segmented mask image.

[0067] Step 207: Perform a closure operation on the segmented mask image to obtain a mask image of the cell segmentation result.

[0068] To make cell boundaries more regular, the segmented mask is closed to obtain the final mask. This final mask can be exported and saved for subsequent biological analysis at the cellular level in conjunction with the original expression matrix.

[0069] For example, as shown in FIG3 , a schematic diagram of an example process based on the method of this embodiment is shown. First, a gene expression matrix can be input, and a gene expression image can be generated based on the matrix, as shown in FIG4 . Then, a 13*13 convolution kernel is used to perform a convolution operation on the gene expression image, so that the scattered points in the gene expression image are adhered to obtain a first convolution image. At this time, a threshold is required for judgment. That is, the local maximum point of the first convolution image is detected based on the two-dimensional grayscale peak of the image, and the 99% percentile value R of all the local maximum points obtained is taken. If the R value is too far from a set empirical threshold (too high or too low will affect subsequent processing), the 13*13 convolution kernel is considered unsuitable for the original image. A new convolution kernel size is calculated using a ratio, and then the new convolution kernel is used to process the original image to obtain a second convolution image. The median filter size is calculated using this ratio, and then the median filter of this size is used to process the second convolution image to obtain a median image. If the R value is within the allowable range, the first convolution image is used and a median filter of size 35 is used to process the first convolution image to obtain a median image.

[0070] After obtaining the median image, the Laplacian operator was used to sharpen it, resulting in a sharpened image (Figure 5). The sharpened image was binarized using the large law method to obtain the initial mask image (Figure 6). Adhesion cells were then segmented using area filtering and the watershed algorithm. Finally, the cell mask image was output and saved, as shown in Figure 7.

[0071] Compared to existing cell segmentation methods, this embodiment provides a solution for cell segmentation based directly on gene expression profiles. By combining multiple image processing methods, it delivers more reliable cell segmentation results. Cell segmentation is independent of image profiles and eliminates the need for additional registration technology between image profiles and gene expression profiles, eliminating the potential for additional errors. This also reduces overall operational time and technical costs, improving the efficiency and accuracy of cell segmentation.

[0072] Furthermore, as a specific implementation of the method shown in FIG. 1 and FIG. 2 , this embodiment provides a cell segmentation processing device, as shown in FIG. 8 , which includes: an acquisition module 31 , a processing module 32 , and a segmentation module 33 .

[0073] an acquisition module 31, configured to acquire a gene expression profile of a cell;

[0074] a processing module 32 configured to preprocess the gene expression graph to obtain a preprocessed graph;

[0075] The segmentation module 33 is configured to perform binarization processing on the pre-processed image to obtain an initial mask image; based on the initial mask image, use a watershed algorithm based on distance transformation to segment the connected domain with cell adhesion to obtain a segmented mask image.

[0076] In a specific application scenario, the segmentation module 33 is specifically configured to filter out the connected domains in the initial mask image whose areas do not meet the preset conditions to obtain a filtered mask image; traverse each connected domain in the filtered mask image, extract the area where the connected domain is located based on the minimum circumscribed rectangle of the connected domain, and use the watershed algorithm to segment the connected domain where cell adhesion exists to obtain a segmented mask image.

[0077] In a specific application scenario, the segmentation module 33 is further configured to set the grayscale value of each pixel in the connected domain in the filter mask image to a first value, and set the grayscale value of each pixel outside the connected domain to a second value; for each target pixel in the connected domain whose grayscale value is the first value, remap the grayscale value of the target pixel to the distance from the target pixel to the pixel whose grayscale value is the second value closest to it, to obtain a distance map of the connected domain; binarize the distance map of the connected domain to obtain a preset number of pixels in the connected domain that are farthest from the pixel whose grayscale value is the second value; use the preset number of pixels as injection points of the watershed algorithm, and use the watershed function to perform watershed segmentation on the original mask of the connected domain in the filter mask image to obtain the segmented target connected domain, and overlay the target connected domain onto the filter mask image to obtain the segmented mask image.

[0078] In a specific application scenario, the segmentation module 33 is further configured to filter the connected domains in the initial mask image whose area is greater than a first preset threshold, or the connected domains whose area is less than a second preset threshold, to obtain the filtered mask image, wherein the first preset threshold is greater than the second preset threshold.

[0079] In a specific application scenario, the processing module 32 is specifically configured to pre-process the gene expression graph to obtain a median graph; and perform sharpening processing on the median graph to obtain a sharpened graph.

[0080] Correspondingly, the segmentation module 33 is specifically configured to perform a binarization process on the sharpened image to obtain an initial mask image.

[0081] In a specific application scenario, the processing module 32 is further configured to perform a convolution operation on the gene expression map using a convolution kernel of a preset size, so that the scattered points in the gene expression map are adhered to obtain a first convolution map; detect the local maximum point of the first convolution map based on the two-dimensional grayscale peak of the image; obtain the pth percentile of the local maximum point, wherein p is a preset value; if the pth percentile is within a preset range, perform median filtering on the first convolution map using a first median filter to obtain the median map, wherein the filter size of the first median filter is determined according to the preset size.

[0082] In a specific application scenario, the processing module 32 is further configured to, after obtaining the pth percentile in the local maximum point, if the pth percentile is outside a preset range, determine a new size of the convolution kernel based on the pth percentile and the preset size; perform a convolution operation on the gene expression map using the convolution kernel of the new size, so that the scattered points in the gene expression map are adhered to obtain a second convolution map; and perform median filtering on the second convolution map using a second median filter to obtain the median map, wherein the filter size of the second median filter is determined based on the new size.

[0083] In a specific application scenario, the processing module 32 is further configured to calculate the new size of the convolution kernel according to the formula K=N*(N / R), where K*K represents the new size of the convolution kernel, N*N represents the preset size, and R represents the pth percentile.

[0084] In a specific application scenario, the acquisition module 31 is specifically configured to acquire a gene expression matrix including spatial positions; and generate the gene expression graph based on the gene expression matrix.

[0085] In a specific application scenario, the acquisition module 31 is specifically configured to obtain the coordinate position of the expression gene in the gene expression matrix and the total gene expression amount of the corresponding coordinate position; based on the coordinate position of the expression gene and the total gene expression amount of the corresponding coordinate position, the gene expression map is generated, wherein the gene expression map is a grayscale map, and the grayscale value of the pixel point in the gene expression map is the total gene expression amount of the coordinate position corresponding to the pixel point.

[0086] In a specific application scenario, the acquisition module 31 is further configured to draw a gene expression map of the cell based on the gene expression matrix and the segmented mask map, wherein the spatial position in the gene expression matrix corresponds to the spatial position in the segmented mask map.

[0087] In a specific application scenario, the segmentation module 33 is further configured to perform a closure operation on the segmented mask image to obtain a mask image of the cell segmentation result.

[0088] It should be noted that for other corresponding descriptions of the functional units involved in the cell segmentation processing device provided in this embodiment, reference can be made to the corresponding descriptions in FIG. 1 and FIG. 2 , which will not be repeated here.

[0089] Based on the above methods shown in FIG. 1 and FIG. 2 , this embodiment also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the above methods shown in FIG. 1 and FIG. 2 are implemented.

[0090] Based on this understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, USB flash drive, mobile hard disk, etc.), and includes a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods of various implementation scenarios of the present application.

[0091] Based on the above-mentioned method shown in Figures 1 and 2, and the virtual device embodiment shown in Figure 8, in order to achieve the above-mentioned purpose, the embodiment of the present application also provides an electronic device, which can be specifically a personal computer, a laptop computer, etc., and the device includes a storage medium and a processor; the storage medium is used to store computer programs; the processor is used to execute computer programs to implement the above-mentioned method shown in Figures 1 and 2.

[0092] Optionally, the physical device may further include a user interface, a network interface, a camera, a radio frequency (RF) circuit, a sensor, an audio circuit, a Wi-Fi module, and the like. The user interface may include a display, an input unit such as a keyboard, and the like. Optional user interfaces may also include a USB interface, a card reader interface, and the like. The network interface may optionally include a standard wired interface, a wireless interface (such as a Wi-Fi interface), and the like.

[0093] Those skilled in the art will understand that the above-mentioned physical device structure provided in this embodiment does not constitute a limitation on the physical device, and may include more or fewer components, or a combination of certain components, or different component arrangements.

[0094] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages the hardware and software resources of the physical device, supporting the execution of information processing programs and other software and / or programs. The network communication module is used to enable communication between components within the storage medium, as well as with other hardware and software within the physical information processing device.

[0095] Through the description of the above embodiments, those skilled in the art can clearly understand that the present application can be implemented by means of software plus the necessary general hardware platform, or by hardware. By applying the solution of this embodiment, compared with the currently available cell segmentation method, this embodiment provides a solution for cell segmentation directly based on gene expression maps, which uses a combination of multiple image processing methods to provide more reliable cell segmentation results. Cell segmentation does not rely on image maps, and does not require the additional introduction of technology for aligning image maps with gene expression maps, eliminating the introduction of additional errors, while saving overall operating time and technical costs, and improving the efficiency and accuracy of cell segmentation processing.

[0096] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprises" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a..." do not exclude the presence of other identical elements in the process, method, article or device that includes the elements.

[0097] The foregoing is merely a list of specific embodiments of the present application, intended to enable those skilled in the art to understand and implement the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments described herein, but is intended to conform to the broadest scope consistent with the principles and novel features of the present application.

Claims

1. A cell segmentation processing method, characterized in that: include: Obtain gene expression profiles of cells; Preprocessing the gene expression graph to obtain a preprocessed graph; Binarizing the preprocessed image to obtain an initial mask image; According to the initial mask image, a watershed algorithm based on distance transformation is used to segment the connected domains where cell adhesion exists, to obtain a segmented mask image.

2. The method according to claim 1, characterized in that The method of segmenting the connected domains where cell adhesion exists by using a watershed algorithm based on distance transformation according to the initial mask image to obtain a segmented mask image comprises: Filtering the connected domains whose areas do not meet the preset conditions in the initial mask image to obtain a filtered mask image; Each connected domain in the filter mask image is traversed, and the area where the connected domain is located is extracted based on the minimum circumscribed rectangle of the connected domain. The connected domain with cell adhesion is segmented using the watershed algorithm to obtain a segmented mask image.

3. The method according to claim 2, characterized in that The step of traversing each connected domain in the filter mask image, extracting the area where the connected domain is located based on the minimum circumscribed rectangle of the connected domain, and segmenting the connected domain where cell adhesion exists using the watershed algorithm to obtain a segmented mask image includes: Setting the grayscale value of each pixel within each connected domain in the filter mask image to a first value, and setting the grayscale value of each pixel outside each connected domain to a second value; For each target pixel point whose grayscale value is the first value in the connected domain, remapping the grayscale value of the target pixel point into the distance from the target pixel point to the nearest pixel point whose grayscale value is the second value, thereby obtaining a distance map of the connected domain; Binarize the distance map of the connected domain to obtain a preset number of pixel points in the connected domain that are farthest from the pixel point with a grayscale value of the second value; The preset number of pixel points are used as water injection points of the watershed algorithm, and the watershed function is used to perform watershed segmentation on the original mask of the connected domain in the filtering mask image to obtain the segmented target connected domain, and the target connected domain is covered to the filtering mask image to obtain the segmented mask image.

4. The method according to claim 2, characterized in that The filtering of connected domains whose areas do not meet preset conditions in the initial mask image to obtain a filtered mask image includes: The connected domains whose areas are greater than a first preset threshold or the connected domains whose areas are less than a second preset threshold in the initial mask image are filtered to obtain the filtered mask image, wherein the first preset threshold is greater than the second preset threshold.

5. The method according to claim 1, wherein The preprocessing of the gene expression graph to obtain a preprocessed graph comprises: Preprocessing the gene expression graph to obtain a median graph; Performing a sharpening process on the median image to obtain a sharpened image; The binarization of the pre-processed image to obtain an initial mask image comprises: The sharpened image is binarized to obtain an initial mask image.

6. The method according to claim 5, characterized in that The preprocessing of the gene expression graph to obtain a median graph comprises: Performing a convolution operation on the gene expression graph using a convolution kernel of a preset size so that scattered points in the gene expression graph are adhered to obtain a first convolution graph; Detecting the local maximum point of the first convolution image according to the two-dimensional grayscale peak of the image; Obtaining the pth percentile of the local maximum point, where p is a preset value; If the pth percentile is within a preset range, median filtering is performed on the first convolution image using a first median filter to obtain the median image, wherein the filter size of the first median filter is determined according to the preset size.

7. The method according to claim 6, characterized in that After obtaining the pth percentile of the local maximum point, the method further includes: If the pth percentile is outside a preset range, determining a new size of the convolution kernel based on the pth percentile and the preset size; Performing a convolution operation on the gene expression graph using the convolution kernel of the new size so that scattered points in the gene expression graph are adhered to obtain a second convolution graph; Performing median filtering on the second convolution image using a second median filter to obtain the median image, wherein a filter size of the second median filter is determined according to the new size.

8. The method according to claim 7, characterized in that Determining a new size of the convolution kernel according to the pth percentile and the preset size includes: The new size of the convolution kernel is calculated according to the formula K=N*(N / R), where K*K represents the new size of the convolution kernel, N*N represents the preset size, and R represents the pth percentile.

9. The method according to claim 1, characterized in that The step of obtaining a gene expression profile of a cell comprises: Obtain a gene expression matrix containing spatial locations; Based on the gene expression matrix, the gene expression map is generated.

10. The method according to claim 9, characterized in that Generating the gene expression graph based on the gene expression matrix includes: Obtaining the coordinate positions of the expressed genes in the gene expression matrix and the total gene expression levels at the corresponding coordinate positions; The gene expression map is generated according to the coordinate positions of the expressed genes and the total gene expression amounts at the corresponding coordinate positions, wherein the gene expression map is a grayscale map, and the grayscale value of a pixel point in the gene expression map is the total gene expression amount at the coordinate position corresponding to the pixel point.

11. The method according to claim 9, characterized in that Generating the gene expression graph based on the gene expression matrix includes: A gene expression map of the cell is drawn according to the gene expression matrix and the segmented mask map, wherein the spatial position in the gene expression matrix corresponds to the spatial position in the segmented mask map.

12. The method according to any one of claims 1 to 11, characterized in that After segmenting the connected domains where cell adhesion exists according to the initial mask image using a watershed algorithm based on distance transformation to obtain a segmented mask image, the method further includes: A closure operation is performed on the segmented mask image to obtain a mask image of the cell segmentation result.

13. A cell segmentation processing device, characterized in that: include: an acquisition module, configured to acquire a gene expression profile of a cell; a processing module, configured to preprocess the gene expression graph to obtain a preprocessed graph; The segmentation module is configured to perform binarization processing on the pre-processed image to obtain an initial mask image; based on the initial mask image, use a watershed algorithm based on distance transformation to segment the connected domain where cell adhesion exists to obtain a segmented mask image.

14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 12 is implemented.

15. An electronic device comprising a storage medium, a processor, and a computer program stored in the storage medium and executable on the processor, wherein: When the processor executes the computer program, the method according to any one of claims 1 to 12 is implemented.