Space-time omics experiment report generation method and device, equipment and storage medium
By using an automated experimental report generation method, the problems of errors and omissions in spatiotemporal omics experimental reports caused by manual operation are solved, and highly accurate and complete experimental reports are generated.
Patent Information
- Application Number
- CN202511133318.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-13
- Publication Date
- 2025-11-21
AI Technical Summary
The current process of generating spatiotemporal omics experimental reports relies on manual operation, which can easily lead to data entry errors and missing images, affecting the accuracy and completeness of the reports.
The automated experimental report generation method responds to experimental report generation instructions, determines the experimental report template, reads experimental data and image sets, scores and selects the best image, generates a report based on the template, including scoring of visual parameters and biological sample information of stained and transparent images, and cropping and scaling images to fill the template.
It improves the accuracy and completeness of experimental reports, avoids errors and omissions caused by human negligence, and ensures accurate data and image entry.
Smart Images

Figure CN120998393A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data management, and particularly relates to a spatiotemporal omics experimental report generation method and device, equipment and a storage medium. BACKGROUND
[0002] At present, in the field of spatiotemporal omics experiments, the quality inspection and permeation links are key steps, which are respectively used for evaluating sample quality and permeation effect. However, the generation process of the experimental report of the two links currently usually depends on manual operation, and manual operation is prone to cause data entry errors, picture omission and other problems of the experimental report due to negligence, thereby affecting the accuracy and integrity of the experimental report of spatiotemporal omics. SUMMARY
[0003] Therefore, the present application aims to overcome the deficiencies in the prior art, and provides a spatiotemporal omics experimental report generation method, which comprises the following steps: In response to an experimental report generation instruction for a target spatiotemporal omics experiment, an experimental report template corresponding to the target spatiotemporal omics experiment is determined; According to the experimental report template, target experimental data and an experimental image set corresponding to the target spatiotemporal omics experiment are read from an experimental information storage directory of the target spatiotemporal omics experiment; Each experimental image in the experimental image set is scored, and a target experimental image is determined according to a scoring result; According to the target experimental data, the target experimental image and the experimental report template, an experimental report corresponding to the target spatiotemporal omics experiment is generated.
[0004] In an embodiment, the experimental image set comprises a staining image and a permeation image, and the step of scoring each experimental image in the experimental image set and determining a target experimental image according to a scoring result comprises: A first score of the staining image is determined based on a first visual parameter of the staining image and biological sample information; A staining image with the largest first score in the experimental image set is selected as a target staining image; A second score of the permeation image is determined based on a second visual parameter of the permeation image and the target staining image; A permeation image with the largest second score in the experimental image set is selected as a target permeation image.
[0005] In an embodiment, the biological sample information comprises a biological sample broken area and a biological sample folded area, and the step of determining the first score of the staining image based on the first visual parameter of the staining image and the biological sample information comprises: The first visual parameter of the stained image is scored to obtain the first visual parameter score; Identify the fragmented and folded regions of the biological sample in the stained image, and score the fragmented and folded regions to obtain scores for the fragmented and folded regions. A first score for the stained image is determined based on the first visual parameter score, the score of the fragmented region of the biological sample, and the score of the folded region of the biological sample.
[0006] In one embodiment, the step of identifying the fragmented and folded regions of the biological sample in the stained image, and scoring the fragmented and folded regions to obtain scores for the fragmented and folded regions includes: The stained image is preprocessed and edge detected to obtain a grayscale image, gradient magnitude, and binary edge map of the stained image; The broken regions of the biological sample are identified based on the binary edge map, and the area, contour regularity, and aspect ratio of the contour boundary rectangle of the broken regions of the biological sample are calculated. The score for the fragmented area of the biological sample is determined based on the area, the regularity of the contour, and the aspect ratio of the contour boundary rectangle. The biological sample folding region is identified based on the grayscale image, and the contrast of the biological sample folding region is calculated. Based on the contrast and the gradient magnitude, a score for the folded region of the biological sample is determined.
[0007] In one embodiment, the step of determining a second score for the translucent image based on a second visual parameter of the translucent image and the target stained image includes: The second visual parameter of the transparent image is scored to obtain the second visual parameter score; Extract the first contour of the target stained image and the second contour of the transparent image, and determine the contour similarity score based on the first contour and the second contour; A second score for the translucent image is determined based on the second visual parameter score and the contour similarity score.
[0008] In one embodiment, the step of generating an experimental report corresponding to the target spatiotemporal omics experiment based on the target experimental data, the target experimental image, and the experimental report template includes: Retrieve the placeholder field at the current filling position in the experimental report template; Based on the placeholder field, filter the target filling data corresponding to the current filling position in the target experimental data, and / or filter the target filling image corresponding to the current filling position in the target experimental image; Fill the current fill position with the target fill data and / or the target fill image, and delete the placeholder field; The experiment report is generated once every fill position in the experiment report template has been filled.
[0009] In one embodiment, the step of filling the target filling image to the current filling position includes: Calculate the region of interest (ROI) of the target-filled image, and crop the target-filled image based on the ROI; The cropped target filling image is scaled according to the size of the current filling position; The scaled target filling image is preprocessed, and the preprocessed target filling image is then filled into the current filling position.
[0010] This application also provides an experimental report generation device for spatiotemporal omics, the experimental report generation device for spatiotemporal omics comprising: The determination module is used to determine the experimental report template corresponding to the target spatiotemporal omics experiment in response to the experimental report generation instruction for the target spatiotemporal omics experiment; The reading module is used to read the target experimental data and set of experimental images from the experimental information storage directory corresponding to the target spatiotemporal omics experiment, based on the experimental report template. The scoring module is used to score each experimental image in the set of experimental images and determine the target experimental image based on the scoring results. The generation module is used to generate an experimental report corresponding to the target spatiotemporal omics experiment based on the target experimental data, the target experimental image, and the experimental report template.
[0011] The embodiments of this application have the following beneficial effects: In response to an instruction to generate an experimental report for a target spatiotemporal omics experiment, this embodiment of the application determines an experimental report template corresponding to the target spatiotemporal omics experiment; based on the experimental report template, it reads the target experimental data and experimental image set from the experimental information storage directory corresponding to the target spatiotemporal omics experiment; it scores each experimental image in the experimental image set and determines the target experimental image based on the scoring results; and it generates an experimental report corresponding to the target spatiotemporal omics experiment based on the target experimental data, target experimental images, and experimental report template. By automatically generating spatiotemporal omics experimental reports, it avoids problems such as data entry errors and image omissions that are easily caused by human error, thus improving the accuracy and completeness of spatiotemporal omics experimental reports. Attached Figure Description
[0012] To more clearly illustrate the technical solutions of this application, the accompanying drawings used in the embodiments will be briefly described below. It should be understood that the following drawings only show some embodiments of this application and therefore should not be considered as a limitation on the scope of protection of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0013] Figure 1 A flowchart illustrating the first embodiment of the method for generating experimental reports in spatiotemporal omics provided in this application; Figure 2 A flowchart illustrating a second embodiment of the method for generating experimental reports in spatiotemporal omics provided in this application; Figure 3 A flowchart illustrating the third embodiment of the method for generating experimental reports in spatiotemporal omics provided in this application; Figure 4 A flowchart illustrating the fourth embodiment of the method for generating experimental reports in spatiotemporal omics provided in this application; Figure 5 A flowchart illustrating the fifth embodiment of the method for generating experimental reports in spatiotemporal omics provided in this application; Figures 6(a), 6(b), and 6(c) are schematic diagrams of quality inspection reports automatically generated by the experimental report generation device according to an embodiment of this application; Figures 7(a) and 7(b) are schematic diagrams of permeation reports automatically generated by the experimental report generation device according to an embodiment of this application; Figure 8 A schematic diagram of the experimental report generation device for spatiotemporal omics provided in this application. Detailed Implementation
[0014] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments.
[0015] The components of the embodiments of this application described and illustrated in the accompanying drawings can be arranged and designed in a variety of different configurations. Therefore, the following detailed description of the embodiments of this application provided in the drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0016] In the following, the terms “comprising,” “having,” and their cognates, which may be used in various embodiments of this application, are intended only to indicate a particular feature, number, step, operation, element, component, or combination thereof, and should not be construed as excluding, firstly, the presence of one or more other features, numbers, steps, operations, elements, components, or combinations thereof, or adding the possibility of one or more features, numbers, steps, operations, elements, components, or combinations thereof.
[0017] Furthermore, the terms "first," "second," and "third" are used only to distinguish descriptions and should not be interpreted as indicating or implying relative importance.
[0018] Unless otherwise specified, all terms used herein (including technical and scientific terms) shall have the same meaning as commonly understood by one of ordinary skill in the art to which the various embodiments of this application pertain. Terms (such as those defined in commonly used dictionaries) shall be interpreted as having the same meaning as in their contextual meaning in the relevant technical field and shall not be construed as having an idealized or overly formal meaning, unless clearly defined in the various embodiments of this application.
[0019] It is understood that the method of this application is applied to experimental report generation devices, which can be smart terminals, PC terminals, mobile terminals, etc., and are not limited here.
[0020] The following detailed description of some embodiments of this application is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0021] Please refer to Figure 1 , Figure 1 A flowchart illustrating a first embodiment of the method for generating experimental reports in spatiotemporal omics provided in this application, the method comprising: Step S101: In response to the instruction to generate an experimental report for the target spatiotemporal omics experiment, determine the experimental report template corresponding to the target spatiotemporal omics experiment.
[0022] In this embodiment, the experimental report generation device responds to a user's instruction to generate an experimental report for a target spatiotemporal omics experiment, and determines the corresponding experimental report template for the target spatiotemporal omics experiment. It is understood that the experimental report generation device pre-stores experimental report templates for various types of spatiotemporal omics experiments. When it receives a user's instruction to generate an experimental report for a target spatiotemporal omics experiment, it can retrieve the corresponding experimental report template from the database storing experimental report templates, based on the type of the target spatiotemporal omics experiment.
[0023] Step S102: Based on the experimental report template, read the target experimental data and experimental image set from the experimental information storage directory corresponding to the target spatiotemporal omics experiment.
[0024] In this embodiment, after determining the experimental report template, the experimental report generation device reads the target experimental data and experimental image set from the pre-set experimental information storage directory corresponding to the target spatiotemporal omics experiment according to the placeholder field of each position to be filled in the experimental report template.
[0025] It should be noted that before generating the experimental report, the experimental report generation device first creates an experimental task and receives the experimental data and images uploaded by relevant experimental personnel after completing the task, and saves the experimental data and images to the experimental information storage directory. Specifically, the experimental report generation device creates experimental tasks according to the client's experimental requirements, and creates task, project, and sample records in the experimental information storage directory according to the experimental tasks; the experimental report generation device receives the experimental data uploaded by relevant experimental personnel after completing the task, verifies the field integrity, data uniqueness, data format, and data correlation of the experimental data, and stores the corresponding task data, sample data, and project data corresponding to the verified experimental data in the experimental information storage directory to ensure the integrity of the data chain; the experimental report generation device receives the experimental images uploaded by relevant experimental personnel after completing the task, and saves the experimental images to the experimental information storage directory. The naming rule for experimental images is: <task number>_<sample name>_<image type>_<quantity number>.jpg, for example, TASK12345 / Sample01 / HE / 1.jpg.
[0026] Step S103: Score each experimental image in the experimental image set, and determine the target experimental image based on the scoring results.
[0027] In this embodiment, after determining the set of experimental images, the experimental report generation device scores each experimental image in the set and determines the target experimental image based on the scoring results. It should be noted that the experimental report generation device scores each experimental image based on its visual parameters and the biological sample information it contains, and then selects the experimental image with the highest score as the target experimental image. The experimental image with the highest score indicates that it has the best visual quality and the best biological sample information it contains.
[0028] Step S104: Generate an experimental report corresponding to the target spatiotemporal omics experiment based on the target experimental data, the target experimental image, and the experimental report template.
[0029] In this embodiment, the experimental report generation device determines the target experimental data and target experimental images. Based on the placeholder fields for each position to be filled in the experimental report template, it selects the target filling data and / or target filling image for each position from all the target experimental data and target experimental images. The target filling data and / or target filling image then replaces the placeholder fields and fills the positions. This generates the experimental report corresponding to the target spatiotemporal omics experiment.
[0030] It should be noted that during the filling process of the target image, the experimental report generation device performs cropping, scaling and other processing on the target image to ensure that the target image fits the corresponding filling position in the experimental report template.
[0031] The experimental report generation device in this embodiment, in response to an experimental report generation instruction for a target spatiotemporal omics experiment, determines the experimental report template corresponding to the target spatiotemporal omics experiment; based on the experimental report template, it reads the target experimental data and experimental image set from the experimental information storage directory corresponding to the target spatiotemporal omics experiment; it scores each experimental image in the experimental image set and determines the target experimental image based on the scoring results; and it generates the experimental report corresponding to the target spatiotemporal omics experiment based on the target experimental data, target experimental image, and experimental report template. By automatically generating spatiotemporal omics experimental reports, it avoids problems such as data entry errors and image omissions that are easily caused by negligence in manual operation, thereby improving the accuracy and completeness of spatiotemporal omics experimental reports.
[0032] Please refer to Figure 2 , Figure 2 This is a flowchart illustrating a second embodiment of the spatiotemporal omics experimental report generation method provided in this application. The difference between the second embodiment and the first embodiment is that the experimental image set includes stained images and translucent images. The step of scoring each experimental image in the experimental image set and determining the target experimental image based on the scoring results includes: Step S201: Determine a first score for the stained image based on the first visual parameters of the stained image and the biological sample information.
[0033] In this embodiment, after determining the set of experimental images corresponding to the target spatiotemporal omics experiment, the experimental report generation device determines a first score for each stained image in the set based on the first visual parameters and biological sample information. The first visual parameters include RGB channel pixel values, HSV color distribution, sharpness, and contrast; the biological sample information includes fragmented and folded regions of the biological sample, which are caused by physiological reasons or experimental operations. The experimental report generation device scores the first visual parameters of the stained image to obtain a first visual parameter score, scores the fragmented and folded regions of the biological sample to obtain fragmented region scores and folded region scores, and determines the first score of the stained image based on the first visual parameter score, the fragmented region score, and the folded region score.
[0034] It should be noted that the stained images are H&E staining images. H&E staining, or hematoxylin-eosin staining, is a commonly used staining method in histology. Hematoxylin staining solution is alkaline, which stains chromatin in the cell nucleus and nucleic acids in the cytoplasm blue or purple, while eosin staining solution is acidic, which stains proteins in the cytoplasm and extracellular matrix red or pink. Through H&E staining, the cell morphology, tissue structure, and relationships between cells can be clearly seen, helping researchers understand the normal or pathological morphology of tissues. Furthermore, morphological observation in sections can be used to assist in selecting target areas, providing a morphological basis for subsequent spatiotemporal omics analysis.
[0035] Step S202: Select the first staining image with the highest score from the experimental image set and determine it as the target staining image.
[0036] In this embodiment, after the experimental report generation device scores each stained image in the experimental image set, it selects the stained image with the highest score from the experimental image set as the target stained image.
[0037] Step S203: Based on the second visual parameters of the translucent image and the target stained image, determine the second score of the translucent image.
[0038] In this embodiment, after determining the target stained image, the experimental report generation device determines a second score for each translucent image in the experimental image set based on the second visual parameters of the translucent image and the target stained image. The second visual parameters include RGB channel pixel values, brightness, etc. The experimental report generation device calculates a contour similarity score between the translucent image and the target stained image, calculates a second visual parameter score for the translucent image, and determines the second score for each translucent image based on the contour similarity score and the second visual parameter score.
[0039] It's important to note that permeabilization is a step in spatiotemporal omics experiments. The Stereo-seq chip P (permeabilization assay chip) carries nucleotide capture probes. After binding to tissue slices, these probes capture mRNA molecules in situ within the tissue. Then, fluorescently labeled nucleotides are used to synthesize cDNA. The intensity and location of the fluorescence reflect the abundance and localization of the target molecule in the tissue or cell. Researchers can quickly determine the optimal permeabilization time for a specific tissue using fluorescence microscopy.
[0040] Step S204: Select the image with the highest second score from the experimental image set and determine it as the target image for transparentization.
[0041] In this embodiment, after the experimental report generation device scores each transparent image in the experimental image set, it selects the transparent image with the second highest score from the experimental image set as the target transparent image.
[0042] The experimental report generation device in this embodiment scores each staining image and permeation experiment in the experimental image set of the target spatiotemporal omics experiment, and then selects the staining image and permeation experiment with the highest score as the target staining image and target permeation experiment. This helps to add the best quality staining images and permeation experiments to the experimental report, thus improving the accuracy and completeness of spatiotemporal omics experimental reports.
[0043] Please refer to Figure 3 , Figure 3 This is a flowchart illustrating a third embodiment of the spatiotemporal omics experimental report generation method provided in this application. The difference between this third embodiment and the first to second embodiments is that the biological sample information includes: a fragmented region of the biological sample and a folded region of the biological sample. The step of determining a first score for the stained image based on the first visual parameters of the stained image and the biological sample information includes: Step S301: Score the first visual parameter of the stained image to obtain the first visual parameter score.
[0044] In this embodiment, the experimental report generation device scores the first visual parameter of the stained image to obtain the first visual parameter score.
[0045] In one embodiment, the first visual parameters include HSV color distribution and sharpness. The experimental report generation device scores the HSV color distribution and sharpness of the stained image to obtain an HSV color distribution score and a sharpness score. Specifically, the formulas for calculating the HSV color distribution score and sharpness score are as follows:
[0046]
[0047] in, It is the HSV color distribution score (such as the uniformity of hue saturation distribution); It's a resolution rating. It is a two-dimensional matrix representing the stained image, where each element I(x,y) represents the pixel grayscale value at coordinates (x,y). For Laplace filter calculation, It is a variance calculation.
[0048] Step S302: Identify the broken biological sample region and the folded biological sample region in the stained image, and score the broken biological sample region and the folded biological sample region to obtain the broken biological sample region score and the folded biological sample region score.
[0049] In this embodiment, the experimental report generation device identifies the broken and folded regions of the biological sample in the stained image, and scores the broken and folded regions to obtain scores for the broken and folded regions.
[0050] Step S303: Based on the first visual parameter score, the score of the broken area of the biological sample, and the score of the folded area of the biological sample, determine the first score of the stained image.
[0051] In this embodiment, the experimental report generation device determines the first score of the stained image based on the first visual parameter score, the biological sample fragmentation region score, and the biological sample folding region score.
[0052] In one embodiment, the formula for calculating the first score is: .
[0053] in, The first score for the stained image (the higher the value, the better the quality). Score the fragmented areas of biological samples (the smaller the value, the better the quality). Scoring of the folded regions of biological samples (higher values indicate more severe folding). Score the HSV color distribution. Rate the clarity. It is understandable that the weights can be adjusted according to different situations; this is just an example.
[0054] In one embodiment, the step of identifying the fragmented and folded regions of the biological sample in the stained image, and scoring the fragmented and folded regions to obtain scores for the fragmented and folded regions includes: Step S3021: Preprocess and perform edge detection on the stained image to obtain a grayscale image, gradient magnitude and binary edge map of the stained image.
[0055] In this embodiment, the experimental report generation device preprocesses the stained image to obtain a grayscale image of the stained image, and then performs Gaussian smoothing on the grayscale image to obtain a Gaussian smoothed grayscale image; the experimental report generation device performs edge detection on the grayscale image and the Gaussian smoothed grayscale image respectively to obtain the gradient magnitude and binary edge map of the stained image.
[0056] In one embodiment, the formula for preprocessing the stained image is:
[0057] in, To convert the image to grayscale, the RGB channels are weighted and fused (based on human eye sensitivity). R, G, and B are the pixel values of the red, green, and blue channels of the original image. The weighting coefficients (0.299, 0.587, 0.114) are determined based on the characteristic that the human eye is most sensitive to green light. This is a Gaussian-smoothed grayscale image used for noise reduction; σ=1.5 is the standard deviation of the Gaussian kernel, which controls the smoothing intensity (the larger the value, the more blurred the image).
[0058] In one embodiment, the formulas for edge detection of the grayscale image and the Gaussian-smoothed grayscale image are as follows:
[0059]
[0060] in, It is the gradient magnitude of the stained image; It is a two-dimensional matrix representing a grayscale image, where each element I(x,y) represents the pixel grayscale value (usually an integer between 0 and 255) at coordinates (x,y) in the grayscale image. , The gradient of the grayscale image in the x and y directions (calculated using the Sobel operator, etc.); The binary edge map extracted by the Canny algorithm; =50: Low threshold, weak edge detection threshold; =150: High threshold, strong edge detection threshold.
[0061] Step S3022: Identify the broken area of the biological sample based on the binary edge map, and calculate the area, contour regularity, and aspect ratio of the contour boundary rectangle of the broken area of the biological sample.
[0062] In this embodiment, the experimental report generation device identifies the broken areas of biological samples based on a binary edge map and calculates the area, contour regularity, and aspect ratio of the contour boundary rectangle of the broken areas of the biological samples.
[0063] In one embodiment, the formula for calculating the area of the broken region of the biological sample is:
[0064] in, It is the area of region C of the fragmented biological sample. This represents the minute increments (differential elements) of each pixel in the broken region of the biological sample in the x and y directions. In actual area calculations, dx and dy are simplified to pixel units (usually 1), so area calculation degenerates into counting pixels within the contour.
[0065] In one embodiment, the formula for calculating the regularity of the contour of a fragmented region of a biological sample is:
[0066] in, The regularity of the outline of the fragmented region C of the biological sample is usually expressed as the degree to which the outline is close to a circle (1 represents a perfect circle, and 0 represents an irregularity). It is pi; It is the area of region C of the broken biological sample; It is the perimeter of the outline of the fragmented region C of the biological sample. , ,in, : Represents the minute arc length (differential arc length) of the contour curve, which is achieved by accumulating the distances between adjacent pixels. x and y are the horizontal and vertical coordinates of the pixel.
[0067] In one embodiment, the formula for calculating the aspect ratio of the outline boundary rectangle of the broken region of the biological sample is:
[0068] in, It is the aspect ratio of the rectangle of the outline boundary of the fragmented region C of the biological sample (the larger the value, the narrower and longer the outline). It is the width of region C of the biological sample. Let C be the length of the fragmented region of the biological sample.
[0069] Step S3023: Determine the score of the broken area of the biological sample based on the area, the regularity of the contour, and the aspect ratio of the contour boundary rectangle.
[0070] In this embodiment, the experimental report generation device determines the score of the fragmented area of the biological sample based on the area, the regularity of the outline, and the aspect ratio of the outline boundary rectangle. In one embodiment, the formula for calculating the score of the fragmented area of the biological sample is:
[0071]
[0072]
[0073]
[0074]
[0075] Among them, the mean and standard deviation It is calculated by extracting the area value of the fragment contour record in each of 50-100 normally stained images (without artificial damage); It is the critical area value used to distinguish between normal tissue fragments and excessively large abnormal fragments; It is a score for the fragmented area of a biological sample. It refers to shape regularity. It's an aspect ratio penalty. It is an area penalty factor. The degree of regularity of the outline of the fragmented region of the biological sample; It is the area of the fragmented region of the biological sample; It is the aspect ratio of the rectangle representing the outline of the broken area of the biological sample. It is understandable that the weights can be adjusted according to different situations; this is just an example.
[0076] Step S3024: Identify the folded region of the biological sample based on the grayscale image, and calculate the contrast of the folded region of the biological sample.
[0077] In this embodiment, the experimental report generation device identifies the folded regions of biological samples based on grayscale images and calculates the contrast of these folded regions. In one embodiment, the formula for calculating the contrast of the folded regions of biological samples is:
[0078] in, It represents the contrast of the folded regions of a biological sample, reflecting the clarity of the texture (the higher the value, the sharper the edges). is the gray level of the grayscale image (usually 0-255), i is the gray value of the reference pixel, and j is the gray value of the adjacent pixel; The gray-level co-occurrence matrix (GLCM) represents the joint probability of gray levels i and j occurring adjacently under specific directions and distances. The GLCM is defined as follows: ; It is a two-dimensional matrix representing the grayscale image to be analyzed, where each element I(x,y) represents the pixel grayscale value (usually an integer between 0 and 255) at coordinates (x,y). It is the distance between pixel pairs (default d=1, i.e., adjacent pixels); The calculation direction is usually taken as one of four angles: [0°, 45°, 90°, 135°]. It is understood that the calculation direction can be adjusted according to different situations; this is just an example.
[0079] Step S3025: Determine the score of the folded region of the biological sample based on the contrast and the gradient magnitude.
[0080] In this embodiment, the experimental report generation device determines the score of the folded region of the biological sample based on contrast and gradient magnitude. In one embodiment, the formula for calculating the score of the folded region of the biological sample is:
[0081]
[0082] in, It is a score for the folded region of a biological sample; It is the weight of contrast. It is a weight for depth discontinuity; It's about contrast. : is the second derivative of the gradient magnitude. It refers to the depth changes in a grayscale image.
[0083] The experimental report generation device in this embodiment scores each stained image corresponding to the target spatiotemporal omics experiment based on its first visual parameters, the fragmented region of the biological sample, and the folded region of the biological sample. The score of the stained image is then determined by combining these scores. By considering not only the visual parameters of the image but also the biological sample information expressed in the image, the accuracy of the scoring is improved, which in turn helps to improve the accuracy of subsequent stained image selection.
[0084] Please refer to Figure 4 , Figure 4 A flowchart illustrating the fourth embodiment of the spatiotemporal omics experimental report generation method provided in this application. The difference between the fourth embodiment and the first to third embodiments lies in the step of determining the second score of the translucent image based on the second visual parameters of the translucent image and the target staining image, which includes: Step S401: The second visual parameter of the transparent image is scored to obtain the second visual parameter score.
[0085] In this embodiment, the experimental report generation device extracts the second visual parameters of the transparent image, scores the second visual parameters, and obtains the second visual parameter score.
[0086] In one embodiment, the second visual parameters are the mean luminance and the standard deviation of luminance, and the formula for calculating the mean luminance is: The formula for calculating the standard deviation of luminance is: Where L(x,y) is the pixel brightness value at coordinates (x,y), which is calculated by weighting the RGB values of the pixel at coordinates (x,y).
[0087] R, G, and B are the red, green, and blue channel pixel values (range 0-255) of the translucent image at (x, y); Mean is the average brightness of the translucent image, reflecting the overall translucent effect. Brightness is the standard deviation of the brightness of the translucent image, measuring the uniformity of the brightness distribution (the smaller the value, the more uniform); N is the total number of pixels in the translucent image.
[0088] In one embodiment, the second visual parameter score is a luminance quality score, and the formula for calculating the luminance quality score is:
[0089] in, The brightness quality score is given, with a higher score indicating better brightness. is the standard deviation of the brightness of the translucent image, measuring the uniformity of the brightness distribution; Mean is the average brightness of the translucent image, reflecting the overall translucent effect. The tanh function compresses the average brightness to the range of 0-1, and the coefficient 4 controls the steepness of the curve.
[0090] Step S402: Extract the first contour of the target stained image and the second contour of the transparent image, and determine the contour similarity score based on the first contour and the second contour.
[0091] In this embodiment, the experimental report generation device extracts the first contour of the target stained image and the second contour of the transparent image, and determines the contour similarity score based on the first contour and the second contour.
[0092] In one embodiment, the experimental report generation device can use the Canny and findContours algorithms to extract the first contour of the target stained image, and the GaussianBlur, Canny, and findContours algorithms to extract the second contour of the transparent image. Canny is an edge detection algorithm that accurately finds the edges of objects in an image while minimizing false edges and noise interference. findContours is used to find the contours of objects in a binary image. This algorithm can obtain the shape information of different objects in the image, and then analyze and identify the objects. GaussianBlur is an image smoothing algorithm based on a Gaussian filter. By applying Gaussian blur to the image, noise in the image can be reduced, and details in the image can be weakened to a certain extent, achieving a softening effect.
[0093] In one embodiment, the experimental report generation device calculates a contour similarity score between the second contour of the translucent image and the first contour of the target stained image. The formula for calculating the contour similarity score is:
[0094] in, It is a contour similarity score; HE is the first contour of the stained image; Trans is the second contour of the transparent image; This is the distance standardization parameter (default 10), which controls the rate of similarity decay; Hausdorff is the maximum mismatch distance between the first and second contours. , where d q is the mismatch distance, p is the number of pixels in the first contour, and q is the number of pixels in the second contour.
[0095] Step S403: Determine the second score of the transparent image based on the second visual parameter score and the contour similarity score.
[0096] In this embodiment, the experimental report generation device determines a second score for the translucent image based on a second visual parameter score and a contour similarity score. In one embodiment, the formula for calculating the second score of the translucent image is:
[0097]
[0098] in, It is the second score for the transparent image; Rating the brightness quality; It is a contour similarity score; It is a sharpness score for the transparent image, calculated using the variance of a Laplacian filter. Variance is the variance, used to measure the dispersion of image pixel values (i.e., contrast or information richness); the Laplacian filter is a second-order derivative operator used to detect edges and details in an image. Its response intensity reflects the sharpness of the image. It is understandable that the weights can be adjusted according to different situations; this is just an example.
[0099] The experimental report generation device in this embodiment scores the second visual parameter of each transparent image corresponding to the target spatiotemporal omics experiment, calculates the contour similarity score between the transparent image and the target stained image, and then combines the second visual parameter score and the contour similarity score to determine the second score of the transparent image. This helps improve the accuracy of the scoring, and thus helps improve the accuracy of subsequent selection of transparent images.
[0100] Please refer to Figure 5 , Figure 5 A flowchart illustrating the fifth embodiment of the method for generating experimental reports for spatiotemporal omics provided in this application. The difference between the fifth embodiment and the first to fourth embodiments is that the step of generating an experimental report corresponding to the target spatiotemporal omics experiment based on the target experimental data, the target experimental image, and the experimental report template includes: Step S501: Obtain the placeholder field for the current filling position in the experiment report template.
[0101] In this embodiment, after determining the target experimental data and target experimental image, the experimental report generation device sequentially identifies the fill positions in the experimental report template. For the currently being processed fill position, it obtains the placeholder field for that position. It is understood that each fill position in the experimental report template has a corresponding placeholder field, which indicates the experimental data or image that needs to be filled at that position. For example: the placeholder field ${permeabilization_pic} represents that the fill position needs to be filled with a permeabilization image; the placeholder field ${slice_embedding_pic} represents that the fill position needs to be filled with a tissue embedding image; and the placeholder field ${slice_he_pic} represents that the fill position needs to be filled with a staining image.
[0102] Step S502: Based on the placeholder field, filter the target filling data corresponding to the current filling position in the target experimental data, and / or filter the target filling image corresponding to the current filling position in the target experimental image.
[0103] In this embodiment, the experimental report generation device filters the target fill data corresponding to the current fill position in the target experimental data according to the placeholder field, or filters the target fill image corresponding to the current fill position in the target experimental image, or simultaneously determines the target fill data and target fill image corresponding to the current fill position. It is understood that some fill positions in the experimental report template only need to be filled with experimental data, some fill positions only need to be filled with experimental images, and some fill positions may need to be filled with both experimental images and experimental images simultaneously.
[0104] Step S503: Fill the current fill position with the target fill data and / or the target fill image, and delete the placeholder field.
[0105] In this embodiment, for some filling positions that only need to be filled with experimental data, the experimental report generation device fills the current filling position with the target filling data and deletes the placeholder field; for some filling positions that only need to be filled with experimental images, the experimental report generation device fills the current filling position with the target filling image and deletes the placeholder field; for some filling positions that may need to be filled with both experimental images and experimental images, the experimental report generation device fills the current filling position with both the target filling data and the target filling image and deletes the placeholder field.
[0106] Step S504: Continue until every fill position in the experimental report template is filled to generate the experimental report corresponding to the target spatiotemporal omics experiment.
[0107] In this embodiment, the experimental report generation device processes each fill position in the experimental report template sequentially until each fill position in the experimental report template is filled, thereby generating the experimental report corresponding to the target spatiotemporal omics experiment.
[0108] The experimental report generation device in this embodiment can quickly determine the target filling data and / or target filling image for each filling position by using the placeholder field of each filling position in the experimental report template. This avoids the need to analyze the filling content required for each filling position by combining the entire experimental report template, and can improve the efficiency and accuracy of generating experimental reports corresponding to spatiotemporal omics experiments.
[0109] In one embodiment, the step of filling the target filling image to the current filling position includes: Step S5031: Calculate the region of interest of the target filling image, and perform cropping processing on the target filling image based on the region of interest.
[0110] In this embodiment, the experimental report generation device calculates the region of interest (ROI) of the target filled image and performs cropping processing on the target filled image based on the ROI. In one embodiment, the experimental report generation device uses the Canny edge detection algorithm to identify key structural regions in the target filled image to generate a preliminary ROI, and further uses the Sobel operator to enhance the edges of the preliminary ROI to determine the final ROI.
[0111] In one embodiment, the experimental report generation device identifies the length and width of the region of interest (ROI) in the target filled image, identifies the length and width of the target filled image, calculates the cropping ratio based on the length and width of the ROI and the length and width of the target filled image, and then determines the cropping start position based on the length and width of the ROI, the length and width of the target filled image, and the cropping ratio. Based on the cropping start position, the target filled image is cropped to extract the ROI, ensuring that the key information of the target filled image is not cropped out.
[0112] The formula for calculating the starting position (x, y) of the cut is as follows:
[0113]
[0114] Where W is the width of the target filled image, and H is the length of the target filled image. The width of the region of interest. Let r be the length of the region of interest, and r be the cropping ratio. .
[0115] Step S5032: Scale the cropped target filling image according to the size of the current filling position.
[0116] In this embodiment, the experimental report generation device scales the cropped target fill image according to the size of the current fill position, reducing the size of the cropped target fill image to be the same as the size of the current fill position.
[0117] Step S5033: Preprocess the scaled target filling image and fill the preprocessed target filling image into the current filling position.
[0118] In this embodiment, the experimental report generation device preprocesses the scaled target filling image and fills the current filling position with the preprocessed target filling image. In one embodiment, the preprocessing may include: sharpening parameter adjustment, noise reduction, high-frequency enhancement, etc., so that the preprocessed target filling image has clear details and sharp edges.
[0119] The experimental report generation device in this embodiment performs cropping, scaling, and preprocessing on the target filling image when filling it to the current filling position. This ensures that the key information of the target filling image is not cropped out and that the details are clear and the edges are sharp, while also making the size of the target filling image conform to the size of the filling position, thereby improving the quality of the experimental images in the generated experimental report.
[0120] For example, the experimental report generated by the experimental report generation device includes a quality inspection report and a permeation report; referring to Figures 6(a), 6(b) and 6(c), the quality inspection report shows experimental data, staining images and permeation images; referring to Figures 7(a) and 7(b), the permeation report shows experimental data and permeation images.
[0121] refer to Figure 8 , Figure 8 This is a schematic diagram of the spatiotemporal omics experimental report generation device provided in this application. The spatiotemporal omics experimental report generation device includes: The determination module 10 is used to determine the experimental report template corresponding to the target spatiotemporal omics experiment in response to the experimental report generation instruction for the target spatiotemporal omics experiment.
[0122] The reading module 20 is used to read the target experimental data and experimental image set from the experimental information storage directory corresponding to the target spatiotemporal omics experiment according to the experimental report template.
[0123] The scoring module 30 is used to score each experimental image in the set of experimental images and determine the target experimental image based on the scoring results.
[0124] The generation module 40 is used to generate an experimental report corresponding to the target spatiotemporal omics experiment based on the target experimental data, the target experimental image, and the experimental report template.
[0125] It is understood that the experimental report generation device for spatiotemporal omics in this embodiment corresponds to the experimental report generation method for spatiotemporal omics in the above embodiment. The options in the above embodiment are also applicable to this embodiment, so they will not be described again here.
[0126] This application also provides a computer device, exemplary of which includes a processor and a memory, wherein the memory stores a computer program, and the processor executes the computer device to perform the above-described method for generating experimental reports in spatiotemporal omics by running the computer program.
[0127] The processor can be an integrated circuit chip with signal processing capabilities. The processor can be a general-purpose processor, including at least one of a Central Processing Unit (CPU), Graphics Processing Unit (GPU), Network Processor (NP), Digital Signal Processor (DSP), Application-Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The general-purpose processor can be a microprocessor or any conventional processor, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in the embodiments of this application.
[0128] The memory can be, but is not limited to, Random Access Memory (RAM), Read Only Memory (ROM), Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), etc. The memory is used to store computer programs, and the processor can execute the computer programs accordingly after receiving execution instructions.
[0129] This application also provides a computer storage medium for storing the computer program used in the aforementioned computer device. The computer storage medium can be a readable storage medium, a non-volatile storage medium, or a volatile storage medium. For example, the computer storage medium may include, but is not limited to, various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0130] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that, in alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0131] In addition, the functional modules or units in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0132] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a smartphone, personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application.
[0133] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
Claims
1. A method for generating experimental reports in spatiotemporal omics, characterized in that, The method includes: In response to the instruction to generate an experimental report for the target spatiotemporal omics experiment, the experimental report template corresponding to the target spatiotemporal omics experiment is determined; According to the experimental report template, the target experimental data and experimental image set are read from the experimental information storage directory corresponding to the target spatiotemporal omics experiment. Each experimental image in the set of experimental images is scored, and the target experimental image is determined based on the scoring results; Based on the target experimental data, the target experimental image, and the experimental report template, generate the experimental report corresponding to the target spatiotemporal omics experiment.
2. The method for generating experimental reports in spatiotemporal omics according to claim 1, characterized in that, The experimental image set includes stained images and transparent images. The step of scoring each experimental image in the experimental image set and determining the target experimental image based on the scoring results includes: Based on the first visual parameters of the stained image and the biological sample information, a first score for the stained image is determined; The staining image with the highest first score is selected from the experimental image set and determined as the target staining image; Based on the second visual parameters of the translucent image and the target stained image, a second score for the translucent image is determined; The image with the highest second score in the experimental image set is selected as the target image for transparency.
3. The method for generating experimental reports in spatiotemporal omics according to claim 2, characterized in that, The biological sample information includes: fragmented areas and folded areas of the biological sample. The step of determining a first score for the stained image based on the first visual parameters of the stained image and the biological sample information includes: The first visual parameter of the stained image is scored to obtain the first visual parameter score; Identify the fragmented and folded regions of the biological sample in the stained image, and score the fragmented and folded regions to obtain scores for the fragmented and folded regions. A first score for the stained image is determined based on the first visual parameter score, the score of the fragmented region of the biological sample, and the score of the folded region of the biological sample.
4. The method for generating experimental reports in spatiotemporal omics according to claim 3, characterized in that, The step of identifying the fragmented and folded regions of the biological sample in the stained image, and scoring the fragmented and folded regions to obtain scores for the fragmented and folded regions, includes: The stained image is preprocessed and edge detected to obtain a grayscale image, gradient magnitude, and binary edge map of the stained image; The broken regions of the biological sample are identified based on the binary edge map, and the area, contour regularity, and aspect ratio of the contour boundary rectangle of the broken regions of the biological sample are calculated. The score for the fragmented area of the biological sample is determined based on the area, the regularity of the contour, and the aspect ratio of the contour boundary rectangle. The biological sample folding region is identified based on the grayscale image, and the contrast of the biological sample folding region is calculated. Based on the contrast and the gradient magnitude, a score for the folded region of the biological sample is determined.
5. The method for generating experimental reports in spatiotemporal omics according to claim 2, characterized in that, The step of determining a second score for the translucent image based on the second visual parameters of the translucent image and the target stained image includes: The second visual parameter of the transparent image is scored to obtain the second visual parameter score; Extract the first contour of the target stained image and the second contour of the transparent image, and determine the contour similarity score based on the first contour and the second contour; A second score for the translucent image is determined based on the second visual parameter score and the contour similarity score.
6. The method for generating experimental reports in spatiotemporal omics according to any one of claims 1-5, characterized in that, The step of generating an experimental report corresponding to the target spatiotemporal omics experiment based on the target experimental data, the target experimental image, and the experimental report template includes: Retrieve the placeholder field at the current filling position in the experimental report template; Based on the placeholder field, filter the target filling data corresponding to the current filling position in the target experimental data, and / or filter the target filling image corresponding to the current filling position in the target experimental image; Fill the current fill position with the target fill data and / or the target fill image, and delete the placeholder field; The experiment report is generated once every fill position in the experiment report template has been filled.
7. The method for generating experimental reports in spatiotemporal omics according to claim 6, characterized in that, The step of filling the target fill image to the current fill position includes: Calculate the region of interest (ROI) of the target-filled image, and crop the target-filled image based on the ROI; The cropped target filling image is scaled according to the size of the current filling position; The scaled target filling image is preprocessed, and the preprocessed target filling image is then filled into the current filling position.
8. A device for generating experimental reports in spatiotemporal omics, characterized in that, The experimental report generation device for spatiotemporal omics includes: The determination module is used to determine the experimental report template corresponding to the target spatiotemporal omics experiment in response to the experimental report generation instruction for the target spatiotemporal omics experiment; The reading module is used to read the target experimental data and set of experimental images from the experimental information storage directory corresponding to the target spatiotemporal omics experiment, based on the experimental report template. The scoring module is used to score each experimental image in the set of experimental images and determine the target experimental image based on the scoring results. The generation module is used to generate an experimental report corresponding to the target spatiotemporal omics experiment based on the target experimental data, the target experimental image, and the experimental report template.
9. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing a computer program, and the processor executing the computer program to implement the method for generating experimental reports of spatiotemporal omics according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when run on a processor, executes the method for generating experimental reports of spatiotemporal omics according to any one of claims 1-7.