Method and device for determining drug diffusion degree, electronic equipment and storage medium
By performing image morphological processing and grayscale conversion on images of the drug diffusion target area, the degree of drug diffusion is determined, solving the problem that existing technologies cannot accurately determine the degree of drug diffusion and achieving accurate determination of the degree of drug diffusion.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NAN TONG PENG YUAN YI LIAO KE JI YOU XIAN GONG SI
- Filing Date
- 2023-08-02
- Publication Date
- 2026-06-02
AI Technical Summary
Current technology cannot accurately determine the extent of drug diffusion in target areas of the human body, thus failing to provide doctors with accurate references and affecting the assessment of drug diffusion levels.
By performing image morphological processing on the target region image of the drug diffusion, including dilation and erosion operations, the image is converted into a grayscale image. The edge contour of the drug diffusion is obtained by subtracting the grayscale image of the morphologically processed image from the grayscale image of the target region. The degree of drug diffusion is determined based on the edge contour and the grayscale image of the target region.
It enables accurate determination of the diffusion extent of drugs in target areas of the human body, providing doctors with accurate references and helping them quickly grasp the drug diffusion situation.
Smart Images

Figure CN117115089B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, specifically to a method, apparatus, electronic device, and storage medium for determining the degree of drug diffusion. Background Technology
[0002] Drug injection is a routine treatment method in the medical field. However, in related techniques, it is impossible to accurately determine the extent of drug diffusion in the target area of the body during drug injection, which cannot provide doctors with accurate references and hinders their ability to quickly and accurately grasp the degree of drug diffusion.
[0003] The above statements are for the purpose of providing background information in relation to this application only and do not necessarily constitute prior art. Summary of the Invention
[0004] The purpose of this application is to provide a method, apparatus, electronic device, and storage medium for determining the extent of drug diffusion. To provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. This summary is not intended as a general description, nor is it intended to identify key / important components or to describe the scope of protection of these embodiments. Its sole purpose is to present some concepts in a simple form as a prelude to the detailed description that follows.
[0005] According to one aspect of the embodiments of this application, a method for determining the degree of drug diffusion is provided, comprising:
[0006] Image morphological processing of the drug diffusion target area image;
[0007] Both the image of the drug diffusion target region and the morphologically processed image are converted into grayscale images to obtain grayscale images of the target region and grayscale images of the morphologically processed image.
[0008] The edge contour of drug diffusion is obtained by subtracting the grayscale image of the morphologically processed image from the grayscale image of the target region.
[0009] The degree of drug diffusion is determined based on the edge contour of the drug diffusion and the grayscale image of the target area.
[0010] In some embodiments of this application, the image morphological processing of the drug diffusion target region image includes:
[0011] The image of the drug diffusion target region is subjected to an image morphological dilation operation to obtain the dilated image;
[0012] The image after the dilation operation is subjected to an image morphological erosion operation to obtain an eroded image.
[0013] In some embodiments of this application, the image morphological dilation operation on the image of the drug diffusion target region includes:
[0014] For each pixel in the drug diffusion target area image, the origin of the structuring element is aligned with the pixel in the drug diffusion target area image, and a bitwise logical OR operation is performed.
[0015] If any pixel in the structuring element overlaps with a corresponding pixel in the image of the drug diffusion target area, the pixel at the corresponding position in the output image is set to 1; otherwise, it is set to 0.
[0016] In some embodiments of this application, the image morphological erosion operation on the image after dilation includes:
[0017] For each pixel in the drug diffusion target area image, the origin of the structuring element is aligned with the pixel in the drug diffusion target area image, and a bitwise logical AND operation is performed.
[0018] If all non-zero pixels in the structuring element match the corresponding pixels in the image of the drug diffusion target area, then the corresponding pixels in the output image are set to 1; otherwise, they are set to 0.
[0019] In some embodiments of this application, determining the degree of drug diffusion based on the edge contour of the drug diffusion and the grayscale image of the target region includes:
[0020] The drug diffusion index is obtained based on the edge contour of the drug diffusion and the grayscale image of the target area;
[0021] The degree of drug diffusion is determined based on the drug diffusion index and a preset threshold.
[0022] In some embodiments of this application, converting both the image of the drug diffusion target region and the morphologically processed image into grayscale images to obtain a grayscale image of the target region and a grayscale image of the morphologically processed image includes:
[0023] The weighted sum of the values in the red channel, green channel, and blue channel of the drug diffusion target area image is calculated to obtain a grayscale image of the target area;
[0024] The weighted sum of the values in the red channel, green channel, and blue channel of the morphologically processed image is calculated to obtain the grayscale image of the morphologically processed image.
[0025] In some embodiments of this application, obtaining the edge contour of drug diffusion by subtracting the morphologically processed image grayscale image from the target region grayscale image includes:
[0026] The difference is obtained by subtracting the gray level of the corresponding pixel in the gray level image of the morphologically processed image from the gray level of the pixel in the gray level image of the target region;
[0027] If the difference is less than 0, then the difference is changed to 0; if the difference is greater than 255, then the difference is changed to 255; if the difference is neither less than 0 nor greater than 255, then the difference is retained.
[0028] According to another aspect of the embodiments of this application, an apparatus for determining the degree of drug diffusion is provided, comprising:
[0029] The morphological processing module is used to perform image morphological processing on images of drug diffusion target areas.
[0030] The grayscale conversion module is used to convert both the drug diffusion target area image and the morphologically processed image into grayscale images, resulting in a grayscale image of the target area and a grayscale image of the morphologically processed image.
[0031] The edge contour acquisition module is used to obtain the edge contour of drug diffusion by subtracting the grayscale image of the morphologically processed image from the grayscale image of the target region.
[0032] The diffusion degree determination module is used to determine the degree of drug diffusion based on the edge contour of the drug diffusion and the grayscale image of the target area.
[0033] According to another aspect of the embodiments of this application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method for determining the degree of drug diffusion as described in any embodiment of this application.
[0034] According to another aspect of the embodiments of this application, a computer-readable storage medium is provided having a computer program stored thereon, the computer program being executed by a processor to implement the method for determining the degree of drug diffusion as described in any embodiment of this application.
[0035] One aspect of the technical solution provided in this application embodiment may include the following beneficial effects:
[0036] The method for determining the degree of drug diffusion provided in this application embodiment performs image morphological processing on the image of the drug diffusion target area, converting both the image of the drug diffusion target area and the morphologically processed image into grayscale images, obtaining a grayscale image of the target area and a grayscale image of the morphologically processed image. By subtracting the grayscale image of the morphologically processed image from the grayscale image of the target area, the edge contour of drug diffusion is obtained. Based on the edge contour of drug diffusion and the grayscale image of the target area, the degree of drug diffusion is determined, thereby accurately determining the degree of drug diffusion in the target area of the human body, providing doctors with an accurate reference so that doctors can quickly and accurately grasp the degree of drug diffusion.
[0037] The above description is merely an overview of the technical solutions of the embodiments of this application. In order to better understand the technical means of the embodiments of this application and to implement them in accordance with the contents of the specification, and to make the above and other objects, features and advantages of the embodiments of this application more obvious and understandable, specific implementation methods of this application are described below. Attached Figure Description
[0038] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0039] Figure 1 A flowchart illustrating a method for determining the degree of drug diffusion according to an embodiment of this application is shown.
[0040] Figure 2 A flowchart of step S10 in one embodiment of this application is shown.
[0041] Figure 3 An image after dilation operation is shown in one embodiment of this application.
[0042] Figure 4 An image after etching is shown in one embodiment of this application.
[0043] Figure 5 A flowchart of step S40 in one embodiment of this application is shown.
[0044] Figure 6 The image shown is a grayscale image of the target area and an image of the edge contour of drug diffusion in one embodiment of this application.
[0045] Figure 7 A block diagram of a drug diffusion degree determination device according to an embodiment of this application is shown.
[0046] Figure 8 A block diagram of an electronic device structure according to an embodiment of this application is shown.
[0047] Figure 9 A schematic diagram of a computer-readable storage medium according to an embodiment of this application is shown. Detailed Implementation
[0048] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the application. All other embodiments obtained by those skilled in the art based on the embodiments in this application without inventive effort are within the scope of protection of this application.
[0049] It will be understood by those skilled in the art that, unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. It should also be understood that terms such as those defined in general dictionaries should be understood to have a meaning consistent with their meaning in the context of the prior art, and should not be interpreted in an idealized or overly formal sense unless specifically defined as herein.
[0050] In the medical field, acquiring images of internal tissues or organs using relevant equipment has become a common technical method. For example, the technology of acquiring ultrasound images of the human body using ultrasound probes is widely used. When injecting drugs into the human body, images of the target area for drug diffusion can be acquired using ultrasound probes. Addressing the technical problem in related technologies where the degree of drug diffusion in the target area of the human body cannot be accurately determined during drug injection, thus failing to provide doctors with accurate references and hindering their ability to quickly and accurately grasp the degree of drug diffusion, this application provides a method for determining the degree of drug diffusion. The method involves performing image morphological processing on the image of the target area for drug diffusion, converting both the target area image and the morphologically processed image into grayscale images, obtaining a grayscale image of the target area and a grayscale image of the morphologically processed image. The grayscale image of the target area is subtracted from the grayscale image of the morphologically processed image to obtain the edge contour of drug diffusion. Based on the edge contour of drug diffusion and the grayscale image of the target area, the degree of drug diffusion is determined, thereby accurately determining the degree of drug diffusion in the target area of the human body, providing doctors with accurate references, and enabling them to quickly and accurately grasp the degree of drug diffusion.
[0051] refer to Figure 1 As shown, one embodiment of this application provides a method for determining the degree of drug diffusion, which may include steps S10 to S40:
[0052] S10. Perform image morphological processing on the image of the drug diffusion target area.
[0053] refer to Figure 2 As shown, in some embodiments, image morphological processing of the drug diffusion target region image may include steps S101 to S102:
[0054] S101. Perform an image morphological dilation operation on the image of the drug diffusion target region to obtain the image after dilation.
[0055] S102. Perform image morphological erosion on the image after the dilation operation to obtain the eroded image.
[0056] refer to Figure 3 As shown, Figure 3 This is an example of an image after dilation. (Reference) Figure 4 As shown, Figure 4 This is an image after erosion, as shown in a specific example.
[0057] In some embodiments, performing image morphological dilation on the drug diffusion target region image may include: aligning the origin of a structuring element with the pixel in the drug diffusion target region image, and performing a bitwise logical OR operation on the pixels in the drug diffusion target region image; if any pixel in the structuring element overlaps with a pixel at a corresponding position in the drug diffusion target region image, then setting the pixel at the corresponding position in the output image to 1, otherwise setting it to 0.
[0058] In some embodiments, performing image morphological erosion on the image after dilation may include: aligning the origin of a structuring element with the pixels in the drug diffusion target region image, and performing a bitwise logical AND operation on the pixels in the structuring element; if all non-zero pixels in the structuring element match the corresponding pixels in the drug diffusion target region image, then setting the corresponding pixels in the output image to 1, otherwise setting them to 0.
[0059] In a specific example, an image morphological dilation operation is performed on the target region image, followed by an image morphological erosion operation. The target region is the area where the drug and target nerve are located. The dilation operation smooths the edges of the target region, while the erosion operation weakens the connections between the segmented images.
[0060] The expansion operation may include the following steps:
[0061] Define a kernel, for example, you can use a 3x3 kernel where all kernel elements are 1, as shown below:
[0062]
[0063] The dilation operation convolves the structuring element with the image region selected by the doctor. For each pixel in the image, the origin of the structuring element is aligned with that pixel, and then a bitwise logical OR operation is performed. If any pixel in the structuring element overlaps with a corresponding pixel in the image, the corresponding pixel in the output image is set to 1; otherwise, it is set to 0. The convolution operation has been described previously and will not be repeated here.
[0064] Expanding the target region: The dilation operation enhances the target region by expanding it. Non-zero pixels in the structuring element can be considered part of the target; therefore, when the structuring element overlaps with pixels in the target region, the corresponding pixel in the output image will also be set to 1, thus expanding the target region.
[0065] Etching operations may include the following steps:
[0066] Define a kernel, for example, you can use a 3x3 kernel where all kernel elements are 1, as shown below:
[0067]
[0068] The erosion operation performs a convolution operation between the structuring element and the dilated image;
[0069] For each pixel in the image, align the origin of the structuring element with that pixel, and then perform a bitwise logical AND operation. If all non-zero pixels in the structuring element match the corresponding pixel in the image, then the corresponding pixel element in the output image is set to 1; otherwise, it is set to 0.
[0070] Reducing the target region: The erosion operation weakens the connections between segmented images by shrinking the target region. Non-zero pixels in the structuring element can be considered part of the target; therefore, the corresponding pixel element in the output image is set to 1 only when all non-zero pixels of the structuring element match pixels in the target region, otherwise it is set to 0. This gradually reduces and separates the target region.
[0071] S20. Convert both the drug diffusion target area image and the morphologically processed image into grayscale images to obtain the target area grayscale image and the morphologically processed image grayscale image.
[0072] In some embodiments, converting both the drug diffusion target region image and the morphologically processed image into grayscale images to obtain a target region grayscale image and a morphologically processed image grayscale image may include:
[0073] The weighted sum of the values in the red channel, green channel, and blue channel of the drug diffusion target area image is calculated to obtain a grayscale image of the target area;
[0074] The weighted sum of the values in the red channel, green channel, and blue channel of the morphologically processed image is calculated to obtain the grayscale image of the morphologically processed image.
[0075] The target region and the morphologically processed image are converted into grayscale images using the following formula:
[0076] Y = αR + βG + γB
[0077] Where Y is the grayscale value of the image. R, G, and B represent the values of the original color image in the red, green, and blue channels, respectively, and the weighting coefficients α, β, and γ corresponding to the values in each channel are preset.
[0078] For example, the weighting coefficients of R, G, and B in the above calculation formula can be set to 0.3, 0.59, and 0.11, respectively. Then the above formula is Y = 0.3R + 0.59G + 0.11B.
[0079] S30. Subtract the morphologically processed image grayscale from the target region grayscale to obtain the edge contour of drug diffusion.
[0080] In some embodiments, subtracting the morphologically processed image grayscale from the target region grayscale to obtain the edge contour of drug diffusion may include:
[0081] The difference is obtained by subtracting the gray level of the corresponding pixel in the gray level image of the morphologically processed image from the gray level of the pixel in the gray level image of the target region;
[0082] If the difference is less than 0, then the difference is changed to 0; if the difference is greater than 255, then the difference is changed to 255; if the difference is neither less than 0 nor greater than 255, then the difference is retained.
[0083] The edge contour of the drug diffusion can provide a reference for doctors. If the doctor determines from the edge contour that the edge area of the drug diffusion is sufficient to cover the target area, the injection can be stopped.
[0084] For example, in a specific example, the output image = target region grayscale image - grayscale image after morphological processing. The output image is the image of the edge contour of the drug diffusion. The calculation process is image matrix subtraction, calculating the pixel grayscale value of the output image by subtracting the pixel grayscale values at corresponding positions. The steps are as follows:
[0085] Input two images: a grayscale image of the target region and a grayscale image after morphological processing, respectively. The two images have the same size and number of channels.
[0086] The difference is obtained by subtracting the pixel grayscale values at corresponding positions in the grayscale image of the target region from those in the morphologically processed grayscale image.
[0087] Handling pixel grayscale overflow: When subtracting pixel grayscale values, the result may exceed the pixel grayscale value range. Typically, the pixel grayscale value range is 0 to 255 (for an 8-bit grayscale image). If the result is less than 0, it is truncated to 0; if the result is greater than 255, it is truncated to 255.
[0088] Output a new image, which is the image of the edge contour of the drug solution diffusion.
[0089] S40. Determine the degree of drug diffusion based on the edge contour of the drug diffusion and the grayscale image of the target area.
[0090] refer to Figure 5 As shown, in some embodiments, determining the degree of drug diffusion based on the edge contour of the drug diffusion and the grayscale image of the target region may include steps S401 to S402:
[0091] S401. Obtain the drug diffusion index based on the edge contour of the drug diffusion and the grayscale image of the target area;
[0092] S402. Determine the degree of drug diffusion based on the drug diffusion index and the preset threshold.
[0093] The target area for drug diffusion can be, for example, a nerve sheath. The method for determining the degree of drug diffusion in this application can, for example, be used to determine whether the drug has diffused into the nerve sheath.
[0094] In a specific example, the formula for calculating the drug diffusion index is: Diffusion Index = Number of outline pixels / Total number of pixels in the target area image * 100. The output image is the outline of the drug diffusion. Because the outline has a large grayscale value, it is displayed brightly. By counting the pixel values, the number of pixels occupied by the outline can be determined. The calculated diffusion index is used as a quantitative indicator of drug diffusion. If the diffusion index is greater than a preset threshold, the drug diffusion is considered complete, and the injection can be stopped. The preset threshold can be, for example, 50%, 55%, or 60%, etc., and can be set according to the actual application needs.
[0095] refer to Figure 6 As shown, Figure 6The image shown here is a grayscale image of the target area and an image of the edge contour of drug diffusion. The image on side A is the grayscale image of the target area, and the image on side B is the image of the edge contour of drug diffusion. Figure 6 The area of human tissue in the solution is 36.17%, and the area of liquid (i.e., drug) is 63.83%. The drug diffusion index exceeds the preset threshold (the preset threshold can be, for example, 60%), and the drug diffusion is complete.
[0096] The method for determining the degree of drug diffusion in the embodiments of this application can accurately determine the degree of drug diffusion in the target area of the human body, providing doctors with accurate reference so that doctors can quickly and accurately grasp the degree of drug diffusion.
[0097] refer to Figure 7 As shown, another embodiment of this application provides an apparatus for determining the degree of drug diffusion, comprising:
[0098] The morphological processing module is used to perform image morphological processing on images of drug diffusion target areas.
[0099] The grayscale conversion module is used to convert both the drug diffusion target area image and the morphologically processed image into grayscale images, resulting in a grayscale image of the target area and a grayscale image of the morphologically processed image.
[0100] The edge contour acquisition module is used to obtain the edge contour of drug diffusion by subtracting the grayscale image of the morphologically processed image from the grayscale image of the target region.
[0101] The diffusion degree determination module is used to determine the degree of drug diffusion based on the edge contour of the drug diffusion and the grayscale image of the target area.
[0102] In some embodiments, the morphological processing module may include:
[0103] The dilation operation unit is used to perform an image morphological dilation operation on the image of the drug diffusion target region to obtain an image after dilation.
[0104] The erosion operation unit is used to perform image morphological erosion operation on the image after the dilation operation to obtain the eroded image.
[0105] In some embodiments, performing image morphological dilation on the drug diffusion target region image may include: aligning the origin of a structuring element with the pixel in the drug diffusion target region image, and performing a bitwise logical OR operation on the pixels in the drug diffusion target region image; if any pixel in the structuring element overlaps with a pixel at a corresponding position in the drug diffusion target region image, then setting the pixel at the corresponding position in the output image to 1, otherwise setting it to 0.
[0106] In some embodiments, performing image morphological erosion on the image after dilation may include: aligning the origin of a structuring element with the pixels in the drug diffusion target region image, and performing a bitwise logical AND operation on the pixels in the structuring element; if all non-zero pixels in the structuring element match the corresponding pixels in the drug diffusion target region image, then setting the corresponding pixels in the output image to 1, otherwise setting them to 0.
[0107] In some embodiments, the diffusion degree determination module may include:
[0108] The drug diffusion index acquisition unit is used to acquire the drug diffusion index based on the edge contour of the drug diffusion and the grayscale image of the target area.
[0109] The drug diffusion degree determination unit is used to determine the drug diffusion degree based on the drug diffusion index and a preset threshold.
[0110] In some embodiments, the grayscale conversion module may include:
[0111] The target area grayscale image acquisition unit is used to calculate the weighted sum of the values in the red channel, the green channel, and the blue channel of the drug diffusion target area image to obtain the target area grayscale image;
[0112] The image grayscale acquisition unit is used to calculate the weighted sum of the values in the red channel, the green channel, and the blue channel of the morphologically processed image to obtain the morphologically processed image grayscale.
[0113] In some embodiments, the edge contour acquisition module is further specifically used to: subtract the gray level of the corresponding pixel in the gray level of the morphologically processed image from the gray level of the pixel in the gray level of the target region to obtain a difference; if the difference is less than 0, then change the difference to 0; if the difference is greater than 255, then change the difference to 255; if the difference is not less than 0 and not greater than 255, then retain the difference.
[0114] The drug diffusion degree determination device provided in this application embodiment performs image morphological processing on the drug diffusion target area image, converting both the drug diffusion target area image and the morphologically processed image into grayscale images, obtaining a target area grayscale image and a morphologically processed image grayscale image. By subtracting the morphologically processed image grayscale image from the target area grayscale image, the edge contour of drug diffusion is obtained. Based on the edge contour of drug diffusion and the target area grayscale image, the degree of drug diffusion is determined, thereby accurately determining the degree of drug diffusion in the target area of the human body, providing doctors with accurate references so that doctors can quickly and accurately grasp the degree of drug diffusion.
[0115] Another embodiment of this application provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method for determining the degree of drug diffusion described in any of the above embodiments.
[0116] refer to Figure 8 As shown, the electronic device 10 may include: a processor 100, a memory 101, a bus 102 and a communication interface 103. The processor 100, the communication interface 103 and the memory 101 are connected through the bus 102. The memory 101 stores a computer program that can run on the processor 100. When the processor 100 runs the computer program, it executes the method provided in any of the foregoing embodiments of this application.
[0117] The memory 101 may include high-speed random access memory (RAM), and may also include non-volatile memory, such as at least one disk storage device. Communication between this device network element and at least one other network element is achieved through at least one communication interface 103 (which may be wired or wireless), such as the Internet, wide area network, local area network, metropolitan area network, etc.
[0118] Bus 102 can be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. Memory 101 is used to store programs. After receiving an execution instruction, processor 100 executes the program. The methods disclosed in any of the foregoing embodiments of this application can be applied to processor 100, or implemented by processor 100.
[0119] Processor 100 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 100 or by instructions in software form. The processor 100 can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), Application-Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 101. The processor 100 reads the information in memory 101 and, in conjunction with its hardware, completes the steps of the above method.
[0120] The electronic devices and methods provided in the embodiments of this application are based on the same inventive concept and have the same beneficial effects as the methods they employ, operate, or implement.
[0121] Another embodiment of this application provides a computer-readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the method for determining the degree of drug diffusion described in any of the above embodiments. Reference Figure 9 As shown, the computer-readable storage medium is an optical disc 20, on which a computer program (i.e., a program product) is stored. When the computer program is run by a processor, it executes the methods provided in any of the aforementioned embodiments.
[0122] It should be noted that examples of computer-readable storage media may also include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other optical and magnetic storage media, which will not be elaborated here.
[0123] The computer-readable storage medium provided in the above embodiments of this application and the method provided in the embodiments of this application are based on the same inventive concept and have the same beneficial effects as the methods adopted, run or implemented by the application stored therein.
[0124] It should be noted that:
[0125] The term "module" is not intended to be limited to a particular physical form. Depending on the specific application, a module can be implemented as hardware, firmware, software, and / or a combination thereof. Furthermore, different modules may share common components or even be implemented using the same components. Clear boundaries may or may not exist between different modules.
[0126] The algorithms and displays provided herein are not inherently related to any particular computer, virtual device, or other equipment. Various general-purpose devices can also be used with the examples based on this. The required structure for constructing such devices is obvious from the above description. Furthermore, this application is not directed to any particular programming language. It should be understood that the content of this application described herein can be implemented using various programming languages, and the above description of specific languages is for the purpose of disclosing the best mode of implementation of this application.
[0127] It should be understood that although the steps in the flowcharts of the accompanying figures are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the accompanying figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.
[0128] The above embodiments merely illustrate the implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method of determining the extent of drug diffusion, characterized by, include: Image morphological processing of the drug diffusion target area image; Both the image of the drug diffusion target region and the morphologically processed image are converted into grayscale images to obtain grayscale images of the target region and grayscale images of the morphologically processed image. The edge contour of drug diffusion is obtained by subtracting the grayscale image of the morphologically processed image from the grayscale image of the target region. The degree of drug diffusion is determined based on the edge contour of the drug diffusion and the grayscale image of the target area; Determining the degree of drug diffusion based on the edge contour of the drug diffusion and the grayscale image of the target region includes: The drug diffusion index is obtained based on the edge contour of the drug diffusion and the grayscale image of the target area; The degree of drug diffusion is determined based on the drug diffusion index and a preset threshold. The formula for calculating the drug diffusion index is: Diffusion index = Number of outline pixels / Total number of pixels in the target area image * 100.
2. The method according to claim 1, characterized in that, The image morphological processing of the drug diffusion target area image includes: The image of the drug diffusion target region is subjected to an image morphological dilation operation to obtain the dilated image; The image after the dilation operation is subjected to an image morphological erosion operation to obtain an eroded image.
3. The method according to claim 2, characterized in that, The image morphological dilation operation on the drug diffusion target region image includes: For each pixel in the drug diffusion target area image, the origin of the structuring element is aligned with the pixel in the drug diffusion target area image, and a bitwise logical OR operation is performed. If any pixel in the structuring element overlaps with a corresponding pixel in the image of the drug diffusion target area, the pixel at the corresponding position in the output image is set to 1; otherwise, it is set to 0.
4. The method according to claim 2, characterized in that, The image morphological erosion operation performed on the image after dilation includes: For each pixel in the drug diffusion target area image, the origin of the structuring element is aligned with the pixel in the drug diffusion target area image, and a bitwise logical AND operation is performed. If all non-zero pixels in the structuring element match the corresponding pixels in the image of the drug diffusion target area, then the corresponding pixels in the output image are set to 1; otherwise, they are set to 0.
5. The method according to claim 1, characterized in that, The step of converting both the drug diffusion target region image and the morphologically processed image into grayscale images to obtain a grayscale image of the target region and a grayscale image of the morphologically processed image includes: The weighted sum of the values in the red channel, green channel, and blue channel of the drug diffusion target area image is calculated to obtain a grayscale image of the target area; The weighted sum of the values in the red channel, green channel, and blue channel of the morphologically processed image is calculated to obtain the grayscale image of the morphologically processed image.
6. The method according to claim 1, characterized in that, The step of subtracting the morphologically processed image grayscale from the target region grayscale to obtain the edge contour of drug diffusion includes: The difference is obtained by subtracting the gray level of the corresponding pixel in the gray level image of the morphologically processed image from the gray level of the pixel in the gray level image of the target region; If the difference is less than 0, then the difference is changed to 0; if the difference is greater than 255, then the difference is changed to 255; if the difference is neither less than 0 nor greater than 255, then the difference is retained.
7. A device for determining the degree of drug diffusion, characterized in that, include: The morphological processing module is used to perform image morphological processing on images of drug diffusion target areas. The grayscale conversion module is used to convert both the drug diffusion target area image and the morphologically processed image into grayscale images, resulting in a grayscale image of the target area and a grayscale image of the morphologically processed image. The edge contour acquisition module is used to obtain the edge contour of drug diffusion by subtracting the grayscale image of the morphologically processed image from the grayscale image of the target region. The diffusion degree determination module is used to determine the degree of drug diffusion based on the edge contour of the drug diffusion and the grayscale image of the target area; The diffusion degree determination module includes: The drug diffusion index acquisition unit is used to acquire the drug diffusion index based on the edge contour of the drug diffusion and the grayscale image of the target area. A drug diffusion degree determination unit is used to determine the drug diffusion degree based on the drug diffusion index and a preset threshold. The formula for calculating the drug diffusion index is: Diffusion index = Number of outline pixels / Total number of pixels in the target area image * 100.
8. An electronic device, characterized in that, The device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method for determining the extent of drug diffusion as described in any one of claims 1-6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, The computer program is executed by a processor to implement the method for determining the extent of drug diffusion as described in any one of claims 1-6.