WO2024001051A1 - 空间组学单细胞数据获取方法及装置和电子设备 - Google Patents
空间组学单细胞数据获取方法及装置和电子设备 Download PDFInfo
- Publication number
- WO2024001051A1 WO2024001051A1 PCT/CN2022/136698 CN2022136698W WO2024001051A1 WO 2024001051 A1 WO2024001051 A1 WO 2024001051A1 CN 2022136698 W CN2022136698 W CN 2022136698W WO 2024001051 A1 WO2024001051 A1 WO 2024001051A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- image
- gene expression
- cell
- stained
- images
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- 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
- G16B40/00—ICT specially adapted for biostatistics; ICT specially adapted for bioinformatics-related machine learning or data mining, e.g. knowledge discovery or pattern finding
- G16B40/30—Unsupervised data analysis
Definitions
- the present application relates to the field of data processing technology, and in particular to a spatial omics single cell data acquisition method and device and electronic equipment.
- Spatiomics technology can reveal the function of the internal space of tissue structures at different times and the heterogeneity between tissue structures, creating favorable conditions for in-depth study of organismal tissue structure and intercellular communication.
- some spatial transcriptome technologies have been developed to capture the entire transcriptome, but in most cases the expression information matrix provided does not reach single-cell level resolution. Therefore, how to obtain single-cell data is an urgent problem that needs to be solved.
- This application provides a spatial omics single cell data acquisition method, device, electronic equipment and storage medium.
- a spatial omics single cell data acquisition method which includes:
- the cells to which the background gene molecules of unknown cells in the gene expression visualization image belong are determined according to the cell mask map, and the cells to which they belong are marked to obtain a spatial component molecular expression matrix with cell markers.
- obtaining stained images of biological samples includes:
- a spliced stained image of the biological sample composed of multiple sub-stained images is obtained through a microscope;
- Multiple sub-staining images of the biological sample are acquired through the microscope, and the multiple sub-staining images are spliced to obtain a spliced staining image.
- obtaining stained images of biological samples includes:
- obtaining multiple sub-stained images of the biological sample through the microscope, splicing the multiple sub-stained images to obtain the spliced stained image includes:
- the portions of the multiple sub-staining images and the template image that are determined to be overlapping areas are respectively cropped into a plurality of staining image overlapping sub-images and a plurality of template image overlapping sub-images of the same number, so as to be paired into multiple overlapping sub-images. right;
- Each of the sub-stained images is translated toward the direction of the template image by the offset amount, and spliced together with the template image.
- obtaining multiple sub-stained images of the biological sample through the microscope, splicing the multiple sub-stained images to obtain the spliced stained image includes:
- the offset between the coordinates, and the coordinates of the second reference image are adjusted based on the offset to splice and generate the spliced stained image.
- registering the staining image with the gene expression visualization image to obtain the registered image includes:
- the staining image and the gene expression visualization image include multiple trajectory lines and/or multiple A trajectory point is formed by the intersection of two of the trajectory lines, and each trajectory line in the plurality of trajectory lines has a corresponding index number;
- the third reference image is moved based on the target offset to obtain the registered image.
- the method further includes:
- the position corresponding to the maximum similarity value is used as the rough registration result.
- register the staining image with the gene expression visualization image, and obtain the registered image including:
- the staining image and the gene expression visualization image each include multiple trajectory lines and multiple trajectory points.
- the trajectory points are formed by the intersection of two of the trajectory lines.
- Each The trajectory line has a corresponding index number;
- a target image is processed based on the offset information to obtain a registered image, where the target image is an image in a candidate image set corresponding to the track point pair.
- the method before performing cell segmentation on the registered images to obtain a cell mask, the method further includes:
- the registered images are subjected to tissue segmentation to obtain a tissue mask map.
- performing tissue segmentation on the registered images to obtain a tissue mask includes:
- the gene expression matrix arranges the gene expression levels according to pixel positions;
- the image data is determined by assigning the gene expression amount at each pixel position in the gene expression matrix to the corresponding pixel position in the registered image;
- the tissue mask map is obtained by marking the connected areas of the image data according to the foreground pixel points.
- the method further includes:
- the outer contour image and inner contour image of the grayscale image corresponding to the tissue mask map are calculated respectively;
- the pixel density ratio is an outer contour image and an inner contour image in each image combination.
- the grayscale image quality corresponding to the tissue mask image is calculated and described based on the pixel density ratio.
- performing cell segmentation on the registered images to obtain a cell mask includes:
- the pixel points belonging to cells or cell outlines in the segmentation result are determined as pixel points belonging to cells, and the segmentation result of the registered image is output to obtain the cell mask map.
- performing cell segmentation on the registered images to obtain a cell mask includes:
- a watershed algorithm based on distance transformation is used to segment the connected domain where cell adhesion exists, and the segmented cell mask map is obtained.
- performing cell segmentation on the registered images to obtain a cell mask includes:
- the area of the sub-region to be processed included in each marked area is determined based on the cell area.
- the area of the sub-region to be processed is positively related to the area of the cell.
- the sub-region to be processed is used to characterize the corresponding said The smallest processing unit of the marked area;
- grid processing is performed on the corresponding marked area to obtain the grid coordinates corresponding to each marked area;
- Data corresponding to the grid coordinates are extracted from the gene expression visualization image and superimposed on the grid coordinates to obtain the cell processing results of the target object.
- determining the cells to which background gene molecules of unknown cells in the gene expression visualization image belong based on the cell mask map include:
- each gene expression feature of the gene expression visualization image is determined as a cell gene expression feature located within the cell and a background gene expression feature located outside the cell;
- a probability distribution model is fitted based on the spatial position and the signal value of the gene expression characteristics
- the correction result is output according to the probability value to correct the background gene expression characteristics.
- determining the cells to which background gene molecules of unknown cells in the gene expression visualization image belong based on the cell mask map include:
- the gene expression visualization image determine the initial gene molecules belonging to the target cell and the background gene molecules of the unknown cell
- determining the cells to which background gene molecules of unknown cells in the gene expression visualization image belong based on the cell mask map include:
- the cell to which the background gene molecule belongs is determined based on the gene molecule density and the background gene molecule density.
- determining the cells to which background gene molecules of unknown cells in the gene expression visualization image belong based on the cell mask map include:
- the spatial coordinates and the gene expression characteristic signal value are input into a probability distribution model to obtain the probability score that the background gene molecule belongs to the target cell; the probability distribution model is based on the probability score of the gene molecule sample belonging to the target cell.
- the spatial coordinates and gene expression characteristic signal values are fitted;
- the cell to which the background gene molecule belongs is determined based on the probability score.
- the corresponding cell markers include:
- the cells are stained with ssDNA staining solution and cell boundary fluorescent staining solution, wherein the ssDNA staining solution includes buffer and ssDNA reagent, and the cell boundary fluorescent staining solution includes fluorescent dye.
- the method also includes:
- the directed target detection network includes:
- the backbone Backbone layer is configured to perform feature extraction on the staining image or gene expression visualization image to be tested to obtain multiple feature maps at different scales;
- the Neck layer is configured to receive the multiple feature maps from the Backbone layer and perform cross-scale fusion on the multiple feature maps to obtain multiple fused feature maps;
- the detection head Head layer is configured to predict the plurality of fused images to obtain target detection results regarding the staining image or gene expression visualization image to be tested,
- the target detection results include: classification information, target frame coordinate prediction information, target prediction information and angle prediction information.
- the stained image plane in which the stained image is located includes a first direction and a second direction perpendicular to the first direction, and the stained image includes a plurality of first straight tracks transverse to the second direction. and a plurality of second straight trajectory lines transverse to said first direction,
- the method for determining point coordinates in the stained image includes:
- the pixels in the sampling area of the stained image selected by the first sampling strip during the equal-spaced sampling period in the first direction are accumulated and summed according to the first direction to obtain a series of first pixel values.
- the first candidate point set is formed by the first candidate points obtained by sampling at equal intervals in each first direction;
- the pixels in the sampling area of the stained image selected by the second sampling strip during the second direction equally spaced sampling period are accumulated and summed in the second direction to obtain a series of second pixel values.
- the second candidate point set is formed by the second candidate points obtained by equally spaced sampling in each second direction;
- Grouping steps include:
- Line fitting steps include:
- Coordinate calculation steps include:
- the method further includes:
- the second image including stained genetic material of the biological sample
- Gene expression information of cells of the biological sample is obtained based on the registration image of the first image and the gene expression amount information according to the cell boundary.
- a spatial omics single cell data acquisition device including:
- An acquisition unit used to acquire staining images of biological samples and obtain gene expression visualization images of the biological samples
- a registration unit used to register the staining image and the gene expression visualization image to obtain a registered image
- the first segmentation unit is used to perform cell segmentation on the registered image to obtain a cell mask
- a correction unit configured to determine, based on the cell mask map, the cells to which the background gene molecules of unknown cells in the gene expression visualization image belong;
- the labeling unit is used to label the corresponding cells to obtain a spatial component molecular expression matrix with cell labels.
- the acquisition unit is also used for:
- a spliced stained image of the biological sample composed of multiple sub-stained images is obtained through a microscope;
- Multiple sub-staining images of the biological sample are acquired through the microscope, and the multiple sub-staining images are spliced to obtain a spliced staining image.
- the acquisition unit includes:
- a first acquisition module configured to acquire multiple sub-staining images of the biological sample through a microscope; perform a first splicing of the multiple sub-staining images of the biological sample to obtain a first staining image;
- a judgment module configured to judge whether to perform a second splicing of multiple sub-stained images of the biological sample based on the image quality of the first stained image
- a determination module configured to determine the first stained image as the stained image if not
- the second acquisition module is configured to, if so, perform a second splicing of multiple sub-staining images of the biological sample to obtain the staining image.
- the first acquisition module is also used for:
- the portions of the multiple sub-staining images and the template image that are determined to be overlapping areas are respectively cropped into a plurality of staining image overlapping sub-images and a plurality of template image overlapping sub-images of the same number, so as to be paired into multiple overlapping sub-images. right;
- Each of the sub-stained images is translated toward the direction of the template image by the offset amount, and spliced together with the template image.
- the first acquisition module is also used for:
- the offset between the coordinates, and the coordinates of the second reference image are adjusted based on the offset to splice and generate the spliced stained image.
- the registration unit includes:
- An acquisition module configured to acquire a trajectory line in the staining image, and rotate the staining image based on the angle between the trajectory line and the horizontal direction; wherein the staining image and the gene expression visualization image include multiple trajectory lines And/or a plurality of trajectory points, the trajectory points are formed by the intersection of two of the trajectory lines, and each of the multiple trajectory lines has a corresponding index number;
- a processing module configured to enlarge or reduce the staining image to obtain a third reference image, where the third reference image has the same proportion as the gene expression visualization image;
- a first determination module configured to determine a target offset based on the gene expression visualization image and the third reference image
- a registration module configured to move the third reference image based on the target offset to obtain the registered image.
- the registration unit also includes:
- a second determination module configured to determine the similarity between the third reference image and the gene expression visualization image after the processing module enlarges or reduces the staining image to obtain a third reference image
- the coarse registration module is used to use the position corresponding to the maximum similarity value as the coarse registration result.
- the registration unit is also used for:
- the staining image and the gene expression visualization image each include multiple trajectory lines and multiple trajectory points.
- the trajectory points are formed by the intersection of two of the trajectory lines.
- Each The trajectory line has a corresponding index number;
- a target image is processed based on the offset information to obtain a registered image, where the target image is an image in a candidate image set corresponding to the track point pair.
- the device also includes:
- the second segmentation unit is configured to perform tissue segmentation on the registered image to obtain a tissue mask map before the first segmentation unit performs cell segmentation on the registered image to obtain a cell mask map.
- the second dividing unit is also used for:
- the gene expression matrix arranges the gene expression levels according to pixel positions;
- the image data is determined by assigning the gene expression amount at each pixel position in the gene expression matrix to the corresponding pixel position in the registered image;
- the tissue mask map is obtained by marking the connected areas of the image data according to the foreground pixel points.
- the device also includes:
- a calculation unit configured to perform tissue segmentation on the registered image in the second segmentation unit, and after obtaining the tissue mask map, respectively calculate the outer contour image and the inner contour of the grayscale image corresponding to the tissue mask map. image;
- a pairing unit configured to divide the outer contour image and the inner contour image into N segments respectively, and pair the outer contour image of each segment with the inner contour image of each segment in pairs to obtain N image combinations, Each of the image combinations includes an outer contour image and an inner contour image;
- the calculation unit is also used to separately calculate the pixel density ratio of an outer contour image and an inner contour image in each of the image combinations to obtain N pixel density ratios, and the pixel density ratio is for each of the image combinations.
- the calculation unit is also configured to calculate and describe the grayscale image quality corresponding to the tissue mask image according to the pixel density ratio.
- the first dividing unit is also used for:
- the pixel points belonging to cells or cell outlines in the segmentation result are determined as pixel points belonging to cells, and the segmentation result of the registered image is output to obtain the cell mask map.
- the first dividing unit is also used for:
- a watershed algorithm based on distance transformation is used to segment the connected domain where cell adhesion exists, and the segmented cell mask map is obtained.
- the first dividing unit is also used for:
- the area of the sub-region to be processed included in each marked area is determined based on the cell area.
- the area of the sub-region to be processed is positively related to the area of the cell.
- the sub-region to be processed is used to characterize the corresponding said The smallest processing unit of the marked area;
- grid processing is performed on the corresponding marked area to obtain grid coordinates corresponding to each marked area;
- Data corresponding to the grid coordinates are extracted from the gene expression visualization image and superimposed on the grid coordinates to obtain the cell processing results of the target object.
- correction unit is also used for:
- each gene expression feature of the gene expression visualization image is determined as a cell gene expression feature located within the cell and a background gene expression feature located outside the cell;
- a probability distribution model is fitted based on the spatial position and the signal value of the gene expression characteristics
- the correction result is output according to the probability value to correct the background gene expression characteristics.
- correction unit is also used to include:
- the gene expression visualization image determine the initial gene molecules belonging to the target cell and the background gene molecules of the unknown cell
- correction unit is also used to include:
- the cell to which the background gene molecule belongs is determined based on the gene molecule density and the background gene molecule density.
- correction unit is also used to include:
- the spatial coordinates and the gene expression characteristic signal values are input into a probability distribution model to obtain the probability score that the background gene molecule belongs to the target cell; the probability distribution model is based on the probability score of the gene molecule sample belonging to the target cell.
- the spatial coordinates and gene expression characteristic signal values are fitted;
- the cell to which the background gene molecule belongs is determined based on the probability score.
- the marking unit is also used for:
- the cells are stained with ssDNA staining solution and cell boundary fluorescent staining solution, wherein the ssDNA staining solution includes buffer and ssDNA reagent, and the cell boundary fluorescent staining solution includes fluorescent dye.
- the device also includes a detection unit, including:
- the directed target detection network includes:
- the backbone Backbone layer is configured to perform feature extraction on the staining image or gene expression visualization image to be tested to obtain multiple feature maps at different scales;
- the Neck layer is configured to receive the multiple feature maps from the Backbone layer and perform cross-scale fusion on the multiple feature maps to obtain multiple fused feature maps;
- the detection head Head layer is configured to predict the plurality of fused images to obtain target detection results regarding the staining image or gene expression visualization image to be tested,
- the target detection results include: classification information, target frame coordinate prediction information, target prediction information and angle prediction information.
- the stained image plane in which the stained image is located includes a first direction and a second direction perpendicular to the first direction, and the stained image includes a plurality of first straight tracks transverse to the second direction. and a plurality of second straight trajectory lines transverse to said first direction,
- the method for determining point coordinates in the stained image includes:
- the pixels in the sampling area of the stained image selected by the first sampling strip during the equal-spaced sampling period in the first direction are accumulated and summed according to the first direction to obtain a series of first pixel values.
- the first candidate point set is formed by the first candidate points obtained by sampling at equal intervals in each first direction;
- the pixels in the sampling area of the stained image selected by the second sampling strip during the second direction equally spaced sampling period are accumulated and summed in the second direction to obtain a series of second pixel values.
- the second candidate point set is formed by the second candidate points obtained by equally spaced sampling in each second direction;
- Grouping steps include:
- Line fitting steps include:
- Coordinate calculation steps include:
- the device further includes: an analysis unit, the analysis unit is used for:
- Gene expression information of cells of the biological sample is obtained based on the registration image of the first image and the gene expression amount information according to the cell boundary.
- an electronic device including:
- the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can perform the method described in the first aspect.
- a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute the method described in the first aspect.
- a computer program product including a computer program that, when executed by a processor, implements the method described in the first aspect.
- the spatial omics single cell data acquisition method, device, electronic equipment and storage medium acquire staining images of biological samples, acquire gene expression visualization images of the biological samples; visualize the staining images and the gene expression
- the images are registered to obtain a registered image; the registered image is subjected to cell segmentation to obtain a cell mask map; the background of the unknown cells in the gene expression visualization image is determined based on the cell mask map
- the cells to which the gene molecules belong are identified, and the corresponding cells are marked to obtain a spatial component expression matrix with cell markers.
- the embodiments of the present application obtain high-precision spatial single-cell data through the processing flow of gene expression matrix diagram, splicing, registration, segmentation and correction.
- Figure 1 is a schematic flow chart of a spatial omics single cell data acquisition method provided by an embodiment of the present application
- Figure 2 is a schematic diagram of obtaining single cell data for spatial omics provided by an embodiment of the present application
- Figure 3 is a schematic flow chart of a method for obtaining stained images of biological samples provided by an embodiment of the present application
- Figure 4 is a schematic flow chart of a method for splicing multiple sub-stained images provided by an embodiment of the present application
- Figure 5 is a schematic flow chart of another method for splicing multiple sub-stained images provided by an embodiment of the present application.
- Figure 6 is a schematic diagram of the spatial distribution of multiple fields of view provided by an embodiment of the present application.
- Figure 7 is a schematic diagram of the pre-stitching results of an image splicing method provided by an embodiment of the present application.
- Figure 8a is a schematic diagram of the positional relationship between two row-wise adjacent dyed images scanned in the horizontal direction during pre-stitching provided by an embodiment of the present application;
- Figure 8b is a schematic diagram of the positional relationship between two adjacent stained images scanned in the vertical direction during pre-stitching according to an embodiment of the present application
- Figure 9 is a schematic diagram of a single field of view template for splicing biological samples provided by an embodiment of the present application.
- Figure 10 is a schematic diagram of the construction process of a single field of view template for splicing biological samples provided by an embodiment of the present application;
- Figure 11 is a schematic flow chart of a method for registering staining images and gene expression visualization images provided by embodiments of the present application;
- Figure 12 is a schematic diagram of a dyeing image provided by an embodiment of the present application.
- Figure 13 is a schematic diagram of a third reference image provided by an embodiment of the present application.
- Figure 14a is a third reference image with multiple periods provided by the embodiment of the present application.
- Figure 14b is a multiple-cycle gene expression visualization image provided by the embodiment of the present application.
- Figure 15 is a schematic diagram of a preset period determined with the first offset as the center provided by an embodiment of the present application.
- Figure 16 is a schematic flow chart of another method for registering staining images and gene expression visualization images provided by embodiments of the present application.
- Figure 17a is a schematic diagram of a candidate image provided by an embodiment of the present application.
- Figure 17b is a schematic diagram of an initial binary image provided by the embodiment of the present application.
- Figure 17c is a schematic diagram of a target binary image provided by the embodiment of the present application.
- Figure 18 is a schematic flow chart of another method for registering staining images and gene expression visualization images provided by embodiments of the present application.
- Figure 19 is a flow chart for determining image data of a tissue segmentation method for sample images provided by an embodiment of the present application.
- Figure 20 is a schematic diagram of image data of a tissue segmentation method for sample images provided by an embodiment of the present application.
- Figure 21 is a 2D convolution schematic diagram of a tissue segmentation method for sample images provided by an embodiment of the present application.
- Figure 22 is a schematic diagram of low-level features of a tissue segmentation method for sample images provided by an embodiment of the present application.
- Figure 23 is a schematic flow chart of a method for calculating grayscale image quality corresponding to a tissue mask map provided by an embodiment of the present application
- Figure 24 is a schematic structural diagram of the relationship between an external contour image and an internal contour image provided by an embodiment of the present application.
- Figure 25 is a schematic diagram of the relationship between another external contour image and an internal contour image provided by an embodiment of the present application.
- Figure 26 is a schematic flow chart of a method for cell segmentation on registered images provided by an embodiment of the present application.
- Figure 27 shows the segmentation effect of an image segmentation model provided by the embodiment of the present application on a mouse brain image
- Figure 28 is a schematic flow chart of another method for cell segmentation on registered images provided by an embodiment of the present application.
- Figure 29 shows a schematic flow chart of another cell segmentation processing method provided by an embodiment of the present application.
- Figure 30 shows an example flow diagram based on the method of this embodiment provided by the embodiment of this application.
- Figure 31 shows an example of the effect of the gene expression map provided by the embodiment of the present application.
- Figure 32 shows an example of the effect of a sharpened image obtained through sharpening processing provided by the embodiment of the present application
- Figure 33 shows a schematic diagram of the effect of the initial mask image provided by the embodiment of the present application.
- Figure 34 shows a schematic diagram of the effect of the output mask image provided by the embodiment of the present application.
- Figure 35 is a schematic flow chart of another method for cell segmentation on registered images provided by an embodiment of the present application.
- Figure 36 is a schematic flowchart of a method for determining the cells to which background gene molecules of unknown cells in a gene expression visualization image belong, provided by an embodiment of the present application;
- Figure 37 is a schematic diagram of the corresponding relationship between DNB and cell membrane provided by the embodiment of the present application.
- Figure 38 is a schematic diagram of the correction result of a corrected background DNB provided by the embodiment of the present application.
- Figure 39 is a schematic flowchart of another method for determining the cells to which background gene molecules of unknown cells in the gene expression visualization image belong, provided by the embodiments of the present application;
- Figure 40 is a schematic flowchart of another method for determining the cell to which the background gene molecule of the unknown cell belongs in the gene expression visualization image according to the embodiment of the present application;
- Figure 41 is a schematic diagram of the center point of a target cell provided by an embodiment of the present application.
- Figure 42 is a schematic flowchart of another method for determining the cells to which background gene molecules of unknown cells in the gene expression visualization image belong, provided by the embodiments of the present application;
- Figure 43 is a schematic flow chart of a method for determining point coordinates in a stained image provided by an embodiment of the present application.
- Figure 44 is a schematic diagram of a dyeing image provided by an embodiment of the present application.
- Figure 45 is a schematic flow chart of a directed target detection method provided by an embodiment of the present application.
- Figure 46 is a schematic flow chart of a method for obtaining cell gene expression information from biological samples provided by an embodiment of the present application.
- Figure 47 is a schematic structural diagram of a spatial omics single cell data acquisition device provided by an embodiment of the present application.
- Figure 48 is a schematic structural diagram of another spatial omics single cell data acquisition device provided by an embodiment of the present application.
- Figure 49 is a schematic block diagram of an example electronic device provided by an embodiment of the present application.
- Figure 1 is a schematic flow chart of a spatial omics single cell data acquisition method provided by an embodiment of the present application.
- the method consists of the following steps:
- Step 101 Obtain the stained image of the biological sample and obtain the gene expression visualization image of the biological sample;
- SOP spatial resolved technology
- staining can be achieved through but not limited to the following technologies, such as: Hematoxylin and Eosin Staining (HE), ssDNA and DAPI. Specifically, this application does not limited.
- HE Hematoxylin and Eosin Staining
- ssDNA ssDNA
- DAPI DAPI
- the obtained microscope photograph is generally in tif format, including but not limited to 16 bit or 8 bit, and can be either a color image or a grayscale image. Specifically, the embodiments of this application are not limited.
- the biological samples are spatially sequenced, and the gene expression matrix of the biological samples is obtained through standard processes such as sequencing sequence comparison analysis, and the gene expression matrix is converted into a gene expression visualization image.
- each site can capture the gene sequence of the biological sample.
- the number of gene sequences of the site is used as the value of the element in the gene expression matrix, so that the elements of the gene expression matrix correspond to the sites of the spatiotemporal chip (for example, one element corresponds to one site, the first row and the first column of the gene expression matrix The elements correspond to the position in the upper left corner of the space-time chip) and so on to obtain the gene expression matrix, and then draw a gene expression visualization image based on the gene expression matrix.
- the pixels in the gene expression visualization image correspond to the elements of the gene expression matrix
- the pixel values of the pixels correspond to the values of the elements. Therefore, the gene expression visualization image contains spatial information of the same biological sample.
- Obtaining the gene expression visualization image of the biological sample includes but is not limited to the following methods: performing spatial omics sequencing sequence processing on the biological sample to obtain a gene expression matrix; converting the gene expression matrix into a corresponding gene expression visualization image .
- Step 102 register the staining image and the gene expression visualization image to obtain a registered image
- registration is achieved based on line features in the stitched stained images
- accurate automatic registration at pixel level accuracy is achieved through coordinate calculation through track points on the image and using tissue contours as reference objects;
- registration is achieved by stitching tissue masks of stained images.
- the embodiments of this application do not limit the registration method.
- Step 103 Perform cell segmentation on the registered image to obtain a cell mask
- the registered images are input into the image segmentation model to output a cell mask that contains cell nuclei.
- tissue segmentation before performing cell segmentation, tissue segmentation can also be performed first. After tissue segmentation, only the tissue region can be focused and no attention is paid to the outside of the tissue, thereby improving the signal-to-noise ratio of the sample data.
- Step 104 Determine the cells to which the background gene molecules of unknown cells belong in the gene expression visualization image according to the cell mask map, and label the cells to obtain a spatial component molecular expression matrix with cell labels;
- step 103 After the cell segmentation is completed in step 103, at least the cell nucleus is included, but there are still scenarios where some background gene molecules are not labeled as a cell.
- the probability threshold is set to mark the cell belonging. When the probability is too low, the belonging cell is not marked. There is no specific limit on the probability threshold.
- Figure 1 has explained the spatial omics single cell data acquisition method. Please refer to Figure 2.
- Figure 2 is a schematic diagram of a method for obtaining spatial omics single cell data provided by an embodiment of the present application. This figure takes mouse brain slices as an example. Schematic diagram of the process, where A corresponds to step 101, C corresponds to step 102, D corresponds to step 103, and E corresponds to step 104.
- Cell segmentation is used to obtain a cell mask map; according to the cell mask map, the cells to which the background gene molecules of unknown cells in the gene expression visualization image belong are determined, and the cells are marked to obtain spatial component expression with cell labels.
- matrix Compared with related technologies, the embodiments of the present application obtain high-precision spatial single-cell data through the processing flow of gene expression matrix diagram, splicing, registration, segmentation and correction.
- Method 1 Obtain a stained image of the biological sample through a microscope
- Method 2 Obtain a spliced stained image of the biological sample composed of multiple sub-stained images through a microscope;
- Method 3 Acquire multiple sub-staining images of the biological sample through the microscope, and splice the multiple sub-staining images to obtain a spliced staining image.
- Methods 1 and 2 are the results of splicing under a microscope.
- Method 1 is to obtain a large image (stained image) directly through the microscope.
- Method 2 is to use a microscope to acquire multiple small images (sub-stained images).
- the sub-stained images are spliced to obtain a stained image;
- the third method is to splice the stained images through a preset algorithm when the results of the microscope splicing do not meet the requirements.
- the acquisition method of the stained image is not limited.
- FIG. 3 is a schematic flowchart of a method for obtaining stained images of biological samples provided by embodiments of the present application. include:
- Step 1011 Obtain multiple sub-stained images of the biological sample through a microscope; perform a first splicing of the multiple sub-stained images of the biological sample to obtain a first stained image.
- Splicing can be performed in but not limited to the following ways, as shown in Figure 4, including:
- Step 10111 determine the overlapping areas of multiple sub-stained images and template images respectively;
- determining the overlapping area of the sub-stained image and the template image may include: determining a matching direction of the sub-stained image and the template image; and selecting adjacent ones in the sub-stained image and the template image in the determined matching direction. Areas of the same size are used as overlapping areas.
- the matching direction may be determined based on the moving direction of the shooting device when the two images are captured. If the sub-stained image and the template image are two images shot sequentially when the shooting device moves horizontally, the matching direction between the two images can be determined as the horizontal direction.
- other available methods can also be used to determine the relative positional relationship between the two images and thereby determine the matching direction, which will not be described again here.
- the overlapping area is selected such that the ratio of the actual overlapping portions in the sub-stained image and the template image in the overlapping area is greater than a predetermined threshold.
- the predetermined threshold is determined to be 10%, or 30%, etc. Note that this value is used as an example only. In some other examples, the predetermined threshold may also take other larger or smaller values.
- Step 10112 Cut the portions of the multiple sub-staining images and the template image that are determined to be overlapping areas into multiple staining image overlapping sub-images and multiple template image overlapping sub-images of the same number, respectively, to pair them into multiple overlapping sub-images. Overlapping subgraph pairs;
- this operation may include: performing noise reduction and/or windowing on the portions of the sub-stained image and the template image that are determined to be overlapping areas respectively; in a direction perpendicular to the matching direction, denoising and/or windowing are performed.
- the noise reduction processing in the above operation can be performed by, for example, Gaussian filtering, but other noise reduction methods used in the field of image processing can also be used for this processing.
- Windowing can be used to obtain images that suppress spectral leakage.
- the windows used include but are not limited to Hanning windows, Hamming windows, etc.
- a sliding window approach may be used to perform the above resampling.
- the sliding window method can set a certain overlapping area. Multiple stacked small sub-images correspond to ensure that the cropping areas of the source image and the template image are in the overlapping area and in the same coordinate system. Resampling can be achieved using any available method, such as using target detection methods to crop areas with more features, and is not limited to the above-mentioned sliding window method.
- the method shown in FIG. 1 may also optionally include removing overlapping sub-image pairs with features less than a specific standard and/or noise greater than a specific standard from the multiple overlapping sub-image pairs.
- gradient detection can be used to filter subgraph pairs with fewer features and/or more noise.
- the gradient detection methods used include but are not limited to Sobel, Canny and other methods.
- any other method that can be used to detect the number of features and/or noise in the image can be used here, and is not limited to gradient detection methods.
- Step 10113 Obtain the offset between each sub-stained image and the template image by performing frequency domain calculation on the multiple overlapping sub-image pairs;
- the overlapping sub-image pairs for superposition resonance in the frequency domain are the overlapping sub-image pairs obtained after removing the sub-image pairs with fewer features and/or more noise in the above optional step.
- this step can be performed using the Dirac function. For example, it includes: stacking the cross-power spectrum of the multiple overlapping sub-graph pairs, and using the Dirac function to obtain the offset from the stacked cross-power spectrum.
- each overlapping sub-image in the plurality of overlapping sub-image pairs may be transformed from a position coordinate system to a frequency domain. This transformation can be accomplished, for example, by discrete Fourier transform of the two-dimensional image, or by any other means that can achieve domain transformation, which will not be described again here.
- the mutual power spectrum corresponding to each overlapping sub-image pair in the multiple overlapping sub-image pairs can be calculated; perform an inverse discrete Fourier transform on the mutual power spectrum corresponding to each obtained overlapping sub-image pair, To obtain a Dirac function representation of the overlapping area; and determine the coordinates where the maximum peak of the obtained Dirac function representation in the overlapping area is located as an offset.
- the features in the overlapping sub-image pair may also be improved to Make it more visible.
- the overlapping sub-image pair can be transformed into a position coordinate system, and the overlapping sub-image transformed into the position coordinate system can be windowed to enhance features in the overlapping sub-image.
- the window function used here can be a Hanning window or a Hamming window, or any other function that can enhance features in the image. Enhancing features in overlapping sub-images can effectively improve the success rate of image registration for images with unobvious features.
- the method used to enhance image features may not be limited to windowing processing, but may also be any other method capable of enhancing image features.
- performing an inverse discrete Fourier transform on the cross-power spectrum corresponding to each obtained overlapping sub-image pair to obtain the Dirac function representation of the overlapping region may include: The overlapping subgraph performs an inverse discrete Fourier transform on the corresponding cross power spectrum to obtain a stacked Dirac function representation; and performs weighted accumulation of the obtained stacked Dirac function representations to obtain a Dirac function representation of the overlapping region .
- overlapping subgraph pairs with more obvious features can be assigned larger weighting coefficients.
- the weighting coefficient of each overlapping subgraph pair may depend on the energy spectrum of the overlapping subgraph pair (for example, the energy intensity of the maximum peak of the Dirac function) and/or the matching number of the feature points of the overlapping subgraph pair. /or the image sharpness of the overlapping sub-image pair, or may be based on any other metric that can characterize whether the overlapping sub-image pair has more distinct features.
- Step 10114 Translate each of the sub-stained images by the offset amount toward the direction of the template image, and splice them together with the template image.
- Step 1012 Determine whether to perform a second splicing of multiple sub-stained images of the biological sample based on the image quality of the first stained image;
- the image quality of the first stained image needs to be set according to spatial omics single cell data acquisition requirements, which is not limited by the embodiments of this application.
- step 1013 If not, perform step 1013; if yes, perform step 1014.
- Step 1013 determine the first stained image as the stained image
- Step 1014 Perform a second splicing of multiple sub-stained images of the biological sample to obtain the stained image.
- Figure 5 is a flow chart of another method for splicing multiple sub-stained images to obtain a spliced stained image provided by an embodiment of the present application, including:
- Step 10115 Obtain the multiple sub-staining images and template information about the trajectory lines or trajectory points of the biological sample
- trajectory lines can be converted to each other; trajectory points can be obtained based on two intersecting trajectory lines; trajectory lines can be obtained based on collinear trajectory points.
- the template information may include index numbers of multiple trajectory lines on the biological sample. As known to those skilled in the art, the distribution pattern of trajectory lines on a biological sample has been specified at the beginning of the design of the biological sample.
- trajectory lines in the vertical direction of the biological sample there are 10 trajectory lines in the vertical direction of the biological sample, among them
- the spacing between them can be, for example, 1, 2, 3, 4, 5, 4, 3, 2, 1 respectively.
- the position of the first trajectory line is taken as the starting point (coordinate is 0)
- the horizontal axis (x-axis) coordinates of the above 10 trajectory lines are 0, 1, 3, 6, 10, 15, 19, 22 respectively. ,24,25.
- the index numbers in the template information of the biological sample can be associated with the arrangement of the trajectory lines in the biological sample.
- the index numbers of the above 10 trajectory lines can be artificially specified as 0, 1, 2, 3, 4, 5, and 6 respectively. ,7,8,0.
- the acquired template information of the biological sample may also include periodicity.
- the acquired template information of the biological sample may also include periodicity.
- the above-mentioned 10 trajectory lines in the vertical direction of the biological sample they may be extended to the left and right by one or more periods respectively.
- the spacing between the trajectory lines formed by one period of left and right expansion from left to right is 1, 2, 3, 4, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 4, 3, 2, 1.
- the index number of a biological sample corresponding to a certain trajectory line is unique, and a certain index number on a biological sample will correspond to multiple trajectory lines. This is when designing trajectory lines on biological samples. determined by the periodicity.
- a microscope can take an image of a biological sample, for example, by scanning the biological sample line by line or column by column.
- the spatial distribution of multiple images after scanning can be shown in Figure 6.
- the multiple images can share, for example, n+1 columns and m+1 rows, including images from the first row to the first column (r0, c0)
- the image (rm,cn) to the last row and last column.
- the image can have up to 8 adjacent images.
- the microscope when it takes an image, it can also record the camera position information at the time of shooting. Subsequently, based on the camera position information recorded at the time of shooting for any image, the corresponding position of the image can be determined and its adjacent images can be determined for the image.
- Figure 7 is a schematic diagram of the pre-stitching results of the image stitching method according to one embodiment of the present invention.
- Step 10116 Pre-stitch the multiple sub-stained images to obtain the pre-stitched coordinates of the multiple sub-stained images
- the left neighbor and right neighbor images of the current stained image can be determined using, for example, 2-nearest neighbor methods based on the scanning order or the camera position information when the image is captured, and then the stained image and the left and right neighbors can be determined. Offset and overlap between images.
- FFT fast Fourier transform
- SIFT scale-invariant feature transform
- the pre-stitching coordinates of the multiple stained images can be obtained.
- Figure 8a is a schematic diagram of the positional relationship between two adjacent stained images scanned in the horizontal direction during pre-stitching
- Figure 8b is a schematic diagram of the positional relationship between two adjacent stained images scanned in the vertical direction during pre-stitching. Schematic diagram of the positional relationship between stained images.
- Figures 8a and 8b respectively show the amount of deviation and overlap between adjacent stained images obtained after scanning the stained images in the horizontal direction and the vertical direction.
- the distance between the two adjacent images obtained in the row direction that overlaps in the horizontal direction is called the overlap in the horizontal direction (overlap), and the distance that deviates in the vertical direction is called It is called the deviation in the vertical direction (offset).
- the distance in which two adjacent dyed images in the column direction overlap in the vertical direction is called the overlap in the vertical direction.
- the distance of deviation in the horizontal direction is called the offset in the horizontal direction.
- the deviation amount matrix A and the overlap amount matrix B of the plurality of stained images in the corresponding directions can be obtained.
- the spatial coordinates of each stained image can be mapped, thereby completing a pre-stitched image of multiple stained images as shown in Figure 7.
- Step 10117 Select at least one first reference image from the plurality of sub-stained images according to the characteristics of the trajectory line or trajectory point, and derive a global template based on the template information of the biological sample and the pre-stitching coordinates of the first reference image; as well as
- the selected first reference image may be the image with the most obvious trajectory line features or the image with the most trajectory points among the plurality of stained images.
- the first reference image is, for example, the highlighted image (rm-1, cn-1) in Figures 6 and 7, and then the trajectory line detection is performed on the selected image (rm-1, cn-1), And match the distance between the detected adjacent trajectory lines with the distance between the trajectory lines specified during the chip design mentioned above, and then determine the distance corresponding to the trajectory line in the selected first reference image.
- the index number That is to say, the index number corresponding to each trajectory line in the first reference image can be determined according to the distance between adjacent trajectory lines in the first reference image.
- a global template may be derived based on the index number of the first reference image and the pre-stitching coordinates of the first reference image.
- the tissue slices on the biological sample will cover the trajectory line, and some trajectory points may be revealed at the location of the tissue cavity, the probability of complete trajectory points appearing in an image is compared to that of the complete trajectory line. will be higher, so it is also preferable to select the image with the most trajectory points as the first reference image.
- the index number corresponding to each trajectory line in the first reference image is determined based on the distance between adjacent trajectory lines in the first reference image, and based on the The index number and the pre-stitching coordinates of the first reference image are used to derive a global template.
- FIG. 9 is a schematic diagram showing a global template for splicing biological samples according to one embodiment of the present invention
- FIG. 10 is a schematic diagram of the construction process of the global template for splicing biological samples according to one embodiment of the present invention.
- the global template (or global reference system) based on the first reference image (rm-1, cn-1) is obtained by performing left and right bidirectional periodic expansion in the vertical direction and up and down bidirectional periodic expansion in the vertical direction.
- the adjustment of the coordinates of the second reference image other than the selected first reference image (rm-1, cn-1) can be divided into two categories, namely, coordinate adjustment of the second reference image containing the trajectory point and Coordinate adjustment is performed for the second reference image that does not contain trajectory points.
- the coordinate adjustment for the second reference image containing the trajectory point is performed by adding the pre-stitching coordinates of each second reference image containing the trajectory point to the respective unique offset of the second reference image containing the trajectory point.
- the offset of the second reference image is a vector formed by a trajectory point on the second reference image pointing to a template point in the global template corresponding to the trajectory point on the second reference image. Referring to Figure 9, the offset is shown by an arrow in the partially enlarged schematic diagram. The offset represents the template line trajectory corresponding to the trajectory point on the global template derived from the trajectory point point on the biological sample. Vector of points.
- Step 10118 For the second reference image other than the first reference image among the plurality of sub-stained images, calculate the pre-stitching coordinates of the second reference image and the second reference image in the global template. The offset between the corresponding template coordinates, and coordinate adjustment is performed on the second reference image based on the offset to generate the spliced stained image.
- the value of the second reference image containing the trajectory point can be obtained. adjusted coordinates.
- the neighbor adjustment method includes: for each second reference image that does not contain trajectory points, adjust the coordinates of the second reference image that does not contain trajectory points according to the distance to the second reference image that does not contain trajectory points.
- the unique offset of the nearest second reference image that contains trajectory points and the deviation and overlap between the second reference image that does not contain trajectory points and the nearest second reference image that contains trajectory points for The coordinate adjustment is performed on the second reference image that does not contain trajectory points.
- a second reference image that does not contain trajectory points can be used.
- the second reference image not containing the trajectory point is aligned with the offset and overlap between the adjacent or closest adjusted second reference image containing the trajectory point.
- the measure of the nearest distance is Manhattan distance, not Euclidean distance.
- the coordinate adjustment of the second reference image also includes performing seam fusion processing between adjacent second reference images.
- a linear weighted fusion method can be used.
- Figure 11 is a schematic flow chart of a method for registering staining images and gene expression visualization images provided by embodiments of the present application, including:
- Step 1021 obtain the trajectory line in the staining image, and rotate the staining image based on the angle between the trajectory line and the horizontal direction; wherein the staining image and the gene expression visualization image include multiple trajectory lines and/or Or multiple trajectory points, the trajectory points are formed by the intersection of two of the trajectory lines, and each of the multiple trajectory lines has a corresponding index number;
- the trajectory lines in the microscope image are not necessarily in the horizontal and vertical directions. Therefore, the first trajectory line in the microscope image can be selected as the benchmark to calculate the relationship between the first trajectory line and the horizontal direction.
- the included angle of the microscope image is rotated through the above included angle and positioned in the horizontal direction.
- Figure 12 a schematic diagram of a stained image is shown. It can be seen from Figure 12 that the stained image is not located in the horizontal direction, and there is an angle between the first trajectory line and the horizontal direction. Therefore, the stained image can be rotated to the horizontal direction after calculating the angle.
- the gene expression visualization image is generated by the gene expression matrix, which appears as many discrete points, it has a weak ability to express aggregated features or edge features of biological samples.
- tissue segmentation can be performed on the gene expression visualization image to obtain the biological sample outline displayed by gene expression, and convolution enhancement processing is performed on the approximate area where the sample outline is located to enhance the edge features of the gene expression visualization image. , to facilitate subsequent registration of microscope images and gene expression visualization images.
- Step 1022 enlarge or reduce the staining image to obtain a third reference image, where the third reference image has the same proportion as the gene expression visualization image;
- the gene expression visualization image can be used as a reference image, there may be a difference in the scaling ratio between the staining image taken by the microscope and the gene expression visualization image.
- the scaling ratio of the staining image can be determined based on the distance between the staining image and the trajectory line corresponding to the index number in the gene expression visualization image. Specifically, the second trajectory line in the staining image is obtained, and the first distance is determined based on the first trajectory line and the second trajectory line of the staining image; the third trajectory line and the fourth trajectory line in the gene expression visualization image are obtained, wherein, The index number of the third trajectory line is the same as the index number of the first trajectory line, the index number of the fourth trajectory line is the same as the index number of the second trajectory line, and the second distance is determined based on the third trajectory line and the fourth trajectory line.
- the scaling ratio value between the staining image and the gene expression visualization image is determined based on the first spacing and the second spacing, and the staining image is enlarged or reduced according to the above scaling value to obtain a third reference image with the same ratio as the gene expression visualization image.
- the first trajectory line and the second trajectory line are parallel; the third trajectory line and the fourth trajectory line are parallel.
- the first distance When the first distance is determined based on the first trajectory line and the second trajectory line, it can be calculated using the trajectory points on the first trajectory line and the trajectory points on the second trajectory line.
- the two trajectory points When coordinates are used, the difference between the corresponding ordinates or the abscissas can be used as the first spacing.
- the second spacing between the third trajectory line and the fourth trajectory line can be determined based on the same principle. It should be noted that the method for calculating the scaling ratio of the staining image and the gene expression visualization image provided in the above embodiments is only an exemplary description and is not limited to the above implementation.
- Step 1023 determine the target offset based on the gene expression visualization image and the third reference image
- the target offset can be determined based on the gene expression visualization image and the third reference image. It can be seen from the above embodiment that after the original staining image is rotated to the horizontal direction, there may be a 90-degree angle difference between the staining image and the gene expression visualization image. In order to further improve the accuracy of image processing, the staining image is scaled to be consistent with the gene expression. After expressing the third reference image with the same proportion of the visual image, the third reference image can be rotated according to a preset rotation angle, and the corresponding target offset is determined at each rotation angle. The following will be explained with a specific application scenario.
- S represents the third reference image
- V represents the gene expression visualization image
- the black point represents the center of gravity of the third reference image
- the gray point represents the center of gravity of the gene expression visualization image.
- the four areas in Figure 13 represent respectively The original third reference image and the image after rotating the third reference image clockwise by 90 degrees, 180 degrees, and 270 degrees. After the third reference image is rotated, it can be aligned according to the origin coordinates of the third reference image and the origin coordinates of the gene expression visualization image, and then the target offset is determined based on the origin-aligned third reference image and the gene expression visualization image. .
- this embodiment provides an optimal implementation method, that is, first, the third reference image can be converted into the third reference image according to the center of gravity coordinates of the third reference image and the gene expression visualization image.
- the image is initially positioned to roughly the same position as the gene expression visualization image, and then the target offset is calculated based on the moved third reference image for precise positioning.
- the staining image is enlarged or reduced to obtain a fifth reference image, where the fifth reference image has the same proportion as the gene expression visualization image.
- a density centroid algorithm based on pixel gray values can be used, which is not limited in this embodiment.
- the processing process can be implemented on the temporary image of the copied stained image, that is, the stained image is not moved and registered. After the calculation is completed and the final target offset is obtained, Move the stained image in one go and register it with the gene expression visualization image.
- the target offset can be determined based on the fourth reference image and the gene expression visualization image.
- the trajectory line on the space-time chip may have multiple periods, so the microscope image and gene expression visualization image obtained based on the space-time chip may also have multiple periods, that is, the fourth reference image and the gene expression visualization image have multiple cycles.
- the number of trajectory lines and trajectory points in each sub-image is the same, and the index numbers of the trajectory lines between the sub-images correspond one to one.
- Figure 14a and 14b Figure 14a shows a third reference image with multiple cycles
- Figure 14b shows a gene expression visualization image with multiple cycles.
- FIG 14a only the sub-images of the first period and the second period are shown. It can be seen that the sub-images of each period have the same number of index lines and index points, and each index line corresponds to an index number.
- the sub-images corresponding to the first period and the second period are also shown in Figure 14b.
- the schematic diagram of the third reference image and the gene expression visualization image provided in the above embodiment is only a possible implementation manner, and does not impose any limitation on the specific form of the image. Therefore, when determining the target offset based on the fourth reference image and the gene expression visualization image, the influence of the period needs to be considered.
- the first offset may be determined based on the fourth reference image and the gene expression visualization image, where the first offset is the undetermined offset between the fourth reference image and the gene expression visualization image, and then the first offset may be determined based on the fourth reference image and the gene expression visualization image.
- An offset is the center, and a plurality of second offsets corresponding to the first offset within the preset period are determined, that is, each period within the preset period corresponds to a second offset. For any second offset, move the fourth reference image based on the second offset to obtain a sixth reference image, and then calculate the first similarity between the sixth reference image and the gene expression visualization image, thereby obtaining The first similarity corresponding to each period within the preset period.
- the above determined similarity is obtained at any rotation angle, it is necessary to re-execute the above steps at other preset rotation angles to obtain multiple first similarities corresponding to each rotation angle.
- a first maximum similarity is determined, and a sixth reference image corresponding to the first maximum similarity is determined as a third reference image. Then the second offset corresponding to the third reference image can be determined as the target offset.
- one possible implementation is to first obtain multiple sets of trajectory points, where each set of trajectory points includes a first trajectory point and a second set of trajectory points.
- the first trajectory point is located in the fourth reference image
- the second trajectory point is located in the gene expression visualization image
- the first trajectory point and the second trajectory point have the same index identifier. Since a trajectory point is formed by two intersecting trajectory lines, and each trajectory line has an index number, the index identification of the trajectory point can be composed of the index numbers of the two intersecting trajectory lines of the trajectory point.
- the fourth offset may be determined based on the coordinates of the first track point and the coordinates of the second track point, and then the first offset may be determined based on a plurality of fourth offsets. Shift amount.
- the first trajectory point and the second trajectory point obtained with the same index identification may not belong to the corresponding cycle, so the determined There may be multiple second trajectory points.
- any first trajectory point in the fourth reference image can be first selected, and the index of the first trajectory point with the same A plurality of second trajectory points identified.
- the Euclidean distance between the first trajectory point and each second trajectory point can be calculated separately. After calculating multiple Euclidean distances, obtain the Euclidean distance corresponding to the minimum Euclidean distance.
- the second trajectory point is the second trajectory point corresponding to the first trajectory point.
- the fourth offset is determined based on the coordinate difference between the second trajectory point corresponding to the minimum Euclidean distance and the first trajectory point. Since there are multiple trajectory points in the fourth reference image, that is, corresponding to multiple groups of trajectory point sets, it is necessary to traverse all the trajectory point sets, and determine the corresponding trajectory point set for each group according to the above method of determining the basic offset.
- the fourth offset of may be first excluded, and then the target offset is determined based on the remaining fourth offsets.
- the median of multiple fourth offsets can be selected as the target offset, or the average of all fourth offsets can be calculated as the target offset to maximize the accuracy of determining the offset. sex. It should be noted that this embodiment does not limit the specific manner of determining the target offset based on the fourth offset.
- Figure 15 is a schematic diagram of a preset period determined with the first offset as the center.
- the gene expression visualization image is used as the benchmark.
- the middle gray area represents the period in which the second trajectory point is located.
- the fourth reference image can be moved according to the second offset corresponding to any period to obtain a sixth reference image, and the similarity between the sixth reference image and the gene expression visualization image can be calculated.
- this embodiment provides a possible implementation method, that is, perform frequency domain transformation on the sixth reference image to obtain the first frequency domain image, and perform frequency domain transformation on the gene expression visualization image to obtain the second frequency domain image.
- the Hamming distance between the first frequency domain image and the second frequency domain image is calculated as the similarity. When the Hamming distance is smaller, it indicates that the similarity between the first frequency domain image and the second frequency domain image is greater. After determining the Hamming distances corresponding to all preset rotation angles and all preset periods, the minimum Hamming distance is used as the first maximum similarity.
- the discrete cosine transform can be used to obtain the frequency domain image, that is, the discrete cosine transform is performed on the moved third reference image to obtain the first frequency domain image, and the discrete cosine transform is performed on the gene expression visualization image to obtain the second frequency domain image, and then from The low-frequency frequency domain image is intercepted from the first frequency domain image. Based on the low-frequency frequency domain image, the pixel mean of the low-frequency frequency domain image is calculated. In the low-frequency frequency domain image, the pixel value of the pixel point with a pixel value higher than the pixel mean is set to 1.
- the fourth reference image can be initially moved and positioned according to the offset of the center of gravity of the gene expression visualization image.
- the fourth reference image is not initially positioned.
- the fourth reference image is moved according to each period within the preset period to obtain a seventh reference image corresponding to each period.
- the third barycenter coordinate of the fourth reference image can be calculated first, and the fourth reference image can be moved according to each period within the preset period with the period where the third barycenter coordinate is located as the center to obtain the seventh reference image.
- the second similarity between the seventh reference image and the gene expression visualization image is calculated, thereby obtaining the second similarity corresponding to each period within the preset period.
- the seventh reference image corresponding to the second maximum similarity is used as the third reference image, and then the target offset is determined based on the third reference image and the gene expression visualization image.
- a plurality of third offsets may be determined based on the gene expression visualization image and the third reference image, and the target offset may be determined based on the plurality of third offsets.
- the calculation principle of the third offset is the same as the calculation principle of the fourth offset in the above embodiment. That is, multiple sets of trajectory point sets are obtained, where each set of trajectory point sets includes a third trajectory point and a fourth trajectory point, the third trajectory point is located in the third reference image, the fourth trajectory point is located in the gene expression visualization image, and the third trajectory point is located in the gene expression visualization image.
- the track point has the same index identifier as the fourth track point.
- a third offset is determined based on the coordinates of the third trajectory point and the coordinates of the fourth trajectory point.
- the third offsets that exceed the preset range can be first excluded, and then selected from a plurality of third offsets that meet the preset range.
- the median is used as the target offset, or the average of multiple third offsets is calculated as the target offset to maximize the accuracy of determining the offset.
- Step 1024 Move the third reference image based on the target offset to obtain the registered image.
- a preset rotation angle corresponding to the target offset is determined, and the third reference image is moved based on the preset rotation angle and the target offset.
- the image movement in the intermediate process is a process implemented on the temporary image of the copied stained image, that is, the stained image is not moved and registered. After the calculation is completed and the final target offset is obtained, Then move the stained image all at once and register it with the gene expression visualization image.
- the dyeing image and the gene expression visualization image can be registered based on the image coordinates with pixel-level accuracy, thereby improving the accuracy of image processing and facilitating subsequent use of the registered images for research and development. analyze.
- the third reference image and the gene expression visualization image have multiple periods, since the offset corresponding to the preset period is derived from the calculated offset using the theoretical period width, errors may exist in the actual image.
- the third reference image and the gene expression visualization image can be reused to determine the corrected offset as the final offset, and the third reference image can be continued to be moved based on the determined final offset to combine the third reference image with the gene expression visualization image.
- Expression visualization images are registered to improve the accuracy of registration.
- each set of trajectory point sets includes a fifth trajectory point and a sixth trajectory point
- the fifth trajectory point is located in the third reference image.
- Image the sixth trajectory point is located in the gene expression visualization image
- the fifth trajectory point has the same index identifier as the sixth trajectory point.
- a fifth offset is determined based on the coordinates of the fifth trajectory point and the coordinates of the sixth trajectory point.
- the final offset is determined based on the plurality of fifth offsets.
- the implementation of determining the fifth offset and determining the final offset based on multiple fifth offsets may refer to the above embodiments and will not be described again here.
- the step of enlarging or reducing the staining image to obtain a third reference image it further includes: determining the similarity between the third reference image and the gene expression visualization image; The position corresponding to the maximum similarity value is used as the rough registration result. This similarity is used as coarse registration, and the method shown in Figure 11 is used as fine registration.
- Figure 16 is a schematic flow chart of a method for registering staining images and gene expression visualization images provided by embodiments of the present application, including:
- Step 1025 preprocess the stained image to obtain a candidate image set
- the staining image Before registering the staining image with the gene expression visualization image, since the staining image is an image actually taken by a microscope, it is affected by external factors and other factors, and there are certain differences from the gene expression visualization image. For example, the staining image is not in a horizontal position, so In order to facilitate subsequent image registration, the stained images can be preprocessed first.
- the first trajectory line and the second trajectory line of the dyeing image are obtained, and the first trajectory line and the second trajectory line may be randomly determined trajectory lines.
- the stained image is then rotated based on the angle between the first trajectory line and the horizontal direction, that is, the stained image is rotated to a horizontal position. and determine a first spacing between the two trajectory lines based on the first trajectory line and the second trajectory line.
- the rotated stained image is adjusted based on the ratio of the first spacing and the second spacing, and the candidate image is obtained. That is, there may be a scaling difference in the distance between the trace lines of the staining image and the gene expression visualization image.
- the staining image can be scaled to the same scale as the gene expression visualization image.
- the candidate image After obtaining the candidate image, since the candidate image is in a horizontal position at this time, but may be 90° different from the gene expression visualization image, multiple rotation angles can be determined, and the candidate image can be rotated based on each rotation angle, thus The rotated images corresponding to each rotation angle are composed into a candidate image set.
- the plurality of rotation angles may be 90°, 180°, and 270°. After rotation, any image in the candidate image set still has the same index number as the stained image.
- Step 1026 determine the binary image set corresponding to the candidate image set
- Binary image is image binarization, which is to set the gray value of each pixel on the image to 0 or 255, so that the entire image presents an obvious black and white effect, which facilitates subsequent image registration.
- the binary image set may be determined in the following manner: segment any fourth image in the candidate image set based on the tissue contour of the fourth image to obtain a tissue segmentation image.
- tissue segmentation when tissue segmentation is performed, it can be achieved based on the tissue segmentation algorithm, or it can be obtained by manually encircling the tissue outline using a tissue segmentation tool. Then the tissue segmentation image is binarized to obtain the initial binary image.
- the target binary map For any boundary among the multiple boundaries of the initial binary map, determine the boundary point closest to the boundary in the tissue outline, and determine the boundary trajectory line closest to the boundary point among the trajectory lines parallel to the boundary, and ensure the boundary trajectory The line does not pass through the tissue contour, thereby determining the target binary map based on the boundary trajectory line corresponding to each boundary.
- the target binary images corresponding to the plurality of fourth images in the candidate image set form a binary image set. That is, the target binary map is a minimum binary map including the entire biological tissue, and the boundary of the target binary map is composed of trajectory lines.
- FIG 17a is a schematic diagram of a fourth image provided by an embodiment of the present application
- a tissue segmentation image is obtained, and then the tissue segmentation image is binarized to obtain
- the initial binary map of is shown in Figure 17b.
- the minimum binary map including all tissues is determined based on the initial binary map, that is, the target binary map is shown in Figure 17c.
- Step 1027 Based on the similarity between the binary map set and the gene expression visualization image, determine the trajectory point pairs that have a corresponding relationship between the binary map set and the gene expression visualization image;
- the gene expression visualization image may have multiple periods, and the gene expression visualization image in each period is the same. That is, the index number of the gene expression visualization image may have multiple periods. Based on this, when determining the trajectory point pair, for any binary graph in the binary graph set, based on the coordinates corresponding to the vertices of the binary graph and the coordinates corresponding to the trajectory points of the gene expression visualization image, in the gene expression Multiple regions corresponding to the binary image are determined in the visual image. The multiple determined areas correspond to multiple periods one-to-one.
- the vertex of the binary graph is the trajectory point in the binary graph, and the coordinates corresponding to the vertex can be determined by the index numbers corresponding to the two trajectory lines that intersect to form the vertex.
- the similarity index between the binary image and the region is determined, so that multiple similarity indicators between the multiple binary images and the multiple regions can be determined.
- the trajectory point pairs that have a corresponding relationship between the binary map set and the gene expression visualization image are determined.
- the similarity index can represent the degree of similarity between the image corresponding to the binary image and the image corresponding to the region. The greater the similarity index, the higher the degree of similarity.
- the similarity index between the binary image and the region it can be achieved by determining the binary image matrix corresponding to the binary image. Since the gray value of the pixel point of the binary image can only be 0 or 255, optionally, you can set the elements of the binary image matrix of the pixels with a gray value of 0 to 0, and set the elements of the binary image matrix of the pixels with a gray value of 255 to 1, also That is, a binary graph is a matrix composed of 0s and 1s.
- the gene expression visualization image is a gene expression visualization image
- the gene expression matrix corresponding to the gene expression visualization image can be determined, and each pixel of the gene expression visualization image corresponds to a gene expression amount in the gene expression matrix.
- the binary image matrix and the gene expression matrix corresponding to the region are then used to determine the similarity index. For example, you can do a dot multiplication of the binary graph matrix and the gene expression matrix, that is, multiply the binary graph matrix by the elements at the corresponding positions in the gene expression matrix, and then sum all the elements in the matrix obtained by the dot multiplication to obtain a similar degree indicator.
- the corresponding trajectory point pairs can be determined based on the similarity index between the binary map set and multiple areas of the gene expression visualization image.
- the stained image can be obtained by processing the first original image using a trajectory line positioning algorithm, or can be obtained by scaling the first original image according to a preset ratio and then processing it using a trajectory line positioning algorithm. of.
- the following will introduce the methods of determining trajectory point pairs based on multiple similarity indicators for the above two methods of obtaining staining images and gene expression visualization images.
- the trajectory line positioning algorithm When using the trajectory line positioning algorithm to process the first original image and the second original image to obtain staining images and gene expression visualization images, multiple similarities between multiple binary images and multiple regions in the binary image set are obtained. After the degree index, the maximum value among multiple similarity indicators can be obtained, the binary image corresponding to the maximum value is determined to be the first target image, and the area corresponding to the maximum value is determined to be the first target area. Then, the first vertex in the first target image and the first index point in the first target area that have the same coordinates as the first vertex can be obtained, and the first vertex and the first index point can be determined to be a track point pair with a corresponding relationship. The first vertex can be any vertex in the first target image.
- the trajectory line positioning algorithm is used to process the scaled first original image and the scaled second original image to obtain the staining image and the gene expression visualization image.
- the sorting results of the multiple similarity indicators can be determined, and a preset number of similarities can be obtained based on the sorting results. degree index, and determine multiple binary images corresponding to a preset number of similarity indicators and multiple corresponding regions. For example, a preset number of similarity indicators with the largest values can be selected.
- the embodiment of the present application does not limit the specific value of the preset number, which can be determined in combination with actual application scenarios.
- the image before scaling of the binary image corresponding to a preset number of similarity indicators can be obtained. That is, after determining multiple binary images corresponding to the preset number of similarity indicators, the multiple binary images are enlarged according to the reciprocal of the preset scaling ratio to determine multiple second target images, that is, before scaling. image. Then, multiple candidate similarity indicators are determined based on the binary image matrices corresponding to the multiple second target images and the gene expression matrices corresponding to the multiple regions. Obtain the maximum value among multiple candidate similarity indicators, and determine that the binary image corresponding to the maximum value is the third target image, and the area corresponding to the maximum value is the third target area.
- the second vertex can be any vertex in the third target image.
- Step 1028 determine offset information based on the trajectory point pair
- the coordinates corresponding to the two trajectory points of the rule point pair can be obtained, and the difference between the abscissa and the ordinate is determined as the offset information, that is, the offset.
- Step 1029 Process a target image based on the offset information to obtain a registered image, where the target image is an image in the candidate image set corresponding to the track point pair.
- the target image can be moved based on the offset information. That is, the image registration can be achieved by matching the trajectory points to the image corresponding to the trajectory point in the candidate image set.
- the image processing and movement in the intermediate process are all processes implemented on the temporary image of the copied stained image, that is, the stained image is not moved and registered. After the calculation is completed, the final offset information is obtained. , based on the rotation direction and offset information of the target image, the stained image can be moved and aligned with the gene expression visualization image.
- image processing at pixel level precision can be achieved without manual image registration, thereby improving the accuracy of image processing.
- the method further includes: Step 105 of performing tissue segmentation on the registered image to obtain a tissue mask map.
- Figure 18 is a schematic flowchart of a method for tissue segmentation on registered images provided by an embodiment of the present application, including:
- Step 1051 Obtain the gene expression level of the target tissue to be segmented in the registered image and determine the gene expression matrix of the registered image.
- the gene expression matrix evaluates the gene expression level according to the pixel position. arrangement;
- the target tissue may include, but is not limited to, any one or more of sample tissue, biological tissue, muscle tissue, bone tissue, and cell tissue.
- the gene expression matrix represents the expression of genes at different positions (corresponding to the row and column positions of the gene expression matrix).
- Each piece of gene expression data includes gene identifier, gene coordinates and gene expression level, which represents the expression level of the gene at a location.
- the gene expression level of the cell tissue can be determined by transcribing the DNA of the cell tissue.
- gene expression quantities are usually in UTF-8 format.
- the gene expression amount is obtained at each pixel position in the sample image, and the gene expression amount is arranged according to the row coordinates and column coordinates of the pixel position to obtain the gene expression matrix.
- the gene expression matrix is consistent with the size of the sample image. When the gene expression amount at each pixel position is 0, it means that there is no gene of the target tissue at that pixel position.
- the gene expression level at each pixel position in the gene expression matrix can represent the gene expression level of one or more genes. If the sizes of the gene expression matrix and the sample image are inconsistent, both images or one of the images can be scaled.
- Step 1052 determine the image data by assigning the gene expression amount at each pixel position in the gene expression matrix to the corresponding pixel position in the registered image;
- the gene expression amount at each pixel position in the gene expression matrix is assigned to the corresponding pixel position in the image matrix, and all pixel positions are normalized to obtain image data of the sample image.
- the gene expression amount at each pixel position in the gene expression matrix is stored in the dictionary with the row coordinates and column coordinates of each pixel position as keys and the gene expression amount as the value.
- the amount is the same as the gene expression amount at the same pixel position in the gene expression matrix.
- the assigned image matrix is normalized so that the pixel value of each pixel position is within the [0,255] interval, thereby obtaining more accurate image data relative to the sample image and reducing the impact on subsequent tissue segmentation images.
- the image data is shown in Figure 20.
- the format of the image data is preferably TIFF format, or it can also be JPG format, etc. It is not limited to a specific form of expression and can be selected according to the actual situation.
- a gene expression matrix is generated by obtaining the gene expression amount that determines the position of each pixel, and converting the gene expression matrix into image data, thereby reducing the process of repeated shooting and correction of tissue images through the original microscope, and improving segmentation efficiency, and makes the image data display the target tissue more accurately than the initial sample image, and the segmentation effect of the target tissue is better.
- Step 1053 Determine the foreground pixels of the image data by performing image processing on the image data
- the tissue segmentation method further includes: referring to Figure 21, convolving the image data to extract low-frequency features of the image data.
- the convolution method is preferably 2d convolution. Convolution methods such as atrous convolution and depth-separable convolution can also be used to improve the calculation virtuality and expand the perceptual field of view.
- the image data after convolution is shown in Figure 22.
- the foreground pixels of the image data are determined by image processing on the convolved image data.
- Step 1054 Mark the connected areas of the image data according to the foreground pixel points to obtain the tissue mask map.
- the connected area refers to an image area composed of foreground pixels with the same pixel value and adjacent positions in the image data, that is, the segmentation area of the target tissue.
- Figure 23 is a schematic flow chart of a method for calculating and describing the grayscale image quality corresponding to the tissue mask map provided by an embodiment of the present application. include:
- Step 1061 Calculate the outer contour image and inner contour image of the grayscale image corresponding to the tissue mask image respectively;
- the outer contour image and the inner contour image of the target area tissue grayscale image can be obtained respectively based on matrix operations.
- the outer contour image and the inner contour image are strip-shaped annular contours.
- the inner contour image can be enclosed.
- Step 1062 Divide the outer contour image and the inner contour image into N segments respectively, and pair the outer contour image of each segment with the inner contour image of each segment in pairs to obtain N image combinations, each The image combination includes an outer contour image and an inner contour image;
- Figure 24 is a schematic structural diagram of the relationship between the outer contour image and the inner contour image provided by an embodiment of the present disclosure.
- Figure 25 is a schematic diagram of the relationship between the outer contour image and the inner contour image provided by an embodiment of the present disclosure.
- Step 1063 Calculate the pixel density ratio of an outer contour image and an inner contour image in each image combination, and obtain N pixel density ratios.
- the pixel density ratio is the outer contour image of a segment in each image combination.
- Calculating the pixel ratio of the outer contour image of a segment includes using the outer contour image of the segment.
- the number of pixels within the segment is divided by the total number of pixels within the segment's outer contour image.
- the pixels are pixels with a grayscale value greater than 127.
- the ratio is the pixel density ratio. Assuming that an inner contour image exists in an image combination, that is, the two are paired with each other, and the ratio of the pixel ratio of an outer contour image to the pixel ratio of an inner contour image in all image combinations is calculated, and finally N is obtained pixel density ratio.
- Step 1064 Calculate and describe the grayscale image quality corresponding to the tissue mask image according to the pixel density ratio.
- the calculation and description of the grayscale image quality of the target area tissue based on the pixel density ratio includes but is not limited to the following implementation methods, for example: substituting the average value of the pixel density ratio into a preset function to calculate the description of the target area tissue.
- the preset function can be a linear function or a nonlinear function.
- the average value of the effective pixel density ratio is x.
- x is greater than 0 and less than 200, it can be substituted into the formula (1)
- the formula (1) is as follows:
- Figure 26 is a schematic flowchart of a method for cell segmentation on registered images provided by an embodiment of the present application, including:
- Step 1031 input the registered image into the image segmentation model, and obtain the segmentation results of each pixel in the registered image.
- the segmentation result includes pixels belonging to cells and pixels belonging to cell outlines. Points or pixels of the image background.
- the initial segmentation result of points is to determine whether each pixel in the registered image belongs to a cell pixel, a cell outline pixel, or an image background pixel.
- the registered image can be expanded to a three-channel (such as RGB three-channel) image, input the image segmentation model, and obtain the initial segmentation result of each pixel in each channel image, that is, each channel image
- the pixels belong to the target object, the outline of the target object, or the image background, and then the initial segmentation results of each pixel point in each channel image are combined to determine the initial segmentation result of each pixel point in the registered image.
- Step 1032 Determine the pixels belonging to cells based on the pixels that the segmentation result belongs to cells or the pixels of cell outlines, and output the segmentation results of the registered image to obtain the cell mask map.
- Fusion of pixels belonging to cells or cell outlines is used to achieve cell segmentation, that is, pixels of cell objects or cell outlines are determined as pixels belonging to cells, image segmentation is performed, and the segmentation results of the registered image are output.
- the watershed algorithm can also be used to filter the target objects whose area is smaller than the threshold in the segmentation result of the registered image, and/or to repair the incomplete target objects.
- the target object By filtering target objects with an area smaller than the threshold and/or repairing incomplete target objects, the target object is corrected, the post-processing of the segmentation results of the registered image is completed, and the accuracy of image segmentation is improved.
- the target object is cells
- algorithms such as cell filtering and correction are used to filter very small cells and correct incomplete cells to make cell segmentation more accurate.
- the image segmentation model used in the embodiments of this application adopts a pyramid squeeze attention module in the encoder module, which improves the feature extraction capability of the encoder module and enables the image segmentation model to pay more attention to target objects with salient features, thereby improving improve the segmentation accuracy of the image segmentation model.
- the embodiment of the present application is applied to cell segmentation in spatiotemporal omics, as shown in Figure 27, which demonstrates the segmentation effect of the image segmentation model of the embodiment of the present application on mouse brain images.
- a part of the mouse brain image above has been intercepted for display.
- the lower right image can be achieved using the image segmentation model proposed in the embodiment of this application. Separate independent cells from adherent cells and provide more reliable boundaries.
- Figure 28 is a schematic flow chart of a method for cell segmentation on registered images provided by an embodiment of the present application, including:
- Step 1033 preprocess the gene expression visualization image to obtain a preprocessed image
- the gene expression visualization image is a scatter plot, which is not convenient for cell segmentation, preprocessing is required to process the gene expression visualization image of cells to obtain a preprocessed image with enhanced boundary effects.
- Step 1034 Binarize the preprocessed image to obtain an initial mask image
- the Otsu method can be used to binarize the preprocessed image to obtain the initial mask image.
- Step 1035 According to the initial mask map, use the watershed algorithm based on distance transformation to segment the connected domain with cell adhesion to obtain the segmented cell mask map.
- the Watershed Algorithm considers image segmentation based on the composition of the watershed.
- the Watershed Algorithm considers image segmentation based on the composition of the watershed.
- this embodiment provides a specific method as shown in Figure 29, which method includes:
- Step 201 Obtain a gene expression matrix containing spatial positions.
- Gene expression data may include gene identifiers, coordinate positions of multiple genes, and total gene expression amounts at corresponding coordinate positions.
- Step 202 Generate a visualization image of gene expression 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; and then obtaining the coordinate position of the expressed gene and the total gene expression amount at the corresponding coordinate position.
- the amount is generated to generate a gene expression visualization image, where the gene expression visualization image is a grayscale image, and the grayscale value of a pixel in the gene expression visualization image is the total gene expression amount corresponding to the coordinate position of the pixel.
- a gene expression matrix containing spatial positions is input, and an expression image is generated based on the coordinate position of the expressed gene and the total gene expression amount at the corresponding position.
- the specific form of the image is a grayscale image, and the grayscale of the coordinate points is The degree value is the total amount of gene expression at this coordinate.
- step 202 may specifically include: drawing a gene expression visualization image of the cell according to the gene expression matrix and the segmented mask map, wherein the spatial position in the gene expression matrix is consistent with the segmented mask map. corresponding to the spatial position.
- a cell-based expression map is drawn based on a gene expression matrix and a segmented mask map, and the spatial position in the gene expression matrix can correspond to the spatial position in the segmented mask map.
- step 203 Since the generated gene expression visualization image is a scatter plot, which is not easy to segment, it needs to be processed. Specifically, the process shown in step 203 can be performed.
- Step 203 Preprocess the gene expression visualization image to obtain a median map, and sharpen the median map to obtain a sharpened map.
- the visualized gene expression image is a scatter plot, which is inconvenient for cell segmentation, preprocessing is required.
- the visualized gene expression image of the cell is first processed into a median plot. Then the Laplacian operator (laplacian operator) can be used to sharpen the median image to enhance the boundary effect of the median image, thereby obtaining a sharpened image.
- preprocess the gene expression visualization image to obtain the median map may include: first using a convolution kernel of preset size (such as 13*13) to perform a convolution operation on the gene expression visualization image to visualize the gene expression.
- the scattered points in the image are adhered to obtain the first convolution map; then the local maximum point of the first convolution map is detected based on the two-dimensional grayscale peak value of the image; the p-th percentile of the local maximum point is obtained, where, p is a preset value, for example, the p-th percentile can be the 98% percentile value, or the 99% percentile value, etc.; if the p-th percentile is within the preset range, the first median filter is used Perform median filtering on the first convolution map to obtain a median map, where the filter size of the first median filter is determined based on the preset size.
- a convolution kernel of preset size such as 13*13
- the method in this embodiment may also include: if the p-th percentile is outside the preset range, based on the p-th percentile and the preset size to determine the new size of the convolution kernel; use the convolution kernel of the new size to perform a convolution operation on the gene expression visualization image, so that the scattered points in the gene expression visualization image are adhered to obtain the second convolution map; use the second The median filter performs median filtering on the second convolution map to obtain a median map, where the filter size of the second median filter is determined based on the new size.
- Kernel reprocess the original image to obtain the second convolution map; if the R value is within the allowed range, the first convolution map will be used.
- the convolution image is in the form of stacked squares of different grayscales.
- the grayscale span is relatively sharp, and some expression images have holes in the center of clusters.
- the numerical value (decimals are rounded down) is the filter size (if K needs to be calculated, the kernel size here is K*2.7). Perform median filtering on the second convolution map to obtain the median map.
- the median filter used above is relatively large, and the gray-scale boundary of the median image may be blurred.
- Step 204 Binarize the sharpened image to obtain an initial mask image.
- Step 205 Filter the connected domains in the initial mask map whose areas do not meet the preset conditions to obtain the filtered mask map.
- step 205 may specifically include: filtering connected domains with an area greater than a first preset threshold or a connected domain with an area smaller than a second preset threshold in the initial mask map to obtain a filtered mask map, where: A preset threshold is greater than the second preset threshold.
- a preset threshold is greater than the second preset threshold.
- an empirical threshold is used to filter connected domains that are too small or too large in the initial mask to obtain a filtered mask map.
- Step 206 Traverse each connected domain in the filtered mask map, 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 map.
- step 206 may specifically include: setting the gray value of the pixels within each connected domain in the filter mask map to the first value, and setting the gray value of the pixels outside each connected domain to The second value; for each target pixel whose gray value is the first value in the connected domain, remap the gray value of the target pixel to the nearest pixel whose gray value is the second value.
- distance obtain the distance map of the connected domain; perform binarization processing on the distance map of the connected domain, and obtain the preset number of pixels in the connected domain that are farthest from the pixels whose gray value is the second value; convert the preset The number of pixels is used as the water injection point of the watershed algorithm.
- the watershed function is used to perform watershed segmentation on the original mask of the connected domain in the filter mask map to obtain the segmented target connected domain and cover the target connected domain to the filtered mask map. Get the segmented mask image.
- each connected domain in the filter mask map For example, traverse each connected domain in the filter mask map, 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 extracted connected domain area, the gray value of the point within the target connected domain is set to 1, and the gray value of the point outside the connected domain is set to 0 (including the background and non-target connected domain). For each value: Distance transformation is performed on the point of 1, and its gray value is remapped to the distance from the point to the point with the nearest value of 0 (the distance between adjacent points is 1), and the distance map of the connected domain is obtained.
- Step b Use an empirical threshold to binarize the distance map and obtain the points furthest from the point with a distance value of 0 in the connected domain (the number of each is variable due to different conditions in each connected domain).
- Step c Use the several points obtained in the previous step as watershed points for 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 overwrite the result to the filter mask. Mockup.
- Step d Perform the above steps for each connected domain traversed to obtain the segmented mask map.
- Step 207 Perform a closure operation on the segmented mask image to obtain a mask image of the cell segmentation result.
- the final mask image can be output and saved for subsequent biological analysis at the cell level in combination with the original expression matrix.
- the gene expression matrix can be input, and a gene expression visualization image can be generated based on the matrix, as shown in Figure 31.
- a 13*13 convolution kernel is used to perform a convolution operation on the gene expression visualization image, so that the scattered points in the gene expression visualization image are adhered to obtain the first convolution image.
- judgment needs to be made through a threshold that is, the local maximum point of the first convolution map is detected based on the two-dimensional grayscale peak value of the image, and the 99% quantile value R of all the obtained local maximum points is taken out.
- the R value is related to a set value.
- the 13*13 convolution kernel processes the original image to obtain the second convolution image, uses this ratio to calculate the median filter size, and then uses the median filter of this size to process the second convolution image to obtain the median image. If the R value is within the allowed range, the first convolution map is used, and a median filter of size 35 is used to process the first convolution map to obtain the median map.
- this embodiment provides a solution for cell segmentation directly based on gene expression visualization images, which uses a combination of multiple image processing methods to provide more reliable cell segmentation results.
- Cell segmentation does not rely on image images, and does not require the introduction of additional technology for registering image images with gene expression visualization images. This eliminates the introduction of additional errors, saves overall operating time and technical costs, and improves the efficiency and efficiency of cell segmentation processing. accuracy.
- Figure 35 is a schematic flow chart of a method for cell segmentation on registered images provided by an embodiment of the present application, including:
- Step 1036 Determine the labeled area and cell area corresponding to each tissue type of the target object based on the stained image
- the tissue information provided by the staining map and the prior knowledge related to the target object can be combined to determine the labeled areas corresponding to each tissue type contained in the target object based on the staining map.
- the prior knowledge related to the target object can be which cell tissues the target object contains, or the cell morphology of these tissues.
- the tissue outline of each cell tissue of the target object can be drawn with a specific manual tool, and the areas corresponding to different tissues can be marked with different colors.
- the specific manual tool can be the open source tool 3Dslicer, which supports manual annotation, and can also be combined with the open source tool plant-seg network to annotate tissue areas.
- the cell area in this step may be a reference cell area preset for the tissue type of the target object. That is to say, the cell area of each tissue type is set in advance.
- the set cell area can be set based on experience, or can be set based on the average value of tissue cells of the same type in different subjects. Therefore, when this step is performed, the preset cell area can be directly obtained and used as the cell area corresponding to the marked area, and then subsequent processing can be performed.
- Step 1037 Determine the area of the sub-region to be processed included in each marked area based on the area of the cell.
- the area of the sub-region to be processed is positively related to the area of the cell.
- the sub-region to be processed is used to characterize the corresponding The minimum processing unit of the marked area;
- the sub-region to be processed corresponding to the marked area can be used as the minimum processing unit of the marked area for processing and analyzing tissue cells.
- a sub-region to be processed is regarded as a unit.
- the positional relationship between the sub-regions to be processed is used to characterize the positional relationship between cells in the annotated area. Because the area of the sub-region to be processed is positively correlated with the cell area, that is to say, the larger the cell area of the annotated area determined in the previous step, the larger the sub-region to be processed that is divided from the annotated area. Therefore, the positional relationship between cells in the annotated domain corresponding to different tissue types can be better expressed.
- Step 1038 Grid the corresponding marked area according to the area of each sub-area to be processed, and obtain the grid coordinates corresponding to each marked area;
- an optional way to perform grid processing on the marked area may be to divide each marked area into grids with an area equal to the area of the corresponding sub-area to be processed, and obtain the grid coordinates.
- the coordinates of the center point of the grid can also be used as the grid coordinates of the grid.
- the coordinates of the grid center point can be calculated by obtaining the coordinate interval where the grid is located from the coordinates established by the capture unit.
- the coordinates of the center point are determined as the coordinates of the center point of the grid.
- Step 1039 Extract the data corresponding to the grid coordinates from the gene expression visualization image and superimpose it onto the grid coordinates to obtain the cell processing results of the target object.
- the data corresponding to each grid coordinate is extracted from the gene expression data to obtain the tissue cell processing data of the target object, which includes the expression levels of different genes of the target object in the cell tissues of each tissue type, and is further combined with the corresponding Grid coordinates to generate the tissue cell processing results of the target object.
- the gene expression data includes gene identifier ID, gene coordinate data x, y, and gene expression amount MIDCount. Since the grid coordinates have been determined at this time, the coordinate range of each grid can be determined through the grid coordinates. Then compare the gene coordinate data x, y of each data with the coordinate range of each grid. If the gene coordinate data x, y falls within the coordinate range of which grid, it means that the data will be superimposed on this grid. , at this time, the corresponding grid ID, that is, Cell ID, can be set for the data in the expression data. When the data is superimposed later, according to the added Cell ID, it can be clear which grid each data falls in. , that is, the center point coordinates of which grid the data needs to be superimposed on.
- Figure 36 is a schematic flowchart of a method for determining the cells to which background gene molecules of unknown cells in a gene expression visualization image belong, provided by embodiments of the present application, including:
- Step 1041 based on the cell mask map, determine each gene expression feature of the gene expression visualization image as a cell gene expression feature located within the cell and a background gene expression feature located outside the cell;
- each gene expression feature of the gene image is determined as a cell gene expression feature located within the cell and a background gene expression feature located outside the cell.
- the gene expression feature is DNB, as shown in Figure 37.
- Figure 37 is a schematic diagram of the corresponding relationship between DNB and cell membrane, where x and y are DNB coordinates respectively, geneID and MIDCount respectively represent gene information, and label represents cells. logo.
- each DNB of the Stereo-seq spatial transcriptome data is obtained to obtain the cell information to which the DNB belongs, and the remaining DNBs that are not within the cell are used as background DNBs.
- Step 1042 For each cell gene expression feature, fit a probability distribution model based on the spatial position and the signal value of the gene expression feature;
- a probability distribution model is fitted based on the spatial position and the signal value of the gene expression characteristics.
- the probability distribution model can be a Gaussian mixture model, but different probability distribution models can be used, and in determining the cells to which the background signal belongs, the Bayesian model can be used to determine the cells to which it belongs. Corresponding selection and adjustment can be made according to actual needs.
- a Gaussian mixture model is fitted through the coordinates (x, y) and the DNB signal value.
- Step 1043 based on the probability distribution model, determine the probability value that the target background gene expression feature located within the preset range of a target cell belongs to the target cell;
- the probability value that the target background gene expression feature located within a preset range of a target cell belongs to the cell is determined.
- the target cells may be all cells contained in the biological sample, or may be some cells contained in the biological sample.
- the target cell is cell a as an example.
- the Gaussian mixture model is used to calculate the background DNB within the central range of 50x50 pixels of cell a that belongs to cell a. probability value.
- Step 1044 Output the correction result according to the probability value to correct the background gene expression characteristics.
- this step it is determined whether the probability value is greater than or equal to the preset probability value. If so, the target background gene expression characteristics are used as the cell gene expression characteristics located in the target cell to correct the background gene expression characteristics. , the target background gene expression features continue to be used as background gene expression features.
- Figure 32 is a schematic diagram of the correction result of correcting background DNB.
- background DNB those smaller than the preset probability value are regarded as background DNBs, and those greater than or equal to the preset probability value are regarded as DNBs of cells.
- the preset probability value is not specifically limited, and can be selected and adjusted accordingly according to actual needs.
- a probability value belonging to each corresponding target cell is determined respectively; from the determined at least two probability values The highest probability value is selected as the probability value of the output correction result, and the target cell corresponding to the highest probability value is used as the cell to which the target background gene expression feature belongs.
- the background gene expression feature A is within the central range of 50x50 pixels of cell a and cell b at the same time, calculate the probability value that the background gene expression feature A belongs to cell a as x1, The probability value that background gene expression feature A belongs to cell b is x2. If x1 is greater than x2, then the background gene expression feature A is determined to be the gene expression feature of cell a.
- Figure 39 is a schematic flow chart of a method for determining the cells to which background gene molecules of unknown cells in a gene expression visualization image belong, provided by embodiments of the present application, including:
- Step 1045 Determine the initial gene molecules belonging to the target cell and the background gene molecules of the unknown cell according to the gene expression visualization image
- Step 1046 obtain the coordinate information of the initial gene molecule
- Step 1047 determine the center point coordinates of the target cell based on the coordinate information
- Step 1048 Construct a Voronoi diagram based on the center point coordinates and the coordinate information
- Voronoi diagram (Voronoi diagram, also called Thiessen polygon or Dirichlet diagram) is composed of a set of continuous polygons composed of perpendicular bisectors of straight lines connecting two adjacent points. N points that are different on the plane divide the plane according to the nearest neighbor principle; each point is associated with its nearest neighbor area.
- Step 1049 Determine the cells to which the background gene molecules within the Voronoi diagram range belong.
- the background gene molecules within the Voronoi diagram range can be determined to belong entirely to the target cell, to partially belong to the target cell, or to not belong to the target cell at all.
- the coordinate information of the initial gene molecule belonging to the target cell is used to determine the center point coordinates of the target cell, and then a Voronoi diagram is constructed based on the center point coordinates of the target cell to determine the background gene molecules within the Voronoi diagram range.
- the cells to which it belongs improves the correction efficiency and also improves the accuracy of the correction.
- this embodiment only needs to be able to determine the initial gene molecules in the target cells, without knowing the outline map of the target cells. Therefore, it reduces the requirement for high-precision cell segmentation, reduces the dependence on the target cell morphological image map, and improves the the robustness of the correction scheme.
- the step of determining the initial gene molecules belonging to the target cell and the background gene molecules of the unknown cell based on the gene image includes:
- the initial gene molecules belonging to the target cell and the background gene molecules of the unknown cell are determined.
- the step of determining the coordinates of the center point of the target cell based on the coordinate information includes:
- the first ratio is determined as the abscissa value of the center point coordinate; the first ratio is the ratio of the sum of the abscissa values of the initial gene molecules to the number of the molecules;
- the second ratio is determined as the ordinate value of the center point coordinate; the second ratio is the ratio of the sum of the ordinate values of the initial gene molecules to the number of the molecules.
- the step of determining the coordinates of the center point of the target cell based on the coordinate information includes:
- the third ratio is determined as the abscissa value of the center point coordinate; the third ratio is one-half of the difference between the largest abscissa value and the smallest abscissa value;
- the fourth ratio is determined as the ordinate value of the center point coordinate; the fourth ratio is half of the difference between the largest ordinate value and the smallest ordinate value.
- the genetic image data correction method further includes:
- the background gene molecules are within different Voronoi diagram ranges, then input the background gene molecules into a Gaussian mixture model to determine the probability score that the background gene molecules belong to the target cells within the preset distance range;
- the background gene molecules are corrected to gene molecules belonging to the target cells with a high probability score.
- the step of determining the cell to which the background gene molecule within the Voronoi diagram range belongs includes:
- Gene expression information of the target cell is generated based on the corrected result of the gene molecules belonging to the target cell.
- the step of constructing a Voronoi diagram based on the center point coordinates and the coordinate information includes:
- Figure 40 is a schematic flowchart of a method for determining the cells to which background gene molecules of unknown cells in a gene expression visualization image belong, provided by embodiments of the present application, including:
- Step 10410 determine the initial number of molecules of the gene molecules belonging to the target cell in the gene expression visualization image and the initial outline area of the target area occupied by the gene molecules belonging to the target cell;
- the convex hull algorithm is used to calculate the cell segmentation results to determine the initial outline area of the target area occupied by the gene molecules belonging to the target cells.
- the convex hull algorithm (Convex Hull Algorithm) searches for the convex hull of N points in the target area based on the cell segmentation results. The connection between these N points surrounds the initial contour area.
- Step 10411 determine the gene molecule density of the target cell based on the number of molecules and the initial contour area
- the ratio of the number of molecules and the initial contour area is determined as the gene molecule density of the target cell.
- Step 10412 determine the number of background gene molecules within the preset region of the target region and the area of the preset region;
- the background gene molecules are gene molecules whose cell cannot be determined based on the gene image.
- the preset area range is outside the target area, but cannot exceed the area occupied by the gene molecules belonging to neighboring cells.
- the optional area area is 5 pixels * 5 pixels as the default area range.
- the preset area range may be an area determined based on the center point of the target cell.
- the center point of the target cell is determined by the gene image. See Figure 41 for a schematic diagram of the center point of the target cell.
- Step 10413 determine the density of background gene molecules based on the number of molecules and area of the background gene molecules;
- the ratio of the number of background gene molecules to the area is determined as the background gene molecule density.
- Step 10414 Determine the cell to which the background gene molecule belongs based on the gene molecule density and the background gene molecule density.
- the above cell characteristics are used to determine the gene molecule density of the target cell based on the initial number of molecules of the gene molecules belonging to the target cell in the gene image and the initial outline area of the target cell. Compare the gene molecule density of the target cell and the background gene molecule density, and determine the cell to which the background gene molecule belongs based on the gene molecule density and the background gene molecule density, which greatly improves the efficiency of correcting the gene molecules in the target cell and also increases the number of correction targets. The precision of genetic molecules within cells.
- Figure 42 is a schematic flow chart of a method for determining the cells to which background gene molecules of unknown cells in a gene expression visualization image belong, provided by embodiments of the present application, including:
- Step 10415 determine the target area occupied by the gene molecules belonging to the target cells in the gene expression visualization image
- Step 10416 determine the spatial coordinates and gene expression characteristic signal values of the background gene molecules of the unknown cells within the preset correction range of the target area;
- the gene expression feature in this embodiment is DNB.
- the cell information to which the DNB belongs can be obtained, and the remaining DNBs that are not within the cell are used as background DNBs.
- the spatial coordinates of the background gene molecules can be expressed by the coordinates of the background DNB.
- Step 10417 input the spatial coordinates and the gene expression characteristic signal value into a probability distribution model to obtain the probability score that the background gene molecule belongs to the target cell; the probability distribution model is based on the gene to which the target cell belongs.
- the spatial coordinates of the molecular sample and the gene expression characteristic signal values are obtained by fitting;
- GMM model When fitting the GMM model (Gaussian mixture model), there are three independent variables: spatial coordinates (x, y) and signal values.
- the dependent variable, the output, is the probability score of each gene molecule belonging to the target cell.
- the specific implementation process is: introducing Gaussian Mixture (Gaussian Mixture) in the Scikit-learn (a machine learning library) library, using the input data to automatically fit the parameter information of the GMM model to obtain the final probability model.
- Gaussian Mixture Gaussian Mixture
- Scikit-learn a machine learning library
- the probability distribution model is fitted based on the spatial coordinates of the gene molecule samples belonging to the target cells and the gene expression characteristic signal value samples.
- the probability distribution model may be a Gaussian mixture model.
- Step 10418 Determine the cell to which the background gene molecule belongs based on the probability score.
- the background gene molecules are corrected to gene molecules belonging to the target cell. If the probability score is less than the probability threshold, the background gene molecules are still background molecules of unknown cells.
- the third quartile between the first probability score and the second probability score is determined as the probability threshold.
- the first probability score is the probability score with the highest value among the probability scores; the second probability score is the probability score with the lowest value among the probability scores.
- the probability score of the background gene molecule of the unknown cell belonging to the target cell within the preset correction range is calculated, and the belonging of the background gene molecule is determined based on the probability score. cell. It reduces the large errors in genetic image data caused by the diffusion of gene molecules and improves the correction efficiency. At the same time, it does not rely on high-precision cell segmentation results, which enhances the robustness of the correction scheme.
- this application also provides detection of track crosses on the chip, mainly for subsequent splicing correction and registration. Both splicing and registration use track detection results.
- Figure 43 shows a flowchart of a method 100 for determining point coordinates in a stained image according to one embodiment of the present invention.
- the method 100 may include a sampling step 1001, a grouping step 1002, a straight line fitting step 1003 and a coordinate calculation step 1004.
- FIG. 44 shows an example stained image to which the present invention is applicable.
- the stained image can be acquired by a camera, a stained image sensor, etc.
- the stained image may be, for example, a stained image of a mechanical structure, a carrier, a slide or a biochip with straight trace lines. As shown in FIG.
- the stained image plane in which the stained image is located may include a first direction X and a second direction Y perpendicular to the first direction
- a straight trajectory line ie, a plurality of dark lines in the stained image that is generally parallel to the first direction X
- a plurality of second straight trajectory lines transverse to the first direction Multiple dark lines parallel to the second direction Y.
- there are 6 first straight trajectory lines and 8 second straight trajectory lines in this example stained image. Since every first straight trajectory line intersects every second straight trajectory line, there are a total of 6 ⁇ 8 48 intersection points in this example stained image.
- the stained image may have a pixel length L and a pixel width W.
- An example second sampling strip is also shown in Figure 38.
- the pixel length of the sampling bar is the same as the pixel length of the example dyeing image, which is L, and the pixel width of the sampling bar is smaller than the pixel width of the example dyeing image, which is W2.
- a straight trajectory line transverse to any direction means that the straight trajectory line is parallel to a direction perpendicular to the any direction or the angle between the straight trajectory line and a direction perpendicular to the any direction is less than a preset value.
- the range of the preset value may include 1 to 10 degrees, 10 to 20 degrees, 20 to 30 degrees, 30 to 40 degrees or 40 to 50 degrees, etc.
- the preset value may be 1 degree, 2 degrees, 3 Degrees, 4 degrees, 5 degrees, 6 degrees, 7 degrees, 8 degrees, 9 degrees, 10 degrees.
- the sampling step 1001 includes a first direction sampling step and a second direction sampling step.
- a first sampling strip is used to perform first direction equally spaced sampling on the stained image along the first direction to determine a first candidate point set, wherein for each first direction equal spaced sampling, Perform the following first direction sampling sub-step one and first direction sampling sub-step two.
- the first direction sampling sub-step includes: accumulating pixel values in the first direction for the pixels in the sampling area of the stained image selected by the first sampling strip during the equal-spaced sampling period in the first direction. and to obtain a series of first pixel value sums, wherein the series of first pixel value sums at any second direction position in the second direction are equal to the values in the sampling area at the second The sum of pixel values of each pixel aligned along the first direction at the direction position.
- the second step of the first direction sampling sub-step includes: determining the extreme points of the series of first pixel value sums, and for each determined extreme point: determining a corresponding first value obtained by equal intervals sampling in the first direction. candidate point, the coordinate of the corresponding first candidate point in the second direction is the coordinate of the second direction position corresponding to the extreme point in the second direction, the corresponding first candidate point is in the second direction
- the coordinates in one direction are determined based on the position of the first sampling strip in the first direction during the equally spaced sampling period in the first direction. In this way, the first candidate points obtained by sampling at equal intervals in each first direction form the first candidate point set.
- a second sampling strip is used to perform second direction equally spaced sampling on the stained image along the second direction to determine a second candidate point set, wherein for each second direction equal spaced sampling, Perform the following second direction sampling sub-step one and second direction sampling sub-step two.
- the first step of second direction sampling includes: accumulating pixel values in the second direction for the pixels in the sampling area of the stained image selected by the second sampling strip during the second direction equally spaced sampling period. and to obtain a series of second pixel value sums, wherein the value of the series of second pixel value sums at any first direction position in the first direction is equal to the value in the sampling area at the first direction position. The sum of pixel values of each pixel aligned along the second direction at the direction position.
- the second direction sampling sub-step includes: determining the extreme points of the series of second pixel value sums, and for each determined extreme point: determining a corresponding second point obtained by equal intervals sampling in the second direction. candidate point, the coordinate of the corresponding second candidate point in the first direction is the coordinate of the first direction position corresponding to the extreme point in the first direction, the corresponding second candidate point is in the first direction
- the coordinates in the two directions are determined based on the position of the second sampling strip in the second direction during the equally spaced sampling period in the second direction. In this way, the second candidate points obtained by sampling at equal intervals in each second direction form the second candidate point set.
- All extreme value points used in the sampling step 1001 may be the same maximum value point or the same minimum value point. For example, if the straight trajectory line is a dark line, all the extreme value points used can be the minimum value points; if the straight trajectory line is a bright line, all the extreme value points used can be the maximum value points. .
- the first candidate points in the first candidate point set are divided into a plurality of first candidate point groups; and the second candidate points in the second candidate point set are divided into a plurality of second candidates. Click group.
- the first candidate points in the first candidate point set are divided into a plurality of first candidate point groups in a first grouping manner, wherein the first grouping manner is configured such that each first candidate point Each first candidate point in the point group is substantially arranged in a straight line transverse to the second direction.
- the second candidate points in the second candidate point set are divided into a plurality of second candidate point groups in a second grouping manner, wherein the second grouping manner is configured such that the second candidate points in each second candidate point group are Each second candidate point is substantially arranged in a straight line transverse to the first direction.
- the straight line fitting step 1003 perform straight line fitting on the first candidate point in each first candidate point group to obtain a corresponding first straight line analytical formula; and perform straight line fitting on the first candidate point in each second candidate point group.
- the two candidate points are subjected to straight line fitting to obtain a corresponding second straight line analytical formula.
- straight line fitting based on multiple points with known coordinates to obtain a straight line analytical formula is known in the art and will not be described in detail here.
- Commonly used straight line fitting methods include: least squares method; gradient descent method; Gauss-Newton and column-horse methods.
- the coordinates of the intersection points of each first linear analytical expression and each second linear analytical expression are calculated.
- the method of finding the coordinates of the intersection point of two known analytical expressions of straight lines is known in the art and will not be described in detail here.
- Figure 45 is a directional target detection method provided by an embodiment of the present application, including:
- Step 1005 Obtain the staining image or gene expression visualization image to be tested.
- Step 1006 Input the staining image or gene expression visualization image to be tested into a directed target detection network to obtain target detection results.
- the dyeing image to be tested or the gene expression visualization image is input into the trained YOLOV6-based directed target detection model, and the multi-level convolutional neural network trained in the directed target detection model is used to perform a convolution operation on the image to be detected.
- fusion of feature maps, and output feature fusion maps of different scales; for feature fusion maps of different scales, corresponding predictors are used to predict category confidence, target frame positioning confidence, target detection confidence, and angle classification confidence.
- the Backbone layer adopts RepVGG architecture
- the Neck layer adopts FPN-PAN architecture
- the Head layer adopts a decoupling head, so that category analysis is performed via the classification branch to obtain the classification information, and regression analysis is performed via the regression branch to obtain the target frame coordinate prediction information, the target prediction information and the angle respectively.
- Forecast information Classification information used to represent the category analysis results, target frame coordinate prediction information used to determine the position of the target detection frame, target prediction information used to determine whether there is a corresponding target in the target detection frame, and angle used to determine the angle of the target detection frame Forecast information, the corresponding target can include track lines or track crosses (also called track intersections).
- Embodiments of the present application provide a method for training a directed target detection network based on YOLOV6.
- the method includes: acquiring multiple training images and label information including labels in the multiple training images; and converting the multiple training images.
- a training image and the label information are input into the YOLOV6-based directed target detection network to obtain the setting parameters of the YOLOV6-based directed target detection network through training; wherein the YOLOV6-based directed target detection network includes :
- the backbone Backbone layer is configured to perform feature extraction on the training image to obtain multiple feature maps of different scales; the neck Neck layer is configured to receive the multiple feature maps from the Backbone layer and perform the feature extraction on the multiple feature maps.
- the feature maps are fused across scales to obtain a plurality of fused feature maps; and a detection head Head layer is configured to predict the plurality of fused images to obtain a prediction result about the training image, wherein the prediction result Including: classification information, target frame coordinate prediction information, target prediction information and angle prediction information.
- the Backbone layer adopts RepVGG architecture
- the Neck layer adopts FPN-PAN architecture
- the Head layer uses a decoupling head, so that category analysis is performed via the classification branch to obtain the classification information, and regression analysis is performed via the regression branch to obtain the target frame coordinate prediction information, the target prediction information and the angle prediction information.
- inputting the plurality of training images and the label information into the YOLOV6-based directed target detection network to obtain the setting parameters of the YOLOV6-based directed target detection network through training includes: in each During this training,
- the method further includes: preprocessing the acquired tag information in the first data form to process the tag information into data in the form of [x, y, w, h, ⁇ , classID], And input the processed data into the directed target detection network based on YOLOV6,
- (x, y) represents the position of the center of the target detection frame
- w represents the long side width of the target detection frame
- h represents the short side height of the target detection frame
- ⁇ represents the long side of the target detection frame.
- classID represents the category of the target detection frame.
- the first data form of the tag information is [x1, y1, x2, y2, x3, y3, x4, y4, classID], where, (x1, y1), (x2, y2), (x3, y3) and (x4, y4) respectively define the positions of the four vertices of the target detection frame.
- the method further includes: post-processing the obtained prediction results in the form of [x, y, w, h, ⁇ , conf, classID] to process the prediction results into a second data form. data, and presenting the data in the second data form to the user,
- (x, y) represents the position of the center of the target detection frame
- w represents the long side width of the target detection frame
- h represents the short side height of the target detection frame
- ⁇ represents the long side of the target detection frame.
- the angle of rotation relative to the horizontal axis, conf indicates the confidence that the target detection frame has the corresponding target
- classID indicates the category of the target detection frame.
- the second data form is [x1, y1, x2, y2, x3, y3, x4, y4, conf, classID], where (x1, y1), (x2, y2), ( x3, y3) and (x4, y4) respectively define the positions of the four vertices of the target detection frame.
- Figure 46 is a method for obtaining cell gene expression information of biological samples provided by an embodiment of the present application, including:
- Step 1101 Obtain a first image of the biological sample, where the first image includes the stained cell boundaries of the biological sample;
- Step 1102 Obtain a second image of the biological sample, where the second image includes the stained genetic material of the biological sample;
- Step 1103 obtain the gene expression information of the biological sample
- Step 1104 register the second image with the first image to obtain a registration image of the second image and the first image;
- Step 1105 register the second image with the gene expression information to obtain a registered image of the second image and the gene expression information
- Step 1106 Obtain the registration image of the first image and the gene expression information based on the registration image of the second image and the first image, and the registration image of the second image and the gene expression information;
- Step 1107 Obtain the cell boundaries of the biological sample based on the registered image of the first image and the gene expression information
- Step 1108 Obtain the gene expression information of the cells of the biological sample according to the cell boundaries based on the registered image of the first image and the gene expression amount information.
- the cells of the biological sample are stained with ssDNA staining solution and a cell boundary fluorescent staining solution, wherein the ssDNA staining solution includes a buffer and an ssDNA reagent, and the cell boundary fluorescent staining solution includes a fluorescent dye.
- ssDNA staining solution can stain the genetic material of cells
- cell boundary fluorescent staining solution can stain the boundaries of cells.
- the cell boundary includes a cell wall or cell membrane.
- the gene expression information of the cells of the tissue sample includes position information, gene expression amount and cell type of each site on the chip carrying the tissue sample.
- registering the second image and the gene expression information to obtain a registered image of the second image and the gene expression information includes:
- the second image and the gene expression information are aligned according to the track line in the second image and the track line of the gene expression information to obtain the alignment of the second image and the gene expression information. accurate image.
- the tissue sample is stained with a cell staining reagent and then imaged, the imaging is performed to obtain a second image of the tissue sample through a FITC channel, and the first image of the tissue sample is obtained through a DAPI channel
- the cell staining reagent includes: ssDNA staining solution and cell boundary fluorescent staining solution; the ssDNA staining solution includes buffer and ssDNA reagent; the cell boundary fluorescent staining solution includes fluorescent dye.
- the present invention also proposes a spatial omics single cell data acquisition device. Since the device embodiment of the present invention corresponds to the above-mentioned method embodiment, details not disclosed in the device embodiment can be referred to the above-mentioned method embodiment, and will not be described again in the present invention.
- Figure 47 is a schematic structural diagram of a spatial omics single cell data acquisition device provided by an embodiment of the present application. As shown in Figure 47, it includes:
- the acquisition unit 21 is used to acquire staining images of biological samples and obtain gene expression visualization images of the biological samples;
- the registration unit 22 is used to register the staining image and the gene expression visualization image to obtain a registered image
- the first segmentation unit 23 is used to perform cell segmentation on the registered image to obtain a cell mask map
- the correction unit 24 is configured to determine the cells to which the background gene molecules of unknown cells in the gene expression visualization image belong based on the cell mask map;
- the labeling unit 25 is used to label the corresponding cells to obtain a spatial component molecular expression matrix with cell labels.
- Cell segmentation is used to obtain a cell mask map; according to the cell mask map, the cells to which the background gene molecules of unknown cells in the gene expression visualization image belong are determined, and the cells are marked to obtain spatial component expression with cell labels.
- matrix Compared with related technologies, the embodiments of the present application obtain high-precision spatial single-cell data through the processing flow of gene expression matrix diagram, splicing, registration, segmentation and correction.
- the acquisition unit 21 is also used to:
- a spliced stained image of the biological sample composed of multiple sub-stained images is obtained through a microscope;
- Multiple sub-staining images of the biological sample are acquired through the microscope, and the multiple sub-staining images are spliced to obtain a spliced staining image.
- the acquisition unit 21 includes:
- a first acquisition module configured to acquire multiple sub-staining images of the biological sample through a microscope; perform a first splicing of the multiple sub-staining images of the biological sample to obtain a first staining image;
- a judgment module configured to judge whether to perform a second splicing of the plurality of sub-stained images of the biological sample based on the image quality of the first stained image
- a determination module configured to determine the first stained image as the stained image if not
- the second acquisition module is configured to, if so, perform a second splicing of multiple sub-staining images of the biological sample to obtain the staining image.
- the first acquisition module is also used to:
- the portions of the multiple sub-staining images and the template image that are determined to be overlapping areas are respectively cropped into a plurality of staining image overlapping sub-images and a plurality of template image overlapping sub-images of the same number, so as to be paired into multiple overlapping sub-images. right;
- Each of the sub-stained images is translated toward the direction of the template image by the offset amount, and spliced together with the template image.
- the first acquisition module is also used to:
- the offset between the coordinates, and the coordinates of the second reference image are adjusted based on the offset to splice and generate the spliced stained image.
- the registration unit 22 includes:
- An acquisition module configured to acquire a trajectory line in the staining image, and rotate the staining image based on the angle between the trajectory line and the horizontal direction; wherein the staining image and the gene expression visualization image include multiple trajectory lines And/or a plurality of trajectory points, the trajectory points are formed by the intersection of two of the trajectory lines, and each of the multiple trajectory lines has a corresponding index number;
- a processing module configured to enlarge or reduce the staining image to obtain a third reference image, where the third reference image has the same proportion as the gene expression visualization image;
- a first determination module configured to determine a target offset based on the gene expression visualization image and the third reference image
- a registration module configured to move the third reference image based on the target offset to obtain the registered image.
- the registration unit 22 further includes:
- a second determination module configured to determine the similarity between the third reference image and the gene expression visualization image after the processing module enlarges or reduces the staining image to obtain a third reference image
- the coarse registration module is used to use the position corresponding to the maximum similarity value as the coarse registration result.
- the registration unit 22 is also used to:
- the staining image and the gene expression visualization image each include multiple trajectory lines and multiple trajectory points.
- the trajectory points are formed by the intersection of two of the trajectory lines.
- Each The trajectory line has a corresponding index number;
- a target image is processed based on the offset information to obtain a registered image, where the target image is an image in a candidate image set corresponding to the track point pair.
- the device further includes:
- the second segmentation unit 26 is configured to perform tissue segmentation on the registered image to obtain a tissue mask before the first segmentation unit performs cell segmentation on the registered image to obtain a cell mask map. picture.
- the second dividing unit 26 is also used to:
- the gene expression matrix arranges the gene expression levels according to pixel positions;
- the image data is determined by assigning the gene expression amount at each pixel position in the gene expression matrix to the corresponding pixel position in the registered image;
- the tissue mask map is obtained by marking the connected areas of the image data according to the foreground pixel points.
- the device further includes:
- the calculation unit 27 is configured to perform tissue segmentation on the registered image in the second segmentation unit, and after obtaining the tissue mask map, respectively calculate the outer contour image and inner contour image of the grayscale image corresponding to the tissue mask map. outline image;
- the pairing unit 28 is used to divide the outer contour image and the inner contour image into N segments respectively, and pair the outer contour image of each segment with the inner contour image of each segment in pairs to obtain N image combinations.
- each of the image combinations includes an outer contour image and an inner contour image;
- the calculation unit 27 is also used to separately calculate the pixel density ratio of a segment of the outer contour image and a segment of the inner contour image in each of the image combinations to obtain N pixel density ratios.
- the pixel density ratio is for each of the image combinations.
- the calculation unit is also used to calculate and describe the grayscale image quality corresponding to the tissue mask map according to the pixel density ratio.
- the first dividing unit 23 is also used to:
- the pixel points belonging to cells or cell outlines in the segmentation result are determined as pixel points belonging to cells, and the segmentation result of the registered image is output to obtain the cell mask map.
- the first dividing unit 23 is also used to:
- a watershed algorithm based on distance transformation is used to segment the connected domain where cell adhesion exists, and the segmented cell mask map is obtained.
- the first dividing unit 23 is also used to:
- the area of the sub-region to be processed included in each marked area is determined according to the cell area.
- the area of the sub-region to be processed is positively related to the area of the cell.
- the sub-region to be processed is used to characterize the corresponding said The smallest processing unit of the marked area;
- grid processing is performed on the corresponding marked area to obtain the grid coordinates corresponding to each marked area;
- Data corresponding to the grid coordinates are extracted from the gene expression visualization image and superimposed on the grid coordinates to obtain the cell processing results of the target object.
- correction unit 24 is also used to:
- each gene expression feature of the gene expression visualization image is determined as a cell gene expression feature located within the cell and a background gene expression feature located outside the cell;
- a probability distribution model is fitted based on the spatial position and the signal value of the gene expression characteristics
- the correction result is output according to the probability value to correct the background gene expression characteristics.
- the correction unit 24 is also configured to include:
- the gene expression visualization image determine the initial gene molecules belonging to the target cell and the background gene molecules of the unknown cell
- the correction unit 24 is also configured to include:
- the cell to which the background gene molecule belongs is determined based on the gene molecule density and the background gene molecule density.
- the correction unit 24 is also configured to include:
- the spatial coordinates and the gene expression characteristic signal values are input into a probability distribution model to obtain the probability score that the background gene molecule belongs to the target cell; the probability distribution model is based on the probability score of the gene molecule sample belonging to the target cell.
- the spatial coordinates and gene expression characteristic signal values are fitted;
- the cell to which the background gene molecule belongs is determined based on the probability score.
- the marking unit 25 is also used to:
- the cells are stained with ssDNA staining solution and cell boundary fluorescent staining solution, wherein the ssDNA staining solution includes buffer and ssDNA reagent, and the cell boundary fluorescent staining solution includes fluorescent dye.
- the device further includes a detection unit 29, including:
- the directed target detection network includes:
- the backbone Backbone layer is configured to perform feature extraction on the staining image or gene expression visualization image to be tested to obtain multiple feature maps at different scales;
- the Neck layer is configured to receive the multiple feature maps from the Backbone layer and perform cross-scale fusion on the multiple feature maps to obtain multiple fused feature maps;
- the detection head Head layer is configured to predict the plurality of fused images to obtain target detection results regarding the staining image or gene expression visualization image to be tested,
- the target detection results include: classification information, target frame coordinate prediction information, target prediction information and angle prediction information.
- a determining unit 210 is also included, and the determining unit 210 is used for:
- the dyeing image plane in which the dyeing image is located includes a first direction and a second direction perpendicular to the first direction, and the dyeing image includes a plurality of first straight tracks transverse to the second direction and a plurality of first straight tracks transverse to the second direction. a plurality of second straight trajectory lines in the first direction,
- the pixels in the sampling area of the stained image selected by the first sampling strip during the equal-spaced sampling period in the first direction are accumulated and summed according to the first direction to obtain a series of first pixel values.
- the first candidate point set is formed by the first candidate points obtained by sampling at equal intervals in each first direction;
- the pixels in the sampling area of the stained image selected by the second sampling strip during the second direction equally spaced sampling period are accumulated and summed in the second direction to obtain a series of second pixel values.
- the second candidate point set is formed by the second candidate points obtained by equally spaced sampling in each second direction;
- Grouping steps include:
- Line fitting steps include:
- Coordinate calculation steps include:
- the device further includes: an analysis unit 211, the analysis unit is used to:
- Gene expression information of cells of the biological sample is obtained based on the registration image of the first image and the gene expression amount information according to the cell boundary.
- the present application also provides an electronic device, a readable storage medium and a computer program product.
- Figure 49 shows a schematic block diagram of an example electronic device 300 that may be used to implement embodiments of the present application.
- Electronic devices are intended to refer to various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers.
- Electronic devices may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices.
- the components shown herein, their connections and relationships, and their functions are examples only and are not intended to limit the implementation of the present application as described and/or claimed herein.
- the device 300 includes a computing unit 301, which can be loaded into a RAM (Random Access Memory) according to a computer program stored in a ROM (Read-Only Memory) 302 or from a storage unit 308. Access the computer program in the memory) 303 to perform various appropriate actions and processes. In the RAM 303, various programs and data required for the operation of the device 300 can also be stored.
- Computing unit 301, ROM 302 and RAM 303 are connected to each other via bus 304.
- An I/O (Input/Output, input/output) interface 305 is also connected to the bus 304.
- I/O interface 305 Multiple components in the device 300 are connected to the I/O interface 305, including: input unit 306, such as a keyboard, mouse, etc.; output unit 307, such as various types of displays, speakers, etc.; storage unit 308, such as a magnetic disk, optical disk, etc. ; and communication unit 309, such as a network card, modem, wireless communication transceiver, etc.
- the communication unit 309 allows the device 300 to exchange information/data with other devices through computer networks such as the Internet and/or various telecommunications networks.
- Computing unit 301 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of the computing unit 301 include but are not limited to CPU (Central Processing Unit, Central Processing Unit), GPU (Graphic Processing Units, Graphics Processing Unit), various dedicated AI (Artificial Intelligence, artificial intelligence) computing chips, various running The computing unit of the machine learning model algorithm, DSP (Digital Signal Processor, digital signal processor), and any appropriate processor, controller, microcontroller, etc.
- the computing unit 301 performs various methods and processes described above, such as spatial omics single cell data acquisition methods.
- the spatial omics single cell data acquisition method can be implemented as a computer software program, which is tangibly embodied in a machine-readable medium, such as the storage unit 308.
- part or all of the computer program may be loaded and/or installed onto device 300 via ROM 302 and/or communication unit 309.
- the computer program When the computer program is loaded into RAM 303 and executed by computing unit 301, one or more steps of the method described above may be performed.
- the computing unit 301 may be configured to perform the aforementioned spatial omics single cell data acquisition method in any other suitable manner (eg, by means of firmware).
- These various embodiments may include implementation in one or more computer programs executable and/or interpreted on a programmable system including at least one programmable processor, the programmable processor
- the processor which may be a special purpose or general purpose programmable processor, may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
- An output device may be a special purpose or general purpose programmable processor, may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
- An output device may be a special purpose or general purpose programmable processor, may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
- Program code for implementing the methods of the present application may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing device, such that the program codes, when executed by the processor or controller, cause the functions specified in the flowcharts and/or block diagrams/ The operation is implemented.
- the program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
- a machine-readable medium may be a tangible medium that may contain or store a program for use by or in connection with an instruction execution system, apparatus, or device.
- the machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium.
- Machine-readable media may include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any suitable combination of the foregoing.
- machine-readable storage media would include electrical connections based on one or more wires, laptop disks, hard drives, RAM, ROM, EPROM (Electrically Programmable Read-Only-Memory, Erasable Programmable Read-Only Memory) Or flash memory, optical fiber, CD-ROM (Compact Disc Read-Only Memory, portable compact disk read-only memory), optical storage device, magnetic storage device, or any suitable combination of the above.
- the systems and techniques described herein may be implemented on a computer having a display device (eg, CRT (Cathode-Ray Tube, cathode ray tube) or LCD (Cathode-Ray Tube)) for displaying information to the user.
- a display device eg, CRT (Cathode-Ray Tube, cathode ray tube) or LCD (Cathode-Ray Tube)
- LCD Liquid Crystal Display
- keyboard and pointing device e.g., a mouse or a trackball
- Other kinds of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and may be provided in any form, including Acoustic input, voice input or tactile input) to receive input from the user.
- the systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., A user's computer having a graphical user interface or web browser through which the user can interact with implementations of the systems and technologies described herein), or including such backend components, middleware components, or any combination of front-end components in a computing system.
- the components of the system may be interconnected by any form or medium of digital data communication (eg, a communications network). Examples of communication networks include: LAN (Local Area Network), WAN (Wide Area Network), the Internet, and blockchain networks.
- Computer systems may include clients and servers. Clients and servers are generally remote from each other and typically interact over a communications network. The relationship of client and server is created by computer programs running on corresponding computers and having a client-server relationship with each other.
- the server can be a cloud server, also known as cloud computing server or cloud host. It is a host product in the cloud computing service system to solve the problem of traditional physical host and VPS service ("Virtual Private Server", or "VPS" for short) Among them, there are defects such as difficult management and weak business scalability.
- the server can also be a distributed system server or a server combined with a blockchain.
- artificial intelligence is the study of using computers to simulate certain human thinking processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.). It has both hardware-level technology and software-level technology.
- Artificial intelligence hardware technology generally includes technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing, etc.; artificial intelligence software technology mainly includes computer vision technology, speech recognition technology, natural language processing technology, and machine learning/depth Learning, big data processing technology, knowledge graph technology and other major directions.
Landscapes
- Engineering & Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- Health & Medical Sciences (AREA)
- Life Sciences & Earth Sciences (AREA)
- Medical Informatics (AREA)
- Epidemiology (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Databases & Information Systems (AREA)
- Bioethics (AREA)
- Evolutionary Computation (AREA)
- Artificial Intelligence (AREA)
- Public Health (AREA)
- Software Systems (AREA)
- Biophysics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Biotechnology (AREA)
- Evolutionary Biology (AREA)
- General Health & Medical Sciences (AREA)
- Spectroscopy & Molecular Physics (AREA)
- Theoretical Computer Science (AREA)
- Investigating Or Analysing Biological Materials (AREA)
Abstract
Description
Claims (26)
- 一种空间组学单细胞数据获取方法,其特征在于,包括:获取生物样本的染色图像,获取所述生物样本的基因表达可视化图像;将所述染色图像与所述基因表达可视化图像进行配准,得到配准后的图像;对所述配准后的图像进行细胞分割,得到细胞掩模图;根据所述细胞掩码图确定所述基因表达可视化图像中未知所属细胞的背景基因分子的所属细胞,并对所属细胞标记,得到带细胞标记的空间组分子表达矩阵。
- 根据权利要求1所述的方法,其特征在于,所述获取生物样本的染色图像包括:通过显微镜获取所述生物样本的一个染色图像;或通过显微镜获取所述生物样本的由多个子染色图像拼接的拼接染色图像;或通过所述显微镜获取所述生物样本的多个子染色图像,对所述多个子染色图像进行拼接,得到拼接染色图像。
- 根据权利要求2所述的方法,其特征在于,所述获取生物样本的染色图像包括:通过显微镜获取所述生物样本的多个子染色图像;对所述生物样本的多个子染色图像进行第一拼接,得到第一染色图像;根据所述第一染色图像的图像质量判断是否对所述生物样本的多个子染色图像进行第二拼接;若否,将所述第一染色图像确定为所述染色图像;若是,对所述生物样本的多个子染色图像进行第二拼接,得到所述染色图像。
- 根据权利要求3所述的方法,其特征在于,所述通过所述显微镜获取所述生物样本的多个子染色图像,对所述多个子染色图像进行拼接,得到拼接染色图像包括:分别确定多个子染色图像和模板图像的重叠区域;将所述多个子染色图像和所述模板图像的被确定为重叠区域的部分分别裁剪为多个染色图像重叠子图和数量相同的多个模板图像重叠子图,以配对为多个重叠子图对;通过对所述多个重叠子图对进行频域计算,分别获得各子染色图像和所述模板图像之间的偏移量;以及将所述各子染色图像分别朝向所述模板图像的方向平移所述偏移量,并 与所述模板图像拼接在一起。
- 根据权利要求3所述的方法,其特征在于,所述通过所述显微镜获取所述生物样本的多个子染色图像,对所述多个子染色图像进行拼接,得到拼接染色图像包括:获取所述多个子染色图像以及关于所述生物样本的轨迹线或轨迹点的模板信息;对所述多个子染色图像进行预拼接得到所述多个子染色图像的预拼接坐标;根据轨迹线或轨迹点的特征从所述多个子染色图像中选取至少一个第一参考图像,根据所述生物样本的模板信息和所述第一参考图像的预拼接坐标推导全局模板;以及对于所述多个子染色图像中除了所述第一参考图像之外的第二参考图像,计算所述第二参考图像的预拼接坐标与所述第二参考图像在所述全局模板中的相应模板坐标之间的偏移量,并基于所述偏移量对所述第二参考图像进行坐标调整以拼接生成所述拼接染色图像。
- 根据权利要求1所述的方法,其特征在于,所述将所述染色图像与所述基因表达可视化图像进行配准,得到配准后的图像包括:获取所述染色图像中的轨迹线,基于所述轨迹线与水平方向的夹角旋转所述染色图像;其中,所述染色图像和所述基因表达可视化图像包括多条轨迹线和/或多个轨迹点,所述轨迹点是由两条所述轨迹线相交形成的,所述多条轨迹线中的每条轨迹线具有对应的索引号;将所述染色图像进行放大或缩小得到第三参考图像,所述第三参考图像与所述基因表达可视化图像具有相同的比例;基于所述基因表达可视化图像和所述第三参考图像确定目标偏移量;基于所述目标偏移量移动所述第三参考图像,得到所述配准后的图像。
- 根据权利要求6所述的方法,其特征在于,在将所述染色图像进行放大或缩小得到第三参考图像之后,所述方法还包括:确定所述第三参考图像与基因表达可视化图像之间的相似度;将相似度最大值对应的位置作为粗配准结果。
- 根据权利要求1所述的方法,其特征在于,将所述染色图像与所述基因表达可视化图像进行配准,得到配准后的图像包括:对所述染色图像进行预处理,获取候选图像集合;确定所述候选图像集合对应的二值图集合;基于所述二值图集合与所述基因表达可视化图像之间的相似度,确定所述二值图集合与所述基因表达可视化图像中具有对应关系的轨迹点对;基于所述轨迹点对确定偏移信息;基于所述偏移信息处理目标图像,以得到配准后的图像,所述目标图像为所述轨迹点对所对应的候选图像集合中的图像。
- 根据权利要求1所述的方法,其特征在于,在对所述配准后的图像进行细胞分割,得到细胞掩模图之前,所述方法还包括:对所述配准后的图像进行组织分割,得到组织掩模图。
- 根据权利要求9所述的方法,其特征在于,所述对所述配准后的图像进行组织分割,得到组织掩模图包括:获取所述配准后的图像中待分割的目标组织的基因表达量并确定所述配准后的图像的基因表达矩阵,所述基因表达矩阵按照像素位置对所述基因表达量进行排列;通过将所述基因表达矩阵中每一像素位置的基因表达量赋值于配准后的图像中对应的像素位置确定图像数据;通过对所述图像数据进行图像处理以确定所述图像数据的前景像素点;根据所述前景像素点对所述图像数据的连通区域进行标记得到所述组织掩模图。
- 根据权利要求10所述的方法,其特征在于,在对所述配准后的图像进行组织分割,得到组织掩模图之后,所述方法还包括:分别计算得到组织掩模图对应的灰度图像的外轮廓图像与内轮廓图像;将所述外轮廓图像与所述内轮廓图像分别分为N段,并将每段所述外轮廓图像与每段所述内轮廓图像两两配对,得到N个图像组合,每个所述图像组合包括一段外轮廓图像与一段内轮廓图像;分别计算每个所述图像组合中一段外轮廓图像与一段内轮廓图像的像素密度比值,得到N个所述像素密度比值,所述像素密度比值为每个所述图像组合中一段外轮廓图像与一段内轮廓图像的像素占比的比值,所述像素占比为像素点与总像素点的比值;根据所述像素密度比值计算描述所述组织掩模图对应的灰度图像质量。
- 根据权利要求1所述的方法,其特征在于,所述对所述配准后的图像进行细胞分割,得到细胞掩模图包括:将所述配准后的图像输入所述图像分割模型,获得所述配准后的图像中各个像素点的分割结果,所述分割结果包括属于细胞的像素点;将所述分割结果属于细胞的像素点或细胞轮廓的像素点确定属于细胞的像素点,输出所述配准后的图像的分割结果,得到所述细胞掩模图。
- 根据权利要求1所述的方法,其特征在于,所述对所述配准后的图像进行细胞分割,得到细胞掩模图包括:对所述基因表达可视化图像进行预处理,得到预处理图;将所述预处理图进行二值化处理,得到初始掩模图;根据所述初始掩模图,利用基于距离变换的分水岭算法对存在细胞粘连的连通域进行分割,得到分割后的所述细胞掩模图。
- 根据权利要求1所述的方法,其特征在于,所述对所述配准后的图像进行细胞分割,得到细胞掩模图包括:基于所述染色图像确定所述目标对象的各个组织类型对应的标注区域和细胞面积;依据所述细胞面积确定每个所述标注区域包含的待处理子区域的面积,所述待处理子区域的面积与所述细胞面积正相关,所述待处理子区域用于表征对应的所述标注区域的最小处理单元;依据每个所述待处理子区域的面积,将对应的所述标注区域进行网格化处理,得到每个所述标注区域对应的网格化坐标;从所述基因表达可视化图像中提取所述网格化坐标对应的数据,并叠加至所述网格化坐标,得到所述目标对象的细胞处理结果。
- 根据权利要求1所述的方法,其特征在于,所述根据所述细胞掩码图确定所述基因表达可视化图像中未知所属细胞的背景基因分子的所属细胞包括:基于所述细胞掩模图,将所述基因表达可视化图像的每个基因表达特征分别确定为位于细胞内的细胞基因表达特征及位于细胞外的背景基因表达特征;对每个所述细胞基因表达特征,通过空间位置和基因表达特征的信号值拟合出概率分布模型;基于所述概率分布模型,确定出针对位于一目标细胞的预设范围内的目标背景基因表达特征属于所述目标细胞的概率值;根据所述概率值输出校正结果以进行背景基因表达特征的校正。
- 根据权利要求1所述的方法,其特征在于,所述根据所述细胞掩码图确定所述基因表达可视化图像中未知所属细胞的背景基因分子的所属细胞包括:根据所述基因表达可视化图像,确定所属于目标细胞的初始基因分子以及未知所属细胞的背景基因分子;获取所述初始基因分子的坐标信息;根据所述坐标信息,确定所述目标细胞的中心点坐标;根据所述中心点坐标和所述坐标信息,构建维诺图;确定所述维诺图范围内的背景基因分子的所属细胞。
- 根据权利要求1所述的方法,其特征在于,所述根据所述细胞掩码图确定所述基因表达可视化图像中未知所属细胞的背景基因分子的所属细胞包括:确定所述基因表达可视化图像中所属于目标细胞的基因分子的初始分子数量以及所述所属于目标细胞的基因分子所占的目标区域的初始轮廓面积;根据所述分子数量和所述初始轮廓面积,确定所述目标细胞的基因分子密度;确定所述目标区域的预设区域范围内的背景基因分子的分子数量以及所述预设区域范围的区域面积;根据所述背景基因分子的分子数量和区域面积,确定背景基因分子密度;根据所述基因分子密度与所述背景基因分子密度确定所述背景基因分子的所属细胞。
- 根据权利要求1所述的方法,其特征在于,所述根据所述细胞掩码图确定所述基因表达可视化图像中未知所属细胞的背景基因分子的所属细胞包括:确定所述基因表达可视化图像中所属于目标细胞的基因分子所占的目标区域;确定所述目标区域的预设校正范围内的未知所属细胞的背景基因分子的空间坐标及基因表达特征信号值;将所述空间坐标和所述基因表达特征信号值输入概率分布模型,以得到所述背景基因分子所属于所述目标细胞的概率分数;所述概率分布模型根据所属于目标细胞的基因分子样本的空间坐标及基因表达特征信号值拟合得到;根据所述概率分数确定所述背景基因分子的所属细胞。
- 根据权利要求1所述的方法,其特征在于,所述对所属细胞标记包括:以ssDNA染液和细胞边界荧光染色液对所属细胞进行染色,其中,所述ssDNA染液包括缓冲液和ssDNA试剂,所述细胞边界荧光染色液包括荧光染料。
- 根据权利要求5或6所述的方法,其特征在于,所述方法还包括:获取待测染色图像或基因表达可视化图像;以及将所述待测染色图像或基因表达可视化图像输入有向目标检测网络,以获得目标检测结果,其中所述有向目标检测网络包括:主干Backbone层,被配置为对待测染色图像或基因表达可视化图像执行特征提取,以获得不同尺度的多个特征图;颈部Neck层,被配置为从Backbone层接收所述多个特征图,并对所述 多个特征图进行跨尺度融合,以获得多个融合特征图;以及检测头Head层,被配置为对所述多个融合图像进行预测,以获得关于所述待测染色图像或基因表达可视化图像的目标检测结果,其中所述目标检测结果包括:目标框坐标预测信息、目标预测信息和角度预测信息。
- 根据权利要求5或6所述的方法,其特征在于,所述染色图像所在的染色图像平面包括第一方向和与所述第一方向垂直的第二方向,所述染色图像包括横向于所述第二方向的多个第一直轨迹线和横向于所述第一方向的多个第二直轨迹线,所述染色图像中的点坐标的确定方法包括:采样步骤,包括:应用第一采样条沿所述第一方向对所述染色图像进行第一方向等间隔采样以确定第一候选点集合,其中对于每次第一方向等间隔采样,执行以下子步骤:将所述第一采样条在该次第一方向等间隔采样期间所选中的所述染色图像的采样区域内的像素按所述第一方向进行像素值累加求和以得到一系列第一像素值和;以及确定所述一系列第一像素值和的极值点,并且对于确定的每个极值点:确定该次第一方向等间隔采样所获得的一个对应第一候选点,该对应第一候选点在所述第二方向上的坐标为该极值点所对应的第二方向位置在所述第二方向上的坐标,该对应第一候选点在所述第一方向上的坐标基于在该次第一方向等间隔采样期间所述第一采样条在所述第一方向上的位置确定,其中,由每次第一方向等间隔采样所获得的第一候选点形成所述第一候选点集合;应用第二采样条沿所述第二方向对所述染色图像进行第二方向等间隔采样以确定第二候选点集合,其中对于每次第二方向等间隔采样,执行以下子步骤:将所述第二采样条在该次第二方向等间隔采样期间所选中的所述染色图像的采样区域内的像素按所述第二方向进行像素值累加求和以得到一系列第二像素值和;以及确定所述一系列第二像素值和的极值点,并且对于确定的每个极值点:确定该次第二方向等间隔采样所获得的一个对应第二候选点,该对应第二候选点在所述第一方向上的坐标为该极值点所对应的第一方向位置在所述第一方向上的坐标,该对应第二候选点在所述第二方向上的坐标基于在该次第二方向等间隔采样期间所述第二采样条在所述第二方向上的位置确定,其中,由每次第二方向等间隔采样所获得的第二候选点形成所述第二候 选点集合;分组步骤,包括:将所述第一候选点集合中的第一候选点分成多个第一候选点组;以及将所述第二候选点集合中的第二候选点分成多个第二候选点组;直线拟合步骤,包括:对每个第一候选点组中的第一候选点进行直线拟合以得到一个相应的第一直线解析式;以及对每个第二候选点组中的第二候选点进行直线拟合以得到一个相应的第二直线解析式;以及坐标计算步骤,包括:计算每个第一直线解析式与每个第二直线解析式的交点的坐标。
- 根据权利要求19所述的方法,其特征在于,在对所属细胞标记,得到带细胞标记的空间组分子表达矩阵之后,所述方法还包括:获取生物样本的第一图像,所述第一图像包括所述生物样本经染色的细胞边界;获取所述生物样本的第二图像,所述第二图像包括所述生物样本经染色的遗传物质;获取所述生物样本的基因表达量信息;将所述第二图像与所述第一图像配准,得到第二图像与第一图像的配准图像;将所述第二图像与所述基因表达量信息进行配准,得到第二图像与第基因表达量信息的配准图像;根据第二图像与第一图像的配准图像、第二图像与基因表达量信息的配准图像获取第一图像与基因表达量信息的配准图像;根据第一图像与基因表达量信息的配准图像获取所述生物样本的细胞边界;基于第一图像与基因表达量信息的配准图像根据所述细胞边界获取所述生物样本的细胞的基因表达信息。
- 一种空间组学单细胞数据获取装置,其特征在于,包括:获取单元,用于获取生物样本的染色图像,获取所述生物样本的基因表达可视化图像;配准单元,用于将所述染色图像与所述基因表达可视化图像进行配准,得到配准后的图像;第一分割单元,用于对所述配准后的图像进行细胞分割,得到细胞掩模图;修正单元,用于根据所述细胞掩码图确定所述基因表达可视化图像中未知所属细胞的背景基因分子的所属细胞;标记单元,用于对所属细胞标记,得到带细胞标记的空间组分子表达矩阵。
- 一种电子设备,其特征在于,包括:至少一个处理器;以及与所述至少一个处理器通信连接的存储器;其中,所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行权利要求1-22中任一项所述的方法。
- 一种存储有计算机指令的非瞬时计算机可读存储介质,其特征在于,所述计算机指令用于使所述计算机执行根据权利要求1-22中任一项所述的方法。
- 一种计算机程序产品,其特征在于,包括计算机程序,所述计算机程序在被处理器执行时实现根据权利要求1-22中任一项所述的方法。
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202280097469.4A CN119422202A (zh) | 2022-06-29 | 2022-12-05 | 空间组学单细胞数据获取方法及装置和电子设备 |
Applications Claiming Priority (10)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| PCT/CN2022/102505 WO2024000313A1 (zh) | 2022-06-29 | 2022-06-29 | 基因图像数据校正方法、电子设备和介质 |
| CNPCT/CN2022/102443 | 2022-06-29 | ||
| CNPCT/CN2022/102424 | 2022-06-29 | ||
| PCT/CN2022/102360 WO2024000268A1 (zh) | 2022-06-29 | 2022-06-29 | 一种图像处理方法、装置、设备及介质 |
| PCT/CN2022/102424 WO2024000288A1 (zh) | 2022-06-29 | 2022-06-29 | 图像拼接方法、基因测序系统及相应的基因测序仪 |
| CNPCT/CN2022/102360 | 2022-06-29 | ||
| CNPCT/CN2022/102505 | 2022-06-29 | ||
| PCT/CN2022/102443 WO2024000295A1 (zh) | 2022-06-29 | 2022-06-29 | 图像中的点坐标的确定方法和装置及相应设备和介质 |
| PCT/CN2022/110779 WO2024031219A1 (zh) | 2022-08-08 | 2022-08-08 | 一种图像分割模型的训练方法、图像分割方法及装置 |
| CNPCT/CN2022/110779 | 2022-08-08 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2024001051A1 true WO2024001051A1 (zh) | 2024-01-04 |
Family
ID=89383934
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2022/136698 Ceased WO2024001051A1 (zh) | 2022-06-29 | 2022-12-05 | 空间组学单细胞数据获取方法及装置和电子设备 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN119422202A (zh) |
| WO (1) | WO2024001051A1 (zh) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN119169012A (zh) * | 2024-11-21 | 2024-12-20 | 北京大学人民医院 | 一种多重免疫组织荧光染色图像的分析方法及相关设备 |
| CN119887766A (zh) * | 2025-03-27 | 2025-04-25 | 辽宁省人民医院 | 一种磁敏感加权序列中脑静脉侧支循环快速标注方法 |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN121708010A (zh) * | 2026-02-11 | 2026-03-20 | 宁波财经学院 | 一种骨髓瘤显微细胞图像癌细胞计数方法 |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110047107A (zh) * | 2018-01-13 | 2019-07-23 | 深圳华大智造科技有限公司 | 相机标定方法及图像配准方法、基因测序仪及系统 |
| WO2019196019A1 (zh) * | 2018-04-10 | 2019-10-17 | 深圳华大智造科技有限公司 | 荧光图像配准方法、基因测序仪及系统、存储介质 |
| WO2020155043A1 (zh) * | 2019-01-31 | 2020-08-06 | 深圳华大生命科学研究院 | 荧光图像配准方法、基因测序仪及系统、存储介质 |
| CN113781530A (zh) * | 2021-10-09 | 2021-12-10 | 上海衡道医学病理诊断中心有限公司 | 一种染色切片的图像配准方法及系统 |
| US20220068438A1 (en) * | 2020-08-27 | 2022-03-03 | The Broad Institute, Inc. | Deep learning and alignment of spatially-resolved whole transcriptomes of single cells |
-
2022
- 2022-12-05 CN CN202280097469.4A patent/CN119422202A/zh active Pending
- 2022-12-05 WO PCT/CN2022/136698 patent/WO2024001051A1/zh not_active Ceased
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110047107A (zh) * | 2018-01-13 | 2019-07-23 | 深圳华大智造科技有限公司 | 相机标定方法及图像配准方法、基因测序仪及系统 |
| WO2019196019A1 (zh) * | 2018-04-10 | 2019-10-17 | 深圳华大智造科技有限公司 | 荧光图像配准方法、基因测序仪及系统、存储介质 |
| WO2020155043A1 (zh) * | 2019-01-31 | 2020-08-06 | 深圳华大生命科学研究院 | 荧光图像配准方法、基因测序仪及系统、存储介质 |
| US20220068438A1 (en) * | 2020-08-27 | 2022-03-03 | The Broad Institute, Inc. | Deep learning and alignment of spatially-resolved whole transcriptomes of single cells |
| CN113781530A (zh) * | 2021-10-09 | 2021-12-10 | 上海衡道医学病理诊断中心有限公司 | 一种染色切片的图像配准方法及系统 |
Non-Patent Citations (2)
| Title |
|---|
| CHENG MENGNAN, WU LIANG, HAN LEI, HUANG XIN, LAI YIWEI, XU JIANGSHAN, WANG SHUAI, LI MEI, ZHENG HUIWEN, FENG WEIMIN, HUANG ZIRUI, : "A Cellular Resolution Spatial Transcriptomic Landscape of the Medial Structures in Postnatal Mouse Brain", FRONTIERS IN CELL AND DEVELOPMENTAL BIOLOGY, FRONTIERS MEDIA, CH, vol. 10, CH , XP093124994, ISSN: 2296-634X, DOI: 10.3389/fcell.2022.878346 * |
| ZUBAIR ASIF, CHAPPLE RICHARD H, NATARAJAN SIVARAMAN, WRIGHT WILLIAM C, PAN MIN, LEE HYEONG-MIN, TILLMAN HEATHER, EASTON JOHN, GEEL: "Cell type identification in spatial transcriptomics data can be improved by leveraging cell-type-informative paired tissue images using a Bayesian probabilistic model", NUCLEIC ACIDS RESEARCH, OXFORD UNIVERSITY PRESS, GB, vol. 50, no. 14, 12 August 2022 (2022-08-12), GB , pages e80, XP093121475, ISSN: 0305-1048, DOI: 10.1093/nar/gkac320 * |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN119169012A (zh) * | 2024-11-21 | 2024-12-20 | 北京大学人民医院 | 一种多重免疫组织荧光染色图像的分析方法及相关设备 |
| CN119887766A (zh) * | 2025-03-27 | 2025-04-25 | 辽宁省人民医院 | 一种磁敏感加权序列中脑静脉侧支循环快速标注方法 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN119422202A (zh) | 2025-02-11 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US11681418B2 (en) | Multi-sample whole slide image processing in digital pathology via multi-resolution registration and machine learning | |
| US10127675B2 (en) | Edge-based local adaptive thresholding system and methods for foreground detection | |
| CN103400151B (zh) | 一体化的光学遥感影像与gis自动配准与水体提取方法 | |
| EP2987142B1 (en) | Systems and methods for multiplexed biomarker quantitation using single cell segmentation on sequentially stained tissue | |
| WO2024001051A1 (zh) | 空间组学单细胞数据获取方法及装置和电子设备 | |
| CN109426814B (zh) | 一种发票图片特定板块的定位、识别方法、系统、设备 | |
| CN110781885A (zh) | 基于图像处理的文本检测方法、装置、介质及电子设备 | |
| CN107392141B (zh) | 一种基于显著性检测和lsd直线检测的机场提取方法 | |
| Vanetti et al. | Gas meter reading from real world images using a multi-net system | |
| CN104751093B (zh) | 用于获取宿主设备显示的图像识别码的方法和装置 | |
| CN113537026B (zh) | 建筑平面图中的图元检测方法、装置、设备及介质 | |
| Liu et al. | Road centerlines extraction from high resolution images based on an improved directional segmentation and road probability | |
| CN115272887A (zh) | 基于无人机检测的海岸带垃圾识别方法、装置以及设备 | |
| CN118520893B (zh) | 一种应用于aoi的条形码标签识别的方法、装置及存储介质 | |
| CN110659637A (zh) | 一种结合深度神经网络和sift特征的电能表示数与标签自动识别方法 | |
| CN116612478A (zh) | 一种脱机手写汉字的评分方法、装置及存储介质 | |
| CN114511862A (zh) | 表格识别方法、装置及电子设备 | |
| CN104268550A (zh) | 特征提取方法及装置 | |
| CN117372937B (zh) | 一种基于指针仪表的数据读取方法 | |
| CN118608917A (zh) | 一种图像敏感信息的识别方法、系统、设备及介质 | |
| CN115393337A (zh) | 工业缺陷检测方法、装置、设备及计算机可读存储介质 | |
| Rahi | Contour Detection of Growing Plant Roots | |
| CN108573258B (zh) | 一种快速的复杂背景图像中维语文字定位方法 | |
| Zeng et al. | Ellipse-CenterNet: Ellipse Detection in Complex Environments | |
| CN116469109A (zh) | 一种数字仪表的测量结果识别方法及装置 |
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: 22949128 Country of ref document: EP Kind code of ref document: A1 |
|
| WWE | Wipo information: entry into national phase |
Ref document number: 202280097469.4 Country of ref document: CN |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| WWP | Wipo information: published in national office |
Ref document number: 202280097469.4 Country of ref document: CN |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 22949128 Country of ref document: EP Kind code of ref document: A1 |