A peritumoral region segmentation method and system based on ultrasound images

CN119048534BActive Publication Date: 2026-08-18BEIJING UNIV OF POSTS & TELECOMM
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410949966.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-16
Publication Date
2026-08-18
Estimated Expiration
2044-07-16

AI Technical Summary

Technical Problem

然而,事实上,肿瘤周围的正常组织与异常组织并不会完全均匀地呈现出相同的厚度或宽度,这意味着采用等距扩展的方法无法准确反映瘤周区域的真实情况

Benefits of technology

[0047] The peritumor region segmentation method and system based on ultrasound imaging of this invention combines physician-annotated ultrasound images with edge detection technology from computer vision. This allows for rapid and accurate segmentation of the peritumoral region, providing a reliable data foundation for subsequent tumor analysis and diagnosis. Compared to current segmentation methods, this invention has greater clinical significance, offering a more efficient and accurate solution for medical image analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119048534B_ABST
    Figure CN119048534B_ABST
Patent Text Reader

Abstract

The application discloses a peritumoral region segmentation method and system based on ultrasonic images, which converts an RGB color model of a tumor ultrasonic image into an HSV color model, and determines a target region image for detection according to the HSV color model; performs edge detection on the target region image to obtain a complete edge image according to a detection result; establishes a hierarchical structure based on the edge image, and determines attribute information of each edge according to the hierarchical structure; performs edge drawing according to a line width pixel value and the attribute information, and performs full threshold segmentation on the drawn edge image to obtain a segmented contour image; calculates areas of all contours in the segmented contour image, and performs filling drawing on all the contours to obtain a binary mask image; obtains a tumor peritumoral mask image based on the binary mask image, and merges and processes the tumor peritumoral mask image and the tumor ultrasonic image to obtain a segmentation result of an irregular peritumoral region. The application can effectively realize accurate and rapid segmentation of the peritumoral region of the tumor.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of medical imaging and computer vision technology, and in particular to a method and system for segmenting the peritumoral region based on ultrasound imaging. Background Technology

[0002] The peritumoral region is the area where a tumor directly contacts normal tissues. Nutrients and pathways necessary for tumor growth and metastasis pass through this region to enter and exit the tumor tissue, including blood vessels, lymphatic vessels, nerves, and various connective tissues. Analysis of the peritumoral region not only assesses the depth of tumor invasion but also serves as a basis for determining whether surgical margins have been invaded during tumor resection. Furthermore, peritumoral analysis provides valuable information about the tumor's biological characteristics and invasiveness, which can be used to predict patient prognosis and guide adjuvant therapy. Tumor biology research shows that the tumor periphery releases numerous growth factors and cytokines, leading to hypoxia and angiogenesis, which are crucial for tumor formation, development, and metastasis. Comprehensive analysis of information from the tumor and its peritumoral region allows for a more complete description of the tumor's invasive and metastatic characteristics. Therefore, analysis of the peritumoral region is of great significance for medical diagnosis and treatment.

[0003] Current methods for peritumoral tumor segmentation typically employ an equidistant expansion approach along the original tumor boundary. However, in reality, the normal and abnormal tissues surrounding a tumor do not exhibit completely uniform thickness or width. This means that equidistant expansion cannot accurately reflect the true state of the peritumoral region. Furthermore, due to the high similarity between the features of the peritumoral region and normal tissue, as well as the complexity of local tissue structures, conventional segmentation models cannot effectively distinguish subtle differences between the peritumoral edge and normal tissue when processing peritumoral segmentation. The accuracy of existing peritumoral tumor segmentation models is not ideal. The inability to obtain high-quality, accurate peritumoral tumor data directly impacts the precision of subsequent medical analyses, hindering effective pathological analysis, surgical decisions, and treatment planning.

[0004] Analyzing the peritumoral region, whether for medical radiomics analysis or training precise automatic segmentation models, requires a large amount of accurate labeled data. Obtaining ultrasound image masks necessitates professional image annotation by physicians. Rapid and accurate processing of large numbers of labeled images can significantly improve research efficiency while ensuring the consistency and accuracy of results. Therefore, in practical applications, the ability to quickly and accurately segment the peritumoral region from a large batch of labeled tumor images has significant research value and clinical demand. Summary of the Invention

[0005] The present invention aims to at least partially solve one of the technical problems in the related art.

[0006] Therefore, this invention designs a peritumoral region segmentation method based on ultrasound imaging, aiming to quickly and accurately segment the peritumoral region of a tumor. By leveraging the professional knowledge and experience of physicians, using pre-annotated ultrasound images as input, and combining edge detection technology from computer vision, the method automatically detects and accurately extracts the boundary information of the peritumoral region, thereby achieving accurate segmentation of the peritumoral region of the tumor.

[0007] Another objective of this invention is to propose a peritumoral region segmentation system based on ultrasound imaging.

[0008] To achieve the above objectives, the present invention proposes a method for peritumoral region segmentation based on ultrasound imaging, comprising:

[0009] The RGB color model of the tumor ultrasound image is converted into the HSV color model, and the target area image to be detected is determined according to the HSV color model; wherein, the tumor ultrasound image includes the tumor in the peritumoral region and the annotated image inside the tumor.

[0010] Edge detection is performed on the target region image to obtain a complete edge image based on the detection results;

[0011] A hierarchical structure is established based on the edge image, and the attribute information of each edge is determined according to the hierarchical structure.

[0012] Edges are drawn based on preset line width pixel values ​​and all attribute information, and full threshold segmentation is performed on the drawn edge images to obtain segmented contour images.

[0013] Calculate the area of ​​all contours in the segmented contour image, and fill and draw all contours to obtain a binary mask image;

[0014] Based on the binary mask image, a peritumoral mask image of the tumor is obtained, and the peritumoral mask image of the tumor is merged with the tumor ultrasound image to obtain the segmentation result of the irregular peritumoral region.

[0015] The peritumoral region segmentation method based on ultrasound imaging in this invention may also have the following additional technical features:

[0016] In one embodiment of the present invention, converting the RGB color model of a tumor ultrasound image to an HSV color model, and determining the target region image to be detected based on the HSV color model, includes:

[0017] Obtain the RGB color space corresponding to the color channels of the tumor ultrasound image;

[0018] Convert the RGB color space to the HSV color space, which consists of three color channels: hue, saturation, and lightness.

[0019] The color component threshold is set according to the color component range of the HSV color space to detect the target color region and determine the target region image.

[0020] In one embodiment of the present invention, edge detection is performed on the target region image to obtain a complete edge image based on the detection result, including:

[0021] The first feature image is obtained by smoothing the target region image using a Gaussian filter;

[0022] The gradient magnitude and direction of the pixels in the first feature image are calculated using the Sobel operator;

[0023] The second feature image is obtained by performing non-maximum pixel gradient suppression on the gradient magnitude along the gradient direction;

[0024] A double thresholding operation is performed on the second feature image to obtain a complete edge image by connecting pixels with strong and weak edges.

[0025] In one embodiment of the present invention, a hierarchical structure is established based on the edge image, and attribute information of each edge is determined according to the hierarchical structure, including:

[0026] The preset algorithm is used to find the point set of all contours of the edge image, and a complete hierarchical relationship is established for all contours;

[0027] The contour attribute information of the hierarchical tree structure is obtained based on the hierarchical relationship; wherein, the contour attribute information includes the next contour number of the same level contour, the previous contour number of the same level contour, the parent contour number, and the embedded contour number.

[0028] In one embodiment of the present invention, calculating the area of ​​all contours in the segmented contour image and filling and drawing all contours to obtain a binary mask image includes:

[0029] Find all contours in the image after thresholding and calculate the area of ​​all contours using Green's formula to remove noisy contours and retain the contours of the labeled lines.

[0030] The maximum area contour number is calculated, and the contour is filled with white while the rest of the contour is filled with black to obtain a binary mask image of the tumor surrounding the tumor and the tumor internal annotation image of the same tumor ultrasound image.

[0031] In one embodiment of the present invention, a first feature image is obtained by smoothing the target region image using a Gaussian filter, including:

[0032] A two-dimensional Gaussian function weight matrix is ​​constructed with each pixel of the target region image as the center.

[0033] The first feature image is obtained by convolving the Gaussian function weight matrix with the target region image.

[0034] In one embodiment of the present invention, the gradient magnitude and direction of pixels in a first feature image are calculated using the Sobel operator, including:

[0035] The Sobel operator was used to perform convolution operations with the tumor ultrasound image to obtain the gradient in the horizontal direction and the gradient in the vertical direction.

[0036] The gradient magnitude and direction of each pixel in the first feature image are calculated using the gradient in the horizontal and vertical directions.

[0037] In one embodiment of the present invention, a color component threshold is set according to the color component range of the HSV color space to detect and determine the target color region image, including:

[0038] The color component threshold is determined based on the color of the image annotation lines in the HSV color space;

[0039] Each pixel of the tumor ultrasound image is scanned, and the input pixel value is determined based on the scan results to be within the threshold range of the color component. If it is within the threshold range, the pixel value of the current pixel is set accordingly.

[0040] To achieve the above objectives, a second aspect of the present invention provides a peritumoral region segmentation system based on ultrasound imaging, comprising:

[0041] The model conversion module is used to convert the RGB color model of the tumor ultrasound image into the HSV color model, and determine the target area image to be detected based on the HSV color model; wherein, the tumor ultrasound image includes the tumor in the peritumoral region and the annotated image inside the tumor.

[0042] The edge detection module is used to perform edge detection on the target region image to obtain a complete edge image based on the detection results;

[0043] An attribute determination module is used to establish a hierarchical structure based on the edge image and determine the attribute information of each edge according to the hierarchical structure.

[0044] The threshold segmentation module is used to draw edges based on preset line width pixel values ​​and all attribute information, and to perform full threshold segmentation on the drawn edge image to obtain the segmented contour image.

[0045] The contour filling module is used to calculate the area of ​​all contours in the segmented contour image and fill and draw all contours to obtain a binary mask image.

[0046] The image segmentation module is used to obtain a tumor peritumoral mask image based on the binary mask image, and to merge the tumor peritumoral mask image with the tumor ultrasound image to obtain the segmentation result of the irregular peritumoral region.

[0047] The peritumor region segmentation method and system based on ultrasound imaging of this invention combines physician-annotated ultrasound images with edge detection technology from computer vision. This allows for rapid and accurate segmentation of the peritumoral region, providing a reliable data foundation for subsequent tumor analysis and diagnosis. Compared to current segmentation methods, this invention has greater clinical significance, offering a more efficient and accurate solution for medical image analysis.

[0048] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description

[0049] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein:

[0050] Figure 1 A flowchart illustrating a peritumoral region segmentation method based on ultrasound imaging provided in an embodiment of the present invention;

[0051] Figure 2 An ultrasound image of a liver tumor provided in an embodiment of the present invention;

[0052] Figure 3 This is a tumor (including the peritumoral region) annotation diagram provided in an embodiment of the present invention;

[0053] Figure 4 This is an internal tumor annotation diagram provided in an embodiment of the present invention;

[0054] Figure 5 This is an example of an edge-marked image of a tumor (including the peritumoral region) according to an embodiment of the present invention.

[0055] Figure 6 This is an example of tumor internal annotation edge extraction from an embodiment of the present invention;

[0056] Figure 7 This is a flowchart illustrating the implementation of step S2 of the present invention;

[0057] Figure 8 This is a flowchart of the contour tracking process in step S3 of the present invention;

[0058] Figure 9A contour drawing of a tumor (including the peritumoral region) according to an embodiment of the present invention;

[0059] Figure 10 A diagram showing the internal contour of a tumor according to an embodiment of the present invention;

[0060] Figure 11 This is a binary mask image of a tumor (including the peritumoral region) according to an embodiment of the present invention.

[0061] Figure 12 This is a binary mask image of the tumor interior in an embodiment of the present invention;

[0062] Figure 13 This is a binary mask image of the peritumoral region according to an embodiment of the present invention;

[0063] Figure 14 This is a segmentation diagram of the peritumoral region according to an embodiment of the present invention;

[0064] Figure 15 This is a structural diagram of the peritumoral region segmentation system based on ultrasound imaging, according to an embodiment of the present invention. Detailed Implementation

[0065] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.

[0066] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0067] The following describes a method for segmenting the peritumoral region based on ultrasound imaging according to an embodiment of the present invention, with reference to the accompanying drawings.

[0068] Figure 1 This is a flowchart of a peritumoral region segmentation method based on ultrasound imaging according to an embodiment of the present invention, as follows: Figure 1 As shown, the method includes:

[0069] S1, convert the RGB color model of the tumor ultrasound image to the HSV color model, and determine the target area image to be detected based on the HSV color model; wherein, the tumor ultrasound image includes the tumor in the peritumoral region and the annotated image inside the tumor.

[0070] S2, perform edge detection on the target region image to obtain a complete edge image based on the detection results;

[0071] S3, establish a hierarchical structure based on the edge image, and determine the attribute information of each edge according to the hierarchical structure;

[0072] S4. Draw the edge according to the preset line width pixel value and all attribute information, and perform full threshold segmentation on the drawn edge image to obtain the segmented contour image.

[0073] S5, calculate the area of ​​all contours in the segmented contour image, and fill and draw all contours to obtain a binary mask image.

[0074] S6. Obtain the peritumoral mask image of the tumor based on the binary mask image, and merge the peritumoral mask image of the tumor with the tumor ultrasound image to obtain the segmentation result of the irregular peritumoral region.

[0075] In one embodiment of the present invention, step S1 can convert the RGB color model of the ultrasound image into an HSV color model composed of three color channels: hue, saturation, and value. Based on the color component range of the converted HSV space, a threshold range is set to detect the target color region.

[0076] like Figure 2 The image shown is an ultrasound image of a liver tumor. Figure 3 and Figure 4 These are images of the tumor (including the peritumoral area) and the tumor interior, both annotated by a doctor.

[0077] For example, the color channels of ultrasound images are based on the RGB color model. To more accurately distinguish subtle differences between different colors and achieve color detection and recognition, the RGB color space can be converted to the HSV color space using the following formula:

[0078] V = max(R', G', B') × 255

[0079]

[0080] Where R', G', and B' are the results of R, G, and B being normalized to 0-1, and at this time, the ranges of H, S, and V are H:[0,180], S:[0,255], and V:[0,255].

[0081] Specifically, the selected annotation line color in this annotation image is green, meaning the color extraction threshold is set to H:[35,77], S:[43,255], V:[46,255]. The image pixels are scanned to determine if the color of each pixel falls within the set threshold range. If it does, the pixel value is set to 255 (white); otherwise, it is set to 0 (black), resulting in the edge extraction image as shown below. Figure 5 and Figure 6 As shown.

[0082] In one embodiment of the present invention, step S2 involves performing high-precision edge detection on the target region image obtained in step S1, smoothing the image using a filter, calculating the magnitude and direction of the image gradient, performing non-maximum suppression on the magnitude in the gradient direction, performing a double thresholding operation on the processed image, and obtaining a complete edge image by connecting the pixels of strong and weak edges.

[0083] The edge detection process of this invention is as follows: Figure 7 As shown, the standard deviation of the Gaussian filter can be set between 1 and 3, with a default setting of 1, which preserves more detail while smoothing the image. When calculating the gradient magnitude and direction of pixels, the appropriate Sobel operator aperture size will be automatically selected based on the image. Regarding the gradient intensity threshold setting, the default setting is a high threshold G. H Set to 255, low threshold G L Setting the threshold to 127, the level of gradient intensity affects the determination of edge pixels. The threshold can be adjusted as needed based on the image segmentation results to obtain edge detection results that better meet practical requirements. Specifically, this may include the following steps:

[0084] S21 uses a Gaussian filter to remove noise from ultrasound images and improve image smoothness.

[0085] For each pixel, a two-dimensional Gaussian function weight matrix is ​​constructed centered on that pixel. The weight values ​​indicate the contribution of nearby pixels to the central pixel; pixels farther from the center have smaller weight values. The two-dimensional Gaussian function is:

[0086]

[0087] Here, the coordinates x and y of the pixel are the offsets relative to the center point, G(x,y) represents the value of the two-dimensional Gaussian function at the point (x,y), and σ is the standard deviation of the Gaussian function, which controls the variance of the Gaussian distribution.

[0088] The weighted average of the center pixel and its neighboring pixels is calculated using the weight matrix, which is the Gaussian blur value of the center pixel. The Gaussian function weight matrix is ​​then convolved with the output image from step S1, i.e.:

[0089] I σ =I*G(x,y)

[0090] Here, * represents the convolution operator. After all pixels are processed by a Gaussian filter, some noise in the original image is removed, making the image somewhat blurry.

[0091] S22 uses the Sobel operator to calculate the gradient magnitude and direction of a pixel.

[0092] Specifically, the gradient of a two-dimensional image consists of two components: the rate of change of gray levels in the horizontal and vertical directions. Their magnitude and direction can determine the image's edge and texture information. The horizontal gradient *g* is obtained by convolving the image with the original image using the Sobel operator. x and the gradient g in the vertical direction y :

[0093]

[0094] The gradient magnitude and direction of each pixel (i,j) are calculated using two gradients, where the gradient magnitude G is... m (i,j) represents the gradient intensity of the image, and the gradient direction θ represents the direction of the gradient.

[0095]

[0096] S23 performs non-maximum pixel gradient suppression on the gradient magnitude in the gradient direction to refine and sharpen the detected image edges.

[0097] The gradient magnitudes of adjacent pixels along the gradient direction are compared. If the gradient magnitude of the current pixel is greater than the gradient magnitudes of its two adjacent pixels along the gradient direction, the pixel is marked as an edge point; otherwise, the pixel is suppressed, and its gradient magnitude is set to 0. To more accurately estimate the gradient change along the gradient direction and avoid the discontinuity and distortion caused by calculating the gradient using discrete pixel values, a linear interpolation method is used to represent the gradient transition between pixels. This better reflects the gradient changes in the actual scene and reduces errors and inaccuracies.

[0098] The neighborhood of each pixel is divided into four parts: top, bottom, left, and right. The gradient direction region to which a pixel belongs is determined by the gradient magnitudes in the x and y directions of the center pixel. Two gradient magnitudes, g, for comparison in the positive and negative gradient directions are obtained through linear interpolation based on the pixel gradient direction and the gradients of neighboring pixels. up and g down The calculation method is as follows:

[0099] g up (i,j)=(1-weight)·G m (i,j+1)+weight·G m (i-1,j+1)

[0100] g down (i,j)=(1-weight)·G m (i,j-1)+weight·Gm (i+1,j-1)

[0101] The weight values ​​are as follows:

[0102]

[0103] S24, perform hysteresis threshold processing.

[0104] Specifically, after performing non-maximum pixel gradient suppression, noise and color changes may cause blurring or discontinuities in the image. To eliminate stray responses, weak edge pixels are filtered by setting high and low thresholds, while strong edge pixels with high gradient values ​​are retained. The specific implementation process is as follows:

[0105]

[0106] Among them, G H For the high threshold of gradient strength, G L The threshold value is the gradient strength. Strong, Weak, and Non-edge represent strong edge pixels, weak edge pixels, and non-edge pixels, respectively.

[0107] If the gradient magnitude of a pixel exceeds the high threshold, the pixel is retained as an edge pixel; if it is less than the low threshold, the pixel is not an edge pixel; if the gradient magnitude is between the two thresholds, the pixel is determined to be an edge if it is connected to an edge pixel, otherwise it is not an edge pixel.

[0108] In one embodiment of the present invention, step S3 establishes a complete hierarchical structure based on the edge contours obtained in step S2, determines the number of each contour and the subordinate relationship between them, and obtains the attribute information of each contour. That is, the point set of all contours in the image is found through the following algorithm, and a complete hierarchical subordinate relationship is established for all contours to obtain the contour attribute information of the hierarchical tree structure, including the next contour number of the same level contour, the previous contour number of the same level contour, the parent contour number, and the embedded contour number.

[0109] Specifically, the process involves finding the point set of all contours in the image. This point set is an array of coordinates for each individual contour, and a complete hierarchical relationship is established for all contours. The entire image is scanned using raster scanning. The starting point of the contour is determined based on the grayscale values ​​of pixels (i,j) and (i,j-1). Figure 8 The illustrated process performs contour tracking, determining the attribute information of each contour, including the index of the next contour at the same level, the index of the previous contour at the same level, the index of the first child contour, and the index of the parent contour. In this example, 27 contours were found in the tumor (including the peritumoral region) edge extraction image, and 15 contours were found in the tumor internal edge extraction image. This process may include the following steps:

[0110] S31, f ij This represents the grayscale value of pixel (i,j), and the entire image is scanned using a raster scan. NBD represents the current contour number, initially set to 1; LNBD represents the previous contour number, reset to 1 each time a new row is scanned. When the grayscale value f of a pixel (i,j) is scanned... ij When ≠0, operate according to the following conditions:

[0111] (1) If f ij =1 and f i,j-1 =0, then (i,j) is the starting point of the outer contour, NBD = NBD+1, (i2,j2) = (i,j+1).

[0112] (2) If f ij ≥1 and f i,j+1 =0, then (i,j) is the starting point of the hole profile, NBD = NBD + 1, (i2,j2) = (i,j + 1). If f ij >1, then LNBD=f ij .

[0113] (3) In other cases, proceed to STEP4.

[0114] S32. Determine the parent-child relationship of the contours based on their types. If the current contour and the previous contour are both outer contours or hole contours, then the current contour and the previous contour are sibling contours, and their parent contours are both the parent contours of the previous contour. If the current contour is an outer contour and the previous contour is a hole contour, or the current contour is a hole contour and the previous contour is an outer contour, then the parent contours are both the previous contour.

[0115] S33. After determining the starting point (i,j) of the contour, perform contour tracking according to the following steps.

[0116] (1) Starting from (i2,j2), search for non-zero pixels in the 4-neighborhood centered at (i,j) in a clockwise direction. If a non-zero pixel exists, let (i1,j1) record the current non-zero pixel; otherwise, let f ij =-NBD, proceed to STEP4.

[0117] (2) Let (i2,j2)=(i1,j1), (i3,j3)=(i,j).

[0118] (3) Taking (i3,j3) as the center and the updated (i2,j2) as the starting point, search for non-zero pixels in the neighborhood of the center point 4 in a counterclockwise direction, and let (i4,j4) record the first non-zero pixel.

[0119] (4) Based on (i3,j3), i.e., the currently scanned grayscale value, change f ij The value, if ,but ;if and but Otherwise, do not change. The value of .

[0120] (5) If (i4,j4)==(i,j) and (i3,j3)==(i1,j1), it means that the scan has returned to the starting point of the contour, so proceed to STEP4; otherwise, let (i2,j2)=(i3,j3) and (i3,j3)=(i4,j4), and continue to execute STEP3(3).

[0121] S34, if f ij If ≠1, then LNBD=f ij The raster scan continues from point (i, j+1). The entire process ends when the scan reaches the bottom right pixel of the image.

[0122] In one embodiment of the present invention, S4 performs edge drawing based on all contour information obtained in step S3 by custom setting the line width pixel value, and performs full threshold segmentation on the drawn edge contour image.

[0123] It is understandable that when drawing the found image contours, it is necessary to select an appropriate line width pixel value. A larger line width can reduce the possibility of edge breakage, but if the line width is too large, the extra areas may be mistaken for lesion areas. Therefore, this invention allows for customizing the line width pixel value according to the actual thickness of the annotated lines. Image pixel quality has a significant impact on edge drawing quality; low pixel quality will result in more jagged edges. This invention introduces the Otsu's method for full threshold segmentation to obtain smooth boundaries.

[0124] Specifically, based on the annotation lines and image pixel quality, the line width pixel value is reasonably set for drawing all contour point sets, with a default line width pixel value of 7. The maximum inter-class variance method is introduced for full thresholding segmentation. The grayscale value of pixels in the source image is compared with the threshold thresh. Pixels with a grayscale value greater than the threshold thresh are set to 255 (white), and pixels with a grayscale value less than or equal to the threshold thresh are set to 0 (black). In this embodiment, the optimal threshold is determined to be 9. The image after thresholding segmentation is as follows: Figure 9 and Figure 10 As shown.

[0125] Suppose the image has a total of N pixels, contains L gray levels, and the gray level value is f. i The number of pixels is n i Then the pixel gray level in the image is fi The probability is:

[0126]

[0127] Let the threshold be T. The image is segmented into foreground A and background B using this threshold. The probability that a pixel is assigned to A is p. A (T), the average gray level of the pixels assigned to A is m. A Similarly, the probability of a pixel being assigned to B is p. B (T), the average gray level of the pixels assigned to B is m. B (T), the average gray level of the entire image is m G Then we have:

[0128] p A (T)*m A (T)+p B (T)*m B (T)=m G

[0129] The inter-class variances of the foreground and background are:

[0130] σ 2 =p A (T)[m A (T)-m G ] 2 +p B (T)[m B (T)-m G ] 2

[0131] Substituting the two equations above, we get:

[0132] σ 2 =p A (T)p B (T)[m A (T)-m B (T)] 2

[0133] in: The T value that maximizes the inter-class variance is used as the global threshold thresh for the image. The image is then segmented into background and target regions based on this threshold.

[0134]

[0135] In one embodiment of the present invention, S5 re-establishes the hierarchical relationship for the contours drawn in step S4, obtains attribute information, calculates the area of ​​all contours in the image, determines the largest contour number, and fills and draws all contours to generate a binary mask image.

[0136] Specifically, the present invention searches for all contours of the image after threshold segmentation again, calculates the area of ​​all contours using Green's formula, removes noisy contours, and retains only the outline of the labeled lines.

[0137] For example, if planar region D n The interior of any simple closed curve in D is contained within D. n Among them, it is called D. n It is a simply connected region; otherwise, it is called a multiply connected region. By observation... Figure 5 It can be seen that the outlines of the labeled lines in the output image after thresholding are multiply connected components, while the noise contours contain both simply connected and multiply connected components. To remove the noise region, Green's formula is used to calculate the area of ​​all contour regions. In this example, the contour with the largest area in the tumor (including the peritumoral region) edge extraction image is numbered 3, and the contour with the largest area in the tumor interior edge extraction image is numbered 2. The internal pixels of the contour with the largest area are filled with 255 (white), and the remaining contours are considered noise contours, with pixels filled with 0 (black). This yields the binary mask images of the tumor (including the peritumoral region) and the tumor interior, as shown below. Figure 11 and Figure 12 As shown.

[0138] Specifically, the contour region (i.e., the non-zero pixel region) in the binary image after thresholding is a planar region D whose area needs to be calculated. n Planar region D n It is a bounded region enclosed by a simple closed curve L (Jordan curve), that is, the starting point and ending point of the boundary curve L coincide and do not intersect each other.

[0139] In the planar region D n When calculating the area, the boundary curve L is considered as a directed curve, and its coordinates are represented as (x1, y1), (x2, y2), ..., (x...). n ,y n ), Region D n If the area of ​​region D is dxdy, then the region D n The area is:

[0140]

[0141] Let functions P(x,y) and Q(x,y) exist in a bounded closed region D. n It has continuous first-order partial derivatives on D. n The boundary L is piecewise smooth, according to Green's theorem:

[0142]

[0143] Let Q(x,y) = x, P(x,y) = -y, then:

[0144]

[0145] The area of ​​the contour enclosed by curve L is:

[0146]

[0147] Where, x n+1 =x1,y n+1 =y1.

[0148] The binary mask image is obtained by calculating the number of the contour with the largest area, filling the inside of the contour with white and the rest of the contour with black.

[0149] In one embodiment of the present invention, step S6 performs steps S1-S5 on the tumor (including the peritumoral region) and the annotated image inside the tumor, respectively, to obtain a binary mask image of the tumor (including the peritumoral region) and the inside of the tumor from the same tumor ultrasound image. The mask regions of the two images are superimposed and cropped to obtain a precise peritumoral mask image of the tumor. By merging the peritumoral mask image with the original ultrasound image, the precise segmentation of the irregular peritumoral region can be achieved.

[0150] Specifically, by superimposing and cropping the tumor (including the peritumoral region) and the binary mask image of the tumor interior from the obtained tumor image, a peritumoral mask image of the tumor can be obtained, such as... Figure 13 As shown, by merging the masked image of the peritumoral region with the original ultrasound image, irregular peritumoral regions can be extracted. Figure 14 As shown, the effective extraction of this part can be used for subsequent analysis of medical images.

[0151] The peritumor region segmentation method based on ultrasound images according to embodiments of the present invention, based on labeled ultrasound images, has the ability to rapidly process large numbers of images without requiring extensive data training for the model, while simultaneously achieving accurate segmentation of irregular peritumor regions. During processing, a Gaussian filter is used to remove noise from the ultrasound images, improving image smoothness, and non-maximum suppression is applied to the amplitude along the gradient direction, thereby refining and clarifying the detected image edges. Furthermore, users can customize the line width pixel values ​​according to the actual situation of the labeled lines to prevent discontinuous edges, and the maximum inter-class variance method is used to eliminate edge burrs. By using a method to find the maximum area contour, interference from regions of similar color to the labeled lines in the image can be effectively eliminated, further improving the convenience and accuracy of the segmentation operation. This invention has promising application prospects in the field of medical image analysis.

[0152] To achieve the above embodiments, such as Figure 15 As shown, this embodiment also provides a peritumoral region segmentation system 10 based on ultrasound imaging, including:

[0153] The model conversion module 100 is used to convert the RGB color model of the tumor ultrasound image into the HSV color model, and determine the target area image to be detected based on the HSV color model; wherein, the tumor ultrasound image includes the tumor in the peritumoral region and the annotated image inside the tumor.

[0154] Edge detection module 200 is used to perform edge detection on the target region image to obtain a complete edge image based on the detection results;

[0155] The attribute determination module 300 is used to establish a hierarchical structure based on the edge image and determine the attribute information of each edge according to the hierarchical structure.

[0156] The threshold segmentation module 400 is used to draw edges based on preset line width pixel values ​​and all attribute information, and to perform full threshold segmentation on the drawn edge image to obtain the segmented contour image.

[0157] The contour filling module 500 is used to calculate the area of ​​all contours in the segmented contour image and fill and draw all contours to obtain a binary mask image.

[0158] The image segmentation module 600 is used to obtain a tumor peritumoral mask image based on the binary mask image, and to merge the tumor peritumoral mask image with the tumor ultrasound image to obtain the segmentation result of the irregular peritumoral region.

[0159] Furthermore, the model conversion module 100 is also used for:

[0160] Obtain the RGB color space corresponding to the color channels of the tumor ultrasound image;

[0161] Convert the RGB color space to the HSV color space, which consists of three color channels: hue, saturation, and lightness.

[0162] The color component threshold is set according to the color component range of the HSV color space to detect the target color region and determine the target region image.

[0163] The peritumor region segmentation system based on ultrasound images according to embodiments of the present invention, based on labeled ultrasound images, has the ability to rapidly process large numbers of images without requiring extensive data training for the model, while simultaneously achieving accurate segmentation of irregular peritumor regions. During processing, a Gaussian filter is used to remove noise from the ultrasound images, improving image smoothness, and non-maximum suppression is applied to the amplitude along the gradient direction, thereby refining and clarifying the detected image edges. Furthermore, users can customize the line width pixel values ​​according to the actual situation of the labeled lines to prevent discontinuous edges, and the maximum inter-class variance method is used to eliminate edge burrs. By using a method to find the maximum area contour, interference from regions of similar color to the labeled lines in the image can be effectively eliminated, further improving the convenience and accuracy of the segmentation operation. This invention has promising application prospects in the field of medical image analysis.

[0164] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0165] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.

Claims

1. A method for segmenting the peritumoral region based on ultrasound imaging, characterized in that, include: The RGB color model of the tumor ultrasound image is converted into the HSV color model, and the target area image to be detected is determined according to the HSV color model; wherein, the tumor ultrasound image includes the tumor in the peritumoral region and the annotated image inside the tumor. Edge detection is performed on the target region image to obtain a complete edge image based on the detection results; A hierarchical structure is established based on the edge image, and the attribute information of each edge is determined according to the hierarchical structure. Edges are drawn based on preset line width pixel values ​​and all attribute information, and full threshold segmentation is performed on the drawn edge images to obtain segmented contour images. Calculate the area of ​​all contours in the segmented contour image, and fill and draw all contours to obtain a binary mask image; Based on the binary mask image, a peritumoral mask image of the tumor is obtained, and the peritumoral mask image of the tumor is merged with the tumor ultrasound image to obtain the segmentation result of the irregular peritumoral region.

2. The method according to claim 1, characterized in that, Converting the RGB color model of a tumor ultrasound image to an HSV color model, and determining the target region image based on the HSV color model, includes: Obtain the RGB color space corresponding to the color channels of the tumor ultrasound image; Convert the RGB color space to the HSV color space, which consists of three color channels: hue, saturation, and lightness. The color component threshold is set according to the color component range of the HSV color space to detect the target color region and determine the target region image.

3. The method according to claim 1, characterized in that, Performing edge detection on the target region image to obtain a complete edge image based on the detection results includes: The first feature image is obtained by smoothing the target region image using a Gaussian filter; The gradient magnitude and direction of the pixels in the first feature image are calculated using the Sobel operator; The second feature image is obtained by performing non-maximum pixel gradient suppression on the gradient magnitude along the gradient direction; A double thresholding operation is performed on the second feature image to obtain a complete edge image by connecting pixels with strong and weak edges.

4. The method according to claim 3, characterized in that, A hierarchical structure is established based on the edge image, and the attribute information of each edge is determined according to the hierarchical structure, including: The preset algorithm is used to find the point set of all contours of the edge image, and a complete hierarchical relationship is established for all contours; The contour attribute information of the hierarchical tree structure is obtained based on the hierarchical relationship; wherein, the contour attribute information includes the next contour number of the same level contour, the previous contour number of the same level contour, the parent contour number, and the embedded contour number.

5. The method according to claim 4, characterized in that, Calculate the area of ​​all contours in the segmented contour image, and fill and draw all contours to obtain a binary mask image, including: Find all contours in the image after thresholding and calculate the area of ​​all contours using Green's formula to remove noisy contours and retain the contours of the labeled lines. The maximum area contour number is calculated, and the contour is filled with white while the rest of the contour is filled with black to obtain a binary mask image of the tumor surrounding the tumor and the tumor internal annotation image of the same tumor ultrasound image.

6. The method according to claim 3, characterized in that, The first feature image is obtained by smoothing the target region image using a Gaussian filter, including: A two-dimensional Gaussian function weight matrix is ​​constructed with each pixel of the target region image as the center. The first feature image is obtained by convolving the Gaussian function weight matrix with the target region image.

7. The method according to claim 1, characterized in that, The gradient magnitude and direction of pixels in the first feature image are calculated using the Sobel operator, including: The Sobel operator was used to perform convolution operations with the tumor ultrasound image to obtain the gradient in the horizontal direction and the gradient in the vertical direction. The gradient magnitude and direction of each pixel in the first feature image are calculated using the gradient in the horizontal and vertical directions.

8. The method according to claim 2, characterized in that, Color component thresholds are set based on the color component ranges of the HSV color space to detect and determine the target color region in the image, including: The color component threshold is determined based on the color of the image annotation lines in the HSV color space; Each pixel of the tumor ultrasound image is scanned, and the input pixel value is determined based on the scan results to be within the threshold range of the color component. If it is within the threshold range, the pixel value of the current pixel is set accordingly.

9. A peritumoral region segmentation system based on ultrasound imaging, characterized in that, include: The model conversion module is used to convert the RGB color model of the tumor ultrasound image into the HSV color model, and determine the target area image to be detected based on the HSV color model; wherein, the tumor ultrasound image includes the tumor in the peritumoral region and the annotated image inside the tumor. The edge detection module is used to perform edge detection on the target region image to obtain a complete edge image based on the detection results; An attribute determination module is used to establish a hierarchical structure based on the edge image and determine the attribute information of each edge according to the hierarchical structure. The threshold segmentation module is used to draw edges based on preset line width pixel values ​​and all attribute information, and to perform full threshold segmentation on the drawn edge image to obtain the segmented contour image. The contour filling module is used to calculate the area of ​​all contours in the segmented contour image and fill and draw all contours to obtain a binary mask image. The image segmentation module is used to obtain a tumor peritumoral mask image based on the binary mask image, and to merge the tumor peritumoral mask image with the tumor ultrasound image to obtain the segmentation result of the irregular peritumoral region.

10. The system according to claim 9, characterized in that, The model conversion module is also used for: Obtain the RGB color space corresponding to the color channels of the tumor ultrasound image; Convert the RGB color space to the HSV color space, which consists of three color channels: hue, saturation, and lightness. The color component threshold is set according to the color component range of the HSV color space to detect the target color region and determine the target region image.

Citation Information

Patent Citations

  • Tumor interstitial ratio calculation method and terminal for full-view digital pathological section

    CN116363103A

  • Intratumoral and peritumoral habitat analysis method, device and equipment and storage medium

    CN118096773A