An image segmentation method, device, apparatus and storage medium
By preprocessing DICOM medical images and performing dual-loop iterative processing, the problem of low image segmentation accuracy and efficiency in SPECT-CT post-processing analysis software was solved, achieving automated high-precision organ contour and ROI segmentation, and significantly improving segmentation accuracy and efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SPARTICLE HEALTHCARE CO LTD
- Filing Date
- 2026-05-07
- Publication Date
- 2026-07-31
AI Technical Summary
Existing SPECT-CT post-processing and analysis software suffers from poor image segmentation accuracy and low efficiency. Manually outlining organ contours and ROIs is problematic due to large errors, high workload, and long processing time.
The method involves preprocessing DICOM medical images to obtain initial segmentation data, and then using a dual-loop separation iterative process, including a first loop iteration for contour convergence and a second loop iteration for contour smoothing, to replace the traditional manual drawing operation and achieve automated contour segmentation.
It improves the accuracy and efficiency of image segmentation, eliminates errors caused by manual drawing, reduces workload and time consumption, and significantly improves the accuracy of organ and tissue boundary fitting and segmentation speed.
Smart Images

Figure CN122492735A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to an image segmentation method, apparatus, device, and storage medium. Background Technology
[0002] Single-photon emission computed tomography (SPECT-CT) post-processing, as a nuclear medicine image analysis and processing software system, tracks the metabolic distribution of radiotracers in the body through image analysis, providing functional metabolic information for disease diagnosis. It plays an irreplaceable role, especially in scenarios such as myocardial perfusion imaging for coronary heart disease, tumor metastasis assessment, and image fusion analysis.
[0003] In SPECT-CT post-processing analysis software, the outlines of organs in Digital Imaging and Communications in Medicine (DICOM) medical images are usually drawn manually, which leads to poor image segmentation accuracy and low efficiency. Summary of the Invention
[0004] To address the aforementioned issues, this application provides an image segmentation method, apparatus, device, and storage medium, with the aim of improving the accuracy and efficiency of image segmentation.
[0005] The embodiments of this application disclose the following technical solutions: In a first aspect, this application provides an image segmentation method, comprising: The DICOM medical image is preprocessed to obtain initial segmentation data; the initial segmentation data includes a grayscale image, an initial level set, and an initial contour point set. The initial segmentation data is subjected to a double-loop separation iteration process to determine the target segmentation contour. The double-loop separation iteration process means that the contour evolution is divided into a first loop iteration and a second loop iteration in sequence. The first loop iteration is used for contour convergence, and the second loop iteration is used for contour smoothing. Based on the target segmentation contour, the target segmentation result is determined from the DICOM medical image.
[0006] Optionally, in the method described above, the preprocessing of the DICOM medical image to obtain initial segmentation data includes: The DICOM image is subjected to grayscale normalization and noise suppression processing to obtain a grayscale image; An initial contour is determined based on the grayscale image, and the level set function is initialized based on the initial contour to obtain an initial level set. The initial horizontal set is traversed and filtered to select inner contour points and outer contour points to obtain an initial contour point set; the initial contour point set includes an inner contour point column and an outer contour point column.
[0007] Optionally, in the method described above, the step of performing a double-loop separation iteration process on the initial segmented data to determine the target segmentation contour includes: The initial segmentation data is subjected to a first loop iteration to obtain the initial segmentation contour and the corresponding converged contour point set; the initial segmentation contour is the contour after convergence iteration; the converged contour point set includes the converged inner contour point set and the converged outer contour point set that match the initial segmentation contour. Based on the initial segmentation contour and the converged contour point set, a second loop iteration is performed to obtain the target segmentation contour.
[0008] Optionally, in the method described above, the step of performing a first loop iteration on the initial segmentation data to obtain the initial segmentation contour and the corresponding converged contour point set includes: Based on the initial set of contour points, the mean internal gray value and the mean external gray value corresponding to each contour point are calculated. The data-driven terms of each contour point are calculated using the mean internal and mean external gray values, thus obtaining the basis for judging the contour convergence direction of each contour point. Based on the contour convergence direction judgment criteria corresponding to each contour point, the contour points are expanded or contracted, and the inner contour point column and the outer contour point column are updated. The initial segmentation contour is generated based on the updated inner contour point set and the updated outer contour point set; Redundant points are removed from the updated inner contour point set and the updated outer contour point set to obtain a converged contour point set; the redundant points are contour points that do not contribute to the characterization of the contour boundary shape after the inner contour point set and the outer contour point set are updated by contour expansion or contraction operations.
[0009] Optionally, in the method described above, the second iterative processing based on the initial segmented contour and the converged contour point set to obtain the target segmented contour includes: Gaussian filtering is applied to the initial segmented contour and the converged contour point set to obtain the gray value of each contour point. Based on the gray values of each contour point, the curve smoothing driving term corresponding to each contour point is calculated using a unit step function. The position of each contour point is adjusted based on the curve smoothing driving term corresponding to each contour point to obtain a smooth segmentation contour. When the smooth segmentation contour satisfies the preset convergence condition or the number of iterations reaches the preset maximum number of iterations, the smooth segmentation contour is determined as the target segmentation contour.
[0010] Optionally, the method described above further includes: When the smooth segmentation contour does not meet the preset convergence condition and has not reached the preset maximum number of iterations, a second loop iteration process is performed on the smooth segmentation contour until the smooth segmentation contour meets the preset convergence condition or the number of iterations reaches the preset maximum number of iterations.
[0011] Secondly, this application provides an image segmentation apparatus, comprising: The preprocessing module is used to preprocess DICOM medical images to obtain initial segmentation data; the initial segmentation data includes grayscale images, initial level sets, and initial contour point sets. The contour segmentation module is used to perform a double-loop separation iterative process on the initial segmentation data to determine the target segmentation contour. The double-loop separation iterative process means that the contour evolution is divided into a first loop iteration and a second loop iteration in sequence. The first loop iteration is used for contour convergence, and the second loop iteration is used for contour smoothing. The result determination module is used to determine the target segmentation result from the DICOM medical image based on the target segmentation contour.
[0012] Optionally, in the apparatus described above, the preprocessing module includes: The grayscale image determination module is used to perform grayscale normalization and noise suppression processing on the DICOM image to obtain a grayscale image; An initialization module is used to determine an initial contour based on the grayscale image and to initialize the level set function based on the initial contour to obtain an initial level set. The initial contour point set determination module is used to traverse and filter the inner contour points and outer contour points of the initial horizontal set to obtain the initial contour point set; the initial contour point set includes the inner contour point column and the outer contour point column.
[0013] Thirdly, this application provides an electronic device, the device including: a processor, and a memory communicatively connected to the processor; The memory stores instructions that the computer executes; The processor executes computer execution instructions stored in the memory to implement any of the image segmentation methods described in the above embodiments.
[0014] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement any of the image segmentation methods described in the above embodiments.
[0015] Compared with the prior art, this application has the following beneficial effects: The method of this application preprocesses DICOM medical images to obtain initial segmentation data to reduce image noise interference and ensure segmentation stability. The initial segmentation data includes a grayscale image, an initial level set, and an initial contour point set. Then, a dual-loop separation iterative process is performed on the initial segmentation data to determine the target segmentation contour. The dual-loop separation iterative process involves dividing the contour evolution into a first loop iteration and a second loop iteration. The first loop iteration is used for contour convergence, and the second loop iteration is used for contour smoothing. Convergence and smoothing are separated into two independent loops and executed step-by-step, balancing accuracy and speed. This results in a contour that is both accurate and smooth, significantly reducing errors and computational load, while also significantly improving segmentation efficiency. Finally, based on the target segmentation contour, the target segmentation result is determined from the DICOM medical image. Compared to the manual drawing method in the prior art, the method of this application, through an automated segmentation approach using dual-loop separation iteration, optimizes contour convergence and contour smoothing step-by-step, replacing traditional manual drawing operations, eliminating human errors caused by mouse dragging, and ensuring that the segmentation contour accurately fits the boundaries of real organ tissues. This significantly reduces the workload and time spent on drawing, thereby improving the accuracy and efficiency of image segmentation. Attached Figure Description
[0016] 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 of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 A flowchart illustrating an image segmentation method provided in an embodiment of this application; Figure 2 A schematic diagram of the level set function and segmentation region provided for embodiments of this application; Figure 3 This is a schematic diagram of contour expansion and contraction operations provided in an embodiment of this application; Figure 4 This is a schematic diagram of the structure of an image segmentation device provided in an embodiment of this application; Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with specific embodiments and accompanying drawings. It should be particularly noted that the embodiments described in this application are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0019] It should be noted that, unless otherwise defined, the technical or scientific terms used in the embodiments of this application should have the ordinary meaning understood by one of ordinary skill in the art to which this application pertains. The terms "first," "second," and similar terms used in the embodiments of this application do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" mean that the element or object preceding the word encompasses the elements or objects listed after the word and their equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are only used to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0020] As described earlier, nuclear medicine imaging provides functional metabolic information, making it a crucial tool for early disease diagnosis and efficacy assessment in current medical imaging diagnostic technologies. SPECT-CT, as a mainstream nuclear medicine device, achieves dual diagnosis of "functional + anatomical" through the fusion of SPECT functional images and CT anatomical images, making it irreplaceable in scenarios such as myocardial perfusion imaging for coronary heart disease, tumor metastasis assessment, and bone disease screening. SPECT-CT post-processing software is the core tool for image analysis. Its core functions include organ contouring and Region of Interest (ROI) extraction in medical image analysis, accurately locating target areas and calculating radioactive tracer uptake, providing quantitative evidence for clinical diagnosis. However, SPECT images themselves have low resolution and blurred lesion boundaries, easily obscuring small lesions or misjudging lesion size; furthermore, DICOM format fused images use an approximate multi-layer extraction method for ROI calculation, which can deviate from the actual situation, seriously affecting diagnostic accuracy. Meanwhile, in current SPECT-CT post-processing analysis software, organ contours and ROIs are mostly drawn manually. The mouse drag operation has a large error and it is difficult to match the actual organ tissue boundary, resulting in large errors between the contour line and the ROI area. In addition, a single analysis requires drawing more than a dozen organs or ROIs, which has the problems of large workload and long time consumption.
[0021] Through research, the inventors proposed an image segmentation method, apparatus, device, and storage medium. By preprocessing to clarify the initial segmentation benchmark, and by using a dual-loop separation iteration to achieve step-by-step optimization of contour convergence and smoothing, the method not only replaces the manual drawing operation, effectively avoiding the operation error caused by mouse dragging, but also makes the segmentation contour accurately fit the boundary of the real organ tissue, solving the problem of large errors in manually drawing contour lines or ROI regions. Furthermore, it significantly reduces the workload of segmenting multiple organs and multiple ROIs, shortens the overall processing time, and ultimately significantly improves the accuracy and efficiency of image segmentation.
[0022] To facilitate understanding of the technical solution of this application, the technical terms that may be used in this solution are explained here.
[0023] Single-Photon Emission Computed Tomography (SPECT): A nuclear medicine imaging technique that generates three-dimensional tomographic images by detecting the distribution of radioactive tracers in the body. It is widely used in the diagnosis of diseases such as heart disease, tumors, and bones.
[0024] Medical image analysis focuses on local areas of interest (ROI): such as diseased tissue or specific organs, which are usually determined by manual delineation or automatic segmentation by AI.
[0025] Tissue Polypeptide Specific Antigen (TPS): A tumor marker reference that can reflect tumor status and help determine disease conditions.
[0026] Image fusion technology: a processing technology that integrates multi-source image information, suitable for medical image analysis (such as SPECT / CT fused images).
[0027] Digital Imaging and Communications in Medicine (DICOM): Standardizes the storage, transmission, and analysis of medical images.
[0028] Level Set Algorithm: An algorithm for image segmentation that uses high-dimensional implicit functions to characterize the evolution of low-dimensional curves / surfaces.
[0029] Gaussian filtering: A linear smoothing filtering technique based on the Gaussian function, used to suppress noise, smooth images, and preserve image details.
[0030] The Heaviside function is a step function used to determine the sign of the level set function at a point, and it is often used in the region partitioning of level set algorithms.
[0031] Data-Driven Term: A curve evolution driving factor that depends on data features such as image grayscale, and determines the accuracy of segmentation.
[0032] Curve Smoothing Term: An evolutionary driving factor dependent on curve curvature, used to optimize the smoothness of segmentation contours.
[0033] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.
[0034] See Figure 1 This figure is a flowchart illustrating an image segmentation method provided in an embodiment of this application. Figure 1 As shown, the method includes: S101: Preprocess the DICOM medical image to obtain initial segmentation data.
[0035] The initial segmentation data includes a grayscale image, an initial level set, and an initial contour point set.
[0036] In this embodiment, preprocessing of DICOM medical images refers to performing standardization processes such as noise reduction and grayscale normalization on the DICOM format medical images output from SPECT-CT post-processing to obtain grayscale images that can be used for segmentation, an initial level set for characterizing contour evolution, and an initial contour point set for initiating iterations. Here, DICOM medical images refer to medical images that conform to medical digital imaging and communication standards, grayscale images are images represented by single-channel grayscale, the initial level set is an initial implicit function used to distinguish target regions from background regions, and the initial contour point set is an initial set of contour points determined based on the location of the target organ.
[0037] S102: Perform double-loop separation and iteration processing on the initial segmentation data to determine the target segmentation contour.
[0038] The dual-loop separation iteration process refers to dividing the contour evolution into a first loop iteration and a second loop iteration in sequence. The first loop iteration is used for contour convergence, and the second loop iteration is used for contour smoothing.
[0039] In this embodiment, the dual-loop separation iteration process refers to executing the first loop iteration and the second loop iteration in the order of contour evolution. The first loop iteration is driven by the image grayscale data and performs contour convergence iteration based on the grayscale features of the grayscale image, the initial level set, and the initial contour point set, so that the initial contour quickly approaches the boundary of the target organ. The second loop iteration performs smoothing iteration optimization on the converged contour, removing contour spikes and irregular fluctuations. After two rounds of iteration and step-by-step optimization, the final target segmentation contour that fits the real organ boundary and is smooth and complete is obtained.
[0040] S103: Determine the target segmentation result from the DICOM medical image based on the target segmentation contour.
[0041] In this embodiment, the corresponding organ region or region of interest (ROI) is extracted from the original DICOM medical image using the target segmentation contour as the boundary, forming a target segmentation result that can be used for subsequent quantitative analysis and clinical diagnosis. This result can be organ contour, ROI mask, or three-dimensional segmentation volume data.
[0042] In this embodiment, the DICOM medical image is preprocessed to obtain initial segmentation data to reduce image noise interference and ensure segmentation stability. The initial segmentation data includes a grayscale image, an initial level set, and an initial contour point set. Then, a dual-loop separation iterative process is performed on the initial segmentation data to determine the target segmentation contour. The dual-loop separation iterative process involves dividing the contour evolution into a first loop iteration and a second loop iteration. The first loop iteration is used for contour convergence, and the second loop iteration is used for contour smoothing. Convergence and smoothing are separated into two independent loops and executed step by step, balancing accuracy and speed. This results in a contour that is both accurate and smooth, significantly reducing errors and computational load, while also significantly improving segmentation efficiency. Finally, based on the target segmentation contour, the target segmentation result is determined from the DICOM medical image. Compared to the manual drawing method in the prior art, the method of this application uses a dual-loop separation iterative automated segmentation approach to optimize contour convergence and contour smoothing step by step, replacing the traditional manual drawing operation, eliminating human errors caused by mouse dragging, and ensuring that the segmentation contour accurately fits the boundaries of real organ tissues. This significantly reduces the workload and time spent on drawing, thereby improving the accuracy and efficiency of image segmentation.
[0043] Furthermore, based on the above embodiments, a specific implementation of "preprocessing the DICOM medical image to obtain initial segmentation data" in S101 includes the following steps: S1011: Perform grayscale normalization and noise suppression on the DICOM image to obtain a grayscale image.
[0044] In this embodiment, a DICOM format medical image for SPECT-CT post-processing is input, and grayscale normalization is performed on it to map the grayscale values to the range of 0-255. A preliminary mean filtering method is used to suppress noise, and image denoising and standardization are completed to ensure that the image quality meets the requirements of subsequent segmentation, resulting in a standard grayscale image.
[0045] S1012: Determine the initial contour based on the grayscale image, and initialize the level set function based on the initial contour to obtain the initial level set.
[0046] In this embodiment, an initial contour is set manually or automatically based on the approximate anatomical location of the target organ in the grayscale image, and the level set function is then applied based on this initial contour. Perform initialization assignment, marking the interior points of the initial contour C as... <0, the outer points of the initial contour C are marked as >0, for example, pixels inside the initial contour. =-1, outer pixel =1, thus distinguishing the target region from the background region and obtaining the initial level set. Here, C is a two-dimensional curve or three-dimensional surface defined by an implicit equation, and represents the segmented target contour.
[0047] The level set refers to the set of the hypothetical implicit function z = (x,t) (x=(x1,x2,…,xn)∈Rn) represents a high-dimensional space equation, whose low-dimensional space interface is... (x,t)=0. This equation divides the region into: (x,t)<0 (internal region of the contact surface) (x,t)=0 (the contact surface itself) (x,t)>0 (outer region of the contact surface). For example, a time-varying level set function z= in three-dimensional space is defined. (x,y,t), such as Figure 2 As shown, when t=t1, the red curve (contact surface) corresponding to the function divides the space into the blue target region (interior) and the background region (exterior). The level set function is defined in n-dimensional space as a function that changes with time t, and is used... (x,t)=0 is used to characterize the cross section for n-1 dimensional space.
[0048] S1013: Iterate through the initial level set and filter the inner and outer contour points to obtain the initial contour point set; the initial contour point set includes the inner contour point sequence and the outer contour point sequence.
[0049] In this embodiment, based on the already initialized initial level set function The image is traversed and the pixels that are close to the inner side of the initial contour are selected to form the inner contour point set Lin. At the same time, the pixels that are close to the outer side of the initial contour are selected to form the outer contour point set Lout. The inner contour point set Lin and the outer contour point set Lout together constitute the initial contour point set.
[0050] Wherein, the inner contour point sequence Lin is the set of internal points closely adhering to curve C, which can be represented as: The outer contour point set Lout is the set of external points that closely follow the curve C, and can be represented as: Specifically, D is the domain of the level set function, represented as (x, y) in a two-dimensional scene and (x, y, z) in a three-dimensional scene; Ω is the target region, which is the part of region D enclosed by C ( <0), D\Ω represents the background area.
[0051] In this embodiment, the DICOM image is subjected to grayscale normalization and noise suppression processing to obtain a grayscale image, which can effectively improve image quality and eliminate noise interference, providing a stable and reliable data foundation for subsequent segmentation iterations. Then, the initial contour is determined based on the grayscale image, and the level set function is initialized based on the initial contour to obtain the initial level set. The initial level set is then iterated and filtered to obtain the inner contour points and outer contour points to obtain the initial contour point set. The initial contour point set includes the inner contour point sequence and the outer contour point sequence. By normalizing and initializing the level set and the inner and outer contour point sets, accurate initial evolution boundaries can be quickly established, avoiding the operational errors and large delineation deviations caused by traditional manual drawing, significantly reducing the computational complexity of subsequent double loop iterations, improving the overall segmentation efficiency and the accuracy of the initial contour, and providing a prerequisite guarantee for achieving fast, accurate, and automated image segmentation.
[0052] Furthermore, based on the above embodiments, a specific implementation of "performing a double-loop separation iteration process on the initial segmentation data to determine the target segmentation contour" in S102 includes the following steps: S1021: Perform the first loop iteration on the initial segmentation data to obtain the initial segmentation contour and the corresponding converged contour point set.
[0053] The initial segmentation contour is the contour after convergence iteration; the convergence contour point set includes the convergence inner contour point sequence and the convergence outer contour point sequence that match the initial segmentation contour.
[0054] In this embodiment, a first loop iteration is performed on the initial segmentation data, which includes a grayscale image, an initial level set, and an initial contour point set. The contour convergence calculation is completed using the grayscale data as the driving force to obtain the initial segmentation contour that has approached the organ boundary. Simultaneously, a converged contour point set corresponding to the initial segmentation contour and used to characterize the inner and outer boundaries of the contour is generated. The initial segmentation contour refers to the contour that initially approximates the real organ after the convergence iteration is completed. The converged inner contour point set refers to the set of points that are close to the inner side of the initial segmentation contour, and the converged outer contour point set refers to the set of points that are close to the outer side of the initial segmentation contour.
[0055] S1022: Based on the initial segmented contour and the converged contour point set, a second loop iteration is performed to obtain the target segmented contour.
[0056] In this embodiment, based on the initial segmentation contour, a second loop iteration is performed with the converged contour point set as the object to smooth and optimize the contour, eliminate contour burrs and irregular fluctuations, and finally obtain a target segmentation contour that fits the real boundary of the organ and is complete and smooth.
[0057] In this embodiment, the initial segmentation data is processed in a first loop iteration to obtain the initial segmentation contour and the corresponding converged contour point set. The initial segmentation contour is the contour after convergence iteration. The converged contour point set includes the converged inner contour point set and the converged outer contour point set that match the initial segmentation contour. Based on the initial segmentation contour and the converged contour point set, a second loop iteration is performed to obtain the target segmentation contour. This decouples the data-driven convergence and curve smoothing-driven execution, avoiding the complex partial differential equation solving and curvature calculation in the traditional level set algorithm, greatly reducing computational complexity and improving segmentation speed.
[0058] As an achievable method, a specific implementation of "performing a first loop iteration on the initial segmentation data to obtain the initial segmentation contour and the corresponding convergent contour point set" in S1021 includes the following steps: S10211: Calculate the internal and external gray values corresponding to each contour point based on the initial contour point set.
[0059] In this embodiment, the inner contour point series Lin and the outer contour point series Lout in the initial contour point set are traversed, and the mean gray value Cin inside the contour and the mean gray value Cout outside the contour corresponding to each contour point are calculated.
[0060] S10212: Calculate the data-driven terms of each contour point using the mean internal and external gray values corresponding to each contour point, and obtain the basis for judging the contour convergence direction corresponding to each contour point.
[0061] Among them, the data-driven term depends on the evolution rate of the image grayscale data and determines the convergence direction of the contour towards the target region.
[0062] In this embodiment, the mean internal grayscale value Cin, the mean external grayscale value Cout, and the current grayscale value I of each contour point are substituted into the formula Fd=λout (I-Cout)²-λin (I-Cin)² to calculate the data-driven term Fd corresponding to each contour point. The direction of contour convergence is determined based on the sign of the data-driven term Fd, serving as the basis for judging contour expansion or contraction. Here, λin is the internal feature consistency weight, used to adjust the influence of the internal grayscale features of the contour on the curve evolution; λout is the external feature consistency weight, used to adjust the influence of the external grayscale features of the contour on the curve evolution.
[0063] S10213: Based on the contour convergence direction judgment criteria corresponding to each contour point, perform expansion or contraction operations on each contour point, and update the inner contour point list and the outer contour point list.
[0064] In this embodiment, reference Figure 3 The outline point expansion or contraction operation shown performs a switch-in operation on outline points in the outer outline point column Lout that satisfy Fd>0, moving them into the inner outline point column Lin and updating the outer outline point column Lout, thus expanding the outline outward; and performs a switch-out operation on points in the inner outline point column Lin that satisfy Fd<0, moving them into the outer outline point column Lout and updating the inner outline point column Lin, thus contracting the outline inward, thus completing the synchronous update of the inner outline point column Lin and the outer outline point column Lout.
[0065] S10214: Generate the initial segmentation contour based on the updated inner contour point list and the updated outer contour point list.
[0066] In this embodiment, the updated inner contour point set and outer contour point set are used as the boundary basis to form an initial segmentation contour that has completed convergence iteration towards the true boundary of the target organ. This contour is a segmentation contour that initially approximates the organ tissue.
[0067] S10215: Remove redundant points from the updated inner contour point set and the updated outer contour point set to obtain the converged contour point set.
[0068] Redundant points are contour points that, after being updated through contour expansion or contraction operations, do not contribute to the characterization of contour boundary morphology.
[0069] In this embodiment, the updated inner contour point set Lin is scanned, and redundant points located deep inside the current contour and not adjacent to external points are deleted. The updated outer contour point set Lout is scanned, and redundant points located deep outside the current contour and not adjacent to internal points are deleted. The inner and outer contour point sets after removing redundant points are combined to obtain a converged contour point set. Here, redundant points can be understood as contour points where, after updating the inner and outer contour point sets through contour expansion or contraction operations, the Euclidean distance between two adjacent contour points is less than a preset spacing threshold, or the line connecting them is in the same direction as the surrounding contour points and does not contribute to the characterization of the contour boundary shape.
[0070] In this embodiment, the internal and external gray values corresponding to each contour point are calculated based on the initial contour point set. The data-driven terms for each contour point are calculated using the mean internal and external gray values, providing a basis for determining the contour convergence direction. Based on this convergence direction, each contour point is expanded or contracted, and the inner and outer contour point sequences are updated. Based on the updated inner and outer contour point sequences, an initial segmentation contour is generated, which accurately drives the contour towards the target organ boundary based on image gray-scale features, clearly defining the contour evolution direction and effectively avoiding invalid iterations. Redundant points in the updated inner and outer contour point sequences are then removed, reducing unnecessary calculation points, optimizing the point set structure, and further reducing the iteration computation, thus obtaining a converged contour point set. This improves both the convergence efficiency and boundary positioning accuracy of the first loop and provides a regular and reliable contour foundation for subsequent smooth iterations, ensuring the stability and efficiency of the overall segmentation algorithm.
[0071] As an achievable method, a specific implementation of "performing a second loop iteration based on the initial segmented contour and the converged contour point set to obtain the target segmented contour" in S1022 includes the following steps: S10221: Perform Gaussian filtering on the initial segmented contour and the converged contour point set to obtain the gray value of each contour point.
[0072] In this embodiment, for example, a Gaussian filter with a size of 9×9 and a standard deviation σ=3 is used to perform Gaussian convolution operation on the gray values of all contour points in the convergent contour point set, smoothing the gray value distribution and suppressing noise interference, to obtain the processed gray value G(x) of each contour point. I(x). Where G(x) is the Gaussian convolution kernel function. In this embodiment, σ=3; I(x) is the gray value of the current contour point; This is the convolution operator; x represents the coordinates of the current contour point in the image.
[0073] S10222: Based on the gray values of each contour point, calculate the curve smoothing driving term corresponding to each contour point using a unit step function.
[0074] In this embodiment, based on the grayscale value of the contour point after Gaussian filtering, a grayscale similarity comparison is performed with the mean grayscale value Cin inside the contour and the mean grayscale value Cout outside the contour. If the grayscale value after Gaussian filtering is closer to the mean grayscale value Cin inside the contour, then the point is determined to be located inside the target region, and the level set function is applied. (x) is assigned a negative value; if it is closer to the outer gray mean Cout, then the point is determined to be outside the background area, and the level set function is adjusted accordingly. (x) is assigned a positive value, and then the above is... Substituting (x) into the Heaviside unit step function H( (x)) determines the position of each contour point within the level set function; the Heaviside function is used to determine the sign of the level set function for contour point x, and its expression is:
[0075] Among them, H( (x)) = 1 indicates that the point is outside the contour; H( (x)) = 0 indicates that the point is inside the contour.
[0076] Then, the curve smoothing driving term Fint=G(x) is calculated through Gaussian convolution. H( (x) serves as the control basis for contour smoothing evolution. Among them, the curve smoothing driving term depends on the smoothing speed of Gaussian filtering to optimize the smoothness of the contour.
[0077] S10223: Adjust the position of each contour point based on the curve smoothing driving term corresponding to each contour point to obtain a smooth segmented contour.
[0078] In this embodiment, the positions of the inner contour point series Lin and the outer contour point series Lout in the convergent contour point set are finely adjusted according to the value of the curve smoothing driving term Fint. Contour points that deviate from the smooth trajectory are moved and corrected in the direction of the overall contour trend. Sharp protrusions and burrs on the contour are removed, and valid points that are close to the current contour boundary are re-selected and retained, so that the positional changes between adjacent contour points remain continuous and uniform, thereby optimizing the smoothness and integrity of the contour and obtaining a smooth segmented contour.
[0079] S10224: When the smooth segmentation contour meets the preset convergence condition or the number of iterations reaches the preset maximum number of iterations, the smooth segmentation contour is determined as the target segmentation contour.
[0080] In this embodiment, for example, the preset convergence condition can be that for all outer contour points in the outer contour point column Lout of the convergence contour set, Fd≤0 and for all inner contour points in the inner contour point column Lin of the convergence contour set, Fd≥0. The iteration terminates when either the above preset convergence condition is met or the current iteration count reaches a preset maximum threshold, and the current smooth segmentation contour is taken as the target segmentation contour that fits the actual organ boundary and is completely smooth. To avoid infinite iteration, the preset maximum threshold can be adjusted according to the image complexity, such as 100 iterations.
[0081] Furthermore, based on the above embodiments, the method may further include: S10225: When the smooth segmentation contour does not meet the preset convergence condition and has not reached the preset maximum number of iterations, perform a second loop iteration process on the smooth segmentation contour until the smooth segmentation contour meets the preset convergence condition or the number of iterations reaches the preset maximum number of iterations.
[0082] In this embodiment, if the above-mentioned preset convergence condition is not met and the current iteration number has not reached the preset maximum threshold, the current smooth segmentation contour and the corresponding contour point set are used as the input data for the new round of the second loop iteration. The iterative operations of Gaussian filtering, curve smoothing driving term calculation, and contour point position adjustment are repeatedly executed to continuously optimize the contour smoothness and boundary accuracy until the smooth segmentation contour meets the preset convergence condition or the iteration number reaches the preset maximum iteration threshold. Then, the loop iteration is terminated to obtain the final target segmentation contour.
[0083] In this embodiment, Gaussian convolution is used instead of traditional curvature calculation. Gaussian filtering is applied to the initial segmentation contour and the converged contour point set to obtain the gray values of each contour point. This significantly simplifies the computational complexity of the smoothing process and improves the efficiency of contour optimization. Based on the gray values of each contour point, the curve smoothing driving term corresponding to each contour point is calculated using a unit step function. The position of each contour point is adjusted based on the curve smoothing driving term to obtain a smooth segmentation contour, which makes the segmentation edges more continuous, regular, and closer to the morphology of real organs. When the smooth segmentation contour meets the preset convergence condition or the number of iterations reaches the preset maximum number of iterations, the smooth segmentation contour is determined as the target segmentation contour. This ensures that the segmentation result is fully converged and avoids infinite iteration. While improving the smoothness and accuracy of segmentation, it also ensures that the algorithm runs efficiently and stably, improving the accuracy and reliability of the final output segmentation contour.
[0084] See Figure 4 This figure is a schematic diagram of the structure of an image segmentation device provided in an embodiment of this application. Figure 4 As shown, the device 30 includes a preprocessing module 31, a contour segmentation module 32, and a result determination module 33.
[0085] The preprocessing module 31 preprocesses the DICOM medical image to obtain initial segmentation data, which includes a grayscale image, an initial level set, and an initial contour point set. The contour segmentation module 32 performs a double-loop separation iterative process on the initial segmentation data to determine the target segmentation contour. The double-loop separation iterative process involves dividing the contour evolution into a first loop iteration and a second loop iteration; the first loop iteration is used for contour convergence, and the second loop iteration is used for contour smoothing. The result determination module 33 determines the target segmentation result from the DICOM medical image based on the target segmentation contour.
[0086] The image segmentation apparatus provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.
[0087] Furthermore, based on the above embodiments, the preprocessing module 31 may include a grayscale image determination module 311, an initialization module 312, and an initial contour point set determination module 313.
[0088] The grayscale image determination module 311 performs grayscale normalization and noise suppression on the DICOM image to obtain a grayscale image. The initialization module 312 determines the initial contour based on the grayscale image and initializes the level set function based on the initial contour to obtain an initial level set. The initial contour point set determination module 313 iterates through and filters the inner and outer contour points of the initial level set to obtain an initial contour point set; the initial contour point set includes an inner contour point column and an outer contour point column.
[0089] The image segmentation apparatus provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.
[0090] Furthermore, based on the above embodiments, the contour segmentation module 32 is specifically used to perform a first loop iteration process on the initial segmentation data to obtain an initial segmentation contour and a corresponding converged contour point set; the initial segmentation contour is the contour after convergence iteration; the converged contour point set includes a converged inner contour point set and a converged outer contour point set that match the initial segmentation contour; and a second loop iteration process is performed based on the initial segmentation contour and the converged contour point set to obtain the target segmentation contour.
[0091] The image segmentation apparatus provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.
[0092] Furthermore, based on the above embodiments, when performing a first loop iteration on the initial segmentation data to obtain the initial segmentation contour and the corresponding converged contour point set, the contour segmentation module 32 is specifically used to calculate the internal grayscale mean and external grayscale mean of each contour point based on the initial contour point set; to perform expansion or contraction operations on each contour point according to the contour convergence direction judgment criteria corresponding to each contour point, and to update the inner contour point list and the outer contour point list; to generate the initial segmentation contour based on the updated inner contour point list and the updated outer contour point list; to remove redundant points in the updated inner contour point list and the updated outer contour point list to obtain the converged contour point set; the redundant points are contour points that do not contribute to the characterization of the contour boundary morphology after the inner contour point list and the outer contour point list are updated by contour expansion or contraction operations.
[0093] The image segmentation apparatus provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.
[0094] Furthermore, based on the above embodiments, when performing a second loop iteration based on the initial segmented contour and the converged contour point set to obtain the target segmented contour, the contour segmentation module 32 is specifically used to perform Gaussian filtering on the initial segmented contour and the converged contour point set to obtain the gray value of each contour point; based on the gray value of each contour point, the curve smoothing driving term corresponding to each contour point is calculated using a unit step function; the position of each contour point is adjusted based on the curve smoothing driving term corresponding to each contour point to obtain a smoothed segmented contour; when it is determined that the smoothed segmented contour meets the preset convergence condition or the number of iterations reaches the preset maximum number of iterations, the smoothed segmented contour is determined as the target segmented contour.
[0095] The image segmentation apparatus provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.
[0096] Furthermore, based on the above embodiments, the contour segmentation module 32 is also used to perform a second loop iteration process on the smooth segmentation contour when the smooth segmentation contour does not meet the preset convergence condition and has not reached the preset maximum number of iterations, until the smooth segmentation contour meets the preset convergence condition or the number of iterations reaches the preset maximum number of iterations.
[0097] The image segmentation apparatus provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.
[0098] See Figure 5 The figure is a schematic diagram of the structure of an electronic device provided in an embodiment of this application, including: Memory 11 is used to store computer programs; The processor 12 is configured to implement the steps of the image segmentation method described in any of the above method embodiments when executing the computer program.
[0099] In this embodiment, the device can be an in-vehicle computer, a PC (Personal Computer), or a terminal device such as a smartphone, tablet computer, handheld computer, or portable computer.
[0100] The device may include a memory 11, a processor 12, and a bus 13.
[0101] The memory 11 includes at least one type of readable storage medium, such as flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 11 may be an internal storage unit of the device, such as the hard disk of the device. In other embodiments, the memory 11 may be an external storage device of the device, such as a plug-in hard disk, SmartMedia Card (SMC), Secure Digital (SD) card, Flash Card, etc. Furthermore, the memory 11 may include both internal and external storage units of the device. The memory 11 can be used not only to store application software and various types of data installed on the device, such as program code for executing image segmentation methods, but also to temporarily store data that has been output or will be output. In some embodiments, the processor 12 may be a Central Processing Unit (CPU).
[0102] In some embodiments, processor 12 may be a central processing unit (CPU), controller, microcontroller, microprocessor or other data processing chip, used to run program code stored in memory 11 or process data, such as program code for executing an image segmentation method.
[0103] This bus 13 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 5 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0104] Furthermore, the device may also include a network interface 14, which may optionally include a wired interface and / or a wireless interface (such as a Wi-Fi interface, a Bluetooth interface, etc.), typically used to establish communication connections between the device and other electronic devices.
[0105] Optionally, the device may further include a user interface 15, which may include a display, an input unit such as a keyboard, and optionally, a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen, etc. The display may also be appropriately referred to as a screen or display unit, used to display information processed in the device and to display a visual user interface.
[0106] Figure 5 Only devices with components 11-15 are shown; those skilled in the art will understand that... Figure 5 The structure shown does not constitute a limitation on the device and may include fewer or more components than shown, or combine certain components, or have different component arrangements.
[0107] Based on the same inventive concept, corresponding to the methods of any of the above embodiments, this application also provides a computer-readable storage medium storing computer instructions for causing the computer to perform the methods described in any of the above embodiments.
[0108] The computer-readable media in this application embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media 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 memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.
[0109] The computer instructions stored in the storage medium of the above embodiments are used to cause the computer to perform the methods described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0110] It should be noted that the various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for methods, apparatuses, electronic devices, and media, since they are basically similar to the method embodiments, the descriptions are relatively simple, and relevant parts can be referred to the descriptions of the method embodiments. The methods, apparatuses, electronic devices, and media described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components indicated as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of the solution in this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0111] The above description is merely one specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. An image segmentation method, characterized in that, include: Preprocessing DICOM medical images yields initial segmentation data; The initial segmentation data includes a grayscale image, an initial level set, and an initial contour point set; The initial segmentation data is subjected to a double-loop separation and iteration process to determine the target segmentation contour; Dual-loop separation iterative processing refers to dividing the contour evolution into a first loop iteration and a second loop iteration in sequence. The first loop iteration is used for contour convergence, and the second loop iteration is used for contour smoothing. Based on the target segmentation contour, the target segmentation result is determined from the DICOM medical image.
2. The method according to claim 1, characterized in that, The preprocessing of the DICOM medical image to obtain initial segmentation data includes: The DICOM image is subjected to grayscale normalization and noise suppression processing to obtain a grayscale image; An initial contour is determined based on the grayscale image, and the level set function is initialized based on the initial contour to obtain an initial level set. The initial horizontal set is traversed and filtered to select inner contour points and outer contour points to obtain an initial contour point set; the initial contour point set includes an inner contour point column and an outer contour point column.
3. The method according to claim 2, characterized in that, The step of performing a double-loop separation and iteration process on the initial segmented data to determine the target segmentation contour includes: The initial segmentation data is subjected to a first loop iteration to obtain the initial segmentation contour and the corresponding converged contour point set; the initial segmentation contour is the contour after convergence iteration; the converged contour point set includes the converged inner contour point set and the converged outer contour point set that match the initial segmentation contour. Based on the initial segmentation contour and the converged contour point set, a second loop iteration is performed to obtain the target segmentation contour.
4. The method according to claim 3, characterized in that, The first loop iteration processing of the initial segmentation data to obtain the initial segmentation contour and the corresponding converged contour point set includes: Based on the initial set of contour points, the mean internal gray value and the mean external gray value corresponding to each contour point are calculated. The data-driven terms of each contour point are calculated using the mean internal and mean external gray values, thus obtaining the basis for judging the contour convergence direction of each contour point. Based on the contour convergence direction judgment criteria corresponding to each contour point, the contour points are expanded or contracted, and the inner contour point column and the outer contour point column are updated. The initial segmentation contour is generated based on the updated inner contour point set and the updated outer contour point set; Redundant points are removed from the updated inner contour point set and the updated outer contour point set to obtain a converged contour point set; the redundant points are contour points that do not contribute to the characterization of the contour boundary shape after the inner contour point set and the outer contour point set are updated by contour expansion or contraction operations.
5. The method according to claim 3, characterized in that, The second iterative process based on the initial segmented contour and the converged contour point set to obtain the target segmented contour includes: Gaussian filtering is applied to the initial segmented contour and the converged contour point set to obtain the gray value of each contour point. Based on the gray values of each contour point, the curve smoothing driving term corresponding to each contour point is calculated using a unit step function. The position of each contour point is adjusted based on the curve smoothing driving term corresponding to each contour point to obtain a smooth segmentation contour. When the smooth segmentation contour satisfies the preset convergence condition or the number of iterations reaches the preset maximum number of iterations, the smooth segmentation contour is determined as the target segmentation contour.
6. The method according to claim 5, characterized in that, The method further includes: When the smooth segmentation contour does not meet the preset convergence condition and has not reached the preset maximum number of iterations, a second loop iteration process is performed on the smooth segmentation contour until the smooth segmentation contour meets the preset convergence condition or the number of iterations reaches the preset maximum number of iterations.
7. An image segmentation apparatus, characterized in that, include: The preprocessing module is used to preprocess DICOM medical images to obtain initial segmentation data; The initial segmentation data includes a grayscale image, an initial level set, and an initial contour point set; The contour segmentation module is used to perform a double-loop separation and iteration process on the initial segmentation data to determine the target segmentation contour. Dual-loop separation iterative processing refers to dividing the contour evolution into a first loop iteration and a second loop iteration in sequence. The first loop iteration is used for contour convergence, and the second loop iteration is used for contour smoothing. The result determination module is used to determine the target segmentation result from the DICOM medical image based on the target segmentation contour.
8. The apparatus according to claim 7, characterized in that, The preprocessing module includes: The grayscale image determination module is used to perform grayscale normalization and noise suppression processing on the DICOM image to obtain a grayscale image; An initialization module is used to determine an initial contour based on the grayscale image and to initialize the level set function based on the initial contour to obtain an initial level set. The initial contour point set determination module is used to traverse and filter the inner contour points and outer contour points of the initial horizontal set to obtain the initial contour point set; the initial contour point set includes the inner contour point column and the outer contour point column.
9. An electronic device, characterized in that, The device includes: a processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1 to 6.