Ultrasonic image-based peritumoral region segmentation method and system

By converting the RGB model of ultrasound images to an HSV model and combining Gaussian filters and Sobel operators for edge detection, a hierarchical structure is established for segmentation, solving the problem of inaccurate segmentation of the peritumoral region of tumors in existing technologies. This achieves fast and accurate segmentation of the peritumoral region, improving the accuracy of medical image analysis.

CN119048534AActive Publication Date: 2024-11-29BEIJING UNIV OF POSTS & TELECOMM

Patent Information

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

AI Technical Summary

Technical Problem

Existing methods for segmenting the peritumoral region of tumors cannot accurately reflect the real situation, and conventional segmentation models cannot effectively distinguish the subtle differences between the peritumoral edge and normal tissue when processing peritumoral segmentation, resulting in unsatisfactory segmentation accuracy and affecting the precision of medical analysis.

Method used

An ultrasound-based segmentation method was adopted. The RGB color model of the tumor ultrasound image was converted into the HSV color model. Edge detection was performed by combining Gaussian filter and Sobel operator to establish a hierarchical structure. Full threshold segmentation and contour filling were performed to generate a binary mask image. Finally, the images were merged to obtain the segmentation results of the irregular peritumoral region.

Benefits of technology

It enables rapid and accurate segmentation of the peritumoral region of tumors, providing a reliable data foundation for subsequent tumor analysis and diagnosis, and improving the efficiency and accuracy of medical image analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119048534A_ABST
    Figure CN119048534A_ABST
Patent Text Reader

Abstract

The invention discloses a peritumoral region segmentation method and system based on an ultrasonic image, and the method comprises the steps: converting an RGB color model of a tumor ultrasonic image into an HSV color model, and determining a detected target region image according to the HSV color model; performing edge detection on the target area image to obtain a complete edge image according to a detection result; establishing a hierarchical structure based on the edge image, and determining attribute information of each edge according to the hierarchical structure; edge drawing is carried out according to the line width pixel value and the attribute information, and full threshold segmentation is carried out on a drawn edge image to obtain a segmented contour image; calculating the areas of all contours in the segmented contour image, and performing filling drawing on all contours to obtain a binary mask image; and obtaining a tumor perima mask image based on the binary mask image, and merging the tumor perima mask image and the tumor ultrasonic image to obtain a segmentation result of the irregular perima region. According to the invention, accurate and rapid segmentation of the tumor perima area can be effectively realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] The peritumoral area is the area where the tumor is in direct contact with normal human tissue. The nutrients and channels required for tumor growth and metastasis all pass through the peritumoral area to enter and exit the tumor tissue, such as blood vessels, lymphatic vessels, nerves, and various connective tissues. The analysis of the peritumoral area can not only evaluate the depth of tumor infiltration, but also serve as a basis for determining whether the surgical margin is violated during tumor resection. At the same time, the peritumoral area analysis can provide effective information about the biological characteristics and invasive ability of the tumor, which can be used to predict the patient's prognosis and guide adjuvant therapy. Tumor biology studies have shown that the environment surrounding the tumor releases many growth factors and cytokines, leading to hypoxia and angiogenesis, which are crucial for the formation, development, and metastasis of the tumor. By comprehensively analyzing the information of the tumor and peritumoral area, the invasion and metastasis characteristics of the tumor can be more comprehensively described. Therefore, the analysis of the peritumoral area of ​​the tumor is of great significance for medical diagnosis and treatment.

[0003] Current peritumoral segmentation methods usually use equidistant expansion at the original tumor boundary for segmentation. However, in fact, the normal tissue and abnormal tissue around the tumor do not present the same thickness or width completely and evenly, which means that the equidistant expansion method cannot accurately reflect the true situation of the peritumoral area. At the same time, due to the high similarity between the characteristics of the peritumoral area and normal tissue, as well as the complexity of the local tissue structure, conventional segmentation models cannot effectively distinguish the slight differences between the peritumoral edge and normal tissue when dealing with peritumoral segmentation. The accuracy of the current existing peritumoral area segmentation model is not ideal. When conducting effective pathological analysis, surgical decision-making and treatment planning, it is impossible to obtain high-quality and accurate peritumoral area data, which directly affects the accuracy of subsequent medical analysis.

[0004] When analyzing the peritumoral region, whether it is medical imaging omics analysis or accurate automatic segmentation model training, a large amount of accurate annotated data is required. The acquisition of ultrasound image masks requires professional annotation of images by doctors. Quickly and accurately processing a large number of annotated images can greatly improve research efficiency while ensuring the consistency and accuracy of the results. Therefore, in practical applications, how to quickly and accurately segment the peritumoral region of a large number of tumor peritumoral labeled images has important research value and clinical needs. Summary of the invention

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

[0006] To this end, the present invention designs a peritumoral region segmentation method based on ultrasound images, aiming to quickly and accurately segment the peritumoral region of the tumor. By leveraging the professional knowledge and experience of doctors, using ultrasound images that have been annotated by doctors as input, and combining the edge detection technology of computer vision, the boundary information of the peritumoral region is automatically detected and accurately extracted, thereby achieving accurate segmentation of the peritumoral region of the tumor.

[0007] Another object of the present invention is to provide a peritumoral region segmentation system based on ultrasound images.

[0008] To achieve the above object, the present invention provides a method for segmenting a peritumoral region based on ultrasound images, comprising:

[0009] Converting the RGB color model of the tumor ultrasound image into the HSV color model, and determining the detected target area image according to the HSV color model; wherein the tumor ultrasound image includes the tumor in the peritumoral area and the annotated image inside the tumor;

[0010] Performing edge detection on the target area image to obtain a complete edge image according to the detection result;

[0011] Establishing a hierarchical structure based on the edge image, and determining attribute information of each edge according to the hierarchical structure;

[0012] The edge is drawn according to the preset line width pixel value and all attribute information, and the drawn edge image is segmented by full threshold to obtain the segmented contour image;

[0013] Calculating the areas of all contours in the segmented contour image, and filling and drawing all contours to obtain a binary mask image;

[0014] A tumor peritumoral mask image is obtained based on the binary mask image, and the tumor peritumoral mask image is combined with the tumor ultrasound image to obtain a segmentation result of the irregular peritumoral area.

[0015] The ultrasound image-based peritumoral region segmentation method of the embodiment of the present invention may also have the following additional technical features:

[0016] In one embodiment of the present invention, converting the RGB color model of the tumor ultrasound image into the HSV color model, and determining the detected target area image according to the HSV color model, includes:

[0017] Obtaining the RGB color space corresponding to the color channel of the tumor ultrasound image;

[0018] Convert the RGB color space to the HSV color space consisting of three color channels: hue, saturation and brightness;

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

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

[0021] Using a Gaussian filter to smooth the target area image to obtain a first feature image;

[0022] Using the Sobel operator to calculate the gradient magnitude and direction of the pixel points of the first feature image;

[0023] Perform non-maximum pixel gradient suppression on the gradient amplitude in the gradient direction to obtain a second feature image;

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

[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] Using a preset algorithm to find the point set of all contours of the edge image, and establishing a complete hierarchical subordinate relationship for all contours;

[0027] Based on the hierarchical affiliation, contour attribute information of a hierarchical tree structure is obtained; wherein the contour attribute information includes the next contour number of the contour at the same level, the previous contour number of the contour at the same level, the parent contour number and the embedded contour number.

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

[0029] Find all the contours of the image after threshold segmentation, and use Green's formula to calculate the area of ​​all contours to remove the noise contours and retain the contours of the annotation lines;

[0030] The number of the contour with the largest area is obtained by calculation, and the inside of the contour is filled with white, and the rest of the contours are filled with black, so as to obtain a binary mask image containing the tumor in the peritumoral area and the annotated image inside the tumor of the same tumor ultrasound image.

[0031] In one embodiment of the present invention, the target area image is smoothed by using a Gaussian filter to obtain a first feature image, including:

[0032] Construct a two-dimensional Gaussian function weight matrix with each pixel of the target area image as the center;

[0033] The Gaussian function weight matrix is ​​convolved with the target area image to obtain the first feature image.

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

[0035] The Sobel operator is 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 point of the first feature image are calculated using the gradient in the horizontal direction and the gradient in the vertical direction.

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

[0038] Determine the color component threshold according to the color of the image annotation line in the HSV color space;

[0039] Each pixel point of the tumor ultrasound image is scanned, and whether the input pixel value is within the color component threshold range is determined according to the scanning result. If it is within the threshold range, the pixel value of the current pixel point is set accordingly.

[0040] To achieve the above-mentioned purpose, a second embodiment of the present invention provides a peritumoral region segmentation system based on ultrasound images, comprising:

[0041] A model conversion module, 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 according to the HSV color model; wherein the tumor ultrasound image includes a tumor in the peritumoral area and an annotated image inside the tumor;

[0042] An edge detection module is used to perform edge detection on the target area image to obtain a complete edge image according to the detection result;

[0043] an attribute determination module, configured to establish a hierarchical structure based on the edge image, and determine attribute information of each edge according to the hierarchical structure;

[0044] The threshold segmentation module is used to draw edges according to the preset line width pixel value and all attribute information, and perform full threshold segmentation on the drawn edge image to obtain a segmented contour image;

[0045] A contour filling module, used for calculating the areas of all contours in the segmented contour image, and filling and drawing 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 combine the tumor peritumoral mask image with the tumor ultrasound image to obtain a segmentation result of the irregular peritumoral area.

[0047] The ultrasound image-based peritumoral region segmentation method and system of the embodiment of the present invention can quickly and accurately segment the peritumoral region of the tumor by combining the ultrasound image annotated by the doctor and the edge detection technology of computer vision, providing a reliable data basis for subsequent tumor analysis and diagnosis. Compared with the current segmentation method, the present invention is more clinically significant and provides a more efficient and accurate solution for medical image analysis.

[0048] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0050] Figure 1 A flowchart of a method for segmenting a peritumoral region based on ultrasound images provided in an embodiment of the present invention;

[0051] Figure 2 Ultrasonic images of liver tumors provided by an embodiment of the present invention;

[0052] Figure 3 A tumor (including the peritumoral area) annotation map provided in an embodiment of the present invention;

[0053] Figure 4 A tumor internal annotation image provided by an embodiment of the present invention;

[0054] Figure 5 Annotate the edge extraction map of the tumor (including the peritumoral area) according to the embodiment of the present invention;

[0055] Figure 6 This is a tumor internal annotation edge extraction map according to an embodiment of the present invention;

[0056] Figure 7 is an implementation flow chart of step S2 of the present invention;

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

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

[0059] Fig.10 A drawing of the internal contour of a tumor according to an embodiment of the present invention;

[0060] Fig.11 is a binary mask image of a tumor (including the peritumoral area) according to an embodiment of the present invention;

[0061] Fig.12 is a binary mask image of the interior of a tumor according to an embodiment of the present invention;

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

[0063] Fig.14 A peritumoral region segmentation map according to an embodiment of the present invention;

[0064] Fig.15 It is a structural diagram of a peritumoral region segmentation system based on ultrasound imaging according to an embodiment of the present invention. DETAILED DESCRIPTION

[0065] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments can be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0066] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0067] A method for segmenting a peritumoral region based on ultrasound images according to an embodiment of the present invention will be described below with reference to the accompanying drawings.

[0068] Figure 1 FIG. 1 is a flow chart of a method for segmenting a peritumoral region based on ultrasound images according to an embodiment of the present invention. Figure 1 As shown, the method includes:

[0069] S1, converting the RGB color model of the tumor ultrasound image into the HSV color model, and determining the target area image to be detected according to the HSV color model; wherein the tumor ultrasound image includes a tumor in the peritumoral area and an annotated image inside the tumor;

[0070] S2, performing edge detection on the target area image to obtain a complete edge image according to the detection result;

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

[0072] S4, edge drawing is performed according to the preset line width pixel value and all attribute information, and full threshold segmentation is performed on the drawn edge image to obtain a segmented contour image;

[0073] S5, calculating the areas of all contours in the segmented contour image, and filling and drawing all contours to obtain a binary mask image;

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

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

[0076] like Figure 2 Shown is an ultrasound image of a liver tumor. Figure 3 and Figure 4 They are the tumor (including the peritumoral area) and the internal labeled image of the tumor marked by the doctor.

[0077] For example, the color channel of the ultrasound image is an RGB color model. In order to more accurately distinguish the subtle differences between different colors and realize color detection and recognition, the RGB color space can be converted into the HSV color space by the following formula:

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

[0079]

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

[0081] Specifically, the color of the annotation line selected in the annotation image is green, that is, the extraction color interval threshold is set to H: [35, 77], S: [43, 255], V: [46, 255]. Scan the pixel points of the image to determine whether the color of each pixel point is within the set threshold range. If it is within the threshold range, the pixel value of the point is set to 255 (white), otherwise it is set to 0 (black), and the edge extraction image is obtained as shown in the figure. Figure 5 and Figure 6 shown.

[0082] In one example of the present invention, step S2 performs high-precision edge detection on the target area image obtained in step S1, uses a filter to smooth the image, calculates the amplitude and direction of the image gradient, performs non-maximum suppression on the amplitude in the gradient direction, performs a double threshold operation on the processed image, and obtains a complete edge image by connecting strong and weak edge pixels.

[0083] The edge detection process of the present invention is as follows Figure 7 As shown in the figure, the standard deviation of the Gaussian filter can be set between 1 and 3, and the default setting is 1, which smoothes the image while retaining more details. When calculating the pixel gradient amplitude and direction, the appropriate Sobel operator aperture size will be automatically selected according to the image. For the setting of the gradient intensity threshold, the high threshold G is set by default. H Set to 255, low threshold G L Set to 127. The high and low threshold settings of the gradient intensity will affect the determination of edge pixels. The necessary threshold adjustment can be made according to the image segmentation results to obtain an edge detection effect that better meets actual needs. The specific steps may include the following:

[0084] S21, using Gaussian filter to remove ultrasound image noise and improve image smoothness.

[0085] For each pixel, a two-dimensional Gaussian function weight matrix is ​​constructed with it as the center. The weight value indicates the contribution of nearby pixels to the central pixel. The farther away from the center point, the smaller the weight value of the pixel. The two-dimensional Gaussian function is:

[0086]

[0087] The coordinates x and y of the pixel point 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 the pixels in its neighborhood is calculated by the weight matrix, which is the Gaussian blur value of the center pixel. The Gaussian function weight matrix is ​​convolved with the output image of step S1, that is:

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

[0090] Among them, * represents the convolution operator. After all pixels are processed by the Gaussian filter, part of the noise of the original image is removed and the image becomes blurred.

[0091] S22, using the Sobel operator to calculate the pixel point gradient magnitude and direction.

[0092] Specifically, the gradient of a two-dimensional image consists of two components: the grayscale change rate in the horizontal direction and the vertical direction. Its size and direction can determine the edge and texture information of the image. The Sobel operator is used to perform convolution operations with the original image to obtain the gradient g in the horizontal direction. x and the vertical gradient g y :

[0093]

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

[0095]

[0096] S23, performing non-maximum pixel gradient suppression on the gradient amplitude in the gradient direction, and refining and sharpening the detected image edge.

[0097] Compare the gradient magnitudes of adjacent pixels along the gradient direction. If the gradient magnitude of the current pixel is greater than the gradient magnitudes of the two adjacent pixels in the gradient direction, the pixel is marked as an edge point; otherwise, the pixel is suppressed and its gradient magnitude is set to 0. In order to more accurately estimate the change of the gradient along the gradient direction and avoid the discontinuity and distortion of the results caused by calculating the gradient using discrete pixel values, the linear interpolation method is used to represent the transition of the gradient between pixels, which can better reflect the change of the gradient in the actual scene and reduce errors and inaccuracies.

[0098] The neighborhood of each pixel is divided into four parts, including top, bottom, left, and right. The gradient direction area to which the central pixel belongs is determined by the gradient amplitude in the x and y directions. The two gradient amplitudes g involved in the comparison in the positive and negative gradient directions are obtained by linear interpolation based on the pixel gradient direction and the pixel gradient of the adjacent points. 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] Among them, the value of weight is as follows:

[0102]

[0103] S24, performing hysteresis threshold processing.

[0104] Specifically, after non-maximum pixel gradient suppression, the image may become blurred or discontinuous due to noise and color changes. In order to eliminate stray responses, the low and high thresholds are set to filter weak edge pixels and retain strong edge pixels with high gradient values. The specific implementation process is as follows:

[0105]

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

[0107] If the gradient amplitude 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 a non-edge pixel; when it is between the two thresholds, if the pixel is connected to the edge pixel, it is judged as an edge, otherwise it is a non-edge pixel.

[0108] In one embodiment of the present invention, step S3 establishes a complete hierarchical structure based on the edge contour 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 of 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, we search for the point set of all contours of the image. The point set is an array of point coordinates composed of all the point coordinates of each individual contour, and establish a complete hierarchical subordinate relationship for all contours. The entire image is scanned by raster scanning. The starting point of the contour can be determined according to the grayscale value of the pixel point (i, j) and (i, j-1). Figure 8 The process shown in the figure performs contour tracking and can determine 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 edge extraction image of the tumor (including the peritumoral area), and 15 contours were found in the edge extraction image of the tumor. The following steps can be included:

[0110] S31,f ij Represents the grayscale value of the pixel (i, j), and scans the entire image by raster scanning. NBD represents the number of the current contour, and its initial value is 1; LNBD represents the number of the previous contour, and LNBD is reset to 1 each time a new row is scanned. When the grayscale value f of a certain pixel (i, j) is scanned ij ≠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, (i 2 ,j 2 )=(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 contour, NBD = NBD + 1, (i 2 ,j 2 )=(i,j+1). If f ij >1, then LNBD=f ij .

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

[0114] S32, determining the parent-child relationship of the contour according to the type of the contour. If the current contour and the previous contour are both outer contours or hole contours, the current contour and the previous contour are contours of the same level, and the parent contour is the parent contour 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, the parent contour is the previous contour.

[0115] S33, after determining the contour starting point (i, j), contour tracking is performed according to the following steps.

[0116] (1) with (i 2 ,j 2 ) is the starting point, and in the 4-neighborhood centered at (i,j), search for non-zero pixels in a clockwise direction. If there are non-zero pixels, let (i 1 ,j 1 ) record the current non-zero pixel; otherwise, let f ij =-NBD, go to STEP 4.

[0117] (2) Let (i 2 ,j 2 )=(i 1 ,j 1), (i 3 ,j 3 )=(i,j).

[0118] (3) Take (i 3 ,j 3 ) is the center, and the updated (i 2 ,j 2 ) is the starting point, and non-zero pixels are searched in the 4-neighborhood of the center point in the counterclockwise direction. Let (i 4 ,j 4 ) records the first non-zero pixel.

[0119] (4) According to (i 3 ,j 3 ), that is, the gray value currently scanned, changes f ij If the value of ,but ;if and but If otherwise, no change The value of .

[0120] (5) If (i 4 ,j 4 )==(i,j)and(i 3 ,j 3 )==(i 1 ,j 1 ), it means the scan has returned to the starting point of the contour, then go to STEP4; otherwise, let (i 2 ,j 2 )=(i 3 ,j 3 ), (i 3 ,j 3 )=(i 4 ,j 4 ), and continue with STEP 3(3).

[0121] S34, if f ij ≠1, then LNBD=f ij , and continue raster scanning from point (i, j+1). The whole process ends when the pixel at the lower right corner of the image is scanned.

[0122] In one embodiment of the present invention, S4 sets the line width pixel value by user-defined, draws the edge according to all the contour information obtained in step S3, and performs full threshold segmentation on the drawn edge contour image.

[0123] It is understandable that when drawing the contour of the found image, 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 redundant area will be mistaken for the lesion area. Therefore, the present invention allows customizing the line width pixel value according to the actual thickness of the marked line. The image pixel quality has an important impact on the edge drawing quality. Low pixel quality will cause more burrs on the edge. The present invention introduces the maximum inter-class variance method for full threshold segmentation to obtain a smooth boundary.

[0124] Specifically, according to the quality of the annotation line and image pixels, the line width pixel value is reasonably set to draw all contour point sets, and the default line width pixel value is 7. The maximum inter-class variance method is introduced to perform full threshold segmentation, and the grayscale value of the pixel in the source image is compared with the threshold thresh. The pixels greater than the threshold thresh are set to 255 (white), and the pixels 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 threshold segmentation is as follows Fig. 9 and Fig.10 shown.

[0125] Assume that the total number of image pixels is N, including L gray levels, and the gray value is f i The number of pixels is n i , then the grayscale of the pixel in the image is f i The probability is:

[0126]

[0127] Let the threshold be T, and use the threshold to segment the image into two parts: foreground A and background B. The probability of a pixel being classified as A is p A (T), the average grayscale of the pixels assigned to A is m A (T), similarly, the probability of a pixel being classified into B is p B (T), the average grayscale of the pixels assigned to B is m B (T), the grayscale mean 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 variance of foreground and background is:

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

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

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

[0133] in: The T value that can maximize the inter-class variance is used as the global threshold thresh of the image. The image is segmented into the background part and the segmentation target part according to the threshold.

[0134]

[0135] In one embodiment of the present invention, S5 re-establishes the hierarchical affiliation for the contours drawn in step S4, obtains attribute information, calculates the areas of all contours in the image, determines the maximum 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 noise contours, and only retains the contours of the marked lines.

[0137] For example, if the plane area D n The interior of any simple closed curve in D is contained in n Among them, it is called D n is a simply connected region; otherwise it is called a multiply connected region. Figure 5 It can be seen that the contour of the annotated line in the output image after threshold segmentation is a complex connected domain, and the noise contour has both a single connected domain and a complex connected domain. In order to remove the noise area, the Green formula is used to calculate the area of ​​all contour areas. In this example, the contour with the largest area in the edge extraction image of the tumor (including the peritumoral area) is numbered 3, and the contour with the largest area in the edge extraction image of the tumor is numbered 2. Fill the internal pixels of the contour with the largest area to 255 (white), and regard the remaining contours as noise contours, and fill the pixels with 0 (black). The binary mask image of the tumor (including the peritumoral area) and the interior of the tumor can be obtained as shown in the figure. Fig.11 and Fig.12 shown.

[0138] Specifically: the contour area (i.e., non-zero pixel area) in the binary image after threshold segmentation is the plane area D that needs to be calculated.n , plane area D n It is a bounded area surrounded by a simple closed curve L (Jordan curve), that is, the starting point and end point of the boundary curve L coincide and do not intersect with themselves.

[0139] In the plane area D n When calculating the area of ​​the boundary curve L, the boundary curve L is regarded as a directed curve, and the curve coordinates are expressed as (x 1 ,y 1 ),(x 2 ,y 2 ),...,(x n ,y n ), Region D n The area of ​​the infinitesimal element is dxdy, then the area D n The area is:

[0140]

[0141] Assume that functions P(x,y), Q(x,y) are in a bounded closed region D n There are continuous first-order partial derivatives on n The boundary L is piecewise smooth, according to Green's formula:

[0142]

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

[0144]

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

[0146]

[0147] Among them, x n+1 =x 1 ,y n+1 =y 1 .

[0148] The number of the contour with the largest area is obtained by calculation, and the inside of the contour is filled with white, and the rest of the contours are filled with black, so that a binary mask image can be obtained.

[0149] In one embodiment of the present invention, step S6 performs steps S1-S5 on the annotated image of the tumor (including the peritumoral area) and the interior of the tumor, respectively, to obtain binary mask images of the tumor (including the peritumoral area) and the interior of the tumor in the same tumor ultrasound image. The mask areas of the two images are superimposed and cropped to obtain an accurate tumor peritumoral mask image. The peritumoral area mask image is combined with the original ultrasound image to achieve accurate segmentation of the irregular peritumoral area.

[0150] Specifically, the tumor (including the peritumoral area) of the tumor image and the binary mask image inside the tumor are superimposed and cropped to obtain the peritumoral mask image of the tumor as shown in FIG. Fig.13 As shown in Figure 2, the peritumoral area mask image is combined with the original ultrasound image to extract the irregular peritumoral area. Fig.14 As shown, the effective extraction of this part can be used for subsequent analysis of medical images.

[0151] The peritumoral region segmentation method based on ultrasound images according to an embodiment of the present invention is based on annotated ultrasound images and has the ability to quickly process a large number of images without consuming a large amount of data to train the model, while achieving accurate segmentation of irregular peritumoral regions. During the processing, a Gaussian filter is used to remove ultrasound image noise, improve image smoothness, and perform non-maximum suppression of the amplitude in the gradient direction, thereby refining and clarifying the detected image edges. In addition, the user can customize the drawing line width pixel value according to the actual situation of the annotation line to prevent edge discontinuity, and eliminate edge burrs through the maximum inter-class variance method. With the help of the method of finding the maximum area contour, the interference of the color area similar to the annotation line in the image can be effectively eliminated, further improving the convenience and accuracy of the segmentation operation. The present invention has good application prospects in the field of medical image analysis.

[0152] In order to implement the above embodiment, Fig.15 As shown, this embodiment also provides a peritumoral region segmentation system 10 based on ultrasound images, 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 according to the HSV color model; wherein the tumor ultrasound image includes the tumor in the peritumoral area and the annotated image inside the tumor;

[0154] An edge detection module 200 is used to perform edge detection on the target area image to obtain a complete edge image according to the detection result;

[0155] An attribute determination module 300, configured to establish a hierarchical structure based on the edge image, and determine attribute information of each edge according to the hierarchical structure;

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

[0157] The contour filling module 500 is used to calculate the areas 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 combine the tumor peritumoral mask image with the tumor ultrasound image to obtain a segmentation result of the irregular peritumoral area.

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

[0160] Obtaining the RGB color space corresponding to the color channel of the tumor ultrasound image;

[0161] Convert the RGB color space to the HSV color space consisting of three color channels: hue, saturation and brightness;

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

[0163] The ultrasound image-based peritumoral region segmentation system according to an embodiment of the present invention has the ability to quickly process a large number of images based on the labeled ultrasound images, without consuming a large amount of data to train the model, and at the same time realizes the accurate segmentation of irregular peritumoral regions. During the processing, a Gaussian filter is used to remove ultrasound image noise, improve image smoothness, and perform non-maximum suppression of the amplitude in the gradient direction, thereby refining and clarifying the detected image edges. In addition, the user can customize the drawing line width pixel value according to the actual situation of the labeled line to prevent edge discontinuity, and eliminate edge burrs through the maximum inter-class variance method. With the help of the method of finding the maximum area contour, the interference of the color area similar to the labeled line in the image can be effectively eliminated, further improving the convenience and accuracy of the segmentation operation. The present invention has good application prospects in the field of medical image analysis.

[0164] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0165] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

Claims

1. A method for segmenting a peritumoral region based on ultrasound images, characterized in that: include: Converting the RGB color model of the tumor ultrasound image into the HSV color model, and determining the detected target area image according to the HSV color model; wherein the tumor ultrasound image includes the tumor in the peritumoral area and the annotated image inside the tumor; Performing edge detection on the target area image to obtain a complete edge image according to the detection result; Establishing a hierarchical structure based on the edge image, and determining attribute information of each edge according to the hierarchical structure; The edge is drawn according to the preset line width pixel value and all attribute information, and the drawn edge image is segmented by full threshold to obtain the segmented contour image; Calculating the areas of all contours in the segmented contour image, and filling and drawing all contours to obtain a binary mask image; A tumor peritumoral mask image is obtained based on the binary mask image, and the tumor peritumoral mask image is combined with the tumor ultrasound image to obtain a segmentation result of the irregular peritumoral area.

2. The method according to claim 1, characterized in that Converting the RGB color model of the tumor ultrasound image into the HSV color model, and determining the detected target area image according to the HSV color model, including: Obtaining the RGB color space corresponding to the color channel of the tumor ultrasound image; Convert the RGB color space to the HSV color space consisting of three color channels: hue, saturation and brightness; The color component threshold is set according to the color component interval of the HSV color space to detect the target color area and determine the target area image.

3. The method according to claim 1, characterized in that Performing edge detection on the target area image to obtain a complete edge image according to the detection result, including: Using a Gaussian filter to smooth the target area image to obtain a first feature image; Using the Sobel operator to calculate the gradient magnitude and direction of the pixel points of the first feature image; Perform non-maximum pixel gradient suppression on the gradient amplitude in the gradient direction to obtain a second feature image; A double threshold operation is performed on the second feature image to obtain a complete edge image by connecting strong and weak edge pixels.

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

5. The method according to claim 4, characterized in that Calculating the areas of all contours in the segmented contour image, and filling and drawing all contours to obtain a binary mask image, including: Find all the contours of the image after threshold segmentation, and use Green's formula to calculate the area of ​​all contours to remove the noise contours and retain the contours of the annotation lines; The number of the contour with the largest area is obtained by calculation, and the inside of the contour is filled with white, and the rest of the contours are filled with black, so as to obtain a binary mask image containing the tumor in the peritumoral area and the annotated image inside the tumor of the same tumor ultrasound image.

6. The method according to claim 3, characterized in that The target area image is smoothed by using a Gaussian filter to obtain a first feature image, including: Construct a two-dimensional Gaussian function weight matrix with each pixel of the target area image as the center; The Gaussian function weight matrix is ​​convolved with the target area image to obtain the first feature image.

7. The method according to claim 1, characterized in that The Sobel operator is used to calculate the gradient magnitude and direction of the pixel points of the first feature image, including: The Sobel operator is 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 point of the first feature image are calculated using the gradient in the horizontal direction and the gradient in the vertical direction.

8. The method according to claim 2, characterized in that: The color component threshold is set according to the color component interval of the HSV color space to detect the target color area and determine the target area image, including: Determine the color component threshold according to the color of the image annotation line in the HSV color space; Each pixel point of the tumor ultrasound image is scanned, and whether the input pixel value is within the color component threshold range is determined according to the scanning result. If it is within the threshold range, the pixel value of the current pixel point is set accordingly.

9. A peritumoral region segmentation system based on ultrasound imaging, characterized in that: include: A model conversion module, 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 according to the HSV color model; wherein the tumor ultrasound image includes a tumor in the peritumoral area and an annotated image inside the tumor; An edge detection module is used to perform edge detection on the target area image to obtain a complete edge image according to the detection result; an attribute determination module, configured to establish a hierarchical structure based on the edge image, and determine attribute information of each edge according to the hierarchical structure; The threshold segmentation module is used to draw edges according to the preset line width pixel value and all attribute information, and perform full threshold segmentation on the drawn edge image to obtain a segmented contour image; A contour filling module, used for calculating the areas of all contours in the segmented contour image, and filling and drawing 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 combine the tumor peritumoral mask image with the tumor ultrasound image to obtain a segmentation result of the irregular peritumoral area.

10. The system according to claim 9, characterized in that The model conversion module is also used for: Obtaining the RGB color space corresponding to the color channel of the tumor ultrasound image; Convert the RGB color space to the HSV color space consisting of three color channels: hue, saturation and brightness; The color component threshold is set according to the color component interval of the HSV color space to detect the target color area and determine the target area 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

  • System and method for feature extraction and classification on ultrasound tomography images

    US20210035296A1

Cited By

  • Training method, device and equipment for image segmentation model combined with image adaptive enhancement

    CN119477926A

  • Surface defect detection method and system for integrated circuit packaging process

    CN120013859A

  • Digestive tract tumor lesion image segmentation method and system based on multiple modes

    CN120279046A

  • Multi-myeloma myeloid image recognition system based on computer vision

    CN120339208A

  • A computer vision-based multiple myeloma bone marrow image recognition system

    CN120339208B