WO2024119321A1 - Cell segmentation processing method and apparatus, and electronic device - Google Patents
Cell segmentation processing method and apparatus, and electronic device Download PDFInfo
- Publication number
- WO2024119321A1 WO2024119321A1 PCT/CN2022/136657 CN2022136657W WO2024119321A1 WO 2024119321 A1 WO2024119321 A1 WO 2024119321A1 CN 2022136657 W CN2022136657 W CN 2022136657W WO 2024119321 A1 WO2024119321 A1 WO 2024119321A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- gene expression
- mask image
- image
- map
- connected domain
- Prior art date
Links
- 230000011218 segmentation Effects 0.000 title claims abstract description 68
- 238000003672 processing method Methods 0.000 title claims abstract description 14
- 230000014509 gene expression Effects 0.000 claims abstract description 117
- 238000000034 method Methods 0.000 claims abstract description 69
- 230000021164 cell adhesion Effects 0.000 claims abstract description 14
- 230000009466 transformation Effects 0.000 claims abstract description 12
- 238000007781 pre-processing Methods 0.000 claims abstract description 9
- 239000011159 matrix material Substances 0.000 claims description 24
- 238000001914 filtration Methods 0.000 claims description 13
- 238000004590 computer program Methods 0.000 claims description 12
- 108090000623 proteins and genes Proteins 0.000 claims description 10
- 238000002347 injection Methods 0.000 claims description 4
- 239000007924 injection Substances 0.000 claims description 4
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 claims description 2
- 230000008569 process Effects 0.000 description 16
- 238000010586 diagram Methods 0.000 description 9
- 239000000243 solution Substances 0.000 description 8
- 238000005516 engineering process Methods 0.000 description 6
- 230000000694 effects Effects 0.000 description 5
- 238000004458 analytical method Methods 0.000 description 4
- 238000004891 communication Methods 0.000 description 4
- 101001121408 Homo sapiens L-amino-acid oxidase Proteins 0.000 description 2
- 101000827703 Homo sapiens Polyphosphoinositide phosphatase Proteins 0.000 description 2
- 102100026388 L-amino-acid oxidase Human genes 0.000 description 2
- 102100023591 Polyphosphoinositide phosphatase Human genes 0.000 description 2
- 101100233916 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) KAR5 gene Proteins 0.000 description 2
- 230000010365 information processing Effects 0.000 description 2
- 241001270131 Agaricus moelleri Species 0.000 description 1
- 101100012902 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) FIG2 gene Proteins 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 238000003709 image segmentation Methods 0.000 description 1
- 230000003834 intracellular effect Effects 0.000 description 1
- 239000000203 mixture Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
-
- G—PHYSICS
- G16—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
- G16B—BIOINFORMATICS, i.e. INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR GENETIC OR PROTEIN-RELATED DATA PROCESSING IN COMPUTATIONAL MOLECULAR BIOLOGY
- G16B20/00—ICT specially adapted for functional genomics or proteomics, e.g. genotype-phenotype associations
- G16B20/30—Detection of binding sites or motifs
Definitions
- the present application relates to the field of data processing technology, and in particular to a method, device and electronic equipment for processing cell segmentation.
- 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.
- the present application provides a cell segmentation processing method, device and electronic device, the main purpose of which is to improve the technical problems that the current existing cell segmentation methods will affect the efficiency and accuracy of cell segmentation processing and also increase the technical cost.
- the present application provides a method for processing cell segmentation, comprising:
- a watershed algorithm based on distance transformation is used to segment the connected domain where cell adhesion exists, so as to obtain a segmented mask image.
- the present application provides a cell segmentation processing device, comprising:
- an acquisition module configured to acquire a gene expression profile of a cell
- a processing module is 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, a watershed algorithm based on distance transformation is used to segment the connected domain with cell adhesion to obtain a segmented mask image.
- the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the cell segmentation processing method described in the first 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 the processor implements the cell segmentation processing method described in the first aspect when executing the computer program.
- the present application provides a method, device and electronic device for processing cell segmentation.
- the present application provides a solution for performing cell segmentation directly based on the gene expression map.
- the gene expression map of the cell is first preprocessed to obtain a preprocessed map; then the preprocessed map is binarized to obtain an initial mask map; then, according to 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.
- Cell segmentation does not rely on the image map, and does not require the additional introduction of technology for aligning the image map with the gene expression map, which eliminates the introduction of additional errors, while saving overall operation time and technical costs, and can improve the efficiency and accuracy of cell segmentation processing.
- FIG1 is a schematic diagram showing a process flow of a cell segmentation processing method provided in an embodiment of the present application
- FIG2 is a schematic diagram showing a flow chart of another cell segmentation processing method provided in an embodiment of the present application.
- FIG3 shows a schematic diagram of an example process flow based on the method of this embodiment provided in an embodiment of the present application
- FIG4 shows an example diagram of the effect of the gene expression graph provided in an embodiment of the present application.
- FIG5 shows an example diagram of a sharpened image obtained through sharpening processing provided by an embodiment of the present application
- FIG6 is a schematic diagram showing the effect of an initial mask image provided by an embodiment of the present application.
- FIG7 is a schematic diagram showing the effect of an output mask image provided by an embodiment of the present application.
- FIG8 shows a schematic structural diagram of a cell segmentation processing device provided in an embodiment of the present application.
- this embodiment provides a cell segmentation processing method, as shown in FIG1 , the method includes:
- Step 101 Obtain a gene expression map of a cell.
- a gene expression map, or gene expression atlas, can be obtained based on gene expression data.
- Step 102 preprocess the gene expression map of the cell to obtain a preprocessed map.
- 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.
- Step 103 binarize the preprocessed image to obtain an initial mask image.
- the Otsu method may be used to perform binarization processing on the preprocessed image to obtain an initial mask image.
- Step 104 According to the initial mask image, a watershed algorithm based on distance transformation is used to segment the connected domain where the cells are adhered, so as to obtain a segmented mask image.
- the watershed algorithm considers image segmentation based on the composition of the watershed.
- 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 introduction of additional technology to align image maps with gene expression maps, eliminating the introduction of additional errors, while saving overall operation time and technical costs, and can improve the efficiency and accuracy of cell segmentation processing.
- this embodiment provides a specific method as shown in FIG. 2, which includes:
- Step 201 Obtain a gene expression matrix including spatial positions.
- a gene expression matrix including spatial positions is obtained from gene expression data of the cell.
- the gene expression data may include gene identifiers, coordinate positions and total gene expression amounts of the corresponding coordinate positions of multiple genes.
- Step 202 Generate a gene expression map of the cell based on the gene expression matrix.
- step 202 may specifically include: first obtaining the coordinate position of the expressed gene in the gene expression matrix and the total gene expression amount at the corresponding coordinate position; then generating a gene expression map based on the coordinate position of the expressed gene and the total gene expression amount at the corresponding coordinate position, 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 at the coordinate position corresponding to the pixel point.
- the gene expression map of the cell can be accurately generated.
- 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 the coordinate.
- step 202 may specifically include: drawing a gene expression map of the cell 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.
- a cell-based expression map is drawn according to the gene expression matrix and the segmented mask map, and the spatial position in the gene expression matrix may correspond to the spatial position in the segmented mask map.
- step 203 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.
- Step 203 pre-process the gene expression graph to obtain a median graph, and sharpen the median graph to obtain a sharpened graph.
- the gene expression graph is a scatter plot, it is not convenient to perform cell segmentation, so preprocessing is required.
- the gene expression graph of the cell is first processed into a median graph. Then, the median graph can be sharpened using a Laplacian operator to enhance the boundary effect of the median graph, thereby obtaining a sharpened graph.
- 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 according to the two-dimensional grayscale peak of the image; obtaining the pth percentile of the local maximum point, wherein p is a preset value, such as the pth percentile may be a 98% percentile value, or a 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, wherein the filter size of the first median filter is determined according to the preset size.
- a convolution kernel of a preset size such as 13*13
- 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; performing a convolution operation on the gene expression graph using the convolution kernel of the new size, so that the scattered points in the gene expression graph are adhered to obtain a second convolution graph; performing a median filtering on the second convolution graph using a second median filter to obtain a median graph, wherein the filter size of the second median filter is determined based on the new size.
- 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 to obtain the first convolution map; then detect the local maximum point of the first convolution map according to the two-dimensional grayscale peak of the image, and take out the 99% quantile value R of all the local maximum points. 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.
- 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 a sharpened image is obtained to complete the preprocessing.
- the cell segmentation process is performed, and specifically, the process shown in steps 204 to 207 can be executed.
- Step 204 binarize the sharpened image to obtain an initial mask image.
- the sharpened image obtained in the previous step is binarized using the Otsu method to obtain the initial mask image.
- Step 205 Filter the connected domains in the initial mask image whose areas do not meet the preset conditions to obtain a filtered mask image.
- step 205 may specifically include: filtering 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 a filtered mask image, wherein the first preset threshold is greater than the second preset threshold.
- a first preset threshold For example, an empirical threshold is used to filter the connected domains in the initial mask whose area is too small or too large to obtain a filtered mask image.
- 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 with cell adhesion to obtain a segmented mask image.
- step 206 may specifically include: setting the grayscale value of each pixel in each connected domain in the filter mask image to a first value, and setting 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, remapping the grayscale value of the target pixel to the distance from the target pixel to the nearest pixel whose grayscale value is the second value, 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 whose grayscale value is 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.
- each connected domain in the filter mask image For example, 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 based on distance transformation to further segment the connected domain where cell adhesion may exist.
- the specific steps are as follows:
- Step a For each connected domain area extracted, the grayscale value of the points in 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 a distance map of the connected domain.
- Step b Use an empirical threshold to binarize the distance map to obtain the farthest points from the point with a distance value of 0 in the connected domain (since each connected domain is different, the number of points is not fixed).
- Step c Use the several points obtained in the previous step as 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 segmented target connected domain, and overlay the result onto the filter mask image.
- Step d perform the above steps on each connected domain traversed to obtain a segmented mask image.
- Step 207 Perform a closure operation on the segmented mask image to obtain a mask image of the cell segmentation result.
- the segmented mask is closed to obtain the final mask map. Finally, the final mask map can be output and saved for subsequent biological analysis at the cell level in combination with the original expression matrix.
- FIG3 it is a schematic diagram of an example flow chart based on the method of this embodiment.
- a gene expression matrix can be input, and a gene expression image can be generated based on the matrix, as shown in FIG4.
- a 13*13 convolution kernel is used 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.
- a threshold that is, the local maximum point of the first convolution map is detected according to the two-dimensional grayscale peak of the image, and the 99% quantile value R of all the local maximum points is taken out.
- the 13*13 convolution kernel is not suitable for the original image, and 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 map, and the median filter size is calculated using this ratio, and then the second convolution map is processed with a median filter of this size to obtain a median map. If the R value is within the allowable range, the first convolution map is used, and the first convolution map is processed with a median filter of size 35 to obtain a median map.
- the laplacian operator is used to sharpen the median image to obtain a sharpened image, as shown in Figure 5.
- the sharpened image is binarized using the large law method to obtain the initial mask image, as shown in Figure 6, and then the adhesion cells are segmented by area filtering and watershed algorithm. Finally, the cell mask image is output and saved, as shown in Figure 7.
- 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 introduction of additional technology to align image maps with gene expression maps, eliminating the introduction of additional errors, while saving overall operation time and technical costs, and can improve the efficiency and accuracy of cell segmentation processing.
- this embodiment provides a cell segmentation processing device, as shown in FIG. 8 , the device includes: an acquisition module 31 , a processing module 32 , and a segmentation module 33 .
- An acquisition module 31 is configured to acquire a gene expression profile of a cell
- a processing module 32 is configured to preprocess the gene expression graph to obtain a preprocessed graph
- 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.
- 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 with cell adhesion to obtain a segmented mask image.
- the segmentation module 33 is further configured to set the grayscale value of each pixel in each 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 a segmented target connected domain, and cover the target connected domain with the filter mask image to obtain a segmented mask image.
- 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.
- 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.
- the segmentation module 33 is specifically configured to perform binarization processing on the sharpening image to obtain an initial mask image.
- 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 according to 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.
- 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 according to 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; perform a 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.
- 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.
- the acquisition module 31 is specifically configured to obtain the coordinate position of the expressed gene in the gene expression matrix and the total gene expression amount of the corresponding coordinate position; based on the coordinate position of the expressed gene and the total gene expression amount of the corresponding coordinate position, generate the gene expression map, 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.
- 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.
- the segmentation module 33 is further configured to perform a closure operation on the segmented mask image to obtain a mask image of a cell segmentation result.
- this embodiment further provides a computer-readable storage medium on which a computer program is stored.
- the computer program is executed by a processor, the above method as shown in FIG. 1 and FIG. 2 is implemented.
- 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.), including 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.
- a non-volatile storage medium which can be a CD-ROM, USB flash drive, mobile hard disk, etc.
- a computer device which can be a personal computer, server, or network device, etc.
- the embodiment of the present application also provides an electronic device, which can be 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 the computer program to implement the above method shown in Figures 1 and 2.
- the above-mentioned physical device may also include a user interface, a network interface, a camera, a radio frequency (RF) circuit, a sensor, an audio circuit, a WI-FI module, etc.
- the user interface may include a display, an input unit such as a keyboard, etc., and the optional user interface may also include a USB interface, a card reader interface, etc.
- the network interface may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), etc.
- 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 above-mentioned physical device, and supports the operation of the information processing program and other software and/or programs.
- the network communication module is used to realize the communication between the components inside the storage medium, and the communication with other hardware and software in the information processing physical device.
- this embodiment provides a solution for cell segmentation directly based on gene expression maps, using 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 operation time and technical costs, and can improve the efficiency and accuracy of cell segmentation processing.
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Health & Medical Sciences (AREA)
- Life Sciences & Earth Sciences (AREA)
- Theoretical Computer Science (AREA)
- Proteomics, Peptides & Aminoacids (AREA)
- Evolutionary Biology (AREA)
- Genetics & Genomics (AREA)
- Molecular Biology (AREA)
- Analytical Chemistry (AREA)
- Bioinformatics & Computational Biology (AREA)
- Biotechnology (AREA)
- Biophysics (AREA)
- General Health & Medical Sciences (AREA)
- Medical Informatics (AREA)
- Spectroscopy & Molecular Physics (AREA)
- Chemical & Material Sciences (AREA)
- Computer Vision & Pattern Recognition (AREA)
- General Physics & Mathematics (AREA)
- Image Processing (AREA)
Abstract
The present application relates to the technical field of data processing, and relates to a cell segmentation processing method and apparatus, and an electronic device. The method comprises: first, preprocessing a gene expression map of a cell to obtain a preprocessed map; then, performing binarization processing on the preprocessed map to obtain an initial mask pattern; and then, according to the initial mask pattern and by using a watershed algorithm based on distance transformation, segmenting a connected domain where there is cell adhesion to obtain a segmented mask pattern. By using the technical solution in the present application, multiple image processing methods are combined, such that a relatively reliable cell segmentation result can be provided. Cell segmentation does not rely on an image map, and the additional introduction of a technique for aligning an image map with a gene expression map is not required, thereby eliminating introduced additional errors, and also saving on the overall operation time and technical cost.
Description
本申请涉及数据处理技术领域,具体涉及一种细胞分割的处理方法、装置及电子设备。The present application relates to the field of data processing technology, and in particular to a method, device and electronic equipment for processing cell segmentation.
细胞分割是时空组学技术中提取细胞内基因表达的重要一环,通过分割细胞以获取对应空间位置上相应的基因表达是分析过程中不可或缺的一步。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.
目前,现有的细胞分割方式,通常借助相应生物组织切片的显微镜拍照影像或扫描影像进行细胞分割,辅以影像与基因表达图谱的配准以进行后续的基因提取分析。Currently, existing cell segmentation methods usually use microscope photographs 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.
然而,现有的细胞分割方式,对影像图质量要求较高,且为了后续分析,需要将影像图与基因表达图谱进行配准,引入了额外的技术需要和误差可能,进而会影响细胞分割处理的效率和准确性,而且还会增加技术成本。However, existing cell segmentation methods have high requirements on the quality of images, and for subsequent analysis, the images need to be aligned with the gene expression maps, which introduces additional technical requirements and possible errors, which in turn affects the efficiency and accuracy of the cell segmentation process and increases the technical costs.
发明内容Summary of the invention
有鉴于此,本申请提供了一种细胞分割的处理方法、装置及电子设备,主要目的在于改善目前现有的细胞分割方式会影响细胞分割处理的效率和准确性,而且还会增加技术成本的技术问题。In view of this, the present application provides a cell segmentation processing method, device and electronic device, the main purpose of which is to improve the technical problems that the current existing cell segmentation methods will affect the efficiency and accuracy of cell segmentation processing and also increase the technical cost.
第一方面,本申请提供了一种细胞分割的处理方法,包括:In a first aspect, the present application provides a method for processing cell segmentation, comprising:
获取细胞的基因表达图;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 domain where cell adhesion exists, so as to obtain a segmented mask image.
第二方面,本申请提供了一种细胞分割的处理装置,包括:In a second aspect, the present application provides a cell segmentation processing device, comprising:
获取模块,被配置为获取细胞的基因表达图;an acquisition module, configured to acquire a gene expression profile of a cell;
处理模块,被配置为对所述基因表达图进行预处理,得到预处理图;A processing module is 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, a watershed algorithm based on distance transformation is used to segment the connected domain with cell adhesion to obtain a segmented mask image.
第三方面,本申请提供了一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现第一方面所述的细胞分割的处理方法。In a third aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the cell segmentation processing method described in the first aspect.
第四方面,本申请提供了一种电子设备,包括存储介质、处理器及存储在存储介质上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现第一方面所述的细胞分割的处理方法。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 the processor implements the cell segmentation processing method described in the first aspect when executing the computer program.
借由上述技术方案,本申请提供的一种细胞分割的处理方法、装置及电子设备,与目前现有的细胞分割方式相比,本申请提供一种直接基于基因表达图进行细胞分割的方案,具体首先对细胞的基因表达图进行预处理,得到预处理图;再对所述预处理图进行二值化处理,得到初始掩模图;然后根据初始掩模图,利用基于距离变换的分水岭算法对存在细胞粘连的连通域进行分割,得到分割后的掩模图。通过应用本申请的技术方案,使用多种图像处理方法相结合,可提供较为可靠的细胞分割结果。细胞分割不依赖影像图,不需要额外引入将影像图与基因表达图进行配准的技术,排除了引入的额外误差,同时节省了整体操作时间和技术成本,可提高细胞分割处理的效率和准确性。By means of the above technical scheme, 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 the gene expression map. Specifically, the gene expression map of the cell is first preprocessed to obtain a preprocessed map; then the preprocessed map is binarized to obtain an initial mask map; then, according to 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 scheme 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 the image map, and does not require the additional introduction of technology for aligning the image map with the gene expression map, which eliminates the introduction of additional errors, while saving overall operation time and technical costs, and can improve the efficiency and accuracy of cell segmentation processing.
上述说明仅是本申请技术方案的概述,为了能够更清楚了解本申请的技术手段,而可依照说明书的内容予以实施,并且为了让本申请的上述和其它目的、特征和优点能够更明显易懂,以下特举本申请的具体实施方式。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.
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本申请的实施例,并与说明书一起用于解释本申请的原理。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.
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,对于本领域普通技术人员而言,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
图1示出了本申请实施例提供的一种细胞分割的处理方法的流程示意图;FIG1 is a schematic diagram showing a process flow of a cell segmentation processing method provided in an embodiment of the present application;
图2示出了本申请实施例提供的另一种细胞分割的处理方法的流程示意图;FIG2 is a schematic diagram showing a flow chart of another cell segmentation processing method provided in an embodiment of the present application;
图3示出了本申请实施例提供的基于本实施例方法的示例流程示意图;FIG3 shows a schematic diagram of an example process flow based on the method of this embodiment provided in an embodiment of the present application;
图4示出了本申请实施例提供的基因表达图的效果示例图;FIG4 shows an example diagram of the effect of the gene expression graph provided in an embodiment of the present application;
图5示出了本申请实施例提供的经锐化处理得到锐化图的效果示例图;FIG5 shows an example diagram of a sharpened image obtained through sharpening processing provided by an embodiment of the present application;
图6示出了本申请实施例提供的初始掩模图的效果示意图;FIG6 is a schematic diagram showing the effect of an initial mask image provided by an embodiment of the present application;
图7示出了本申请实施例提供的输出掩模图的效果示意图;FIG7 is a schematic diagram showing the effect of an output mask image provided by an embodiment of the present application;
图8示出了本申请实施例提供的一种细胞分割的处理装置的结构示意图。FIG8 shows a schematic structural diagram of a cell segmentation processing device provided in an embodiment of the present application.
为了能够更清楚地理解本申请的上述目的、特征和优点,下面将对本申请的方案进行进一步描述。需要说明的是,在不冲突的情况下,本申请的实施例及实施例中的特征可以相互组合。In order to more clearly understand the above-mentioned purposes, features and advantages of the present application, the scheme of the present application will be further described below. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.
为了改善目前现有的细胞分割方式会影响细胞分割处理的效率和准确性,而且还会增加技术成本的技术问题。本实施例提供了一种细胞分割的处理方法,如图1所示,该方法包括: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 FIG1 , the method includes:
步骤101、获取细胞的基因表达图。Step 101: Obtain a gene expression map of a cell.
基因表达图,或者称为基因表达图谱,具体可根据基因表达数据得到。A gene expression map, or gene expression atlas, can be obtained based on gene expression data.
步骤102、对细胞的基因表达图进行预处理,得到预处理图。Step 102: preprocess the gene expression map of the cell to obtain a preprocessed map.
由于基因表达图为散点图,不便于进行细胞分割,因此需要进行预处理,将细胞的基因表达图处理得到边界效果增强的预处理图。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.
步骤103、对预处理图进行二值化处理,得到初始掩模图。Step 103: binarize the preprocessed image to obtain an initial mask image.
本实施例可使用大津法对预处理图进行二值化处理,得到初始掩模图。In this embodiment, the Otsu method may be used to perform binarization processing on the preprocessed image to obtain an initial mask image.
步骤104、根据初始掩模图,利用基于距离变换的分水岭算法对存在细胞粘连的连通域进行分割,得到分割后的掩模图。Step 104: According to the initial mask image, a watershed algorithm based on distance transformation is used to segment the connected domain where the cells are adhered, so as to obtain a segmented mask image.
分水岭算法(Watershed Algorithm),是根据分水岭的构成来考虑图像的分割。The watershed algorithm considers image segmentation based on the composition of the watershed.
与目前现有的细胞分割方式相比,本实施例提供一种直接基于基因表达图进行细胞分割的方案,使用多种图像处理方法相结合,可提供较为可靠的细胞分割结果。细胞分割不依赖影像图,不需要额外引入将影像图与基因表达图进行配准的技术,排除了引入的额外误差,同时节省了整体操作时间和技术成本,可提高细胞分割处理的效率和准确性。Compared with the existing cell segmentation methods, 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 introduction of additional technology to align image maps with gene expression maps, eliminating the introduction of additional errors, while saving overall operation time and technical costs, and can improve the efficiency and accuracy of cell segmentation processing.
进一步的,作为上述实施例的细化和扩展,为了完整说明本实施例方法的具体实现过程,本实施例提供了如图2所示的具体方法,该方法包括:Further, 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 FIG. 2, which includes:
步骤201、获取包含空间位置的基因表达矩阵。Step 201: Obtain a gene expression matrix including spatial positions.
从细胞的基因表达数据中获取包含空间位置的基因表达矩阵。基因表达数据可以包括多个基因的基因标识符、坐标位置及相应坐标位置的总基因表达量。A gene expression matrix including spatial positions is obtained from gene expression data of the cell. The gene expression data may include gene identifiers, coordinate positions and total gene expression amounts of the corresponding coordinate positions of multiple genes.
步骤202、基于基因表达矩阵,生成细胞的基因表达图。Step 202: Generate a gene expression map of the cell based on the gene expression matrix.
作为一种可选方式,步骤202具体可包括:首先获取基因表达矩阵中的表达基因的坐标位置及相应坐标位置的总基因表达量;再根据表达基因的坐标位置及相应坐标位置的总基因表达量,生成基因表达图,其中,基因表达图为灰度图,基因表达图中像素点的灰度值为与像素点对应坐标位置的总基因表达量。通过这种可选方式,可准确生成得到细胞的基因表达图。As an optional method, step 202 may specifically include: first obtaining the coordinate position of the expressed gene in the gene expression matrix and the total gene expression amount at the corresponding coordinate position; then generating a gene expression map based on the coordinate position of the expressed gene and the total gene expression amount at the corresponding coordinate position, 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 at the coordinate position corresponding to the pixel point. Through this optional method, the gene expression map of the cell can be accurately generated.
例如,在具体的细胞分割使用中,输入含空间位置的基因表达矩阵,根据表达基因的坐标位置及相应位置的总基因表达量生成表达图像,该图像具体形式为灰度图,坐标点的灰度值为该坐标上基因表达的总量。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 the coordinate.
作为另一种可选方式,步骤202具体还可包括:根据基因表达矩阵和分割的掩码图,绘制细胞的基因表达图,其中,基因表达矩阵中的空间位置与分割的掩码图中的空间位置相对应。例如,根据基因表达矩阵和分割的掩码图绘制基于细胞的表达量图,该基因表达矩阵中的空间位置与分割的掩码图中的空间位置可以相对应。通过这种可选方式,可准确生成得到细胞的基因表达图。As another optional method, step 202 may specifically include: drawing a gene expression map of the cell 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. For example, a cell-based expression map is drawn according to the gene expression matrix and the segmented mask map, and the spatial position in the gene expression matrix may correspond to the spatial position in the segmented mask map. Through this optional method, the gene expression map of the cell can be accurately generated.
由于生成的基因表达图像为散点图,不便于分割,需要进行处理,具体可执行步骤203所示的过程。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.
步骤203、对基因表达图进行预处理,得到中值图,并将中值图进行锐化处理,得到锐化图。Step 203: pre-process the gene expression graph to obtain a median graph, and sharpen the median graph to obtain a sharpened graph.
由于基因表达图为散点图,不便于进行细胞分割,因此需要进行预处理,在本实施例中,首先将细胞的基因表达图处理成中值图。然后可使用拉普拉斯算子(laplacian算子)对中值图进行锐化处理,以增强中值图的边界效果,进而得到锐化图。Since the gene expression graph is a scatter plot, it is not convenient to perform cell segmentation, so preprocessing is required. In this embodiment, the gene expression graph of the cell is first processed into a median graph. Then, the median graph can be sharpened using a Laplacian operator to enhance the boundary effect of the median graph, thereby obtaining a sharpened graph.
可选的,对基因表达图进行预处理,得到中值图,具体可包括:首先利用预设尺寸(如13*13)的卷积核对基因表达图进行卷积操作,使得基因表达图中的散点粘连,得到第一卷积图;再根据图像二维灰度峰值检测第一卷积图的局部最大值点;获取局部最大值点中的第p百分位数,其中,p为预设数值,如第p百分位数可为98%分位值、或99%分位值等;若第p百分位数在预设范围内,则利用第一中值滤波器对第一卷积图进行中值过滤,得到中值图,其中,第一中值滤波器的滤波器大小是根据预设尺寸确定得到的。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 according to the two-dimensional grayscale peak of the image; obtaining the pth percentile of the local maximum point, wherein p is a preset value, such as the pth percentile may be a 98% percentile value, or a 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, wherein the filter size of the first median filter is determined according to the preset size.
进一步可选的,在获取局部最大值点中的第p百分位数之后,本实施例方法还可包括:若第p百分位数在预设范围外,则根据第p百分位数和预设尺寸,确定卷积核的新尺寸;利用新尺寸的卷积核对基因表达图进行卷积操作,使得基因表达图中的散点粘连,得到第二卷积图;利用第二中值滤波器对第二卷积图进行中值过滤,得到中值图,其中,第二中值滤波器的滤波器大小是根据新尺寸确定得到的。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; performing a convolution operation on the gene expression graph using the convolution kernel of the new size, so that the scattered points in the gene expression graph are adhered to obtain a second convolution graph; performing a median filtering on the second convolution graph using a second median filter to obtain a median graph, wherein the filter size of the second median filter is determined based on the new size.
示例性的,根据第p百分位数和预设尺寸,确定卷积核的新尺寸,具体可包括:按照公式K=N*(N/R),计算得到卷积核的新尺寸,其中,K*K表示卷积核的新尺寸,N*N表示预设尺寸,R表示第p百分位数。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), wherein K*K represents the new size of the convolution kernel, N*N represents the preset size, and R represents the pth percentile.
例如,首先使用大小13*13(经验数值)的卷积核,对基因表达图的原图进行卷积操作使散点图粘连,得到第一卷积图;再根据图像二维灰度峰值检测第一卷积图的局部最大值点,取出所得所有局部最大值点中的99%分位值R,如R值与一个设定好的经验阈值差距过大(过高或过低,均会影响后续处理),则认为13*13卷积核不适用于原图,此时计算K=13*(13/R),将原本13*13的卷积核改为K*K的卷积核,重新处理原图,得到第二卷积图;如R值在允许范围内,则沿用第一卷积图。卷积图表现为不同灰度的方块层叠的形式,灰度跨度较剧烈,且部分表达图像存在聚集点簇中心空洞的现象,为消除这一问题,使用13*2.7=35(2.7可为经验数值,小数向下取整)为滤波器大小(如需要计算K,则此处核大小为K*2.7)对第二卷积图进行中值滤波,得到中值图。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 to obtain the first convolution map; then detect the local maximum point of the first convolution map according to the two-dimensional grayscale peak of the image, and take out the 99% quantile value R of all the local maximum points. 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 in the form of stacked blocks of different grayscales. The grayscale span is quite dramatic, and some images express the phenomenon of hollow centers of clusters. To eliminate this problem, 13*2.7=35 (2.7 can be an empirical value, and the decimal is rounded down) is used as the filter size (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 the median image.
为了填充点簇空洞,上述所用中值滤波器较大,中值图的灰度边界可能较为模糊,使用laplacian算子对中值图进行锐化以增强灰度边界,得到锐化图,完成预处理,下面执行细胞分割的过程,具体可执行步骤204至207所示的过程。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 a sharpened image is obtained to complete the preprocessing. Next, the cell segmentation process is performed, and specifically, the process shown in steps 204 to 207 can be executed.
步骤204、将锐化图进行二值化处理,得到初始掩模图。Step 204: binarize the sharpened image to obtain an initial mask image.
使用大津法对上一步得到的锐化图进行二值化,得到初始掩模图。The sharpened image obtained in the previous step is binarized using the Otsu method to obtain the initial mask image.
步骤205、过滤初始掩模图中面积不符合预设条件的连通域,得到过滤掩模图。Step 205: Filter the connected domains in the initial mask image whose areas do not meet the preset conditions to obtain a filtered mask image.
可选的,步骤205具体可包括:将初始掩模图中面积大于第一预设阈值的连通域、或面积小于第二预设阈值的连通域进行过滤,得到过滤掩模图,其中,第一预设阈值大于第二预设阈值。例如,使用经验阈值对初始掩模中面积过小或过大的连通域进行过滤,得到 过滤掩模图。Optionally, step 205 may specifically include: filtering 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 a filtered mask image, wherein the first preset threshold is greater than the second preset threshold. For example, an empirical threshold is used to filter the connected domains in the initial mask whose area is too small or too large to obtain a filtered mask image.
步骤206、遍历过滤掩模图中的每个连通域,基于连通域的最小外接矩形提取连通域所在区域,利用分水岭算法对存在细胞粘连的连通域进行分割,得到分割后的掩模图。 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 with cell adhesion to obtain a segmented mask image.
可选的,步骤206具体可包括:将过滤掩模图中的每个连通域内的像素点的灰度值设置为第一数值,并将在每个连通域外的像素点的灰度值设置为第二数值;针对连通域内每个灰度值为第一数值的目标像素点,将目标像素点的灰度值重新映射为目标像素点到距其最近的灰度值为第二数值的像素点的距离,得到连通域的距离图谱;对连通域的距离图谱进行二值化处理,获得连通域中距离灰度值为第二数值的像素点最远的预设个数像素点;将预设个数像素点作为分水岭算法的注水点,利用分水岭函数对过滤掩模图中连通域的原始掩模进行分水岭分割,得到分割后的目标连通域,并将目标连通域覆盖到过滤掩模图,得到分割后的掩模图。Optionally, step 206 may specifically include: setting the grayscale value of each pixel in each connected domain in the filter mask image to a first value, and setting 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, remapping the grayscale value of the target pixel to the distance from the target pixel to the nearest pixel whose grayscale value is the second value, 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 whose grayscale value is 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.
例如,遍历过滤掩模图中的每个连通域,基于连通域的最小外接矩形提取连通域所在区域,使用基于距离变换的分水岭算法对可能存在细胞粘连的连通域进行进一步分割,具体步骤如下:For example, 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 based on distance transformation to further segment the connected domain where cell adhesion may exist. The specific steps are as follows:
步骤a、对每个提取出的连通域区域,目标连通域内的点灰度值设置为1,连通域外的点灰度值设置为0(包括背景和非目标连通域),对每个值为1的点进行距离变换,将其灰度值重新映射为该点到距其最近的值为0的点的距离(相邻点距离为1),得到该连通域的距离图谱。Step a: For each connected domain area extracted, the grayscale value of the points in 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 a distance map of the connected domain.
步骤b、使用一个经验阈值对距离图谱进行二值化,得到连通域中距离值为0的点最远的数个点(由于每个连通域情况不同,各自数量不定)。Step b: Use an empirical threshold to binarize the distance map to obtain the farthest points from the point with a distance value of 0 in the connected domain (since each connected domain is different, the number of points is not fixed).
步骤c、将上一步得到的数个点作为分水岭算法的注水点,使用opencv中的分水岭函数对连通域的原始掩模进行分水岭分割,得到分割后的目标连通域,将该结果覆盖至过滤掩模图。Step c: Use the several points obtained in the previous step as 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 segmented target connected domain, and overlay the result onto the filter mask image.
步骤d、对遍历的每个连通域进行上述步骤,得到分割后的掩模图。Step d: perform the above steps on each connected domain traversed to obtain a segmented mask image.
步骤207、对分割后的掩模图进行闭包操作,得到细胞分割结果的掩模图。Step 207: Perform a closure operation on the segmented mask image to obtain a mask image of the cell segmentation result.
为使细胞边界更规则,对分割后的掩模进行闭包操作,得到最终掩模图。最后可输出并保存最终掩模图,用于后续结合原始表达矩阵进行细胞层面的生物学分析。In order to make the cell boundaries more regular, the segmented mask is closed to obtain the final mask map. Finally, the final mask map can be output and saved for subsequent biological analysis at the cell level in combination with the original expression matrix.
例如,如图3所示,为基于本实施例方法的示例流程示意图。首先可输入基因表达矩阵,基于矩阵可生成基因表达图像,如图4所示。然后利用13*13卷积核对基因表达图进行卷积操作,使得基因表达图中的散点粘连,得到第一卷积图。此时需要通过阈值进行判断,即根据图像二维灰度峰值检测第一卷积图的局部最大值点,取出所得所有局部最大值点中的99%分位值R,如R值与一个设定好的经验阈值差距过大(过高或过低,均会影响后续处理),则认为13*13卷积核不适用于原图,使用比例计算新的卷积核大小,然后使用新的卷积核处理原图得到第二卷积图,使用这一比例计算中值过滤器大小,然后用这个大小的中值过滤器处理第二卷积图得到中值图。而如果R值在允许范围内,则沿用第一卷积 图,使用大小为35的中值过滤器处理第一卷积图得到中值图。For example, as shown in FIG3, it is a schematic diagram of an example flow chart based on the method of this embodiment. 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 map, so that the scattered points in the gene expression map are adhered to obtain a first convolution map. At this time, it is necessary to judge by a threshold, that is, the local maximum point of the first convolution map is detected according to the two-dimensional grayscale peak of the image, and the 99% quantile value R of all the local maximum points is taken out. If the R value is too far 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, and 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 map, and the median filter size is calculated using this ratio, and then the second convolution map is processed with a median filter of this size to obtain a median map. If the R value is within the allowable range, the first convolution map is used, and the first convolution map is processed with a median filter of size 35 to obtain a median map.
在得到中值图之后,使用laplacian算子对中值图进行锐化处理,得到锐化图,如图5所示。采用大律法对锐化图进行二值化处理得到初始掩模图,如图6所示,然后通过面积过滤和分水岭算法分割粘连细胞。最后输出并保存细胞掩模图像,如图7所示。After obtaining the median image, the laplacian operator is used to sharpen the median image to obtain a sharpened image, as shown in Figure 5. The sharpened image is binarized using the large law method to obtain the initial mask image, as shown in Figure 6, and then the adhesion cells are segmented by area filtering and watershed algorithm. Finally, the cell mask image is output and saved, as shown in Figure 7.
与目前现有的细胞分割方式相比,本实施例提供一种直接基于基因表达图进行细胞分割的方案,使用多种图像处理方法相结合,可提供较为可靠的细胞分割结果。细胞分割不依赖影像图,不需要额外引入将影像图与基因表达图进行配准的技术,排除了引入的额外误差,同时节省了整体操作时间和技术成本,可提高细胞分割处理的效率和准确性。Compared with the existing cell segmentation methods, 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 introduction of additional technology to align image maps with gene expression maps, eliminating the introduction of additional errors, while saving overall operation time and technical costs, and can improve the efficiency and accuracy of cell segmentation processing.
进一步的,作为图1和图2所示方法的具体实现,本实施例提供了一种细胞分割的处理装置,如图8所示,该装置包括:获取模块31、处理模块32、分割模块33。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 , the device includes: an acquisition module 31 , a processing module 32 , and a segmentation module 33 .
获取模块31,被配置为获取细胞的基因表达图;An acquisition module 31 is configured to acquire a gene expression profile of a cell;
处理模块32,被配置为对所述基因表达图进行预处理,得到预处理图;A processing module 32 is configured to preprocess the gene expression graph to obtain a preprocessed graph;
分割模块33,被配置为对所述预处理图进行二值化处理,得到初始掩模图;根据所述初始掩模图,使用基于距离变换的分水岭算法对存在细胞粘连的连通域进行分割,得到分割后的掩模图。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.
在具体的应用场景中,分割模块33,具体被配置为过滤所述初始掩模图中面积不符合预设条件的连通域,得到过滤掩模图;遍历所述过滤掩模图中的每个连通域,基于连通域的最小外接矩形提取连通域所在区域,利用所述分水岭算法对存在细胞粘连的连通域进行分割,得到分割后的掩模图。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 with cell adhesion to obtain a segmented mask image.
在具体的应用场景中,分割模块33,具体还被配置为将所述过滤掩模图中的每个连通域内的像素点的灰度值设置为第一数值,并将在每个连通域外的像素点的灰度值设置为第二数值;针对连通域内每个灰度值为所述第一数值的目标像素点,将所述目标像素点的灰度值重新映射为所述目标像素点到距其最近的灰度值为所述第二数值的像素点的距离,得到连通域的距离图谱;对连通域的距离图谱进行二值化处理,获得连通域中距离灰度值为所述第二数值的像素点最远的预设个数像素点;将所述预设个数像素点作为分水岭算法的注水点,利用分水岭函数对所述过滤掩模图中连通域的原始掩模进行分水岭分割,得到分割后的目标连通域,并将所述目标连通域覆盖到所述过滤掩模图,得到分割后的掩模图。In a specific application scenario, the segmentation module 33 is further configured to set the grayscale value of each pixel in each 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 a segmented target connected domain, and cover the target connected domain with the filter mask image to obtain a segmented mask image.
在具体的应用场景中,分割模块33,具体还被配置为将所述初始掩模图中面积大于第一预设阈值的连通域、或面积小于第二预设阈值的连通域进行过滤,得到所述过滤掩模图,其中,所述第一预设阈值大于所述第二预设阈值。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.
在具体的应用场景中,处理模块32,具体被配置为对所述基因表达图进行预处理,得到中值图;将所述中值图进行锐化处理,得到锐化图。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.
相应的,分割模块33,具体被配置为对所述锐化图进行二值化处理,得到初始掩模图。Correspondingly, the segmentation module 33 is specifically configured to perform binarization processing on the sharpening image to obtain an initial mask image.
在具体的应用场景中,处理模块32,具体还被配置为利用预设尺寸的卷积核对所述基因表达图进行卷积操作,使得所述基因表达图中的散点粘连,得到第一卷积图;根据图像 二维灰度峰值检测所述第一卷积图的局部最大值点;获取所述局部最大值点中的第p百分位数,其中,所述p为预设数值;若所述第p百分位数在预设范围内,则利用第一中值滤波器对所述第一卷积图进行中值过滤,得到所述中值图,其中,所述第一中值滤波器的滤波器大小是根据所述预设尺寸确定得到的。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 according to 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.
在具体的应用场景中,处理模块32,具体还被配置为在所述获取所述局部最大值点中的第p百分位数之后,若所述第p百分位数在预设范围外,则根据所述第p百分位数和所述预设尺寸,确定卷积核的新尺寸;利用所述新尺寸的卷积核对所述基因表达图进行卷积操作,使得所述基因表达图中的散点粘连,得到第二卷积图;利用第二中值滤波器对所述第二卷积图进行中值过滤,得到所述中值图,其中,所述第二中值滤波器的滤波器大小是根据所述新尺寸确定得到的。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 according to 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; perform a 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.
在具体的应用场景中,处理模块32,具体还被配置为按照公式K=N*(N/R),计算得到卷积核的新尺寸,其中,K*K表示卷积核的新尺寸,N*N表示所述预设尺寸,R表示所述第p百分位数。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), wherein K*K represents the new size of the convolution kernel, N*N represents the preset size, and R represents the pth percentile.
在具体的应用场景中,获取模块31,具体被配置为获取包含空间位置的基因表达矩阵;基于所述基因表达矩阵,生成所述基因表达图。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.
在具体的应用场景中,获取模块31,具体还被配置为获取所述基因表达矩阵中的表达基因的坐标位置及相应坐标位置的总基因表达量;根据所述表达基因的坐标位置及相应坐标位置的总基因表达量,生成所述基因表达图,其中,所述基因表达图为灰度图,所述基因表达图中像素点的灰度值为与所述像素点对应坐标位置的总基因表达量。In a specific application scenario, the acquisition module 31 is specifically configured to obtain the coordinate position of the expressed gene in the gene expression matrix and the total gene expression amount of the corresponding coordinate position; based on the coordinate position of the expressed gene and the total gene expression amount of the corresponding coordinate position, generate the gene expression map, 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.
在具体的应用场景中,获取模块31,具体还被配置为根据所述基因表达矩阵和分割的掩码图,绘制细胞的基因表达图,其中,所述基因表达矩阵中的空间位置与所述分割的掩码图中的空间位置相对应。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.
在具体的应用场景中,分割模块33,具体还被配置为对所述分割后的掩模图进行闭包操作,得到细胞分割结果的掩模图。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 a cell segmentation result.
需要说明的是,本实施例提供的一种细胞分割的处理装置所涉及各功能单元的其它相应描述,可以参考图1和图2中的对应描述,在此不再赘述。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 may be made to the corresponding descriptions in FIG. 1 and FIG. 2 , which will not be repeated here.
基于上述如图1和图2所示方法,相应的,本实施例还提供了一种计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现上述如图1和图2所示的方法。Based on the above method as shown in FIG. 1 and FIG. 2 , accordingly, this embodiment further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the above method as shown in FIG. 1 and FIG. 2 is implemented.
基于这样的理解,本申请的技术方案可以以软件产品的形式体现出来,该软件产品可以存储在一个非易失性存储介质(可以是CD-ROM,U盘,移动硬盘等)中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施场景的方法。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.), including 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.
基于上述如图1和图2所示的方法,以及图8所示的虚拟装置实施例,为了实现上述目的,本申请实施例还提供了一种电子设备,具体可为个人计算机、笔记本电脑等,该设 备包括存储介质和处理器;存储介质,用于存储计算机程序;处理器,用于执行计算机程序以实现上述如图1和图2所示的方法。Based on the above method shown in Figures 1 and 2, and the virtual device embodiment shown in Figure 8, in order to achieve the above purpose, the embodiment of the present application also provides an electronic device, which can be 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 the computer program to implement the above method shown in Figures 1 and 2.
可选的,上述实体设备还可以包括用户接口、网络接口、摄像头、射频(Radio Frequency,RF)电路,传感器、音频电路、WI-FI模块等等。用户接口可以包括显示屏(Display)、输入单元比如键盘(Keyboard)等,可选用户接口还可以包括USB接口、读卡器接口等。网络接口可选的可以包括标准的有线接口、无线接口(如WI-FI接口)等。Optionally, the above-mentioned physical device may also include a user interface, a network interface, a camera, a radio frequency (RF) circuit, a sensor, an audio circuit, a WI-FI module, etc. The user interface may include a display, an input unit such as a keyboard, etc., and the optional user interface may also include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), etc.
本领域技术人员可以理解,本实施例提供的上述实体设备结构并不构成对该实体设备的限定,可以包括更多或更少的部件,或者组合某些部件,或者不同的部件布置。Those skilled in the art will appreciate 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 arrangements of components.
存储介质中还可以包括操作系统、网络通信模块。操作系统是管理上述实体设备硬件和软件资源的程序,支持信息处理程序以及其它软件和/或程序的运行。网络通信模块用于实现存储介质内部各组件之间的通信,以及与信息处理实体设备中其它硬件和软件之间通信。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 above-mentioned physical device, and supports the operation of the information processing program and other software and/or programs. The network communication module is used to realize the communication between the components inside the storage medium, and the communication with other hardware and software in the information processing physical device.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到本申请可以借助软件加必要的通用硬件平台的方式来实现,也可以通过硬件实现。通过应用本实施例的方案,与目前现有的细胞分割方式相比,本实施例提供一种直接基于基因表达图进行细胞分割的方案,使用多种图像处理方法相结合,可提供较为可靠的细胞分割结果。细胞分割不依赖影像图,不需要额外引入将影像图与基因表达图进行配准的技术,排除了引入的额外误差,同时节省了整体操作时间和技术成本,可提高细胞分割处理的效率和准确性。Through the description of the above implementation methods, 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, using 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 operation time and technical costs, and can improve the efficiency and accuracy of cell segmentation processing.
需要说明的是,在本文中,诸如“第一”和“第二”等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including 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 "comprising a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
以上所述仅是本申请的具体实施方式,使本领域技术人员能够理解或实现本申请。对这些实施例的多种修改对本领域的技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本申请的精神或范围的情况下,在其它实施例中实现。因此,本申请将不会被限制于本文所述的这些实施例,而是要符合与本文所申请的原理和新颖特点相一致的最宽的范围。The above is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features applied for herein.
Claims (15)
- 一种细胞分割的处理方法,其特征在于,包括:A cell segmentation processing method, characterized by comprising:获取细胞的基因表达图;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 domain where cell adhesion exists, so as to obtain a segmented mask image.
- 根据权利要求1所述的方法,其特征在于,所述根据所述初始掩模图,利用基于距离变换的分水岭算法对存在细胞粘连的连通域进行分割,得到分割后的掩模图,包括:The method according to claim 1, characterized in that the segmenting of the connected domains where cell adhesion exists 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 filtering 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.
- 根据权利要求2所述的方法,其特征在于,所述遍历所述过滤掩模图中的每个连通域,基于连通域的最小外接矩形提取连通域所在区域,利用所述分水岭算法对存在细胞粘连的连通域进行分割,得到分割后的掩模图,包括:The method according to claim 2 is characterized in that the 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 using the watershed algorithm to segment the connected domain where cell adhesion exists to obtain the segmented mask image, comprises:将所述过滤掩模图中的每个连通域内的像素点的灰度值设置为第一数值,并将在每个连通域外的像素点的灰度值设置为第二数值;The grayscale value of each pixel in each connected domain in the filter mask image is set to a first value, and the grayscale value of each pixel outside the connected domain is set to a second value;针对连通域内每个灰度值为所述第一数值的目标像素点,将所述目标像素点的灰度值重新映射为所述目标像素点到距其最近的灰度值为所述第二数值的像素点的距离,得到连通域的距离图谱;For each target pixel whose grayscale value is the first value in the connected domain, remap the grayscale value of the target pixel to the distance from the target pixel to the nearest pixel whose grayscale value is the second value, to obtain 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 whose grayscale value is the second value;将所述预设个数像素点作为分水岭算法的注水点,利用分水岭函数对所述过滤掩模图中连通域的原始掩模进行分水岭分割,得到分割后的目标连通域,并将所述目标连通域覆盖到所述过滤掩模图,得到分割后的掩模图。The preset number of pixel points are used as water injection points of the watershed algorithm, and the original mask of the connected domain in the filtering mask image is subjected to watershed segmentation using the watershed function to obtain the segmented target connected domain, and the target connected domain is covered on the filtering mask image to obtain the segmented mask image.
- 根据权利要求2所述的方法,其特征在于,所述过滤所述初始掩模图中面积不符合预设条件的连通域,得到过滤掩模图,包括:The method according to claim 2, characterized in that filtering the connected domains in the initial mask image whose areas do not meet preset conditions to obtain a filtered mask image comprises:将所述初始掩模图中面积大于第一预设阈值的连通域、或面积小于第二预设阈值的连通域进行过滤,得到所述过滤掩模图,其中,所述第一预设阈值大于所述第二预设阈值。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.
- 根据权利要求1所述的方法,其特征在于,所述对所述基因表达图进行预处理,得到预处理图,包括:The method according to claim 1, characterized in that the preprocessing of the gene expression graph to obtain the preprocessed graph comprises:对所述基因表达图进行预处理,得到中值图;Preprocessing the gene expression graph to obtain a median graph;将所述中值图进行锐化处理,得到锐化图;Performing sharpening processing on the median image to obtain a sharpened image;所述将所述预处理图进行二值化处理,得到初始掩模图,包括:The binarization of the preprocessed image to obtain an initial mask image comprises:将所述锐化图进行二值化处理,得到初始掩模图。The sharpened image is binarized to obtain an initial mask image.
- 根据权利要求5所述的方法,其特征在于,所述对所述基因表达图进行预处理,得到中值图,包括: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;获取所述局部最大值点中的第p百分位数,其中,所述p为预设数值;Obtaining the pth percentile of the local maximum point, wherein p is a preset value;若所述第p百分位数在预设范围内,则利用第一中值滤波器对所述第一卷积图进行中值过滤,得到所述中值图,其中,所述第一中值滤波器的滤波器大小是根据所述预设尺寸确定得到的。If the pth percentile is within a preset range, the first convolution image is median filtered using a first median filter to obtain the median image, wherein the filter size of the first median filter is determined based on the preset size.
- 根据权利要求6所述的方法,其特征在于,在所述获取所述局部最大值点中的第p百分位数之后,所述方法还包括:The method according to claim 6, characterized in that after obtaining the pth percentile of the local maximum point, the method further comprises:若所述第p百分位数在预设范围外,则根据所述第p百分位数和所述预设尺寸,确定卷积核的新尺寸;If the pth percentile is outside a preset range, determining a new size of the convolution kernel according to 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 the filter size of the second median filter is determined according to the new size.
- 根据权利要求7所述的方法,其特征在于,所述根据所述第p百分位数和所述预设尺寸,确定卷积核的新尺寸,包括:The method according to claim 7, characterized in that the determining the new size of the convolution kernel according to the pth percentile and the preset size comprises:按照公式K=N*(N/R),计算得到卷积核的新尺寸,其中,K*K表示卷积核的新尺寸,N*N表示所述预设尺寸,R表示所述第p百分位数。According to the formula K=N*(N/R), the new size of the convolution kernel is calculated, where K*K represents the new size of the convolution kernel, N*N represents the preset size, and R represents the pth percentile.
- 根据权利要求1所述的方法,其特征在于,所述获取细胞的基因表达图,包括:The method according to claim 1, characterized in that obtaining the gene expression profile of the cell comprises:获取包含空间位置的基因表达矩阵;Obtain a gene expression matrix containing spatial locations;基于所述基因表达矩阵,生成所述基因表达图。Based on the gene expression matrix, the gene expression map is generated.
- 根据权利要求9所述的方法,其特征在于,所述基于所述基因表达矩阵,生成所述基因表达图,包括:The method according to claim 9, characterized in that generating the gene expression graph based on the gene expression matrix comprises:获取所述基因表达矩阵中的表达基因的坐标位置及相应坐标位置的总基因表达量;Obtaining the coordinate positions of the expressed genes in the gene expression matrix and the total gene expression amounts 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.
- 根据权利要求9所述的方法,其特征在于,所述基于所述基因表达矩阵,生成所述基因表达图,包括:The method according to claim 9, characterized in that generating the gene expression graph based on the gene expression matrix comprises:根据所述基因表达矩阵和分割的掩码图,绘制细胞的基因表达图,其中,所述基因表达矩阵中的空间位置与所述分割的掩码图中的空间位置相对应。A gene expression map of a 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.
- 根据权利要求1至11中任一项所述的方法,其特征在于,在所述根据所述初始掩模图,利用基于距离变换的分水岭算法对存在细胞粘连的连通域进行分割,得到分割后的掩模图之后,所述方法还包括:The method according to any one of claims 1 to 11, characterized in that after segmenting the connected domain with cell adhesion using a watershed algorithm based on distance transformation according to the initial mask image to obtain a segmented mask image, the method further comprises:对所述分割后的掩模图进行闭包操作,得到细胞分割结果的掩模图。A closure operation is performed on the segmented mask image to obtain a mask image of a cell segmentation result.
- 一种细胞分割的处理装置,其特征在于,包括:A cell segmentation processing device, characterized in that it comprises:获取模块,被配置为获取细胞的基因表达图;an acquisition module, configured to acquire a gene expression profile of a cell;处理模块,被配置为对所述基因表达图进行预处理,得到预处理图;A processing module is 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, a watershed algorithm based on distance transformation is used to segment the connected domain with cell adhesion to obtain a segmented mask image.
- 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1至12中任一项所述的方法。A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method according to any one of claims 1 to 12.
- 一种电子设备,包括存储介质、处理器及存储在存储介质上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现权利要求1至12中任一项所述的方法。An electronic device comprises a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 12 when executing the computer program.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2022/136657 WO2024119321A1 (en) | 2022-12-05 | 2022-12-05 | Cell segmentation processing method and apparatus, and electronic device |
CN202280099770.9A CN119836649A (en) | 2022-12-05 | 2022-12-05 | Cell segmentation processing method and device and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2022/136657 WO2024119321A1 (en) | 2022-12-05 | 2022-12-05 | Cell segmentation processing method and apparatus, and electronic device |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2024119321A1 true WO2024119321A1 (en) | 2024-06-13 |
Family
ID=91378358
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2022/136657 WO2024119321A1 (en) | 2022-12-05 | 2022-12-05 | Cell segmentation processing method and apparatus, and electronic device |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN119836649A (en) |
WO (1) | WO2024119321A1 (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118552570A (en) * | 2024-07-25 | 2024-08-27 | 湖南军芃科技股份有限公司 | X-ray ore image segmentation method, device, equipment and medium |
CN119540950A (en) * | 2025-01-23 | 2025-02-28 | 江西农业大学 | A method and system for obtaining phenotypic parameters of edible fungi |
CN119723574A (en) * | 2025-02-26 | 2025-03-28 | 深圳赛陆医疗科技有限公司 | Cell segmentation method, device, storage medium and program product based on spatial omics sequencing |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040114800A1 (en) * | 2002-09-12 | 2004-06-17 | Baylor College Of Medicine | System and method for image segmentation |
CN102073799A (en) * | 2011-01-28 | 2011-05-25 | 重庆大学 | Tumor gene identification method based on gene expression profile |
CN112330690A (en) * | 2020-11-02 | 2021-02-05 | 腾讯科技(深圳)有限公司 | Cell segmentation method, device and equipment based on microscopic image and storage medium |
CN113781515A (en) * | 2021-09-16 | 2021-12-10 | 广州安方生物科技有限公司 | Cell image segmentation method, device and computer readable storage medium |
CN114496099A (en) * | 2022-01-26 | 2022-05-13 | 腾讯科技(深圳)有限公司 | Cell function annotation methods, devices, equipment and media |
CN114862877A (en) * | 2022-05-27 | 2022-08-05 | 四川大学华西医院 | Cell adhesion segmentation method and device based on confidence score |
-
2022
- 2022-12-05 WO PCT/CN2022/136657 patent/WO2024119321A1/en unknown
- 2022-12-05 CN CN202280099770.9A patent/CN119836649A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040114800A1 (en) * | 2002-09-12 | 2004-06-17 | Baylor College Of Medicine | System and method for image segmentation |
CN102073799A (en) * | 2011-01-28 | 2011-05-25 | 重庆大学 | Tumor gene identification method based on gene expression profile |
CN112330690A (en) * | 2020-11-02 | 2021-02-05 | 腾讯科技(深圳)有限公司 | Cell segmentation method, device and equipment based on microscopic image and storage medium |
CN113781515A (en) * | 2021-09-16 | 2021-12-10 | 广州安方生物科技有限公司 | Cell image segmentation method, device and computer readable storage medium |
CN114496099A (en) * | 2022-01-26 | 2022-05-13 | 腾讯科技(深圳)有限公司 | Cell function annotation methods, devices, equipment and media |
CN114862877A (en) * | 2022-05-27 | 2022-08-05 | 四川大学华西医院 | Cell adhesion segmentation method and device based on confidence score |
Non-Patent Citations (2)
Title |
---|
WUHUA ZHANG, LI QIANG, GUAN XIN: "Detection of Pneumonia Lesions in X-Ray Images Based on Multi-Scale Convolutional Neural Networks", LASER & OPTOELECTRONICS PROGRESS, vol. 57, no. 8, 23 September 2019 (2019-09-23), pages 081020 - 081020-8, XP093179076 * |
YINGRONG YOU, FAN YINGLE, PANG QUAN: "Separate Algorithm for Overlapping Cell Images Based on Distance Transformation", COMPUTER ENGINEERING AND APPLICATIONS, no. 20, 11 July 2005 (2005-07-11), pages 206 - 208, XP093179075 * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118552570A (en) * | 2024-07-25 | 2024-08-27 | 湖南军芃科技股份有限公司 | X-ray ore image segmentation method, device, equipment and medium |
CN119540950A (en) * | 2025-01-23 | 2025-02-28 | 江西农业大学 | A method and system for obtaining phenotypic parameters of edible fungi |
CN119723574A (en) * | 2025-02-26 | 2025-03-28 | 深圳赛陆医疗科技有限公司 | Cell segmentation method, device, storage medium and program product based on spatial omics sequencing |
Also Published As
Publication number | Publication date |
---|---|
CN119836649A (en) | 2025-04-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2024119321A1 (en) | Cell segmentation processing method and apparatus, and electronic device | |
WO2020107866A1 (en) | Text region obtaining method and apparatus, storage medium and terminal device | |
CN103984958B (en) | Cervical cancer cell dividing method and system | |
CN111986183B (en) | Chromosome scattered image automatic segmentation and identification system and device | |
CN110458855B (en) | Image extraction method and related product | |
CN111145209A (en) | Medical image segmentation method, device, equipment and storage medium | |
CN108334879B (en) | Region extraction method, system and terminal equipment | |
CN106951895A (en) | Method and system for determining the contour of a region of interest in an image | |
CN106326895A (en) | Image processing device and image processing method | |
CN114862889A (en) | Road edge extraction method and device based on remote sensing image | |
CN110060246B (en) | Image processing method, device and storage medium | |
CN116580397A (en) | Pathological image recognition method, device, equipment and storage medium | |
CN110263778A (en) | A kind of meter register method and device based on image recognition | |
CN118470038A (en) | Three-dimensional image target detection method and system based on computer vision | |
CN112465817B (en) | Pavement crack detection method based on directional filter | |
CN114255352B (en) | A river channel extraction method, device and computer readable storage medium | |
WO2024001051A1 (en) | Spatial omics single cell data acquisition method and apparatus, and electronic device | |
CN117765330A (en) | MRI image-based data labeling method and system | |
CN105374025A (en) | Breast image obtaining method and device and mammography system | |
CN111209792B (en) | Image recognition method and device for common value-added tax invoices | |
CN112580629A (en) | License plate character recognition method based on deep learning and related device | |
US10579896B2 (en) | Mark detection system and method | |
CN117094974A (en) | Image-based defect detection method and device, electronic equipment and storage medium | |
CN116580410A (en) | Bill number identification method and device, electronic equipment and storage medium | |
CN117425914A (en) | Cell image processing method, electronic device, and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 22967484 Country of ref document: EP Kind code of ref document: A1 |