Method and device for automatically adjusting blood flow gain in ultrasonic C mode
During the automatic scanning process of ultrasonic robots, the blood flow profit-loss ratio is calculated based on deep learning and color extraction algorithms, and the blood flow gain in ultrasonic C mode is automatically adjusted, which solves the problem that cannot meet clinical needs in the existing technology and improves blood The quality and efficiency of streaming images.
Patent Information
- Application Number
- CN202411210471.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2044-08-30
AI Technical Summary
During the automatic scanning process of ultrasonic robots, the prior art cannot realize the automatic adjustment of ultrasonic C mode gain parameters, resulting in the acquired blood flow images that cannot meet clinical needs.
By collecting ultrasound images in ultrasound C mode based on the initial blood flow gain, sampling using a sampling frame to generate a sampling frame mask diagram; identifying the blood vessel profile according to the deep learning algorithm to generate a vascular mask diagram; extracting the main blood flow according to the color extraction algorithm Color, generate the main blood flow color mask diagram; calculate the blood flow profit-loss ratio, and adjust the blood flow gain based on the profit-loss ratio until the preset conditions are met or the maximum adjustment times are reached.
Automatic adjustment of blood flow gain in ultrasound C mode is achieved, improving the adjustment accuracy and efficiency of blood flow images, and ensuring that the image meets clinical needs.
Smart Images

Figure CN119091476A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a method and a device for automatically adjusting blood flow gain in ultrasonic C mode. Background Art
[0002] During the process of the ultrasonic robot automatically scanning the blood vessels in the neck or other parts, in order to diagnose whether there is any abnormality in the blood vessel flow velocity, the ultrasonic robot needs to turn on the C mode on the ultrasound device through an interface call, and automatically adjust the gain under the C mode according to the blood flow color filling situation, so as to obtain a blood flow ultrasound image that meets clinical needs. Summary of the invention
[0003] In order to evaluate the blood flow in the current frame ultrasound image and adjust the blood flow gain in the C mode according to the calculated evaluation index to ensure that a blood flow image that meets clinical needs is obtained, the present invention proposes a method and device for automatically adjusting the blood flow gain in the ultrasound C mode. The technical solution proposed by the present invention is as follows:
[0004] In a first aspect, the present invention provides a method for automatically adjusting blood flow gain in ultrasound C mode, comprising:
[0005] Acquire an ultrasound image in ultrasound C mode based on the initial blood flow gain, sample the ultrasound image using a sampling frame, and generate a sampling frame mask image;
[0006] Identify the blood vessel contour in the ultrasound image according to a deep learning algorithm and generate a blood vessel mask image;
[0007] Extracting the main blood flow color in the sampling frame according to a color extraction algorithm, and generating a main blood flow color mask map in the sampling frame;
[0008] Calculate the blood flow surplus and deficit ratio based on the sampling frame mask, the blood vessel mask and the main blood flow color mask in the sampling frame;
[0009] If the maximum number of adjustments is not reached, determine whether the blood flow profit and loss ratio meets the preset conditions. If the blood flow profit and loss ratio does not meet the preset conditions, adjust the blood flow gain based on the blood flow profit and loss ratio until the blood flow profit and loss ratio calculated based on the adjusted blood flow gain meets the preset conditions or reaches the maximum number of adjustments, and output the current gain result.
[0010] In one or some embodiments, the blood flow surplus-deficit ratio includes an excess ratio and a deficit ratio;
[0011] The blood flow surplus / loss ratio is calculated based on the sampling frame mask map, the blood vessel mask map and the main blood flow color mask map in the sampling frame, including:
[0012] The excess ratio and deficit ratio are calculated respectively according to the sampling frame mask, the blood vessel mask and the main blood flow color mask in the sampling frame.
[0013] In one or some embodiments, the sampling frame mask, the blood vessel mask, and the main blood flow color mask in the sampling frame all include a foreground area; and the interference ratio is determined by:
[0014] Intersecting the blood vessel mask image and the main blood flow color mask image in the sampling frame to obtain the main blood flow color mask image in the blood vessel;
[0015] The interference ratio is obtained by determining the area ratio of the foreground area in the main blood flow color mask image in the blood vessel to the foreground area in the main blood flow color mask image in the sampling frame.
[0016] In one or some embodiments, the deficit ratio is determined by:
[0017] Intersecting the sampling frame mask image and the blood vessel mask image to obtain a blood vessel contour mask image in the sampling frame;
[0018] The deficit ratio is obtained by determining the area ratio of the foreground region in the main blood flow color mask image in the blood vessel to the foreground region in the blood vessel contour mask image in the sampling frame.
[0019] In one or some embodiments, the blood flow surplus-deficit ratio satisfies a preset condition including the surplus ratio being greater than a first preset threshold, and the deficit ratio being greater than a second preset threshold;
[0020] If the maximum number of adjustment times is not reached, it is determined whether the blood flow profit and loss ratio meets the preset conditions. If the blood flow profit and loss ratio does not meet the preset conditions, the blood flow gain is adjusted based on the blood flow profit and loss ratio until the blood flow profit and loss ratio calculated based on the adjusted blood flow gain meets the preset conditions or reaches the maximum number of adjustment times, and the current gain result is output, including:
[0021] If the maximum number of adjustments has not been reached, determining whether the interference ratio is greater than a first preset threshold;
[0022] If not, the current blood flow gain is reduced by the first preset gain amplitude to obtain an adjusted blood flow gain, and the above process of calculating the excess ratio and the deficit ratio is re-executed based on the adjusted blood flow gain;
[0023] If so, determining whether the deficit ratio is greater than a second preset threshold;
[0024] If not, the current blood flow gain is increased by a second preset gain amplitude to obtain an adjusted blood flow gain, and the above process of calculating the surplus ratio and the deficit ratio is re-executed based on the adjusted blood flow gain; if so, the current gain result is output;
[0025] If the interference ratio is not greater than the first preset threshold or the deficit ratio is not greater than the second preset threshold, the maximum number of adjustments has been reached, and the current gain result is output.
[0026] In one or some embodiments, extracting the main blood flow color in the sampling frame according to a color extraction algorithm to generate a main blood flow color mask map in the sampling frame includes:
[0027] Traversing each pixel of the ultrasound image in the sampling frame, and determining whether the RGB value of the pixel satisfies the set condition of the color blood flow;
[0028] Mark pixels that meet the preset conditions as 1, and pixels that do not meet the preset conditions as 0, to generate a color blood flow mask;
[0029] Determine the main color and the non-main color of the blood flow by comparing the gray mean of the red channel and the gray mean of the blue channel of all pixels in the color blood flow mask;
[0030] According to the determined main color and non-main color, a mask of the non-main color blood flow is generated and inverted to obtain an inverse code of the mask of the non-main color blood flow;
[0031] The intersection of the color blood flow mask and the inverse code of the non-main color blood flow mask is obtained to obtain a main blood flow color mask map in the sampling frame.
[0032] In a second aspect, the present invention provides a device for automatically adjusting blood flow gain in ultrasound C mode, comprising:
[0033] An acquisition module, used for acquiring an ultrasound image in ultrasound C mode based on an initial blood flow gain, sampling the ultrasound image using a sampling frame, and generating a sampling frame mask image;
[0034] An identification module, used to identify the blood vessel contour in the ultrasound image according to a deep learning algorithm and generate a blood vessel mask map;
[0035] An extraction module, used for extracting the main blood flow color in the sampling frame according to a color extraction algorithm, and generating a main blood flow color mask map in the sampling frame;
[0036] A calculation module, used for calculating the blood flow surplus-deficit ratio based on the sampling frame mask map, the blood vessel mask map and the main blood flow color mask map in the sampling frame;
[0037] The adjustment module is used to determine whether the blood flow profit and loss ratio meets the preset conditions if the maximum number of adjustments has not been reached. If the blood flow profit and loss ratio does not meet the preset conditions, the blood flow gain is adjusted based on the blood flow profit and loss ratio until the blood flow profit and loss ratio calculated based on the adjusted blood flow gain meets the preset conditions or the maximum number of adjustments is reached, and the current gain result is output.
[0038] In a third aspect, the present invention provides a computer program product, comprising a computer program / instruction, which, when executed by a processor, implements the steps of the method for automatic adjustment of blood flow gain under ultrasound C mode as described in the first aspect.
[0039] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method for automatic adjustment of blood flow gain under ultrasound C mode as described in the first aspect.
[0040] In a fifth aspect, the present invention provides an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0041] Memory, used to store computer programs;
[0042] The processor is used to implement the steps of the method for automatically adjusting blood flow gain in ultrasound C mode as described in the first aspect when executing the program stored in the memory.
[0043] Based on the above technical solution, the beneficial effects of the present invention compared with the prior art are as follows:
[0044] The method for automatically adjusting blood flow gain in ultrasonic C mode provided by the present invention obtains a C mode ultrasonic image acquired based on the initial blood flow gain, and samples the ultrasonic image using a sampling frame to generate a sampling frame mask map; then identifies the blood vessel contour in the sampling frame according to a deep learning algorithm to obtain a blood vessel mask map; and extracts the main blood flow color area in the sampling frame according to a color extraction algorithm to obtain a main blood flow color mask map in the sampling frame; based on the sampling frame mask map, the blood vessel mask map and the main blood flow color mask map in the sampling frame, the blood flow surplus and deficit ratio is calculated to evaluate the blood flow situation of the current frame ultrasonic image, and the blood flow gain of the C mode is adjusted according to the calculated blood flow surplus and deficit ratio, so as to realize automatic adjustment of the blood flow gain in ultrasonic C mode, and improve the blood flow gain adjustment accuracy through automatic adjustment, so as to obtain a blood flow image that meets clinical needs. Moreover, the efficiency of blood flow gain adjustment can also be improved through automatic adjustment.
[0045] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.
[0046] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0048] Figure 1 It is a flow chart of a method for automatically adjusting blood flow gain in ultrasound C mode provided by an embodiment of the present invention;
[0049] Figure 2 is a schematic diagram of a blood vessel ultrasound image in C mode provided by an embodiment of the present invention;
[0050] Figure 3a is a schematic diagram of a sampling frame mask diagram provided by an embodiment of the present invention;
[0051] Figure 3b is a schematic diagram of a blood vessel mask map provided by an embodiment of the present invention;
[0052] Figure 3c is a schematic diagram of a mask image of main blood flow colors of a sampling frame provided by an embodiment of the present invention;
[0053] Figure 3d is a schematic diagram of a main blood flow color mask map in a blood vessel provided by an embodiment of the present invention;
[0054] Figure 3e is a schematic diagram of a blood vessel contour mask image in a sampling frame provided by an embodiment of the present invention;
[0055] Figure 4 It is a schematic diagram of a specific implementation of the method for automatically adjusting blood flow gain in ultrasound C mode provided by an embodiment of the present invention;
[0056] Figure 5 It is a structural schematic diagram of a blood flow gain automatic adjustment device in ultrasound C mode provided by an embodiment of the present invention;
[0057] Figure 6 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0058] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0059] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of devices and methods consistent with some aspects of the present invention as detailed in the appended claims.
[0060] The inventor found in his work that currently, during ultrasound scanning, the focus is usually only on the motion control of the robot, and the blood flow gain of the ultrasound C mode is adjusted manually, which cannot achieve automatic adjustment of the ultrasound C mode gain parameters. The acquired blood flow images cannot meet clinical needs and do not meet the inventor's expectations. After further research and development, the inventor made the present invention. The present invention specifically relates to a method and device for automatic adjustment of blood flow gain in ultrasound C mode.
[0061] Embodiment 1
[0062] The embodiment of the present invention provides a method for automatically adjusting blood flow gain in ultrasound C mode, referring to Figure 1 As shown, including:
[0063] S101. Acquire an ultrasound image in ultrasound C mode based on an initial blood flow gain, use a sampling frame to sample the ultrasound image, and generate a sampling frame mask image.
[0064] The above-mentioned ultrasound C mode, namely ultrasound C scanning, is a specific depth scanning mode (Constant Depth Mode) in ultrasound imaging technology. The above-mentioned sampling frame mask image is a binary image that takes the image pixels within the sampling frame as the foreground area.
[0065] The sampling frame mask is generated by setting the initial blood flow gain of the ultrasound device, using the ultrasound device to collect ultrasound images containing blood flow information in C mode, and referring to the collected ultrasound images in C mode. Figure 2 As shown. Perform necessary preprocessing on the acquired ultrasound image, such as denoising, contrast enhancement, etc., to improve image quality and facilitate subsequent processing. On the preprocessed ultrasound image, define a sampling box (Region of Interest, ROI) according to the analysis requirements. The sampling box can be rectangular, circular or other shapes, used to specify the area in the image that needs special attention. Figure 3a As shown, the generated sampling box mask map.
[0066] According to the position and shape of the sampling frame, a mask image (MaskImage) with the same size as the ultrasound image is generated. In the mask image, the pixel values within the sampling frame are set to 1 (or other non-zero values), indicating that these pixels are of interest; while the pixel values outside the sampling frame are set to 0, indicating that these pixels can be ignored in subsequent processing.
[0067] S102: Identify the blood vessel contour in the ultrasound image according to a deep learning algorithm, and generate a blood vessel mask image.
[0068] The above-mentioned vascular mask is a binary image that uses the vascular contour pixels in the ultrasound image as the foreground area. Use the deep learning model in the prior art, such as U-Net, DeepLab, FCN (Fully Convolutional Network), etc. to identify the vascular contour. Set the identified vascular contour area to a specific pixel value such as 1, and set the non-vascular area to another pixel value such as 0. In this way, the original ultrasound image is converted into a binary image, namely the vascular mask. Figure 3b As shown, the generated blood vessel mask image.
[0069] S103: extract the main blood flow color in the sampling frame according to a color extraction algorithm, and generate a main blood flow color mask map in the sampling frame.
[0070] The main blood flow color mask map in the above sampling frame is a binary image that uses the main blood flow color pixels in the sampling frame as the foreground area. First, crop the area containing the required sampling frame from the original ultrasound image. For pixels in the ultrasound image that fall outside the sampling frame, mark them as 0 in the mask map. Convert the cropped image from the RGB color space to a space that is more suitable for color segmentation, such as HSV (hue, saturation, brightness) or YCbCr (brightness, blue difference, red difference). Traverse each pixel of the image and check whether its HSV value falls within the set hue, saturation, and brightness range. For pixels that fall within the range, mark them as 1 in the mask map to indicate the foreground, otherwise mark them as 0 to indicate the background. Refer to Figure 3c As shown, the main blood flow color mask map in the generated sampling frame is shown.
[0071] Taking the above hue range as an example, the hue range is set in the following manner: in the HSV space, the hue value of the main blood flow color is observed. According to the observed hue value, a suitable hue range is set.
[0072] S104, calculating the blood flow surplus / deficit ratio based on the sampling frame mask image, the blood vessel mask image, and the main blood flow color mask image in the sampling frame.
[0073] After calculating the blood flow surplus-deficit ratio, it is determined whether the maximum number of adjustments has been reached. If the maximum number of adjustments has not been reached, S105 is executed.
[0074] S105. If the maximum number of adjustment times is not reached, determine whether the blood flow profit and loss ratio meets the preset conditions. If the blood flow profit and loss ratio does not meet the preset conditions, adjust the blood flow gain based on the blood flow profit and loss ratio until the blood flow profit and loss ratio calculated based on the adjusted blood flow gain meets the preset conditions or reaches the maximum number of adjustment times, and output the current gain result.
[0075] If the maximum number of adjustments is not reached, it is determined whether the blood flow profit and loss ratio meets the preset conditions. If the blood flow profit and loss ratio does not meet the preset conditions, the blood flow gain is adjusted based on the blood flow profit and loss ratio to obtain the adjusted blood flow gain, and the initial blood flow gain in S101 is updated to the adjusted blood flow gain. The above S101-S104 process of calculating the blood flow profit and loss ratio is iteratively executed until the blood flow profit and loss ratio calculated based on the adjusted blood flow gain meets the preset conditions, and the current gain result, i.e., the current blood flow gain, is output. If the maximum number of adjustments is reached when the blood flow profit and loss ratio does not meet the preset conditions during the above iterative execution, the loop is jumped out, and the current gain result, i.e., the ultrasound image of the adjusted blood flow gain is output to obtain a blood flow image that meets clinical needs.
[0076] The method for automatically adjusting blood flow gain in ultrasonic C mode provided by the embodiment of the present invention obtains a C mode ultrasonic image acquired based on the initial blood flow gain, and calculates the relevant mask map according to the ultrasonic image, namely the sampling frame mask map, the blood vessel mask map and the main blood flow color mask map in the sampling frame. Then, the blood flow gain / loss ratio is calculated according to the mask map to evaluate the blood flow condition of the current frame ultrasonic image, and the blood flow gain in C mode is adjusted according to the calculated blood flow gain / loss ratio to realize automatic adjustment of blood flow gain in ultrasonic C mode, and the blood flow gain adjustment accuracy is improved through automatic adjustment, so as to obtain a blood flow image that meets clinical needs. Moreover, the efficiency of blood flow gain adjustment can also be improved through automatic adjustment.
[0077] In an optional embodiment, the step of extracting the main blood flow color in the sampling frame according to the color extraction algorithm to generate a main blood flow color mask map in the sampling frame in S103 includes:
[0078] S1031, traverse each pixel of the ultrasound image in the sampling frame, determine whether the RGB value of the pixel meets the set condition of the color blood flow, mark the pixels that meet the set condition as 1, and mark the pixels that do not meet the preset condition as 0, and generate a color blood flow mask.
[0079] It is found that the RGB three-channel values of gray pixels in ultrasound images are nearly equal, while the RGB values of color blood flow pixels are not equal. Based on this feature, a condition can be set, such as the maximum difference between the RGB values of pixels is greater than a certain threshold, to determine whether a pixel belongs to color blood flow.
[0080] Specifically, the color blood flow mask is generated in the following manner: traverse each pixel of the ultrasound image in the sampling frame and compare its RGB value to see whether it meets the set condition of the color blood flow. Pixels that meet the condition are marked as 1, and pixels that do not meet the condition are marked as 0, thereby generating a color blood flow mask. By generating a color blood flow mask, the color blood flow pixels and background pixels in the sampling frame are distinguished, and the pixels marked as 0 are the background pixels in the sampling frame.
[0081] S1032: Determine the main color and non-main color of the blood flow by comparing the gray mean of the red channel and the gray mean of the blue channel of all pixels in the color blood flow mask.
[0082] The above color blood flow mask is a binary image, which is decomposed into three channels: red, green, and blue. The grayscale mean of the red channel in the color blood flow area and the grayscale mean of the blue channel in the color blood flow area are calculated respectively. The grayscale mean of the red channel is compared with the grayscale mean of the blue channel. If the grayscale mean of the red channel is greater than the grayscale mean of the blue channel, the main color is determined to be red and the non-main color is blue; otherwise, the main color is determined to be blue and the non-main color is red. This process can determine the main color (red or blue) of the blood flow in the sampling frame.
[0083] S1033. Generate a non-primary color blood flow mask according to the determined primary color and non-primary color, and invert it to obtain an inverse code of the non-primary color blood flow mask.
[0084] The color blood flow mask is converted from the RGB color space to a color space more suitable for color distinction, such as the HSV (hue, saturation, brightness) space or the HSL (hue, saturation, brightness) space. Based on the determination result of the main color, a mask of the non-main color blood flow is generated. Taking the main color as red and the non-main color as blue as an example, how to generate a mask of the non-main color blood flow is explained:
[0085] In HSV or HSL space, define a suitable blue blood flow range for blue blood flow, including hue range, saturation range, and brightness range. Make sure that the blue blood flow range is wide enough to include all possible blue blood flow colors, but not too wide to avoid including blood flows of other colors. Specifically, the above hue range can be set by observing the distribution of blue pixels in HSV space. In the converted color space, traverse each pixel of the image and check whether its hue, saturation, and brightness values fall within the defined blue blood flow range. If so, mark the pixel as part of the blue blood flow, thereby generating a binary mask, that is, the mask of the non-main color blood flow mentioned above. Among them, blue blood flow pixels are marked as 1 and other pixels are marked as 0.
[0086] After the mask of non-primary color blood flow is generated, the mask is logically negated. The logical negation operation changes all 1s in the mask to 0s and all 0s to 1s. In this way, the 1s that originally represent non-primary color blood flow become 0s, and the 0s that originally represent other areas become 1s. By performing a logical negation operation on the mask of non-primary color blood flow, it is easier to perform an intersection operation with the color blood flow mask in subsequent steps, thereby extracting the precise area of the primary blood flow color.
[0087] S1035. Obtain the intersection of the color blood flow mask and the inverse code of the non-main color blood flow mask to obtain a main blood flow color mask map in the sampling frame.
[0088] After inverting the inverse code of the non-primary color blood flow mask, the inverse code of the non-primary color blood flow mask contains the mask of the primary blood flow color. Perform an intersection operation on the inverse code of the non-primary color blood flow mask and the color blood flow mask, and retain the pixels that are 1 in both masks, that is, the pixels that belong to both the color blood flow area and the complement of the non-primary color blood flow. Since the color blood flow mask has excluded the background pixels in the sampling frame, the result of the intersection operation will only contain the pixels of the primary blood flow color, and the primary blood flow color mask map in the sampling frame is obtained. Figure 3c shown.
[0089] The present invention distinguishes color blood flow pixels and background pixels in a sampling frame by generating a color blood flow mask. Then, the main color and non-main color of the blood flow in the sampling frame are determined based on the color blood flow mask, and a mask of the non-main color blood flow is generated according to the determination result of the main color. By performing a logical inversion operation on the mask of the non-main color blood flow, it is possible to more easily perform an intersection operation with the color blood flow mask in subsequent steps, thereby extracting the precise area of the main blood flow color. In this way, the reliability of the blood flow gain / loss ratio calculated subsequently can be guaranteed, thereby improving the adjustment efficiency of the blood flow gain.
[0090] In an optional embodiment, the above-mentioned blood flow surplus and deficit ratio includes an overfill ratio and an underfill ratio. The present invention evaluates the overfill situation of the current blood flow by calculating the overfill ratio (ratioOverfill), that is, the degree to which the blood flow overflows the entire blood vessel contour. When the value is 1, it means that the blood flow does not exceed the blood vessel contour. The smaller the value, the greater the degree to which the current blood flow overflows the entire blood vessel contour. The underfill ratio (ratioUnderfill) is used to evaluate the underfill situation of the current blood flow, that is, the degree to which the blood flow does not fill the entire blood vessel contour. When the value is 1, it means that the blood flow just fills the blood vessel contour. The smaller the value, the greater the degree of blood flow underfill in the current blood vessel contour.
[0091] In the above S104, the blood flow surplus-loss ratio is calculated based on the sampling frame mask image, the blood vessel mask image and the main blood flow color mask image in the sampling frame, which specifically includes the following steps:
[0092] The excess ratio and deficit ratio are calculated respectively according to the sampling frame mask, the blood vessel mask and the main blood flow color mask in the sampling frame.
[0093] The above interference ratio is determined as follows:
[0094] S1041, reference Figure 3b The vessel mask and reference are shown Figure 3c The main blood flow color mask map in the sampling frame shown in the figure is intersected to obtain the reference Figure 3d The main blood flow color mask in the blood vessel shown. The white area in the above mask images is the foreground area of the mask image.
[0095] maskColorInVess=maskVess∩maskColorInBox
[0096] In the above formula, maskColorInVess represents the main blood flow color mask map in the blood vessel; maskVess represents the blood vessel mask map; maskColorInBox represents the main blood flow color mask map in the sampling box.
[0097] S1042, determining the foreground area in the main blood flow color mask image in the blood vessel (i.e. Figure 3d The white area in the middle) and the foreground area in the main blood flow color mask image in the sampling frame (i.e. Figure 3c The interference ratio is calculated by the ratio of the area of the white area in the middle to the area of the white area in the middle. The calculation formula is as follows:
[0098]
[0099] In the above formula, S maskColorInVessForeground Represents the area of the foreground region in the main blood flow color mask map in the blood vessel; S maskColorInBoxForeground Represents the area of the foreground region in the main blood flow color mask map in the sampling frame.
[0100] In an optional embodiment, the deficit ratio is determined by:
[0101] S1043, reference Figure 3a The sampling box mask shown and the reference Figure 3b The blood vessel mask shown in the figure is intersected to obtain the reference Figure 3e The blood vessel contour mask in the sampling frame shown in the figure. The white area in each of the above mask images is the foreground area of the mask image. The intersection formula is as follows:
[0102] maskVessInBox=maskBox∩maskVess
[0103] In the above formula, maskVessInBox represents the blood vessel contour mask in the sampling box; maskBox represents the sampling box mask; and maskVess represents the blood vessel mask.
[0104] S1044, determining the ratio of the area of the foreground region in the main blood flow color mask image in the blood vessel to the area of the foreground region in the blood vessel contour mask image in the sampling frame, and obtaining the deficit ratio. The calculation formula is as follows:
[0105]
[0106] In the above formula, S maskColorInVessForeground Represents the area of the foreground region in the main blood flow color mask map in the vessel; S maskVessInBoxForeground Represents the area of the foreground region in the blood vessel contour mask in the sampling frame.
[0107] In an optional embodiment, the blood flow surplus-deficit ratio in the above S105 satisfies the preset conditions including that the surplus ratio is greater than a first preset threshold value, and the deficit ratio is greater than a second preset threshold value;
[0108] In the above S105, if the maximum number of adjustment times is not reached, it is determined whether the blood flow profit and loss ratio meets the preset conditions. If the blood flow profit and loss ratio does not meet the preset conditions, the blood flow gain is adjusted based on the blood flow profit and loss ratio until the blood flow profit and loss ratio calculated based on the adjusted blood flow gain meets the preset conditions or reaches the maximum number of adjustment times, and the current gain result is output for reference. Figure 4 As shown, the specific steps include:
[0109] If the maximum number of adjustments has not been reached, determining whether the interference ratio is greater than a first preset threshold;
[0110] If not, the current blood flow gain is reduced by a first preset gain amplitude to obtain an adjusted blood flow gain, and the above process of calculating the excess ratio and the deficit ratio is re-executed based on the adjusted blood flow gain;
[0111] If so, determining whether the deficit ratio is greater than a second preset threshold;
[0112] If not, the current blood flow gain is increased by a second preset gain amplitude to obtain an adjusted blood flow gain, and the above process of calculating the surplus ratio and the deficit ratio is re-executed based on the adjusted blood flow gain; if so, the current gain result is output;
[0113] If the interference ratio is not greater than the first preset threshold or the deficit ratio is not greater than the second preset threshold, the maximum number of adjustments has been reached, and the current gain result is output.
[0114] Based on the method of the present invention, the automatic adjustment of the ultrasonic C-mode blood flow gain during the automatic scanning of the ultrasonic robot can be realized. Figure 4As shown, the specific process is as follows:
[0115] Before automatic gain adjustment, the initial gain is set first, generally set to 50% of the maximum value. The maximum adjustment times are reasonably set according to the maximum initial gain to ensure that the maximum blood flow gain will not be exceeded during the blood flow gain adjustment process. The ultrasound image in C mode is acquired at the current gain, and the ultrasound image is a color map. The vascular contour is segmented on the color map to calculate the vascular mask map, and the relevant blood flow color mask map is calculated based on the color map, that is, the sampling frame mask map and the main blood flow color mask map in the sampling frame, and then the blood flow under the current gain is calculated according to the relevant mask map. The ratio Overfill and the ratio Underfill are determined. Then it is determined whether the current adjustment times reach the set maximum adjustment times. If the current adjustment times are equal to the maximum adjustment times, the loop is jumped out and the current gain result is output. If the current adjustment times are less than the maximum adjustment times, the blood flow ratio Overfill and the ratio Underfill are compared. First, compare the blood flow overfill ratio (ratioOverfill) with the set overfill ratio threshold (i.e., the first preset threshold). If the overfill ratio does not exceed the first preset threshold, reduce the current blood flow gain by 8 and perform the next round of adjustment. If the overfill ratio exceeds the first preset threshold, perform the next blood flow underfill ratio comparison. Compare the blood flow underfill ratio (ratioUnderfill) with the set underfill ratio threshold (i.e., the second preset threshold). If the underfill ratio does not exceed the second preset threshold, increase the current gain by 4 and perform the next round of adjustment. If the underfill ratio exceeds the second preset threshold, it indicates that the adjustment is successful and outputs the current gain result, i.e., the ultrasound image of the blood flow gain is adjusted to obtain a blood flow image that meets clinical needs.
[0116] The above reduction of 8 and increase of 4 for the current blood flow gain are only an example. The gain amplitude when adjusting the blood flow gain, namely the first preset gain amplitude and the second preset gain amplitude, can be set according to the actual gain adjustment requirements and are not specifically limited here.
[0117] Embodiment 2
[0118] The present invention provides an automatic blood flow gain adjustment device in ultrasound C mode, referring to Figure 5 As shown, including:
[0119] An acquisition module 201 is used to acquire an ultrasound image in ultrasound C mode based on an initial blood flow gain, sample the ultrasound image using a sampling frame, and generate a sampling frame mask image;
[0120] An identification module 202 is used to identify the blood vessel contour in the ultrasound image according to a deep learning algorithm and generate a blood vessel mask image;
[0121] An extraction module 203 is used to extract the main blood flow color in the sampling frame according to a color extraction algorithm, and generate a main blood flow color mask map in the sampling frame;
[0122] A calculation module 204, configured to calculate a blood flow surplus-deficit ratio based on a sampling frame mask map, a blood vessel mask map, and a main blood flow color mask map in the sampling frame;
[0123] The adjustment module 205 is used to determine whether the blood flow profit and loss ratio meets the preset conditions if the maximum number of adjustments has not been reached. If the blood flow profit and loss ratio does not meet the preset conditions, the blood flow gain is adjusted based on the blood flow profit and loss ratio until the blood flow profit and loss ratio calculated based on the adjusted blood flow gain meets the preset conditions or the maximum number of adjustments has been reached, and the current gain result is output.
[0124] The implementation principle and technical effect of the automatic blood flow gain adjustment device in ultrasound C mode provided by the embodiment of the present invention are similar to those of the aforementioned method embodiment, and will not be repeated here.
[0125] Embodiment 3
[0126] An embodiment of the present invention provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the method for automatic adjustment of blood flow gain in ultrasound C mode as described in the aforementioned method embodiment.
[0127] Embodiment 4
[0128] The present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method for automatically adjusting blood flow gain in ultrasound C mode as described in the aforementioned method embodiment.
[0129] The computer-readable storage medium may be included in the device / apparatus described in the above embodiment; or it may exist independently without being assembled into the device / apparatus. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present invention is implemented.
[0130] According to an embodiment of the present invention, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, apparatus, or device.
[0131] Embodiment 5
[0132] The present invention provides an electronic device, referring to Figure 6 As shown, it includes a processor 111, a communication interface 112, a memory 113 and a communication bus 114, wherein the processor 111, the communication interface 112 and the memory 113 communicate with each other through the communication bus 114;
[0133] Memory 113, used for storing computer programs;
[0134] The processor 111 is used to implement the steps of the method for automatically adjusting the blood flow gain in the ultrasound C mode as described in the above method embodiment when executing the program stored in the memory 113.
[0135] The implementation principle and technical effect of the electronic device provided by the embodiment of the present invention are similar to those of the aforementioned method embodiment, and will not be described in detail here.
[0136] The above-mentioned memory 113 can be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk or a ROM. The memory 113 has a storage space for program codes for executing any method steps in the above-mentioned method. For example, the storage space for program codes may include various program codes for implementing various steps in the above method respectively. These program codes can be read from or written into one or more computer program products. These computer program products include program code carriers such as hard disks, compact disks (CDs), memory cards or floppy disks. Such computer program products are usually portable or fixed storage units. The storage unit may have a storage segment or storage space arranged similarly to the memory 113 in the above-mentioned electronic device. The program code can be compressed, for example, in an appropriate form. Generally, the storage unit includes a program for executing the method steps according to an embodiment of the present invention, that is, a code that can be read by, for example, a processor 111, and when these codes are run by an electronic device, the electronic device performs the various steps in the method described above.
[0137] In this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article, or apparatus.
[0138] Those skilled in the art will appreciate that the embodiments of the present disclosure may be provided as methods, systems, or computer program products. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program code.
[0139] The present disclosure is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present disclosure. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0140] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0141] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0142] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. It should be noted that the embodiments of the present invention and the features in the embodiments can be combined with each other without conflict. The present invention is not limited to any single aspect, any single embodiment, or any combination and / or permutation of these aspects and / or embodiments. Each aspect and / or embodiment of the present invention can be used alone, or in combination with one or more other aspects and / or other embodiments.
[0143] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. A method for automatically adjusting blood flow gain in ultrasound C mode, characterized in that: include: Acquire an ultrasound image in ultrasound C mode based on the initial blood flow gain, sample the ultrasound image using a sampling frame, and generate a sampling frame mask image; Identify the blood vessel contour in the ultrasound image according to a deep learning algorithm and generate a blood vessel mask image; Extracting the main blood flow color in the sampling frame according to a color extraction algorithm, and generating a main blood flow color mask map in the sampling frame; Calculate the blood flow surplus and deficit ratio based on the sampling frame mask, the blood vessel mask and the main blood flow color mask in the sampling frame; If the maximum number of adjustments is not reached, determine whether the blood flow profit and loss ratio meets the preset conditions. If the blood flow profit and loss ratio does not meet the preset conditions, adjust the blood flow gain based on the blood flow profit and loss ratio until the blood flow profit and loss ratio calculated based on the adjusted blood flow gain meets the preset conditions or reaches the maximum number of adjustments, and output the current gain result.
2. The method for automatic adjustment of blood flow gain in ultrasound C mode according to claim 1, characterized in that: The blood flow surplus-deficit ratio includes an excess ratio and a deficit ratio; The blood flow surplus / loss ratio is calculated based on the sampling frame mask map, the blood vessel mask map and the main blood flow color mask map in the sampling frame, including: The excess ratio and deficit ratio are calculated respectively according to the sampling frame mask, the blood vessel mask and the main blood flow color mask in the sampling frame.
3. The method for automatic adjustment of blood flow gain in ultrasound C mode according to claim 2, characterized in that: The sampling frame mask, the blood vessel mask and the main blood flow color mask in the sampling frame all include a foreground area; the interference ratio is determined by: Intersecting the blood vessel mask image and the main blood flow color mask image in the sampling frame to obtain the main blood flow color mask image in the blood vessel; The interference ratio is obtained by determining the area ratio of the foreground area in the main blood flow color mask image in the blood vessel to the foreground area in the main blood flow color mask image in the sampling frame.
4. The method for automatic adjustment of blood flow gain in ultrasound C mode according to claim 3, characterized in that: The deficit ratio is determined in the following manner: Intersecting the sampling frame mask image and the blood vessel mask image to obtain a blood vessel contour mask image in the sampling frame; The deficit ratio is obtained by determining the area ratio of the foreground region in the main blood flow color mask image in the blood vessel to the foreground region in the blood vessel contour mask image in the sampling frame.
5. The method for automatic adjustment of blood flow gain in ultrasound C mode according to claim 2, characterized in that: The blood flow surplus-deficit ratio satisfies the preset conditions including the surplus ratio being greater than a first preset threshold value, and the deficit ratio being greater than a second preset threshold value; If the maximum number of adjustment times is not reached, it is determined whether the blood flow profit and loss ratio meets the preset conditions. If the blood flow profit and loss ratio does not meet the preset conditions, the blood flow gain is adjusted based on the blood flow profit and loss ratio until the blood flow profit and loss ratio calculated based on the adjusted blood flow gain meets the preset conditions or reaches the maximum number of adjustment times, and the current gain result is output, including: If the maximum number of adjustments has not been reached, determining whether the interference ratio is greater than a first preset threshold; If not, the current blood flow gain is reduced by a first preset gain amplitude to obtain an adjusted blood flow gain, and the above process of calculating the excess ratio and the deficit ratio is re-executed based on the adjusted blood flow gain; If so, determining whether the deficit ratio is greater than a second preset threshold; If not, the current blood flow gain is increased by a second preset gain amplitude to obtain an adjusted blood flow gain, and the above process of calculating the surplus ratio and the deficit ratio is re-executed based on the adjusted blood flow gain; if so, the current gain result is output; If the interference ratio is not greater than the first preset threshold or the deficit ratio is not greater than the second preset threshold, the maximum number of adjustments has been reached, and the current gain result is output.
6. The method for automatic adjustment of blood flow gain in ultrasound C mode according to claim 1, characterized in that: The extracting the main blood flow color in the sampling frame according to the color extraction algorithm to generate the main blood flow color mask map in the sampling frame includes: Traversing each pixel of the ultrasound image in the sampling frame, and determining whether the RGB value of the pixel satisfies the set condition of the color blood flow; Mark pixels that meet the preset conditions as 1, and pixels that do not meet the preset conditions as 0, to generate a color blood flow mask; Determine the main color and the non-main color of the blood flow by comparing the gray mean of the red channel and the gray mean of the blue channel of all pixels in the color blood flow mask; According to the determined main color and non-main color, a mask of the non-main color blood flow is generated and inverted to obtain an inverse code of the mask of the non-main color blood flow; The intersection of the color blood flow mask and the inverse code of the non-main color blood flow mask is obtained to obtain a main blood flow color mask map in the sampling frame.
7. An automatic blood flow gain adjustment device in ultrasound C mode, characterized in that: include: An acquisition module, used for acquiring an ultrasound image in ultrasound C mode based on an initial blood flow gain, sampling the ultrasound image using a sampling frame, and generating a sampling frame mask image; An identification module, used to identify the blood vessel contour in the ultrasound image according to a deep learning algorithm and generate a blood vessel mask map; An extraction module, used for extracting the main blood flow color in the sampling frame according to a color extraction algorithm, and generating a main blood flow color mask map in the sampling frame; A calculation module, used for calculating the blood flow surplus-deficit ratio based on the sampling frame mask map, the blood vessel mask map and the main blood flow color mask map in the sampling frame; The adjustment module is used to determine whether the blood flow profit and loss ratio meets the preset conditions if the maximum number of adjustments has not been reached. If the blood flow profit and loss ratio does not meet the preset conditions, the blood flow gain is adjusted based on the blood flow profit and loss ratio until the blood flow profit and loss ratio calculated based on the adjusted blood flow gain meets the preset conditions or the maximum number of adjustments is reached, and the current gain result is output.
8. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method for automatic adjustment of blood flow gain in ultrasound C mode as described in any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method for automatically adjusting blood flow gain in ultrasound C mode as described in any one of claims 1 to 6 are implemented.
10. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; Memory, used to store computer programs; The processor is used to implement the steps of the method for automatically adjusting blood flow gain in ultrasound C mode as described in any one of claims 1 to 6 when executing the program stored in the memory.
Citation Information
Patent Citations
Color blood gain regulation method and device
CN102551811A
Gain adjustment method, device and apparatus for ultrasonic blood flow image and storage medium
CN110322413A
Method for automatically positioning blood vessel in ultrasonic imaging, device and equipment
CN112826535A
Blood vessel segmentation labeling method and device, electronic equipment and storage medium
CN117373070A
Blood flow measurement method and device and storage medium
CN117770871A
