A device and method for measuring the size of a gastrointestinal tumor under a laparoscope

By performing grayscale stretching and gradient field analysis on laparoscopic gastrointestinal images and optimizing the gradient vector flow field with prior features, the problem of inaccurate measurement of gastrointestinal tumors under laparoscopy was solved, and the accurate measurement of the size of gastrointestinal tumors was achieved.

CN122335940APending Publication Date: 2026-07-03AFFILIATED HOSPITAL OF JIANGSU UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
AFFILIATED HOSPITAL OF JIANGSU UNIV
Filing Date
2026-03-03
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

It is difficult to accurately measure the size of gastrointestinal tumors under endoscopy, especially due to their irregular shape and blurred edges, which leads to inaccurate measurements.

Method used

By acquiring a sequence of transverse images of the gastrointestinal tract under ultrasound scanning, gray-level stretching is performed based on the gray-level distribution characteristics of the images themselves. Gradient fields and prior features are used to optimize the gradient vector flow field. Contour registration and confidence assessment are then performed in combination with adaptive edge constraint parameters of the images, thereby enabling the segmentation and measurement of gastrointestinal tumors.

Benefits of technology

It improves the accuracy and realism of gastrointestinal tumor size measurement, and can identify the edges of irregularly shaped and blurred gastrointestinal tumors from all angles, avoiding image distortion and tissue interference, and achieving precise quantification of tumor size.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122335940A_ABST
    Figure CN122335940A_ABST
Patent Text Reader

Abstract

This application provides a device and method for measuring the size of gastrointestinal tumors under endoscopy. Based on the grayscale distribution characteristics of the images themselves, a cross-sectional stretching image corresponding to each cross-sectional image in a sequence of cross-sectional images of the target gastrointestinal tract is determined. The gradient vector flow field of each cross-sectional stretching image is optimized based on the gradient field corresponding to each stretching image and the grayscale distribution and morphological prior features of the edge of the gastrointestinal tumor in the target gastrointestinal tract. Image-adaptive edge constraint parameters are obtained when measuring the edge of the gastrointestinal tumor in the target gastrointestinal tract. A gastrointestinal tumor segmentation reference image is obtained by optimizing the gradient vector flow field using each edge constraint parameter and all prior features. The gastrointestinal tumor segmentation reference image is then matched with the currently acquired gastrointestinal tumor monitoring image for contour registration and confidence assessment to obtain the confidence region of the gastrointestinal tumor in the target gastrointestinal tract. This sampling method can comprehensively identify the edges of gastrointestinal tumors with irregular shapes and blurred edges.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of tumor size measurement technology, and more specifically, to a device and method for measuring the size of gastrointestinal tumors under endoscopy. Background Technology

[0002] In medical imaging and surgical planning, accurate measurement of tumor size is crucial for diagnosis, treatment planning, and prognostic assessment. With advancements in imaging technologies such as CT, MRI, and ultrasound, high-resolution three-dimensional images have made precise tumor measurement possible. Traditional measurement methods are mostly based on two-dimensional images and rely on manual measurement, which is subject to operational dependence and subjective errors. With the introduction of computer vision technology, automated tumor edge detection and three-dimensional reconstruction technologies have emerged. These technologies can effectively extract tumor edges by utilizing image processing algorithms, providing more accurate and objective measurement results. In addition, intraoperative laparoscopic techniques combined with real-time imaging make real-time tumor measurement possible. With the rapid development of artificial intelligence and machine learning technologies, deep learning-based automatic tumor segmentation and measurement methods are also gradually being applied in clinical practice, further improving the accuracy and efficiency of measurement.

[0003] In existing technologies, tumor size measurement is mainly based on the analysis and processing of imaging data. Imaging equipment is used to acquire tumor image data, and then edge detection algorithms are used to extract the precise boundaries of the tumor from the image data. Finally, a three-dimensional model of the tumor is reconstructed using the extracted tumor boundaries to more accurately measure the tumor's volume and shape. However, in laparoscopic measurement of gastrointestinal tumor size, gastrointestinal tumors often have irregular shapes and indistinct edges, resulting in extremely poor visibility of the tumor's edges. This is especially true for asymmetric or multiple lesions, where the limited field of view provided by the endoscope makes it difficult to fully cover the tumor and its surrounding tissues. Consequently, it is impossible to accurately determine the complete boundaries of the gastrointestinal tumor during measurement, thus reducing the accuracy of gastrointestinal tumor size measurement. Therefore, how to comprehensively identify the edges of gastrointestinal tumors with irregular shapes and indistinct edges, thereby improving the accuracy of gastrointestinal tumor size measurement, has become a challenge for the industry. Summary of the Invention

[0004] This application provides a device and method for measuring the size of gastrointestinal tumors under endoscopy, which can identify the edges of gastrointestinal tumors with irregular shapes and unclear edges from all angles, thereby improving the accuracy of gastrointestinal tumor size measurement.

[0005] In a first aspect, this application provides an image processing method for measuring the size of gastrointestinal tumors, comprising the following steps: Obtain a sequence of cross-sectional images of the target gastrointestinal tract under ultrasound scanning; Based on the grayscale distribution characteristics of the image itself, each cross-sectional image in the cross-sectional image sequence is stretched in grayscale to obtain the cross-sectional stretched image corresponding to each cross-sectional image. For each cross-sectional stretching image, determine the two-dimensional gradient vector of each stretched pixel in the cross-sectional stretching image based on the 3×3 local neighborhood under gray-scale projection, and construct the gradient field corresponding to the cross-sectional stretching image based on all the two-dimensional gradient vectors. Based on the gradient field and the prior features of gray-scale distribution and morphology of the edge of the gastrointestinal tumor in the target gastrointestinal tract, the prior feature optimized gradient vector flow field of the cross-sectional stretch map when measuring the tumor edge is obtained by solving and optimizing the prior feature optimized gradient vector flow field of each cross-sectional stretch map when measuring the tumor edge. Multiple image-adaptive edge constraint parameters are obtained when measuring the edge of gastrointestinal tumors in the target gastrointestinal tract. The gradient vector flow field is optimized through each edge constraint parameter and all prior features to obtain a reference map of gastrointestinal tumor segmentation in the target gastrointestinal tract. The reference map of gastrointestinal tumor segmentation is matched with the currently acquired gastrointestinal tumor monitoring map for contour registration and confidence assessment to obtain the confidence region of gastrointestinal tumors in the target gastrointestinal tract. Based on the confidence region of the gastrointestinal tumor, the size of the gastrointestinal tumor in the target gastrointestinal tract is determined with confidence. Based on the preset tumor measurement calibration value, the pixel unit is converted into the physical size unit, and the measurement result of the size of the gastrointestinal tumor in the target gastrointestinal tract is output by the gastrointestinal tumor size measurement device under the endoscope.

[0006] In some embodiments, gray-level stretching is performed on each cross-sectional image in the cross-sectional image sequence based on the image's own gray-level distribution characteristics to obtain a stretched cross-sectional image corresponding to each cross-sectional image. Specifically, this includes: Acquire a preset tumor measurement calibration value during the process of measuring the size of gastrointestinal tumors in the target gastrointestinal tract. This calibration value is used for pixel-physical size calibration during subsequent tumor size determination. One cross-sectional image from the cross-sectional image sequence is selected as the chosen cross-sectional image; Determine the grayscale dynamic range, maximum grayscale value, and minimum grayscale value of the selected cross-sectional image; The grayscale stretching coefficient of the selected cross-sectional image is determined by the grayscale dynamic range, the maximum grayscale value, and the minimum grayscale value. Each gray value in the selected cross-sectional image is stretched according to the gray-scale stretching coefficient. After stretching, the gray values ​​are truncated within the range of 0-255 to obtain the cross-sectional stretched image corresponding to the cross-sectional image. Continue to determine the cross-sectional stretching diagrams corresponding to the remaining cross-sectional images in the cross-sectional image sequence.

[0007] In some embodiments, determining the two-dimensional gradient vector of each stretched pixel in the cross-sectional stretched image under grayscale projection based on a 3×3 local neighborhood specifically includes: Select one stretching pixel in the cross-sectional stretching image as the selected stretching pixel. Determine the horizontal and vertical gray-level gradients of the selected stretched pixel point based on the 3×3 local neighborhood under gray-level direction projection; The horizontal grayscale gradient and the vertical grayscale gradient are combined to obtain a two-dimensional gradient vector of the selected stretched pixel. Continue to determine the two-dimensional gradient vector of the remaining stretched pixels in the cross-sectional stretching diagram.

[0008] In some embodiments, determining the horizontal and vertical grayscale gradients of the selected stretched pixel point based on a 3×3 local neighborhood under grayscale direction projection specifically includes: Extract the corresponding gray values ​​in the horizontal direction and the corresponding gray values ​​in the vertical direction within the 3×3 local neighborhood of the selected stretched pixel from the cross-sectional stretched image; The horizontal grayscale gradient of the selected stretched pixel under grayscale projection is determined by the Sobel operator using the corresponding grayscale values ​​in the horizontal direction within the 3×3 local neighborhood. The vertical grayscale gradient of the selected stretched pixel under the grayscale direction projection is determined by the Sobel operator using the corresponding grayscale values ​​in the vertical direction within the 3×3 local neighborhood.

[0009] In some embodiments, constructing the gradient field corresponding to the cross-sectional stretching diagram based on all two-dimensional gradient vectors specifically includes: Obtain the pixel dimensions of the cross-sectional stretched image; By mapping the two-dimensional gradient vector of each stretched pixel to its pixel position, a gradient matrix matching the pixel dimension is directly constructed. All two-dimensional gradient vectors are mapped to the gradient matrix according to their pixel positions to obtain the gradient field corresponding to the cross-sectional stretching diagram.

[0010] In some embodiments, the gastrointestinal tumor segmentation reference map is matched with the currently acquired gastrointestinal tumor monitoring map for contour registration and confidence assessment to obtain the gastrointestinal tumor confidence region of the target gastrointestinal tract, specifically including: Obtain the currently collected gastrointestinal tumor monitoring map; The edge contour of the gastrointestinal tumor in the gastrointestinal tumor segmentation reference image is extracted by optimizing the gradient vector flow field using prior features to obtain the first edge contour. The edge contour of the gastrointestinal tumor in the gastrointestinal tumor monitoring image is extracted by optimizing the gradient vector flow field using prior features to obtain the second edge contour. The first edge contour and the second edge contour are spatially similarly registered using the iterative nearest point algorithm. The overlap and gradient magnitude similarity of the registered contours are calculated. A confidence threshold is set to filter the effective overlapping area and obtain the confidence region of the gastrointestinal tumor in the target gastrointestinal tract.

[0011] In some embodiments, a sequence of cross-sectional images of the target gastrointestinal tract under ultrasound scanning is obtained by endoscopic ultrasound, wherein the scanning parameters of the endoscopic ultrasound are consistent with the image acquisition frame rate to ensure the spatial continuity of the cross-sectional image sequence.

[0012] Secondly, this application provides a device for measuring the size of gastrointestinal tumors under laparoscopy, which includes a measurement image processing unit, the measurement image processing unit comprising: The acquisition module is used to acquire a sequence of cross-sectional images of the target gastrointestinal tract under ultrasound scanning and extract the grayscale distribution features of each cross-sectional image. The processing module is used to perform grayscale stretching on each cross-sectional image in the cross-sectional image sequence based on the grayscale distribution characteristics of the image itself, so as to obtain the cross-sectional stretching map corresponding to each cross-sectional image. The processing module is also used to determine, for each cross-sectional stretch image, the two-dimensional gradient vector of each stretched pixel in the cross-sectional stretch image based on the 3×3 local neighborhood under grayscale projection, and to construct the gradient field corresponding to the cross-sectional stretch image based on all the two-dimensional gradient vectors. The processing module is also used to solve and optimize the prior feature optimized gradient vector flow field of the cross-sectional stretch map when measuring the tumor edge, based on the gradient field and the gray-scale distribution and morphological prior features of the edge of the gastrointestinal tumor in the target gastrointestinal tract. This results in the prior feature optimized gradient vector flow field of each cross-sectional stretch map when measuring the tumor edge. The execution module is used to acquire multiple image adaptive edge constraint parameters when measuring the edge of a gastrointestinal tumor in the target gastrointestinal tract. It optimizes the gradient vector flow field through each edge constraint parameter and all prior features to obtain a reference map of gastrointestinal tumor segmentation in the target gastrointestinal tract. It performs contour registration and confidence assessment on the reference map of gastrointestinal tumor segmentation with the currently acquired gastrointestinal tumor monitoring map to obtain the confidence region of gastrointestinal tumor in the target gastrointestinal tract. Based on the preset tumor measurement calibration value, it converts the pixel units of the confidence region of gastrointestinal tumor into physical size units.

[0013] Thirdly, this application provides a computer device including a memory and a processor, the memory storing code, and the processor being configured to acquire the code and execute the above-described image processing method for measuring the size of gastrointestinal tumors.

[0014] Fourthly, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described image processing method for measuring the size of gastrointestinal tumors.

[0015] The technical solutions provided by the embodiments disclosed in this application have the following beneficial effects: The device and method for measuring the size of gastrointestinal tumors under endoscopy provided in this application first acquire a sequence of cross-sectional images of the target gastrointestinal tract under ultrasound scanning; secondly, based on the gray-level distribution characteristics of the images themselves, each cross-sectional image in the sequence is gray-level stretched to obtain a cross-sectional stretched image corresponding to each cross-sectional image; further, for each cross-sectional stretched image, the two-dimensional gradient vector of each stretched pixel in the cross-sectional stretched image based on a 3×3 local neighborhood is determined under gray-level projection, and a gradient field corresponding to the cross-sectional stretched image is constructed based on all the two-dimensional gradient vectors; further still, based on the gradient field and the gray-level distribution and morphological prior features of the edge of the gastrointestinal tumor in the target gastrointestinal tract, the prior feature optimization gradient of the cross-sectional stretched image when measuring the tumor edge is solved and optimized. The vector flow field is used to obtain the prior feature-optimized gradient vector flow field for each cross-sectional stretch image when determining the tumor edge. Then, multiple image-adaptive edge constraint parameters are obtained when determining the edge of the gastrointestinal tumor in the target gastrointestinal tract. The gradient vector flow field is optimized through each edge constraint parameter and all prior features to obtain the gastrointestinal tumor segmentation reference map of the target gastrointestinal tract. The gastrointestinal tumor segmentation reference map is matched with the currently acquired gastrointestinal tumor monitoring map for contour registration and confidence assessment to obtain the gastrointestinal tumor confidence region of the target gastrointestinal tract. Finally, the size of the gastrointestinal tumor in the target gastrointestinal tract is determined with confidence based on the gastrointestinal tumor confidence region. The pixel units are converted into physical size units based on the preset tumor measurement calibration value, and the measurement results are output by the gastrointestinal tumor size measurement device under the endoscope.

[0016] Therefore, this application can comprehensively identify the edges of gastrointestinal tumors with irregular shapes and blurred edges, thereby improving the accuracy of gastrointestinal tumor size measurement. Firstly, grayscale stretching and range constraint are applied based on the image's own features, effectively highlighting the identification features of gastrointestinal tumors in the target gastrointestinal tract while avoiding image distortion. Furthermore, the edges of the gastrointestinal tumors are identified based on these features, thus avoiding the identification difficulties caused by the irregular shape and blurred edges of gastrointestinal tumors. Secondly, based on cross-sectional stretching... Figure 3The gradient field corresponding to the cross-sectional stretched image is constructed by multiple two-dimensional gradient vectors determined by the local neighborhood of ×3, which can effectively enhance the local edge features of gastrointestinal tumors in the cross-sectional stretched image to distinguish the gastrointestinal tumor area from other tissue areas, thereby improving the visibility of the gastrointestinal tumor edge and avoiding interference from the surrounding tissues. Furthermore, the gradient vector flow field is optimized by solving and combining the prior features of the tumor edge to achieve global convergence of edge detection and effectively adapt to the heterogeneity of the tumor edge. Then, the gradient vector flow field is optimized by the image-adaptive edge constraint parameters to obtain the tumor segmentation reference image. Combined with the contour registration and confidence assessment of the baseline reference image and the current monitoring image, the effective contour area of ​​the gastrointestinal tumor in the target gastrointestinal tract (i.e., the gastrointestinal tumor confidence area) is obtained in all directions. At the same time, the tumor measurement calibration value is returned to the original purpose of pixel-physical size calibration to achieve accurate quantification of tumor size. In summary, the technical solution provided by this application conforms to the basic principles of digital image processing and medical image processing, and can identify the edges of gastrointestinal tumors with irregular shapes and blurred edges in all directions, thereby improving the accuracy and authenticity of gastrointestinal tumor size measurement. Attached Figure Description

[0017] Figure 1 This is an exemplary flowchart of an image processing method for measuring the size of gastrointestinal tumors according to some embodiments of this application; Figure 2 This is an exemplary flowchart of determining a cross-sectional tensile diagram according to some embodiments of this application; Figure 3 This is an exemplary flowchart of determining a two-dimensional gradient vector according to some embodiments of this application; Figure 4 These are schematic diagrams of exemplary hardware and / or software of a measurement image processing unit according to some embodiments of this application; Figure 5 This is a schematic diagram of the structure of a computer device for implementing an image processing method for measuring the size of gastrointestinal tumors, according to some embodiments of this application. Detailed Implementation

[0018] To better understand the above technical solutions, the following will provide a detailed explanation of the technical solutions in conjunction with the accompanying drawings and specific implementation methods.

[0019] refer to Figure 1 The figure is an exemplary flowchart of an image processing method for measuring the size of gastrointestinal tumors according to some embodiments of this application. The image processing method 100 for measuring the size of gastrointestinal tumors mainly includes the following steps: In step 101, a sequence of cross-sectional images of the target gastrointestinal tract under ultrasound scanning is obtained.

[0020] In practice, a sequence of cross-sectional images of the target gastrointestinal tract under ultrasound scanning is acquired using an endoscopic ultrasound system. The scanning parameters of the endoscopic ultrasound system are kept consistent with the image acquisition frame rate to ensure the spatial continuity of the cross-sectional image sequence. The cross-sectional image sequence contains multiple cross-sectional images. Specifically, the endoscopic ultrasound system can be used to continuously scan at different locations and depths of the target gastrointestinal tract to obtain a series of cross-sectional images, thus obtaining a cross-sectional image sequence. All cross-sectional images are arranged in the scanning order to obtain the cross-sectional image sequence. In this embodiment, the cross-sectional image represents an image acquired along a horizontal section of the gastrointestinal tract, and the cross-sectional image shows a cross-section of the tissue.

[0021] In step 102, each cross-sectional image in the cross-sectional image sequence is subjected to gray-scale stretching based on the image's own gray-scale distribution characteristics to obtain the cross-sectional stretched image corresponding to each cross-sectional image.

[0022] In some embodiments, reference Figure 2 As shown, this figure is an exemplary flowchart of determining a cross-sectional stretching image according to some embodiments of this application. In this embodiment, the gray-scale stretching of each cross-sectional image in the cross-sectional image sequence based on the image's own gray-scale distribution characteristics to obtain the cross-sectional stretching image corresponding to each cross-sectional image can be achieved by the following steps: First, in step 1021, a preset tumor measurement calibration value is obtained during the process of measuring the size of gastrointestinal tumors in the target gastrointestinal tract. This calibration value is used for pixel-physical size calibration during subsequent tumor size determination. Secondly, in step 1022, one cross-sectional image from the cross-sectional image sequence is selected as the selected cross-sectional image; Further, in step 1023, the grayscale dynamic range, maximum grayscale value, and minimum grayscale value of the selected cross-sectional image are determined; Furthermore, in step 1024, the grayscale stretching coefficient of the selected cross-sectional image is determined by the grayscale dynamic range, the maximum grayscale value, and the minimum grayscale value. Then, in step 1025, each gray value in the selected cross-sectional image is stretched according to the gray-scale stretching coefficient, and the gray value is truncated in the range of 0-255 after stretching to obtain the cross-sectional stretched image corresponding to the cross-sectional image. Finally, in step 1026, the cross-sectional stretching diagrams corresponding to the remaining cross-sectional images in the cross-sectional image sequence are determined.

[0023] In practice, the tumor measurement calibration value can be obtained from the gastrointestinal tumor monitoring database during the measurement of the size of gastrointestinal tumors in the target gastrointestinal tract. In this embodiment, the tumor measurement calibration value represents the conversion calibration parameter between pixels and actual physical size (e.g., 1 pixel = 0.05 mm). The specific value can be set according to the equipment parameters of the ultrasound endoscope, and is not limited here.

[0024] In practice, the grayscale dynamic range, maximum grayscale value, and minimum grayscale value of the selected cross-sectional image are determined. Specifically, the maximum and minimum grayscale values ​​in the selected cross-sectional image are statistically analyzed using the image grayscale histogram. The grayscale dynamic range is calculated as maximum grayscale value - minimum grayscale value. Based on the grayscale dynamic range, the mapping interval for grayscale stretching is determined to ensure that the contrast of the stretched image is improved without information loss.

[0025] In specific implementation, the gray-scale stretching coefficient of the selected cross-sectional image is determined by the gray-scale dynamic range, the maximum gray-scale value, and the minimum gray-scale value. That is, the target gray-scale dynamic range is set to 255 (0-255), and the gray-scale stretching coefficient = target gray-scale dynamic range / original gray-scale dynamic range. The stretched gray-scale value is calculated by using the linear transformation formula = (original gray-scale value - minimum gray-scale value) × stretching coefficient. In addition, in other embodiments, a nonlinear gray-scale stretching algorithm (such as gamma transform) can be used to determine the stretching coefficient. This is not limited here. Furthermore, in this embodiment, the gray-scale stretching coefficient represents a parameter used to enhance key features in the cross-sectional image, which is adaptively determined by the image's own gray-scale features.

[0026] In some embodiments, each grayscale value in the selected cross-sectional image is stretched according to the grayscale stretching coefficient, and the stretched grayscale values ​​are truncated within the range of 0-255 to obtain the stretched cross-sectional image. Specifically, the following steps can be used: The stretched grayscale value corresponding to each original grayscale value is calculated using a linear transformation formula. The stretched grayscale value is truncated within the range of 0-255. If the stretched grayscale value is <0, it is set to 0; if the stretched grayscale value is >255, it is set to 255, thus obtaining the final stretched grayscale value. Replace the original grayscale value with the final stretched grayscale value to obtain the cross-sectional stretched image corresponding to the cross-sectional image.

[0027] It should be noted that, in this application, the cross-sectional stretched image refers to the image after grayscale stretching of the cross-sectional image, that is, the image after enhancing the grayscale features of the cross-sectional image and constraining the grayscale range. The cross-sectional stretched image contains multiple stretched pixels, that is, the pixels in the cross-sectional stretched image are used as stretched pixels. In the measurement of the size of gastrointestinal tumors in the gastrointestinal tract, images of gastrointestinal tumors in the gastrointestinal tract are usually acquired by ultrasound scanning. However, gastrointestinal tumors have problems such as blurred edges, irregular size, and interference from other tissues, making the features of the acquired image unclear. Therefore, grayscale stretching based on the image's own features and range constraint can effectively highlight the features of gastrointestinal tumors in the target gastrointestinal tract and avoid image distortion, thereby better measuring the size of gastrointestinal tumors.

[0028] It should also be noted that, in this application, grayscale stretching refers to the process of enhancing the grayscale features of a cross-sectional image. Specifically, grayscale stretching is performed on each cross-sectional image in the cross-sectional image sequence based on the image's own grayscale distribution characteristics. During the stretching process, the grayscale value is limited to an effective range of 0-255. This involves: obtaining a preset tumor measurement calibration value during the measurement of gastrointestinal tumor size in the target gastrointestinal tract and using it for subsequent size calibration; selecting one cross-sectional image from the cross-sectional image sequence as the selected cross-sectional image; determining the grayscale dynamic range, maximum grayscale value, and minimum grayscale value of the selected cross-sectional image; determining the grayscale stretching coefficient of the selected cross-sectional image based on the grayscale dynamic range, maximum grayscale value, and minimum grayscale value; stretching each grayscale value in the selected cross-sectional image according to the grayscale stretching coefficient and truncating it within the 0-255 range; and continuing to determine the cross-sectional stretching map corresponding to the remaining cross-sectional images in the cross-sectional image sequence, thus completing the grayscale stretching of each cross-sectional image in the cross-sectional image sequence.

[0029] In step 103, for each cross-sectional stretching image, the two-dimensional gradient vector of each stretched pixel in the cross-sectional stretching image under gray-scale projection is determined based on the 3×3 local neighborhood, and the gradient field corresponding to the cross-sectional stretching image is constructed based on all the two-dimensional gradient vectors.

[0030] It should be noted that in this application, gray-level directional projection means performing projection analysis of gray-level features on the local neighborhood of a pixel in the horizontal and vertical directions of the image, respectively, to extract the directional features of local edges. The basic idea is to describe the edge distribution features of the image by calculating the gray-level gradient of the local neighborhood of the image in a specific direction.

[0031] In some embodiments, reference Figure 3 As shown, this figure is an exemplary flowchart of determining a two-dimensional gradient vector according to some embodiments of this application. In this embodiment, determining the two-dimensional gradient vector of each stretched pixel in the cross-sectional stretched image under grayscale projection based on a 3×3 local neighborhood can be achieved by the following steps: First, in step 1031, a stretching pixel in the cross-sectional stretching image is selected as the selected stretching pixel. Secondly, in step 1032, the horizontal and vertical gray-level gradients of the selected stretched pixel point based on the 3×3 local neighborhood are determined under the gray-level direction projection. Then, in step 1033, the horizontal grayscale gradient and the vertical grayscale gradient are combined to obtain the two-dimensional gradient vector of the selected stretched pixel. Finally, in step 1034, the two-dimensional gradient vectors of the remaining stretched pixels in the cross-sectional stretching diagram are determined.

[0032] In some embodiments, determining the horizontal and vertical gray-level gradients of the selected stretched pixel point based on the 3×3 local neighborhood under gray-level projection can specifically involve the following steps: Extract the corresponding gray values ​​in the horizontal direction and the corresponding gray values ​​in the vertical direction within the 3×3 local neighborhood of the selected stretched pixel from the cross-sectional stretched image; The horizontal grayscale gradient of the selected stretched pixel under grayscale projection is determined by the Sobel operator using the corresponding grayscale values ​​in the horizontal direction within the 3×3 local neighborhood. The vertical grayscale gradient of the selected stretched pixel under the grayscale direction projection is determined by the Sobel operator using the corresponding grayscale values ​​in the vertical direction within the 3×3 local neighborhood.

[0033] In practice, the image processing tool OpenCV can be used to extract the corresponding gray values ​​in the horizontal and vertical directions of the selected stretched pixel within a 3×3 local neighborhood from the cross-sectional stretched image. The 3×3 local neighborhood is the area formed by the eight adjacent pixels around the selected stretched pixel, which is a classic neighborhood size for local image feature extraction, and will not be elaborated here.

[0034] In specific implementation, the horizontal grayscale gradient of the selected stretched pixel is determined by the Sobel operator based on the corresponding grayscale value in the horizontal direction within the 3×3 local neighborhood. That is, the grayscale value of the 3×3 local neighborhood is convolved with the Sobel horizontal operator template, and the convolution result is the horizontal grayscale gradient of the selected stretched pixel. In addition, in other embodiments, the Prewitt and Roberts operators can also be used to calculate the local gradient. It is not limited here. It should be noted that in this embodiment, the horizontal grayscale gradient represents the change of grayscale value in the horizontal direction within the 3×3 local neighborhood with the selected stretched pixel as the reference point, which can reflect the strength of the local horizontal edge.

[0035] In specific implementation, the vertical grayscale gradient of the selected stretched pixel under grayscale projection is determined by the Sobel operator using the corresponding grayscale values ​​in the vertical direction within the 3×3 local neighborhood. That is, the grayscale values ​​of the 3×3 local neighborhood are convolved with the Sobel vertical operator template, and the convolution result is the vertical grayscale gradient of the selected stretched pixel. In addition, in other embodiments, the Prewitt and Roberts operators can also be used to calculate the local gradient. This is not limited here. It should be noted that in this embodiment, the vertical grayscale gradient represents the change in grayscale value with spatial position in the vertical direction within the 3×3 local neighborhood with the selected stretched pixel as the reference point of the cross-sectional stretched image, which can reflect the strength of the local vertical edge.

[0036] In a specific implementation, the horizontal grayscale gradient and the vertical grayscale gradient are combined to obtain a two-dimensional gradient vector of the selected stretched pixel. That is, the horizontal grayscale gradient and the vertical grayscale gradient are combined into a two-dimensional gradient vector, and this vector is used as the two-dimensional gradient vector of the selected stretched pixel. For example, if the horizontal grayscale gradient and the vertical grayscale gradient of the selected stretched pixel are Gx and Gy respectively, then the two-dimensional gradient vector of the selected stretched pixel is (Gx, Gy). This vector contains both the direction and strength information of the edge.

[0037] It should be noted that in this application, the two-dimensional gradient vector represents the gradient feature vector describing the 3×3 local neighborhood of a pixel in the cross-sectional stretched image in both horizontal and vertical directions. This two-dimensional gradient vector reflects the local edge variation characteristics of each pixel in the cross-sectional stretched image; that is, the larger the magnitude of the two-dimensional gradient vector, the more obvious the local edge features of the pixel; conversely, the smaller the magnitude of the two-dimensional gradient vector, the more uniform the gray level of the local area of ​​the pixel, and the absence of obvious edge features. By determining the two-dimensional gradient vector, local edge detail features in the cross-sectional stretched image can be effectively identified, thereby effectively extracting the edge information of gastrointestinal tumors in the cross-sectional stretched image, thus enabling more accurate measurement of the size of gastrointestinal tumors in the gastrointestinal tract.

[0038] In some embodiments, constructing the gradient field corresponding to the cross-sectional stretching diagram based on all two-dimensional gradient vectors can be achieved through the following steps: Obtain the pixel dimensions (width W × height H) of the cross-sectional stretched image; By mapping the two-dimensional gradient vector of each stretched pixel to the pixel position, a gradient matrix (W×H) matching the pixel dimension is directly constructed. All two-dimensional gradient vectors are mapped one by one to the gradient matrix according to pixel position (x,y) to obtain the gradient field corresponding to the cross-sectional stretching diagram.

[0039] It should be noted that in this embodiment, the position of each element in the gradient matrix corresponds exactly to the position of the pixel in the cross-sectional stretching diagram. Each element is a two-dimensional gradient vector of the corresponding pixel, which is a classic expression of the gradient field.

[0040] In specific implementation, the pixel dimension of the cross-sectional stretch image can be obtained through OpenCV in the image processing tool, which will not be elaborated here. In addition, in other embodiments, other acquisition tools can also be used to obtain the pixel dimension of the cross-sectional stretch image, which is not limited here. It should be noted that in this embodiment, the pixel dimension represents the number of pixels in the horizontal (width) and vertical (height) directions of the cross-sectional stretch image.

[0041] It should be noted that, in this application, the gradient field represents a gradient matrix that matches the pixel dimension of an image, composed of two-dimensional gradient vectors calculated from a 3×3 local neighborhood, in the measurement of gastrointestinal tumors. The gradient field reflects the local edge change features of each pixel in the cross-sectional stretched image, especially the edge features of gastrointestinal tumors. The gradient field contains multiple two-dimensional gradient vectors, which reflect the feature quantity representing the edge of gastrointestinal tumors in each pixel in the cross-sectional stretched image in the measurement of gastrointestinal tumors. By determining the gradient field, the edge features in the cross-sectional stretched image, especially the edge of gastrointestinal tumors, can be effectively enhanced, enabling more accurate identification and determination of the size and shape of tumors in subsequent tumor edge detection.

[0042] In step 104, based on the gradient field and the prior features of the gray-scale distribution and morphology of the edge of the gastrointestinal tumor in the target gastrointestinal tract, the prior feature optimized gradient vector flow field of the cross-sectional stretch map when measuring the tumor edge is obtained by solving and optimizing the gradient vector flow field, and then the prior feature optimized gradient vector flow field of each cross-sectional stretch map when measuring the tumor edge is obtained.

[0043] It should be noted that each pixel in the cross-sectional stretching diagram in this application corresponds one-to-one with a two-dimensional gradient vector in the gradient field, that is, one pixel corresponds to one two-dimensional gradient vector.

[0044] In some embodiments, the gradient vector flow field is optimized by solving and optimizing the prior features of the gray-scale distribution and morphological features of the edge of the gastrointestinal tumor in the target gastrointestinal tract, based on the gradient field and the gray-scale distribution and morphological features of the edge of the gastrointestinal tumor. Specifically, the following steps can be taken: Obtain the labeling maps of different types of gastrointestinal tumors in the gastrointestinal tract, extract the gray-level distribution features (such as the gray-level gradient range and gray-level variance) and morphological prior features (such as the smoothness and closure of the edge) of the tumor edge from the labeling map of each type of gastrointestinal tumor, and construct the prior feature set of gastrointestinal tumor edge; Substituting the gradient field into the Euler-Lagrange partial differential equation (i.e., the Euler-Lagrange equation), the basic gradient vector flow field (GVF) is obtained by solving the equation, thus realizing the global diffusion of the gradient field and ensuring the global convergence of edge detection. The basic gradient vector flow field is optimized by using the prior feature set of the edge of gastrointestinal tumors. The diffusion direction and diffusion coefficient of GVF are constrained by the prior features, so that GVF fits the edge features of gastrointestinal tumors better, and the gradient vector flow field optimized by prior features is obtained. The gradient vector of the tumor edge region in the cross-sectional stretch image is adaptively adjusted to complete the construction of the gradient vector flow field optimized by prior features.

[0045] In practice, the labeling maps of different types of gastrointestinal tumors in the gastrointestinal tract can be obtained from existing medical image databases. The labeling maps represent medical images with edge segmentation and labeling of different types of gastrointestinal tumors, covering benign and malignant gastrointestinal tumors and gastrointestinal tumors of different degrees of differentiation, ensuring the comprehensiveness of the prior feature set.

[0046] In specific implementation, the Canny edge detection algorithm in image processing methods can be combined with gray-level statistical analysis to extract the gray-level distribution features and morphological prior features of the tumor edge from the labeled image of each type of gastrointestinal tumor, thereby constructing a prior feature set of gastrointestinal tumor edge. In addition, in other embodiments, a tumor segmentation model based on deep learning can also be used to extract tumor edge features, which is not limited here.

[0047] In practice, the gradient field is substituted into the Euler-Lagrange partial differential equation to solve the basic GVF. This equation is the classic solution formula for GVF. By minimizing the energy functional, the gradient field is smoothly diffused, allowing the gradient vector flow to extend to the gray-scale uniform region of the image. This effectively detects the blurred edges of gastrointestinal tumors and solves the problem that traditional edge detection algorithms are insensitive to blurred edges.

[0048] In practice, the basic gradient vector flow field is optimized using the prior feature set of the gastrointestinal tumor edge. Specifically, the diffusion coefficient of GVF is constrained based on the smoothness of the tumor edge to avoid excessive diffusion of the flow field that leads to edge distortion; the direction of the flow field is adjusted based on the closure of the tumor edge to ensure that the detected tumor edge is a closed contour; and effective edge pixels are selected based on the gray-level gradient range of the tumor edge to eliminate interference from background tissue, thereby obtaining a prior feature optimization gradient vector flow field that fits the edge characteristics of the gastrointestinal tumor.

[0049] It should be noted that the prior feature-optimized gradient vector flow field representation in this application is based on the classic GVF algorithm, combined with the gray-level distribution and morphological prior features of the gastrointestinal tumor edge optimized gradient vector flow field. The flow field contains multiple optimized gradient vectors, which can achieve accurate detection of blurred and irregular edges of gastrointestinal tumors, effectively track the boundaries of gastrointestinal tumors, reduce the error of gastrointestinal tumor edge recognition, and improve the measurement accuracy of gastrointestinal tumor size.

[0050] In practice, the above-mentioned determination method is used to construct a corresponding prior feature optimization gradient vector flow field for each cross-sectional stretch image to ensure the edge detection accuracy of each image in the cross-sectional image sequence. This will not be elaborated further here.

[0051] In step 105, multiple image-adaptive edge constraint parameters are obtained when performing edge determination of gastrointestinal tumors in the target gastrointestinal tract. The gradient vector flow field is optimized using each image-adaptive edge constraint parameter and all prior features to obtain a gastrointestinal tumor segmentation reference map of the target gastrointestinal tract. The gastrointestinal tumor segmentation reference map is then matched with the currently acquired gastrointestinal tumor monitoring map for contour registration and confidence assessment to obtain the gastrointestinal tumor confidence region of the target gastrointestinal tract.

[0052] In specific implementation, multiple image-adaptive edge constraint parameters are acquired when measuring the edges of gastrointestinal tumors in the target gastrointestinal tract. These edge constraint parameters are determined by the image features of the cross-sectional stretched image itself, including gray-level variance constraint parameters, edge gradient magnitude constraint parameters, and contour smoothness constraint parameters. Specifically: the gray-level variance constraint parameter is calculated from the global gray-level variance of the image and is used to determine the overall contrast of the image; the edge gradient magnitude constraint parameter is statistically obtained from the magnitude of the two-dimensional gradient vector in the gradient field and is used to filter effective edge pixels; the contour smoothness constraint parameter is determined by the morphological prior features of the tumor edge and is used to ensure the smoothness of the segmented contour. All constraint parameters dynamically change with the image's own features, rather than being preset fixed values, adapting to the feature differences of different endoscopic ultrasound images.

[0053] It should be noted that the role of the image adaptive edge constraint parameter is to perform secondary optimization of the gradient vector flow field based on the prior features. It adjusts the detection threshold of the flow field according to the actual characteristics of a single image, thereby further improving the accuracy of edge detection. For example, for images with large gray-level variance and low contrast, the threshold of the edge gradient magnitude constraint parameter is appropriately reduced to ensure effective detection of blurred edges; for images with small gray-level variance and high contrast, the threshold is appropriately increased to eliminate the interference of background noise.

[0054] It should be noted that in this application, a cross-sectional stretch map corresponds to a priori feature-optimized gradient vector flow field, and three-dimensional tumor edge detection results can be obtained based on all flow fields of the image sequence.

[0055] In some embodiments, the reference map for segmentation of gastrointestinal tumors in the target gastrointestinal tract is obtained by optimizing the gradient vector flow field using adaptive edge constraint parameters for each image and all prior features. Specifically, the following steps can be taken: By performing secondary optimization on the gradient vector flow field of each prior feature using all image adaptive edge constraint parameters, a gradient vector flow field adapted to the features of a single image is obtained. Based on the optimized gradient vector flow field, tumor edge segmentation is performed on each cross-sectional stretch image to obtain the tumor segmentation image corresponding to each cross-sectional image. Following the scanning order of the cross-sectional image sequence, three-dimensional spatial reconstruction was performed on all tumor segmentation maps to obtain a reference map of gastrointestinal tumor segmentation in the baseline state. This reference map is the three-dimensional segmentation contour of the tumor obtained by endoscopic ultrasound scanning, which serves as the baseline reference for subsequent registration.

[0056] Specifically, the prior feature optimization gradient vector flow field is optimized by using image adaptive edge constraint parameters. Specifically, the gray-level variance constraint parameters, edge gradient magnitude constraint parameters, and contour smoothness constraint parameters are substituted into the energy functional of the flow field to adjust the detection threshold of the flow field, making the flow field more suitable for the features of a single image, and thus obtaining accurate tumor edge segmentation results.

[0057] In practice, tumor edge segmentation is performed on each cross-sectional stretched image based on the optimized gradient vector flow field. By tracking the gradient vector direction of the flow field, the closed edge contour of the tumor is extracted, and the region within the contour is pixel-marked to obtain the tumor segmentation map corresponding to each cross-sectional image.

[0058] In practice, all tumor segmentation maps are reconstructed in three dimensions. Based on the scanning depth and position information of the endoscopic ultrasound, the two-dimensional cross-sectional tumor segmentation maps are stitched together in three dimensions to obtain a reference map of gastrointestinal tumor segmentation in the baseline state. This reference map is a three-dimensional contour map of the tumor and serves as the baseline standard for subsequent registration with the current monitoring map.

[0059] In some embodiments, the process of performing contour registration and confidence assessment between the gastrointestinal tumor segmentation reference map and the currently acquired gastrointestinal tumor monitoring map to obtain the gastrointestinal tumor confidence region of the target gastrointestinal tract can be specifically carried out using the following steps: The currently acquired gastrointestinal tumor monitoring image is obtained. The same processing procedure as the baseline image is used to perform grayscale stretching, gradient field construction, and GVF optimization on the monitoring image to extract the edge contour (second edge contour) of the tumor in the monitoring image. The tumor edge contour (first edge contour) in the gastrointestinal tumor segmentation reference image is extracted. The first edge contour and the second edge contour are spatially similarly registered using the Iterative Closest Point (ICP) algorithm to achieve spatial alignment between the baseline contour and the current contour, thus solving the registration error caused by the position deviation of the ultrasound endoscopy scan. The overlap and gradient magnitude similarity of the two registered contours are calculated, where: the contour overlap is the ratio of the intersection area to the union area of ​​the two registered contours, reflecting the spatial matching degree of the contours; the gradient magnitude similarity is the correlation coefficient of the gradient vector magnitude of corresponding pixels on the two contours, reflecting the edge feature matching degree of the contours. Set confidence thresholds (e.g., overlap ≥ 0.7, gradient magnitude similarity ≥ 0.6) to filter out contour overlap regions that simultaneously meet both thresholds. These regions are the confidence regions for gastrointestinal tumors in the target gastrointestinal tract.

[0060] In practice, the currently acquired gastrointestinal tumor monitoring images can be obtained in real time through endoscopic ultrasound, ensuring that the imaging equipment parameters of the monitoring images are consistent with those of the baseline reference images, thereby reducing registration errors caused by imaging differences.

[0061] In practice, the ICP algorithm is used for spatial similarity registration. This algorithm is a classic algorithm for medical image contour registration. By iteratively calculating the corresponding point pairs of two contours and minimizing the Euclidean distance between the point pairs, the algorithm achieves contour alignment through translation, rotation, and scaling, effectively solving the contour mismatch problem caused by position and angle deviations during ultrasound endoscopic scanning.

[0062] In practice, the overlap and gradient magnitude similarity of the registered contours are calculated, and a confidence threshold is set to filter the effective region. The resulting gastrointestinal tumor confidence region is the region that is identified as a tumor in both the baseline reference image and the current monitoring image. This effectively eliminates interference from background tissue, scanning noise, and edge detection errors, ensuring the accuracy of tumor size measurement.

[0063] It should be noted that, in this application, the gastrointestinal tumor confidence region represents the effective contour region in the target gastrointestinal tract that has been accurately identified as a gastrointestinal tumor. The contour of this region is the overlapping contour after the baseline reference map and the current monitoring map are registered, and it has a high confidence level. By determining the gastrointestinal tumor confidence region, the precise size of the gastrointestinal tumor in the target gastrointestinal tract can be effectively measured.

[0064] It should be noted that, in this application, the size of the gastrointestinal tumor in the target gastrointestinal tract can be confidently determined based on the aforementioned gastrointestinal tumor confidence region. Pixel units are converted to physical size units based on preset tumor measurement calibration values, and the measurement result of the gastrointestinal tumor size in the target gastrointestinal tract is output by the endoscopic gastrointestinal tumor size measurement device. Specifically, the pixel values ​​of the two-dimensional area / three-dimensional volume of the gastrointestinal tumor confidence region are extracted, and the pixel values ​​are converted to actual physical dimensions (e.g., mm) using the tumor measurement calibration value (pixel-physical size conversion coefficient). 2 cm 3 As a preferred embodiment, the pixel size of the confidence region can be extracted and the unit conversion can be completed using OpenCV in the image processing tool, which will not be elaborated here.

[0065] In another aspect, in some embodiments, this application provides a laparoscopic gastrointestinal tumor size measurement device, which includes a measurement image processing unit, with reference to... Figure 4 The figure is a schematic diagram of exemplary hardware and / or software of a measurement image processing unit according to some embodiments of this application. The measurement image processing unit 200 includes: an acquisition module 201, a processing module 202, and an execution module 203, which are described below: The acquisition module 201 in this application is mainly used to acquire the sequence of cross-sectional images of the target gastrointestinal tract under ultrasound scanning and extract the grayscale distribution features of each cross-sectional image. Processing module 202, in this application, is mainly used to perform gray-scale stretching on each cross-sectional image in the cross-sectional image sequence based on the gray-scale distribution characteristics of the image itself, so as to obtain the cross-sectional stretching map corresponding to each cross-sectional image. The processing module 202 is further configured to, for each cross-sectional stretching image, determine the two-dimensional gradient vector of each stretched pixel in the cross-sectional stretching image based on the 3×3 local neighborhood under grayscale direction projection, and construct the gradient field corresponding to the cross-sectional stretching image based on all the two-dimensional gradient vectors. In addition, the processing module 202 is also used to solve and optimize the prior feature optimized gradient vector flow field of the cross-sectional stretch map when measuring the tumor edge based on the gradient field and the gray distribution and morphological prior features of the edge of the gastrointestinal tumor in the target gastrointestinal tract, thereby obtaining the prior feature optimized gradient vector flow field of each cross-sectional stretch map when measuring the tumor edge. The execution module 203 in this application is mainly used to obtain multiple image adaptive edge constraint parameters when measuring the edge of a gastrointestinal tumor in the target gastrointestinal tract. It optimizes the gradient vector flow field through each image adaptive edge constraint parameter and all prior features to obtain a gastrointestinal tumor segmentation reference map of the target gastrointestinal tract. It performs contour registration and confidence assessment on the gastrointestinal tumor segmentation reference map and the currently acquired gastrointestinal tumor monitoring map to obtain the gastrointestinal tumor confidence region of the target gastrointestinal tract. Based on the preset tumor measurement calibration value, it converts the pixel units of the gastrointestinal tumor confidence region into physical size units.

[0066] In addition, this application also provides a computer device, the computer device including a memory and a processor, the memory storing code, and the processor being configured to acquire the code and execute the above-described image processing method for measuring the size of gastrointestinal tumors.

[0067] In some embodiments, reference Figure 5 The figure is a schematic diagram of the structure of a computer device for implementing an image processing method for measuring the size of gastrointestinal tumors, according to some embodiments of this application. The image processing method for measuring the size of gastrointestinal tumors in the above embodiments can be implemented through... Figure 5 The computer device shown is used to implement this, and the computer device 300 includes at least one processor 301, a communication bus 302, a memory 303, and at least one communication interface 304.

[0068] The processor 301 may be a general-purpose central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more devices used to control the execution of the image processing method for measuring the size of gastrointestinal tumors in this application.

[0069] The communication bus 302 can be used to transmit information between the aforementioned components.

[0070] The memory 303 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CDROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disks or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto. The memory 303 may exist independently and be connected to the processor 301 via the communication bus 302. The memory 303 may also be integrated with the processor 301.

[0071] The memory 303 stores program code for executing the scheme of this application, and its execution is controlled by the processor 301. The processor 301 executes the program code stored in the memory 303. The program code may include one or more software modules. In the above embodiments, the determination of the image processing method for measuring the size of gastrointestinal tumors can be implemented by the processor 301 and one or more software modules in the program code in the memory 303.

[0072] Communication interface 304 uses any transceiver-like device for communicating with other devices or communication networks, such as Ethernet, radio access network (RAN), wireless local area networks (WLAN), etc.

[0073] In a specific implementation, as one example, a computer device may include multiple processors, each of which may be a single-core (single CPU) processor or a multi-core (multi CPU) processor. Here, a processor may refer to one or more devices, circuits, and / or processing cores used to process data (e.g., computer program instructions).

[0074] The aforementioned computer device can be a general-purpose computer device or a special-purpose computer device. In specific implementations, the computer device can be a desktop computer, a portable computer, a network server, a handheld digital assistant (PDA), a mobile phone, a tablet computer, a wireless terminal device, a communication device, or an embedded device. This application does not limit the type of computer device.

[0075] In addition, this application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described image processing method for measuring the size of gastrointestinal tumors.

[0076] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.

[0077] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. An image processing method for measuring the size of gastrointestinal tumors under laparoscopy, characterized in that, Includes the following steps: Acquire a sequence of cross-sectional images of the target gastrointestinal tract under ultrasound scanning; Based on the grayscale distribution characteristics of the image itself, each cross-sectional image in the cross-sectional image sequence is stretched in grayscale to obtain the cross-sectional stretched image corresponding to each cross-sectional image. For each cross-sectional stretching image, determine the two-dimensional gradient vector of each stretched pixel in the cross-sectional stretching image based on the 3×3 local neighborhood under gray-scale projection, and construct the gradient field corresponding to the cross-sectional stretching image based on all the two-dimensional gradient vectors. Based on the gradient field and the prior features of gray-scale distribution and morphology of the edge of the gastrointestinal tumor in the target gastrointestinal tract, the prior feature optimized gradient vector flow field of the cross-sectional stretch map when measuring the tumor edge is obtained by solving and optimizing the prior feature optimized gradient vector flow field of each cross-sectional stretch map when measuring the tumor edge. Multiple image-adaptive edge constraint parameters are acquired when measuring the edges of gastrointestinal tumors in the target gastrointestinal tract. The gradient vector flow field is optimized using each edge constraint parameter and all prior features to obtain a reference map for segmenting the gastrointestinal tumors in the target gastrointestinal tract. The reference map for segmenting the gastrointestinal tumors is then matched with the currently acquired gastrointestinal tumor monitoring map for contour registration and confidence assessment to obtain the confidence region of the gastrointestinal tumors in the target gastrointestinal tract. Based on preset tumor measurement calibration values, the pixel units of the confidence region of the gastrointestinal tumors are converted into physical size units to complete the quantitative determination of tumor size.

2. The method as described in claim 1, characterized in that, Based on the grayscale distribution characteristics of the images themselves, grayscale stretching is performed on each cross-sectional image in the cross-sectional image sequence to obtain the corresponding stretched cross-sectional image. Specifically, this includes: Acquire a preset tumor measurement calibration value during the process of measuring the size of gastrointestinal tumors in the target gastrointestinal tract. This calibration value is used for pixel-physical size calibration during subsequent tumor size determination. One cross-sectional image from the cross-sectional image sequence is selected as the chosen cross-sectional image; Determine the grayscale dynamic range, maximum grayscale value, and minimum grayscale value of the selected cross-sectional image; The grayscale stretching coefficient of the selected cross-sectional image is determined by the grayscale dynamic range, the maximum grayscale value, and the minimum grayscale value. Each gray value in the selected cross-sectional image is stretched according to the gray-scale stretching coefficient. After stretching, the gray values ​​are truncated within the range of 0-255 to obtain the cross-sectional stretched image corresponding to the cross-sectional image. Continue to determine the cross-sectional stretching diagrams corresponding to the remaining cross-sectional images in the cross-sectional image sequence.

3. The method as described in claim 1, characterized in that, Determining the two-dimensional gradient vector of each stretched pixel in the cross-sectional stretched image under grayscale projection based on its 3×3 local neighborhood specifically includes: Select one stretching pixel in the cross-sectional stretching image as the selected stretching pixel. Determine the horizontal and vertical gray-level gradients of the selected stretched pixel point based on the 3×3 local neighborhood under gray-level direction projection; The horizontal grayscale gradient and the vertical grayscale gradient are combined to obtain a two-dimensional gradient vector of the selected stretched pixel. Continue to determine the two-dimensional gradient vector of the remaining stretched pixels in the cross-sectional stretching diagram.

4. The method as described in claim 3, characterized in that, Determining the horizontal and vertical gray-level gradients of the selected stretched pixel point based on its 3×3 local neighborhood under gray-level projection specifically includes: Extract the corresponding gray values ​​in the horizontal direction and the corresponding gray values ​​in the vertical direction within the 3×3 local neighborhood of the selected stretched pixel from the cross-sectional stretched image; The horizontal grayscale gradient of the selected stretched pixel under grayscale projection is determined by the Sobel operator using the corresponding grayscale values ​​in the horizontal direction within the 3×3 local neighborhood. The vertical grayscale gradient of the selected stretched pixel under the grayscale direction projection is determined by the Sobel operator using the corresponding grayscale values ​​in the vertical direction within the 3×3 local neighborhood.

5. The method as described in claim 1, characterized in that, The gradient field corresponding to the cross-sectional stretching diagram is constructed based on all two-dimensional gradient vectors, specifically including: Obtain the pixel dimensions of the cross-sectional stretched image; By mapping the two-dimensional gradient vector of each stretched pixel to its pixel position, a gradient matrix matching the pixel dimension is directly constructed. All two-dimensional gradient vectors are mapped to the gradient matrix according to their pixel positions to obtain the gradient field corresponding to the cross-sectional stretching diagram.

6. The method as described in claim 1, characterized in that, The gastrointestinal tumor segmentation reference map is matched with the currently acquired gastrointestinal tumor monitoring map for contour registration and confidence assessment to obtain the specific gastrointestinal tumor confidence region of the target gastrointestinal tract, which includes: Obtain the currently collected gastrointestinal tumor monitoring map; The edge contour of the gastrointestinal tumor in the gastrointestinal tumor segmentation reference image is extracted by optimizing the gradient vector flow field using prior features to obtain the first edge contour. The edge contour of the gastrointestinal tumor in the gastrointestinal tumor monitoring image is extracted by optimizing the gradient vector flow field using prior features to obtain the second edge contour. The first edge contour and the second edge contour are spatially similarly registered using the iterative nearest point algorithm. The overlap and gradient magnitude similarity of the registered contours are calculated. A confidence threshold is set to filter the effective overlapping area and obtain the confidence region of the gastrointestinal tumor in the target gastrointestinal tract.

7. The method as described in claim 1, characterized in that, The target gastrointestinal tract is acquired by ultrasound endoscopy, and the scanning parameters of the ultrasound endoscopy are kept consistent with the image acquisition frame rate to ensure the spatial continuity of the cross-sectional image sequence.

8. A device for measuring the size of gastrointestinal tumors under laparoscopy, comprising a measurement image processing unit, characterized in that, The measurement image processing unit includes: The acquisition module is used to acquire a sequence of cross-sectional images of the target gastrointestinal tract under ultrasound scanning and extract the grayscale distribution features of each cross-sectional image. The processing module is used to perform grayscale stretching on each cross-sectional image in the cross-sectional image sequence based on the grayscale distribution characteristics of the image itself, so as to obtain the cross-sectional stretching map corresponding to each cross-sectional image. The processing module is also used to determine, for each cross-sectional stretch image, the two-dimensional gradient vector of each stretched pixel in the cross-sectional stretch image based on the 3×3 local neighborhood under grayscale projection, and to construct the gradient field corresponding to the cross-sectional stretch image based on all the two-dimensional gradient vectors. The processing module is also used to solve and optimize the prior feature optimized gradient vector flow field of the cross-sectional stretch map when measuring the tumor edge, based on the gradient field and the gray-scale distribution and morphological prior features of the edge of the gastrointestinal tumor in the target gastrointestinal tract. This results in the prior feature optimized gradient vector flow field of each cross-sectional stretch map when measuring the tumor edge. The execution module is also used to acquire multiple image adaptive edge constraint parameters when measuring the edge of a gastrointestinal tumor in the target gastrointestinal tract. It optimizes the gradient vector flow field through each edge constraint parameter and all prior features to obtain a gastrointestinal tumor segmentation reference map of the target gastrointestinal tract. It performs contour registration and confidence assessment on the gastrointestinal tumor segmentation reference map and the currently acquired gastrointestinal tumor monitoring map to obtain the gastrointestinal tumor confidence region of the target gastrointestinal tract. Based on the preset tumor measurement calibration value, it converts the pixel units of the gastrointestinal tumor confidence region into physical size units.

9. A computer device, characterized in that, The computer device includes a memory and a processor, the memory storing code, and the processor being configured to acquire the code and execute the image processing method for measuring the size of gastrointestinal tumors as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the image processing method for measuring the size of gastrointestinal tumors as described in any one of claims 1 to 7.