Image segmentation method and device, equipment and medium
By determining the maximum and minimum pixel values of the organ in medical images and updating these values according to the location of the target pixel point, the problems of low image segmentation efficiency and low accuracy in the prior art are solved, and more efficient and accurate Image segmentation.
Patent Information
- Application Number
- CN202310947918.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-28
- Publication Date
- 2025-02-14
AI Technical Summary
In the prior art, the efficiency of image segmentation is low and the accuracy is not high, resulting in inaccurate medical image segmentation, affecting the accuracy of clinical diagnosis.
By receiving a medical image that identifies the area where an organ is located, the maximum pixel value and minimum pixel value of the organ in the area are determined, and the maximum pixel value and candidate minimum pixel value are updated according to whether the target pixel point is located on the organ, and the final determination is made. Pixels located on the organ.
Improve the efficiency and accuracy of image segmentation. Users only need to specify the target pixel point and its location information in the area where the organ is located, without determining each pixel point in the organ separately, which significantly reduces the trial and error time and labeling of image segmentation. time.
Smart Images

Figure CN119444773A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of multi-point interactive medical image segmentation methods, and in particular to an image segmentation method, device, equipment and medium. Background Art
[0002] With the rapid development and popularization of medical imaging equipment, Computed Tomography (CT), Magnetic Resonance Imaging (MR) and other equipment are widely used in daily clinical diagnosis. More clear CT, MR and other imaging can obtain images reflecting the physiological and physical characteristics of the human body in two-dimensional and three-dimensional areas, and then reconstruct the three-dimensional structure of human tissues and organs. Through three-dimensional visualization technology, the distribution of tissues and organs around the lesions can be displayed, which has become an indispensable technical means for medical institutions to carry out disease diagnosis, surgical planning, prognosis assessment, and follow-up. Medical image segmentation is a key issue that determines whether medical images can provide reliable basis in clinical diagnosis and treatment. Its purpose is to segment out parts with certain special meanings in medical images, usually organs, and extract relevant features of the segmented parts to provide a reliable basis for clinical diagnosis and treatment and pathological research, and assist doctors in making more accurate diagnoses.
[0003] In the related art, the region where the organ in the medical image is located is usually determined by a model. In order to train the model, the medical image usually needs to be segmented. Specifically, the organs in the medical image are segmented. At present, the organs in the medical image are usually segmented by manual outlining. The manual outlining method refers to the determination of each pixel point in the target organ of the medical image by a person, or the determination of each pixel point at the edge of the target organ in the medical image by a person. The segmentation method in the related art is inefficient and prone to errors, resulting in the problem of low image segmentation accuracy. Summary of the invention
[0004] The embodiments of the present application provide an image segmentation method, apparatus, device and medium, which are used to solve the problems of low efficiency and low accuracy of image segmentation in the prior art.
[0005] In a first aspect, an embodiment of the present application provides an image segmentation method, the method comprising:
[0006] Receiving a medical image with a region where an organ is located, and determining a maximum pixel value and a minimum pixel value of the organ in the region according to a pixel value of each pixel point in the region;
[0007] Receiving information of a designated target pixel point and whether the target pixel point is located on the organ; determining a candidate maximum pixel value and a candidate minimum pixel value based on the target pixel value and the minimum pixel value according to whether the target pixel point is located on the organ;
[0008] Determining whether to use the candidate minimum pixel value or the candidate maximum pixel value to update the corresponding minimum pixel value or the maximum pixel value according to the deviation between the target pixel value and the maximum pixel value and the minimum pixel value;
[0009] Pixel points in the region whose pixel values are between the updated minimum pixel value and the maximum pixel value are determined as pixel points located on the organ.
[0010] In a second aspect, an embodiment of the present application further provides an image segmentation device, the device comprising:
[0011] A receiving module, used for receiving a medical image with a region where a certain organ is located marked, and determining a maximum pixel value and a minimum pixel value of the organ in the region according to a pixel value of each pixel point in the region;
[0012] A processing module is used to receive information about a designated target pixel point and whether the target pixel point is located on the organ; determine a candidate maximum pixel value and a candidate minimum pixel value based on the target pixel value and the minimum pixel value according to whether the target pixel point is located on the organ; and determine whether to use the candidate minimum pixel value or the candidate maximum pixel value to update the corresponding minimum pixel value or the maximum pixel value according to the deviation between the target pixel value and the maximum pixel value and the minimum pixel value;
[0013] The determination module is used to determine the pixel points in the region whose pixel values are between the updated minimum pixel value and the updated maximum pixel value as the pixel points located on the organ.
[0014] In a third aspect, an embodiment of the present application further provides an electronic device, which includes at least a processor and a memory, and the processor is used to implement the steps of any of the above-mentioned image segmentation methods when executing a computer program stored in the memory.
[0015] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of any of the above-described image segmentation methods.
[0016] In an embodiment of the present application, an electronic device receives a medical image with an area marked with an organ, determines the maximum pixel value and the minimum pixel value of the organ in the area according to the pixel value of each pixel in the area; receives a specified target pixel and information on whether the target pixel is located on the organ; determines a candidate maximum pixel value and a candidate minimum pixel value based on the target pixel value and the minimum pixel value according to whether the target pixel is located on the organ; determines whether to use the candidate minimum pixel value or the candidate maximum pixel value to update the corresponding minimum pixel value or maximum pixel value according to the deviation between the target pixel value and the maximum pixel value and the minimum pixel value; and determines the pixel in the area whose pixel value is between the updated minimum pixel value and the maximum pixel value as a pixel located on the organ. Since in the embodiment of the present application, the user only needs to specify the target pixel and whether the target pixel is located on the organ in the area where the organ is located, and does not need to determine each pixel in the organ separately, the efficiency of image segmentation can be improved, and the electronic device can accurately determine the updated maximum pixel value and the minimum pixel value, thereby accurately determining each pixel located on the organ, so the accuracy of image segmentation can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0018] Figure 1 A schematic diagram of an image segmentation process provided in an embodiment of the present application;
[0019] Figure 2 A schematic diagram of a medical image provided in an embodiment of the present application;
[0020] Figure 3 A schematic diagram of a target pixel point not located on an organ provided in an embodiment of the present application;
[0021] Figure 4 A schematic diagram of a target pixel point provided in an embodiment of the present application;
[0022] Figure 5 A schematic diagram of a segmented medical image provided in an embodiment of the present application;
[0023] Figure 6 A detailed process diagram of image segmentation provided in an embodiment of the present application;
[0024] Figure 7 A schematic diagram of the structure of an image segmentation device provided in an embodiment of the present application;
[0025] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0026] The present application will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present application.
[0027] In order to improve the efficiency and accuracy of image segmentation, the embodiments of the present application provide an image segmentation method, apparatus, device and medium.
[0028] The image segmentation method includes: receiving a medical image with an area marked with an organ, determining the maximum pixel value and the minimum pixel value of the organ in the area according to the pixel value of each pixel in the area; receiving a designated target pixel and information on whether the target pixel is located on the organ; determining a candidate maximum pixel value and a candidate minimum pixel value based on the target pixel value and the minimum pixel value according to whether the target pixel is located on the organ; determining whether to use the candidate minimum pixel value or the candidate maximum pixel value to update the corresponding minimum pixel value or maximum pixel value according to the deviation between the target pixel value and the maximum pixel value and the minimum pixel value; determining the pixel point in the area whose pixel value is between the updated minimum pixel value and the maximum pixel value as the pixel point located on the organ. Thus, image segmentation is realized quickly and accurately.
[0029] Figure 1 A schematic diagram of an image segmentation process provided in an embodiment of the present application, the process includes the following steps:
[0030] S101: receiving a medical image with a region where an organ is located marked, and determining a maximum pixel value and a minimum pixel value of the organ in the region according to a pixel value of each pixel point in the region.
[0031] The image segmentation method provided in the embodiment of the present application is applied to an electronic device, which may be a smart device such as a PC or a server.
[0032] In order to achieve image segmentation, the electronic device may first receive a medical image with a region where a certain organ is located. Specifically, the user may select a region where a certain organ is located in the medical image by clicking the left button of the mouse, and the electronic device may receive the medical image with the region where the organ is located. It should be noted that at this time, the rough region where the organ is located includes not only the pixels located on the organ but also the pixels not located on the organ.
[0033] The area selected by the user may be a rectangular frame. Specifically, the electronic device may use the rectangular frame to select the area where the organ is located. To ensure the integrity of the selected organ, the actual selected area is a preset multiple of the rectangular frame, which is greater than 12, for example, 1.2.
[0034] After receiving the medical image, the electronic device can determine the maximum pixel value and the minimum pixel value of the organ in the area where the organ is located in the medical image based on the pixel value of each pixel point in the area where the organ is located. Specifically, the electronic device can determine the maximum pixel value among the pixel values of each pixel point in the area in the medical image as the maximum pixel value of the organ, and determine the minimum pixel value among the pixel values as the minimum pixel value of the organ.
[0035] Figure 2 A schematic diagram of a medical image provided in an embodiment of the present application.
[0036] in, Figure 2 The middle rectangular box is the area where the organ is located. Figure 2 It may be a medical image received by an electronic device and having a region where an organ is located marked therein.
[0037] S102: receiving information of a designated target pixel point and whether the target pixel point is located on the organ; determining a candidate maximum pixel value and a candidate minimum pixel value based on the target pixel value and the minimum pixel value according to whether the target pixel point is located on the organ.
[0038] In order to achieve image segmentation, the electronic device can receive information about the specified target pixel point and whether the target pixel point is located on the organ. Specifically, the electronic device can display the received medical image, and the user can specify the target pixel point in the area where the organ is located in the medical image, and move the mouse cursor to the target pixel point. If the user determines that the target pixel point is located on the organ, the user can click the right button of the mouse. If the user determines that the target pixel point is not located on the organ, the user can click the left button of the mouse. At this time, the electronic device can receive the specified target pixel point and whether the target pixel point is located on the organ.
[0039] After receiving the information about the designated target pixel point and whether the target pixel point is located on the organ, the electronic device can determine the candidate maximum pixel value and the minimum candidate pixel value based on the target pixel value and the minimum pixel value according to whether the target pixel point is located on the organ. For example, when the target pixel point is located on the organ, the electronic device can determine the target pixel value as the candidate maximum pixel value and the minimum pixel value as the candidate minimum pixel value. For example, when the target pixel value is not located on the organ, if the deviation between the target pixel value and the maximum pixel value is greater than the deviation between the target pixel value and the minimum pixel value, the electronic device determines the sum of the target pixel value and the first preset value as the candidate minimum pixel value, the first preset value is a value greater than 0, and the maximum pixel value is determined as the candidate maximum pixel value. If the deviation between the target pixel value and the maximum pixel value is not greater than the deviation between the target pixel value and the minimum pixel value, the electronic device determines the difference between the target pixel value and the second preset value as the candidate maximum pixel value, the second preset value is a value greater than 0, and the minimum pixel value is determined as the candidate minimum pixel value. The electronic device can also determine the candidate maximum pixel value and the candidate minimum pixel value in other ways, and the specific calculation method is not limited here.
[0040] S103: Determine whether to use the candidate minimum pixel value or the candidate maximum pixel value to update the corresponding minimum pixel value or the maximum pixel value according to the deviation between the target pixel value and the maximum pixel value and the minimum pixel value.
[0041] After determining the candidate maximum pixel value and the candidate minimum pixel value, the electronic device may determine whether to use the candidate minimum pixel value or the candidate maximum pixel value to update the corresponding minimum pixel value or maximum pixel value according to the deviation between the target pixel value and the maximum pixel value and the minimum pixel value. For example, if the deviation between the target pixel value and the maximum pixel value is less than the third preset value, the candidate maximum pixel value may be used to update the maximum pixel value; if the deviation between the target pixel value and the maximum pixel value is not less than the third preset value, the candidate maximum pixel value is not used to update the maximum pixel value; if the deviation between the target pixel value and the minimum pixel value is less than the fourth preset value, the candidate minimum pixel value is used to update the minimum pixel value; if the deviation between the target pixel value and the minimum pixel value is not less than the fourth preset value, the candidate minimum pixel value is not used to update the minimum pixel value.
[0042] It should be noted that the user can specify the target pixel and whether the target pixel is located on the organ multiple times, that is, the electronic device can receive information on multiple target pixels and whether the target pixel is located on the organ. If the electronic device receives multiple target pixels and whether the target pixel is located on the organ, steps S102 and S103 can be repeatedly executed for each target pixel.
[0043] In the embodiment of the present application, the electronic device determines whether the region where the organ is located is an accurate segmentation result based on the region where the organ is located by the rough segmentation in step S101 through multi-point interaction in step S102. The maximum pixel and the minimum pixel are recalculated by using the left and right mouse buttons, the right button represents that the target pixel is located on the organ, that is, the target pixel is located in the correct segmentation region, and the left button represents that the target pixel is not located on the organ, that is, the target pixel is located in the wrong segmentation region, that is, the dual threshold detection method is used to recalculate the maximum pixel and the minimum pixel.
[0044] S104: Determine the pixel points in the region whose pixel values are between the updated minimum pixel value and the updated maximum pixel value as the pixel points located on the organ.
[0045] After determining the updated minimum pixel value and the maximum pixel value, the electronic device may determine that the pixel points in the region where the organ is located, whose pixel values are between the updated minimum pixel value and the maximum pixel value, are the pixel points located on the organ.
[0046] When performing medical image segmentation, segmentation is basically based on the edge of the organ of interest. The embodiment of the present application adopts a fast, high-precision, and operable multi-point interactive medical image segmentation method, which can accurately perform image segmentation with fewer operations. Specifically, first roughly select the region of interest, that is, the region where the organ described in the embodiment of the present application is located, and then the target pixel points located on the organ can be determined by the right mouse button, and the target pixel points not located on the organ can be determined by the left mouse button, and then the rough organ segmentation of the medical image is performed, and then the rough segmentation area is clicked to determine whether the rough segmentation area is an ideal correct segmentation area, and the edge detection range of the dual threshold detection is narrowed by the left mouse button, and the edge detection range is determined by the right mouse button to achieve fast target organ segmentation. In the embodiment of the present application, the electronic device performs rough segmentation based on the organ of interest in the medical image, and calculates the latest segmentation area through a multi-point interactive method, which can greatly reduce the trial and error time of medical image segmentation and reduce the time of medical image annotation. The user can quickly and accurately segment the organs in the medical image with relatively few clicks of the left and right mouse buttons.
[0047] In the embodiment of the present application, the user only needs to specify the target pixel point and whether the target pixel point is located on the organ in the area where the organ is located, without having to determine each pixel point in the organ separately. Therefore, the image segmentation efficiency can be improved, and the electronic device can accurately determine the updated maximum pixel value and minimum pixel value, thereby accurately determining each pixel point located on the organ, thereby improving the accuracy of image segmentation.
[0048] In order to accurately determine the maximum pixel value and the minimum pixel value of an organ, based on the above embodiments, in the embodiment of the present application, the maximum pixel value and the minimum pixel value of the organ in the region according to the pixel value of each pixel point in the region include:
[0049] Obtaining an average value of pixel values of pixel points in the region, determining the product of the average value and a preset value; and obtaining a rough maximum value and a rough minimum value saved for the organ;
[0050] The maximum pixel value of the organ in the region is determined according to the difference between the rough maximum value and the product; the minimum pixel value of the organ in the region is determined according to the sum of the rough minimum value and the product.
[0051] In order to accurately determine the maximum pixel value and the minimum pixel value of the organ, the electronic device may obtain the average value of the pixel value of each pixel point in the region where the organ is located, and determine the product of the average value and a preset value, where the preset value is a value greater than 0 and less than 1, such as 1 / 2. The electronic device also obtains a rough maximum value and a rough minimum value stored for the organ.
[0052] The electronic device may determine the maximum pixel value of the organ according to the difference between the rough maximum value and the product. Specifically, the electronic device may determine the difference between the rough maximum value and the product as the maximum value of the organ. The electronic device may determine the minimum pixel value of the organ according to the sum of the rough minimum value and the product. Specifically, the electronic device may determine the minimum pixel value of the organ according to the sum of the rough minimum value and the product.
[0053] The electronic device can use the following formula to determine the maximum pixel value and the minimum pixel value of the organ:
[0054]
[0055] minVal=min+midVal / 2
[0056] maxVal=max-midVal / 2
[0057] Where midVal is the average value of the pixel values of the pixels in the region, w is the number of pixels in the horizontal direction of the region, h is the number of pixels in the vertical direction of the region, i is the i-th pixel in the horizontal direction of the region, j is the j-th pixel in the vertical direction of the region, and p ij is the pixel value of the jth pixel in the vertical direction of the i-th pixel in the region in the horizontal direction; minVal is the minimum value of the organ, min is the rough minimum value of the organ, maxVal is the maximum value of the organ, and max is the rough maximum value of the organ.
[0058] In order to accurately determine the candidate maximum pixel value and the candidate minimum pixel value, based on the above embodiments, in the embodiment of the present application, the step of determining the candidate maximum pixel value and the candidate minimum pixel value based on the target pixel value and the minimum pixel value according to whether the target pixel point is located on the organ includes:
[0059] If the target pixel point is not located on the organ, determine whether the target pixel value of the target pixel point is greater than the minimum pixel value; if not, determine the minimum pixel value as the candidate maximum pixel value and the candidate minimum pixel value; if so, determine a first difference between the target pixel value and the minimum pixel value, and determine a first ratio between the target pixel value and the minimum pixel value; determine the candidate maximum pixel value and the candidate minimum pixel value based on the first ratio, the first difference and the minimum pixel value.
[0060] In order to accurately determine the candidate maximum pixel value and the candidate minimum pixel value, the electronic device can determine whether the target pixel point is located on the organ. If the target pixel point is not located on the organ, the electronic device can determine whether the target pixel value of the target pixel point is greater than the minimum pixel value. If the target pixel value of the target pixel point is not greater than the minimum pixel value, the electronic device can determine the minimum pixel value as the candidate maximum pixel value and the candidate minimum pixel value. If the target pixel value of the target pixel point is greater than the minimum pixel value, the electronic device can determine the difference between the target pixel value and the minimum pixel value. For the convenience of distinction, the difference can be called the first difference, and the ratio of the target pixel value to the minimum pixel value is determined. For the convenience of distinction, the ratio can be called the first ratio, and the candidate maximum pixel value and the candidate minimum pixel value are determined according to the first ratio, the first difference and the minimum pixel value. Specifically, the electronic device can determine the first sum of the first ratio and the minimum pixel value, determine the product of the first value after the square root of the first difference and the second value after the logarithm of the first sum is calculated with the minimum pixel value as the base, and determine the product and the second sum of the minimum pixel value as the candidate maximum pixel value and the candidate minimum pixel value.
[0061] When the target pixel point is not located on the organ, the electronic device may use the following formula to determine the candidate maximum pixel value and the candidate minimum pixel value:
[0062]
[0063]
[0064]
[0065] Among them, newValue a is the candidate minimum pixel value, minValue is the minimum pixel value, pointValue is the target pixel value, newValue isb is the candidate maximum pixel value.
[0066] When the electronic device receives the target pixel and the information that the target pixel is not located on the organ, it is equivalent to iteratively narrowing the pixel value range of the pixel on the organ.
[0067] Figure 3 A schematic diagram of a target pixel point that is not located on an organ provided in an embodiment of the present application.
[0068] Figure 3 The middle rectangular box is the area where the organ is located. Figure 3 The point in the region where the organ is located is the target pixel point selected by the user.
[0069] In order to accurately determine the candidate maximum pixel value and the candidate minimum pixel value, on the basis of the above embodiments, the step of determining the candidate maximum pixel value and the candidate minimum pixel value based on the target pixel value and the minimum pixel value according to whether the target pixel point is located on the organ includes:
[0070] If the target pixel point is located on the organ, a second difference between the target pixel value and the minimum pixel value is determined, and a second ratio between the target pixel value and the minimum pixel value is determined; and a candidate maximum pixel value and a candidate minimum pixel value are determined based on the second ratio, the second difference and the minimum pixel value.
[0071] In order to accurately determine the candidate maximum pixel value and the candidate minimum pixel value, the electronic device can determine whether the target pixel point is located on the organ. If the target pixel point is located on the organ, the difference between the target pixel value and the minimum pixel value is determined. For the sake of distinction, the difference can be called the second difference. The ratio of the target pixel value to the minimum pixel value is determined. For the sake of distinction, the ratio can be called the second ratio. The candidate maximum pixel value and the candidate minimum pixel value are determined based on the second ratio, the second difference and the minimum pixel value. Specifically, the electronic device can determine the third sum of the second ratio and the minimum pixel value, determine the product of the third value after the square root of the second difference and the fourth value after the logarithm of the third sum is calculated with the minimum pixel value as the base, and determine the product and the fourth sum of the minimum pixel value as the candidate maximum pixel value and the candidate minimum pixel value.
[0072] When the target pixel is located on an organ, the electronic device may use the following formula to determine the candidate maximum pixel value and the candidate minimum pixel value:
[0073]
[0074]
[0075] Among them, newValuea is the candidate minimum pixel value, minValue is the minimum pixel value, pointValue is the target pixel value, newValue is b is the candidate maximum pixel value.
[0076] Figure 4 A schematic diagram of a target pixel point provided in an embodiment of the present application.
[0077] Figure 4 The middle rectangular box is the area where the organ is located. Figure 4 The point above the region where the organ is located (the upper and lower parts described here are Figure 4 The upper and lower parts in the figure are the target pixels on the organ selected by the user. Figure 4 The point in the middle and lower part of the region where the organ is located (the upper and lower parts described here are Figure 4 The upper and lower pixels in the figure are target pixels selected by the user that are not located on the organ.
[0078] In order to accurately update the maximum pixel value and the minimum pixel value, based on the above embodiments, in the embodiment of the present application, determining whether to use the candidate minimum pixel value or the candidate maximum pixel value to update the corresponding minimum pixel value or the maximum pixel value according to the deviation between the target pixel value and the maximum pixel value and the minimum pixel value includes:
[0079] Determine whether the deviation between the target pixel value and the maximum pixel value is greater than the deviation between the target pixel value and the minimum pixel value. If so, use the candidate minimum pixel value to update the minimum pixel value; if not, use the candidate maximum pixel value to update the maximum pixel value.
[0080] In order to accurately update the maximum pixel value and the minimum pixel value, the electronic device can first determine the deviation between the target pixel value and the maximum pixel value, and the deviation between the target pixel value and the minimum pixel value, and judge whether the deviation between the target pixel value and the maximum pixel value is greater than the deviation between the target pixel value and the minimum pixel value; if the deviation between the target pixel value and the maximum pixel value is greater than the deviation between the target pixel value and the minimum pixel value, the electronic device uses the minimum candidate pixel value to update the minimum pixel value; if the deviation between the target pixel value and the maximum pixel value is not greater than the deviation between the target pixel value and the minimum pixel value, the electronic device uses the candidate maximum pixel value to update the maximum pixel value.
[0081] Electronic devices can be determined using the following formula:
[0082]
[0083] Among them, minx is the minimum pixel value after update, maxx is the maximum pixel value after update, and newValuea is the candidate minimum pixel value, maxValue is the maximum pixel value, pointValue is the target pixel value, minValue is the minimum pixel value, newValue b is the candidate maximum pixel value.
[0084] In order to accurately implement image segmentation, based on the above embodiments, in the embodiment of the present application, the method further includes:
[0085] The pixel points located on the organ are displayed using a preset color.
[0086] In an embodiment of the present application, after determining each pixel located on the organ, the electronic device can display each pixel located on the organ with a preset color, so that the user can further determine whether the pixel located on the organ is accurate, thereby accurately achieving image segmentation.
[0087] Figure 5 A schematic diagram of a segmented medical image provided in an embodiment of the present application.
[0088] Figure 5 The gray pixels in the middle rectangle are the pixels located on the organ. Figure 5 It can be seen that the solution provided in the embodiment of the present application can accurately achieve the segmentation of organs in medical images.
[0089] Figure 6 A detailed process diagram of image segmentation provided in an embodiment of the present application, the process includes the following steps:
[0090] S601: Receive a medical image with a region where a certain organ is located marked.
[0091] S602: Obtain an average value of pixel values of pixel points in the region, determine the product of the average value and a preset value; and obtain a rough maximum value and a rough minimum value saved for the organ.
[0092] S603: Determine the maximum pixel value of the organ in the region according to the difference between the rough maximum value and the product; determine the minimum pixel value of the organ in the region according to the sum of the rough minimum value and the product.
[0093] S604: Receive information about a designated target pixel point and whether the target pixel point is located on an organ.
[0094] S605: Determine a candidate maximum pixel value and a candidate minimum pixel value based on the target pixel value and the minimum pixel value according to whether the target pixel point is located on the organ.
[0095] S606: Determine whether the deviation between the target pixel value and the maximum pixel value is greater than the deviation between the target pixel value and the minimum pixel value. If so, execute S607; if not, execute S608.
[0096] S607: Use the candidate minimum pixel value to update the minimum pixel value, and execute S609.
[0097] S608: Use the candidate maximum pixel value to update the maximum pixel value, and execute S609.
[0098] S609: Determine the pixel points in the region whose pixel values are between the updated minimum pixel value and the updated maximum pixel value as the pixel points located on the organ.
[0099] In order to accurately implement image segmentation, based on the above embodiments, in the embodiment of the present application, the method further includes:
[0100] If a segmentation instruction is received that carries other medical images whose acquisition time is adjacent to that of the medical image;
[0101] Then, in the target area corresponding to the area in the other medical image, the pixel points whose pixel values are between the updated minimum pixel value and the maximum pixel value are determined as the pixel points located on the organ.
[0102] In actual scenarios, multiple frames of medical images acquired continuously may all need to be segmented, and the colors of the same organ in multiple frames of medical images with adjacent acquisition times usually do not change much. Therefore, if an electronic device receives a segmentation instruction carrying other medical images, and the acquisition time of the other medical images is adjacent to the acquisition time of the medical image, the electronic device can determine the pixel points located on the organ in the other medical images based on the maximum pixel value and the minimum pixel value determined above.
[0103] Specifically, the segmentation instruction received by the electronic device may carry the time when the other medical image was collected and the identifier of the device collected, wherein the identifier of each device collecting the medical image is different. If the identifier of the device collecting the other medical image is the same as the identifier of the device collecting the medical image, and the time interval between the time when the other medical image was collected and the time when the medical image was collected is within the preset time interval range, then the other medical image is determined to be an image whose collection time is adjacent to the medical image. At this time, the electronic device can obtain the target area corresponding to the area where the organ is located in the other medical image, wherein the other medical image has the same size as the medical image, so each area in the medical image has a corresponding area in the other medical image. After obtaining the target area in the other medical image, the electronic device can determine the pixel point in the target area whose pixel value is between the updated minimum pixel value and the maximum pixel value as the pixel point located on the organ, and thus determine the pixel point located on the organ in the other medical image.
[0104] Because the electronic device is based on the similarity of the edges of organs in medical images and other adjacent medical images, it can realize the interactive medical image segmentation of multiple points in continuous multi-frame medical images. At the same time, it can realize the fast and accurate image segmentation scheme of medical images by utilizing the continuity characteristics of medical images. It improves the efficiency and accuracy of determining the pixel points located on organs in other medical images.
[0105] Figure 7 A schematic diagram of the structure of an image segmentation device provided in an embodiment of the present application, the device comprising:
[0106] A receiving module 701 is used to receive a medical image with a region where an organ is located marked, and determine a maximum pixel value and a minimum pixel value of the organ in the region according to the pixel value of each pixel point in the region;
[0107] The processing module 702 is used to receive information about a designated target pixel point and whether the target pixel point is located on the organ; determine a candidate maximum pixel value and a candidate minimum pixel value based on the target pixel value and the minimum pixel value according to whether the target pixel point is located on the organ; and determine whether to use the candidate minimum pixel value or the candidate maximum pixel value to update the corresponding minimum pixel value or the maximum pixel value according to the deviation between the target pixel value and the maximum pixel value and the minimum pixel value;
[0108] The determination module 703 is used to determine the pixel points in the region whose pixel values are between the updated minimum pixel value and the updated maximum pixel value as the pixel points located on the organ.
[0109] Furthermore, the receiving module 701 is specifically used to obtain the average value of pixel values of pixel points in the area, determine the product of the average value and a preset value; and obtain a rough maximum value and a rough minimum value saved for the organ; determine the maximum pixel value of the organ in the area according to the difference between the rough maximum value and the product; determine the minimum pixel value of the organ in the area according to the sum of the rough minimum value and the product.
[0110] Furthermore, the processing module 702 is specifically used to determine whether the target pixel value of the target pixel is greater than the minimum pixel value if the target pixel point is not located on the organ; if not, determining the minimum pixel value as the candidate maximum pixel value and the candidate minimum pixel value; if so, determining a first difference between the target pixel value and the minimum pixel value, and determining a first ratio between the target pixel value and the minimum pixel value; and determining the candidate maximum pixel value and the candidate minimum pixel value based on the first ratio, the first difference and the minimum pixel value.
[0111] Furthermore, the processing module 702 is specifically used to determine a second difference between the target pixel value and the minimum pixel value, and a second ratio between the target pixel value and the minimum pixel value if the target pixel point is located on the organ, and determine a candidate maximum pixel value and a candidate minimum pixel value based on the second ratio, the second difference and the minimum pixel value.
[0112] Furthermore, the processing module 702 is specifically used to determine whether the deviation between the target pixel value and the maximum pixel value is greater than the deviation between the target pixel value and the minimum pixel value. If so, the minimum pixel value is updated by using the candidate minimum pixel value; if not, the maximum pixel value is updated by using the candidate maximum pixel value.
[0113] Furthermore, the processing module 702 is further configured to display the pixel points located on the organ using a preset color.
[0114] Furthermore, the processing module 702 is also used to, if a segmentation instruction of other medical images with acquisition time adjacent to the medical image is received, determine the pixel points in the target area corresponding to the area in the other medical image, whose pixel values are between the updated minimum pixel value and the maximum pixel value, as pixel points located on the organ.
[0115] Based on the above embodiments, the present application also provides an electronic device, such as Figure 8As shown, it includes: a processor 801 , a communication interface 802 , a memory 803 and a communication bus 804 , wherein the processor 801 , the communication interface 802 , and the memory 803 communicate with each other via the communication bus 804 .
[0116] The memory 803 stores a computer program. When the program is executed by the processor 801, the processor 801 performs the following steps:
[0117] Receiving a medical image with a region where an organ is located, and determining a maximum pixel value and a minimum pixel value of the organ in the region according to a pixel value of each pixel point in the region;
[0118] Receiving information of a designated target pixel point and whether the target pixel point is located on the organ; determining a candidate maximum pixel value and a candidate minimum pixel value based on the target pixel value and the minimum pixel value according to whether the target pixel point is located on the organ;
[0119] Determining whether to use the candidate minimum pixel value or the candidate maximum pixel value to update the corresponding minimum pixel value or the maximum pixel value according to the deviation between the target pixel value and the maximum pixel value and the minimum pixel value;
[0120] Pixel points in the region whose pixel values are between the updated minimum pixel value and the maximum pixel value are determined as pixel points located on the organ.
[0121] Further, the processor 801 is specifically used to obtain an average value of pixel values of pixel points in the region, determine the product of the average value and a preset value; and obtain a rough maximum value and a rough minimum value saved for the organ;
[0122] The maximum pixel value of the organ in the region is determined according to the difference between the rough maximum value and the product; the minimum pixel value of the organ in the region is determined according to the sum of the rough minimum value and the product.
[0123] Furthermore, the processor 801 is specifically used to determine whether the target pixel value of the target pixel is greater than the minimum pixel value if the target pixel point is not located on the organ; if not, determining the minimum pixel value as the candidate maximum pixel value and the candidate minimum pixel value; if so, determining a first difference between the target pixel value and the minimum pixel value, and determining a first ratio between the target pixel value and the minimum pixel value; and determining the candidate maximum pixel value and the candidate minimum pixel value based on the first ratio, the first difference and the minimum pixel value.
[0124] Furthermore, the processor 801 is specifically used to determine a second difference between the target pixel value and the minimum pixel value, and a second ratio between the target pixel value and the minimum pixel value if the target pixel point is located on the organ, and determine a candidate maximum pixel value and a candidate minimum pixel value based on the second ratio, the second difference and the minimum pixel value.
[0125] Furthermore, the processor 801 is specifically used to determine whether the deviation between the target pixel value and the maximum pixel value is greater than the deviation between the target pixel value and the minimum pixel value. If so, the minimum pixel value is updated using the candidate minimum pixel value; if not, the maximum pixel value is updated using the candidate maximum pixel value.
[0126] Furthermore, the processor 801 is further configured to display the pixel points located on the organ using a preset color.
[0127] Furthermore, the processor 801 is further configured to receive a segmentation instruction for other medical images whose acquisition time is adjacent to that of the medical image;
[0128] Then, in the target area corresponding to the area in the other medical image, the pixel points whose pixel values are between the updated minimum pixel value and the maximum pixel value are determined as the pixel points located on the organ.
[0129] The communication bus mentioned in the above server can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0130] The communication interface 802 is used for communication between the above electronic device and other devices.
[0131] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0132] The above-mentioned processor can be a general-purpose processor, including a central processing unit, a network processor (Network Processor, NP), etc.; it can also be a digital signal processing processor (Digital Signal Processing, DSP), an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, etc.
[0133] On the basis of the above embodiments, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program executable by an electronic device, and when the program is run on the electronic device, the electronic device implements the following steps when executing:
[0134] The memory stores a computer program, and when the program is executed by the processor, the processor performs the following steps:
[0135] Receiving a medical image with a region where an organ is located, and determining a maximum pixel value and a minimum pixel value of the organ in the region according to a pixel value of each pixel point in the region;
[0136] Receiving information of a designated target pixel point and whether the target pixel point is located on the organ; determining a candidate maximum pixel value and a candidate minimum pixel value based on the target pixel value and the minimum pixel value according to whether the target pixel point is located on the organ;
[0137] Determining whether to use the candidate minimum pixel value or the candidate maximum pixel value to update the corresponding minimum pixel value or the maximum pixel value according to the deviation between the target pixel value and the maximum pixel value and the minimum pixel value;
[0138] Pixel points in the region whose pixel values are between the updated minimum pixel value and the maximum pixel value are determined as pixel points located on the organ.
[0139] In a possible implementation manner, determining the maximum pixel value and the minimum pixel value of the organ in the region according to the pixel value of each pixel point in the region includes:
[0140] Obtaining an average value of pixel values of pixel points in the region, determining the product of the average value and a preset value; and obtaining a rough maximum value and a rough minimum value saved for the organ;
[0141] The maximum pixel value of the organ in the region is determined according to the difference between the rough maximum value and the product; the minimum pixel value of the organ in the region is determined according to the sum of the rough minimum value and the product.
[0142] In a possible implementation manner, determining the candidate maximum pixel value and the candidate minimum pixel value based on the target pixel value and the minimum pixel value according to whether the target pixel point is located on the organ includes:
[0143] If the target pixel point is not located on the organ, determine whether the target pixel value of the target pixel point is greater than the minimum pixel value; if not, determine the minimum pixel value as the candidate maximum pixel value and the candidate minimum pixel value; if so, determine a first difference between the target pixel value and the minimum pixel value, and determine a first ratio between the target pixel value and the minimum pixel value; determine the candidate maximum pixel value and the candidate minimum pixel value based on the first ratio, the first difference and the minimum pixel value.
[0144] In a possible implementation manner, determining the candidate maximum pixel value and the candidate minimum pixel value based on the target pixel value and the minimum pixel value according to whether the target pixel point is located on the organ includes:
[0145] If the target pixel point is located on the organ, a second difference between the target pixel value and the minimum pixel value is determined, and a second ratio between the target pixel value and the minimum pixel value is determined; and a candidate maximum pixel value and a candidate minimum pixel value are determined based on the second ratio, the second difference and the minimum pixel value.
[0146] In a possible implementation, determining whether to use the candidate minimum pixel value or the candidate maximum pixel value to update the corresponding minimum pixel value or the maximum pixel value according to the deviation between the target pixel value and the maximum pixel value and the minimum pixel value includes:
[0147] Determine whether the deviation between the target pixel value and the maximum pixel value is greater than the deviation between the target pixel value and the minimum pixel value. If so, use the candidate minimum pixel value to update the minimum pixel value; if not, use the candidate maximum pixel value to update the maximum pixel value.
[0148] In a possible implementation, the method further includes:
[0149] The pixel points located on the organ are displayed using a preset color.
[0150] In a possible implementation, the method further includes:
[0151] If a segmentation instruction is received that carries other medical images whose acquisition time is adjacent to that of the medical image;
[0152] Then, in the target area corresponding to the area in the other medical image, the pixel points whose pixel values are between the updated minimum pixel value and the maximum pixel value are determined as the pixel points located on the organ.
[0153] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0154] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. 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 produce 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.
[0155] 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.
[0156] 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.
[0157] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. An image segmentation method, characterized in that: The method comprises: Receiving a medical image with a region where an organ is located, and determining a maximum pixel value and a minimum pixel value of the organ in the region according to a pixel value of each pixel point in the region; Receiving information of a designated target pixel point and whether the target pixel point is located on the organ; determining a candidate maximum pixel value and a candidate minimum pixel value based on the target pixel value and the minimum pixel value according to whether the target pixel point is located on the organ; Determining whether to use the candidate minimum pixel value or the candidate maximum pixel value to update the corresponding minimum pixel value or the maximum pixel value according to the deviation between the target pixel value and the maximum pixel value and the minimum pixel value; Pixel points in the region whose pixel values are between the updated minimum pixel value and the maximum pixel value are determined as pixel points located on the organ.
2. The method according to claim 1, characterized in that Determining the maximum pixel value and the minimum pixel value of the organ in the region according to the pixel value of each pixel point in the region comprises: Obtaining an average value of pixel values of pixel points in the region, determining the product of the average value and a preset value; and obtaining a rough maximum value and a rough minimum value saved for the organ; The maximum pixel value of the organ in the region is determined according to the difference between the rough maximum value and the product; the minimum pixel value of the organ in the region is determined according to the sum of the rough minimum value and the product.
3. The method according to claim 1, characterized in that The step of determining the candidate maximum pixel value and the candidate minimum pixel value based on the target pixel value and the minimum pixel value according to whether the target pixel point is located on the organ comprises: If the target pixel point is not located on the organ, determine whether the target pixel value of the target pixel point is greater than the minimum pixel value; if not, determine the minimum pixel value as the candidate maximum pixel value and the candidate minimum pixel value; if so, determine a first difference between the target pixel value and the minimum pixel value, and determine a first ratio between the target pixel value and the minimum pixel value; determine the candidate maximum pixel value and the candidate minimum pixel value based on the first ratio, the first difference and the minimum pixel value.
4. The method according to claim 1, characterized in that: The step of determining the candidate maximum pixel value and the candidate minimum pixel value based on the target pixel value and the minimum pixel value according to whether the target pixel point is located on the organ comprises: If the target pixel point is located on the organ, a second difference between the target pixel value and the minimum pixel value is determined, and a second ratio between the target pixel value and the minimum pixel value is determined; and a candidate maximum pixel value and a candidate minimum pixel value are determined based on the second ratio, the second difference and the minimum pixel value.
5. The method according to claim 1, characterized in that The determining, according to the deviation between the target pixel value and the maximum pixel value and the minimum pixel value, whether to adopt the candidate minimum pixel value or the candidate maximum pixel value to update the corresponding minimum pixel value or the maximum pixel value comprises: Determine whether the deviation between the target pixel value and the maximum pixel value is greater than the deviation between the target pixel value and the minimum pixel value. If so, use the candidate minimum pixel value to update the minimum pixel value; if not, use the candidate maximum pixel value to update the maximum pixel value.
6. The method according to claim 1, characterized in that The method further comprises: The pixel points located on the organ are displayed using a preset color.
7. The method according to claim 1, characterized in that The method further comprises: If a segmentation instruction is received that carries other medical images whose acquisition time is adjacent to that of the medical image; Then, in the target area corresponding to the area in the other medical image, the pixel points whose pixel values are between the updated minimum pixel value and the maximum pixel value are determined as the pixel points located on the organ.
8. An image segmentation device, characterized in that: The device comprises: A receiving module, used for receiving a medical image with a region where a certain organ is located marked, and determining a maximum pixel value and a minimum pixel value of the organ in the region according to a pixel value of each pixel point in the region; A processing module is used to receive information about a designated target pixel point and whether the target pixel point is located on the organ; determine a candidate maximum pixel value and a candidate minimum pixel value based on the target pixel value and the minimum pixel value according to whether the target pixel point is located on the organ; and determine whether to use the candidate minimum pixel value or the candidate maximum pixel value to update the corresponding minimum pixel value or the maximum pixel value according to the deviation between the target pixel value and the maximum pixel value and the minimum pixel value; The determination module is used to determine the pixel points in the region whose pixel values are between the updated minimum pixel value and the updated maximum pixel value as the pixel points located on the organ.
9. An electronic device, characterized in that: The electronic device comprises at least a processor and a memory, and the processor is used to execute the steps of the image segmentation method according to any one of claims 1 to 7 when executing a computer program stored in the memory.
10. A computer-readable storage medium, characterized in that: The computer program is stored therein, and when the computer program is executed by a processor, the steps of the image segmentation method according to any one of claims 1 to 7 are executed.