An automatic segmentation method for multi-contact electrodes in brain surgery based on CT images

Through Canny edge detection and region growing technology combined with threshold adaptive models, CT images are accurately segmented with multi-contact electrodes, which solves the problems of low segmentation accuracy and poor anti-noise ability in the existing technology, and achieves efficient automated segmentation. Improved accuracy and safety of brain surgery.

CN118710667BActive Publication Date: 2024-10-29JILIN UNIV FIRST HOSPITAL
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411183760.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-27
Publication Date
2024-10-29
Estimated Expiration
2044-08-27

AI Technical Summary

Technical Problem

Existing multi-contact electrode segmentation methods based on CT images have problems such as low segmentation accuracy, poor noise immunity, and poor adaptability.

Method used

The Canny edge detection algorithm and region growing technology are used to perform edge detection and segmentation on CT images, combined with the threshold adaptive acquisition model and three-dimensional reconstruction technology to achieve accurate segmentation of multi-contact electrodes.

Benefits of technology

It improves the segmentation accuracy and anti-noise ability, enhances the adaptability of the segmentation algorithm, provides an automated multi-contact electrode segmentation method, reduces manual intervention, and improves the safety and effectiveness of brain surgery.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118710667B_ABST
    Figure CN118710667B_ABST
Patent Text Reader

Abstract

The present invention discloses an automatic segmentation method for multi-contact electrodes in brain surgery based on CT images, including obtaining an initial CT image of a patient's brain; using a Canny edge detection algorithm to perform edge detection on the initial CT image of the brain to extract the initial edges of the multi-contact electrodes; performing regional growth on the initial edges to obtain an initial segmentation result of the multi-contact electrodes; performing fine segmentation on the initial segmentation result; using the fine segmentation result to perform three-dimensional reconstruction on the multi-contact electrodes to obtain a three-dimensional model of the multi-contact electrodes; and evaluating the segmentation result. The present invention does not require manual intervention, greatly improving the efficiency and accuracy of segmentation; by pre-processing CT images, denoising and smoothing, the image quality is improved, and the influence of noise and artifacts on the segmentation results is reduced; a variety of image segmentation and feature extraction technologies are used to enhance the adaptability and robustness of the segmentation algorithm; each contact of the multi-contact electrode is accurately segmented, improving the safety and effectiveness of the operation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of medical image processing, and in particular to an automatic segmentation method for multi-contact electrodes in brain surgery based on CT images. Background Art

[0002] With the development of medical technology, the positioning and segmentation accuracy of multi-contact electrodes in brain surgery are increasingly required. At present, the segmentation of multi-contact electrodes mainly depends on the experience and skills of doctors, which is subjective and uncertain. Therefore, it is of great clinical value to study an automatic segmentation method of multi-contact electrodes based on CT images.

[0003] In the prior art, some segmentation methods based on CT images have been applied, but these methods generally have problems such as low segmentation accuracy, poor noise resistance, and poor adaptability. Therefore, it is necessary to study an automatic segmentation method for multi-contact electrodes in brain surgery based on CT images with high accuracy, strong noise resistance, and good adaptability. Summary of the invention

[0004] The purpose of this section is to summarize some aspects of embodiments of the present invention and briefly introduce some preferred embodiments. Some simplifications or omissions may be made in this section and the specification abstract and the invention title of this application to avoid blurring the purpose of this section, the specification abstract and the invention title, and such simplifications or omissions cannot be used to limit the scope of the present invention.

[0005] In view of the problems existing in the above-mentioned existing segmentation methods based on CT images, the present invention is proposed.

[0006] Therefore, the technical problem solved by the present invention is to solve the problems of low segmentation accuracy, poor noise resistance and poor adaptability of the existing segmentation method based on CT images.

[0007] In order to solve the above technical problems, the present invention provides the following technical solutions: a method for automatic segmentation of multi-contact electrodes in brain surgery based on CT images, comprising the following steps: S1: implanting multi-contact electrodes in the patient's brain and obtaining the patient's brain CT initial image; S2: using the Canny edge detection algorithm to perform edge detection on the initial brain CT image and extracting the initial edges of the multi-contact electrodes; S3: performing regional growth on the initial edges to obtain the initial segmentation results of the multi-contact electrodes; S4: performing fine segmentation on the initial segmentation results; S5: using the fine segmentation results to perform three-dimensional reconstruction on the multi-contact electrodes to obtain a three-dimensional model of the multi-contact electrodes; S6: evaluating the segmentation results; wherein, after obtaining the initial brain CT image, the initial brain CT image is also evaluated. The initial image is preprocessed; wherein the preprocessing steps include: grayscale, smoothing filtering, grayscale gradient enhancement, and multi-scale gradient enhancement; wherein the Canny edge detection algorithm is used to detect the edge of the initial brain CT image, and the initial edge of the multi-contact electrode is extracted, which specifically includes the following steps: Q1: obtaining the preprocessed initial brain CT image; Q2: using the Sobel operator or the Prewitt operator to calculate the horizontal and vertical gradients of the image to obtain a gradient image, and synchronously calculating the amplitude and direction of the gradient, the amplitude represents the strength of the edge, and the direction represents the direction of the edge; Q3: performing non-maximum suppression on the gradient amplitude image, removing pixels that are not local maxima, and retaining potential edge points; Q4: setting the lower threshold and Upper threshold, pixels below the lower threshold are regarded as noise, and pixels above the upper threshold will be connected to form an initial edge; Q5: Apply the hysteresis threshold algorithm to connect the edge pixels detected by the lower threshold to the edge pixels detected by the upper threshold; Q6: Use Robert's thinning algorithm to thin the edges detected by the double threshold; Q7: According to the edge points detected in the above steps, the initial edge of the multi-touch electrode is extracted; wherein, the initial edge is regionally grown to obtain the initial segmentation result of the multi-touch electrode, which specifically includes the following steps: W1: Select one or more significant edge points from the initial edge image as initial seed points; W2: Calculate the neighborhood pixels for each seed point; W3: For each neighborhood pixel, according to the predetermined The similarity metric standard defined by the algorithm is used to determine whether the pixel belongs to the target area where the seed point is located; W4: the neighboring pixels belonging to the target area are added to the seed point set to form a new seed point set; W5: steps 2 to 4 are repeated for the new seed point set to perform iterative region growing; W6: the iterative process ends and the final segmentation result is output, in which the pixels belonging to the target area are marked as 1 and the pixels not belonging to the target area are marked as 0; wherein, the fine segmentation of the initial segmentation result specifically includes the following steps: T1: extracting the area of ​​the multi-contact electrode from the initial segmentation result, calculating the total number of pixels in the area, and obtaining the area A of the electrode; T2: calculating the average gray value B of all pixels in the multi-contact electrode area;T3: construct a threshold adaptive acquisition model, input the electrode area A and the average gray value B, and output the acquired adaptive threshold; T4: use the calculated adaptive threshold to perform binarization on the initial segmentation result; wherein the constructed threshold adaptive acquisition model is specifically:;

[0008]

[0009] Wherein, δ is an adaptive threshold, A is the area of ​​the electrode, B is the average grayscale value, 1.25, 1.251 and 2.77 are adjustment constants, and dx is an integral operation; wherein, the three-dimensional reconstruction of the multi-contact electrode using the fine segmentation result to obtain the three-dimensional model of the multi-contact electrode specifically includes the following steps: R1: extracting the area of ​​the multi-contact electrode from the fine segmentation result; R2: constructing a three-dimensional coordinate system according to the parameters of the CT scan; R3: performing interpolation calculation on the extracted electrode area to generate a continuous three-dimensional surface; R4: generating a three-dimensional model of the multi-contact electrode using the continuous surface obtained by interpolation calculation; R5: optimizing the generated three-dimensional model.

[0010] The present invention provides a method for automatic segmentation of multi-contact electrodes in brain surgery based on CT images, which has the following beneficial effects:

[0011] 1. The present invention provides an automated brain surgery multi-contact electrode segmentation method that does not require manual intervention and greatly improves segmentation efficiency and accuracy.

[0012] 2. By preprocessing CT images, denoising and smoothing, the image quality is improved and the impact of noise and artifacts on the segmentation results is reduced.

[0013] 3. The use of multiple image segmentation and feature extraction techniques, such as threshold segmentation, region growing and machine learning algorithms, enhances the adaptability and robustness of the segmentation algorithm.

[0014] 4. The present invention can accurately segment the individual contacts of a multi-contact electrode, provide precise image guidance for brain surgery, and improve the safety and effectiveness of the surgery. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. Among them:

[0016] Figure 1 The present invention provides a method flow chart of the automatic segmentation method of multi-contact electrodes in brain surgery based on CT images.

[0017] Figure 2 A flow chart of a method for performing edge detection on an initial brain CT image and extracting initial edges of multi-contact electrodes provided by the present invention using a Canny edge detection algorithm.

[0018] Figure 3 A flow chart of a method for performing region growth on initial edges to obtain initial segmentation results of multi-contact electrodes provided by the present invention.

[0019] Figure 4 A flow chart of a method for fine segmentation of an initial segmentation result provided by the present invention.

[0020] Figure 5 A flow chart of a method for performing three-dimensional reconstruction of multi-contact electrodes using fine segmentation results to obtain a three-dimensional model of the multi-contact electrodes provided by the present invention. DETAILED DESCRIPTION

[0021] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.

[0022] Multi-contact electrodes in brain surgery are a type of medical device used for deep brain stimulation (DBS). DBS surgery is a surgical method for treating neurological diseases such as Parkinson's disease, dystonia, and epilepsy. In this surgery, doctors implant electrodes into the deep structures of the patient's brain and regulate neural activity by electrically stimulating these areas, thereby alleviating the patient's symptoms.

[0023] Compared with traditional single-contact electrodes, multi-contact electrodes have several key features:

[0024] Multi-contact design: Multi-contact electrodes have multiple contact points that can stimulate multiple brain areas simultaneously, which helps to more finely modulate neural activity, potentially improving treatment effectiveness.

[0025] Directionality: Multi-contact electrodes are usually designed with specific stimulation directions, allowing doctors to more precisely control the area of ​​electrical stimulation and reduce interference with irrelevant brain areas.

[0026] Sensing function: Some advanced multi-contact electrode systems have brain sensing functions, which can monitor the brain's electrical activity in real time and adjust stimulation parameters based on this information to achieve more personalized treatment.

[0027] Implantability and Adjustability: The multi-contact electrodes are designed for long-term implantation, and their stimulation parameters can be remotely adjusted via an external device post-operatively to accommodate changes in the patient's symptoms.

[0028] During surgery, doctors use special imaging techniques and navigation systems to precisely locate the electrodes. After surgery, the electrodes are connected to an implanted pulse generator (IPG) via wires. This pulse generator generates electrical stimulation according to the doctor's programming and transmits it to the electrodes, thereby affecting the brain's neural activity.

[0029] The use of multi-contact electrodes has greatly improved the precision and personalization of DBS surgery, providing patients with more effective treatment options.

[0030] At present, some segmentation methods based on CT images have been used in the process of multi-contact electrode surgery in brain surgery, but these methods generally have problems such as low segmentation accuracy, poor noise resistance, and poor adaptability. Therefore, it is necessary to study an automatic segmentation method for multi-contact electrodes in brain surgery based on CT images with high accuracy, strong noise resistance and good adaptability.

[0031] Therefore, please refer to Figure 1 The present invention provides a method for automatic segmentation of multi-contact electrodes in brain surgery based on CT images, comprising the following steps:

[0032] S1: Multi-contact electrodes are implanted in the patient's brain to obtain the initial CT image of the patient's brain;

[0033] In the actual operation process, the following specific steps are usually included:

[0034] 1. Patient preparation:

[0035] The patient is placed in the CT scanner and is ensured to be comfortable and immobile.

[0036] If the patient has multi-contact electrodes implanted in their body, it is necessary to ensure that the electrodes do not move or cause interference during the scan.

[0037] 2.CT scanning parameter settings:

[0038] Select an appropriate CT scan volume, usually covering the entire head.

[0039] The slice thickness and spacing of the scan were set to ensure sufficient resolution to observe the electrodes and surrounding brain tissue.

[0040] The contrast and brightness of the CT scan are set so that the brain structures can be seen clearly.

[0041] 3. Scanning process:

[0042] The CT scanner sends X-rays through the patient's head.

[0043] Each pixel in the patient's head receives X-rays and generates a signal based on how much the X-rays are attenuated as they pass through the head.

[0044] This signal is converted into digital data and constructed into a three-dimensional image.

[0045] 4. Image reconstruction:

[0046] The acquired raw data is sent to the computer system for image reconstruction.

[0047] The reconstruction algorithm uses this data to generate images in the transverse, sagittal, and coronal planes.

[0048] 5. Image Analysis:

[0049] A neurosurgeon or radiologist analyzes the CT images to determine the location and orientation of the electrodes.

[0050] Your doctor will use specialized software tools to mark the location of the electrodes and assess their relationship to the surrounding tissue.

[0051] 6. Data export and recording:

[0052] The finalized CT images are exported into digital formats, such as DICOM format, for easy storage and further analysis.

[0053] The physician's analysis and the patient's CT image records are archived for subsequent surgical planning and treatment tracking.

[0054] Throughout the process, ensuring the patient's comfort and safety is of utmost importance. In addition, doctors and technicians need to ensure that the quality of CT images meets clinical needs in order to accurately assess the location of electrodes and the condition of brain tissue.

[0055] Furthermore, after obtaining the initial brain CT image, the method further includes performing image preprocessing on the initial brain CT image;

[0056] Among them, the preprocessing steps include: grayscale, smoothing filtering, grayscale gradient enhancement, and multi-scale gradient enhancement.

[0057] It should be noted that the above preprocessing steps are described as follows:

[0058] 1. Grayscale:

[0059] Purpose: To convert color CT images into grayscale images to simplify image analysis and processing.

[0060] Technical details: By calculating the average or weighted average of the color channels (such as RGB) of each pixel, a single grayscale value is obtained to represent the brightness of the pixel.

[0061] 2. Smoothing filtering:

[0062] Purpose: To reduce noise and artifacts in images and improve image quality.

[0063] Technical details: Use a low-pass filter, such as a Gaussian filter, to smooth the image. A low-pass filter allows low-frequency details to pass through while suppressing high-frequency noise.

[0064] 3. Grayscale gradient enhancement:

[0065] Purpose: To increase the contrast between the object and the background in an image, making important structures more prominent.

[0066] Technical details: By calculating the gradient of the image (that is, the rate of change of pixel values), and then performing nonlinear enhancement on the gradient, such as using the Sobel operator, Prewitt operator, or Laplacian operator.

[0067] 4. Multi-scale gradient enhancement:

[0068] Purpose: Enhance the contrast of images at different scales to highlight structures of different sizes.

[0069] Technical details: Apply different filters (such as Gaussian filters) to smooth the image at different scales, and then perform gradient enhancement at each scale. This method can enhance both the details and the overall structure of the image at the same time.

[0070] Through these preprocessing steps, the original CT image can be converted into a format more suitable for subsequent analysis and segmentation. Grayscale reduces color information, making subsequent processing easier; smoothing filtering reduces noise and makes gradient enhancement more effective; grayscale gradient enhancement and multi-scale gradient enhancement are both designed to improve the visibility of important structures in the image and provide better input for subsequent automatic segmentation.

[0071] S2: Use the Canny edge detection algorithm to perform edge detection on the initial brain CT image and extract the initial edges of the multi-contact electrodes. Figure 2 , specifically including the following steps:

[0072] Q1: Obtain the initial brain CT image after preprocessing;

[0073] Q2: Use the Sobel operator or Prewitt operator to calculate the horizontal and vertical gradients of the image to obtain a gradient image, and simultaneously calculate the magnitude and direction of the gradient. The magnitude represents the strength of the edge, and the direction represents the direction of the edge.

[0074] In the step of calculating the gradient, the Sobel operator or Prewitt operator is used to detect the edges in the image. The following are the detailed steps of this step:

[0075] 1. Apply Sobel operator or Prewitt operator:

[0076] The Sobel operator and the Prewitt operator are both linear filters used to calculate the gradient of an image. They correspond to the horizontal and vertical directions of the image respectively.

[0077] To calculate the horizontal gradient, the image is filtered using the x component of the Sobel operator or the horizontal component of the Prewitt operator.

[0078] To calculate the vertical gradient, the image is filtered using the y component of the Sobel operator or the vertical component of the Prewitt operator.

[0079] 2. Calculate the magnitude of the gradient:

[0080] Square the gradient values ​​in the horizontal and vertical directions.

[0081] Add the squared values ​​in both directions and take the square root to get the magnitude of the gradient.

[0082] The amplitude value reflects the strength of the edge, that is, the sharper the edge, the larger the amplitude value.

[0083] 3. Calculate the direction of the gradient:

[0084] The direction of the gradient can be found by calculating the ratio of the horizontal and vertical gradients.

[0085] The arctan function is used to calculate the direction of the gradient, which ranges from 0 to π (or from 0 degrees to 180 degrees).

[0086] The angle of the direction may represent the inclination angle of the edge line, that is, the direction of the edge line.

[0087] 4. Generate gradient image:

[0088] The calculated gradient magnitudes and directions are combined into an image that shows the strength and direction of all edge points in the image.

[0089] Typically, the gradient magnitude is used to show the strength of the edge, while the gradient direction is displayed in color coding to visually represent the direction of the edge.

[0090] Through the above steps, a gradient image containing all edge points in the image and their intensity and direction can be obtained. This gradient image will provide key information for subsequent edge detection and image segmentation.

[0091] Further explanation:

[0092] a. Steps for calculating gradient using Sobel operator:

[0093] Select the Sobel operator, which contains two kernel functions: one for detecting edges in the horizontal direction and the other for detecting edges in the vertical direction.

[0094] The Sobel kernel function is applied to the preprocessed CT image to obtain the gradient images in the horizontal and vertical directions.

[0095] Calculate the gradient magnitude of each pixel, that is, the absolute value of the sum of the horizontal and vertical gradients.

[0096] Calculate the gradient direction of each pixel, that is, the value of the arctan function of the sum of the horizontal and vertical gradients.

[0097] Outputs a gradient image containing gradient magnitude and direction.

[0098] b. Steps for calculating the gradient of the Prewitt operator:

[0099] Select the Prewitt operator, which also contains two kernel functions: one for detecting edges in the horizontal direction and the other for detecting edges in the vertical direction.

[0100] The Prewitt kernel function is applied to the preprocessed CT image to obtain the gradient images in the horizontal and vertical directions.

[0101] Calculate the gradient magnitude of each pixel, that is, the absolute value of the sum of the horizontal and vertical gradients.

[0102] Calculate the gradient direction of each pixel, that is, the value of the arctan function of the sum of the horizontal and vertical gradients.

[0103] Outputs a gradient image containing gradient magnitude and direction.

[0104] In practical applications, both the Sobel operator and the Prewitt operator can be used to detect edges, but their kernel functions and calculation methods are slightly different. The Sobel operator usually provides a stronger edge response, while the Prewitt operator provides a smoother edge detection. Which operator to choose depends on the specific application requirements and the characteristics of the image.

[0105] Q3: Perform non-maximum suppression on the gradient amplitude image, remove pixels that are not local maxima, and retain potential edge points;

[0106] It should be noted that:

[0107] ⑴The basic principle of non-maximum suppression:

[0108] In a gradient image, each pixel represents a gradient amplitude, which reflects the magnitude of the brightness change around the point.

[0109] The purpose of non-maximum suppression is to remove pixels that do not have the largest gradient magnitude in their surrounding neighborhood.

[0110] The purpose of this is to retain true edge points while suppressing those pixels that may be caused by noise or other non-edge factors.

[0111] ⑵Specific technical steps:

[0112] Traverse each pixel in the gradient magnitude image.

[0113] For the current pixel, calculate the gradient magnitude of all pixels in its surrounding neighborhood (usually a neighborhood window, such as a 3x3 or 5x5 square window).

[0114] Compare the gradient magnitude of the current pixel with the gradient magnitudes of all pixels in its neighborhood. If the gradient magnitude of the current pixel is not the maximum value, set its gradient magnitude to zero, i.e., suppress the point.

[0115] Repeat the above steps until all pixels are traversed.

[0116] ⑶Technology and precautions:

[0117] The choice of the neighborhood window should be determined according to the resolution and smoothness of the image to ensure that edge points can be effectively identified while avoiding over-suppression.

[0118] In practical applications, it may be necessary to adjust the size of the neighborhood window and the strength of suppression according to specific circumstances.

[0119] For the gradient direction image, a similar process can be performed to suppress it by comparing the difference in gradient direction between the current pixel and its neighborhood.

[0120] This helps enhance edge definition and continuity.

[0121] Q4: Set the lower threshold and upper threshold. Pixels below the lower threshold are considered as noise, and pixels above the upper threshold are connected to form the initial edge.

[0122] It should be noted that the double threshold detection steps are as follows:

[0123] Set two thresholds, a lower threshold and a higher upper threshold.

[0124] A low threshold is used to determine the likelihood of an edge, and a high threshold is used to determine a true edge.

[0125] Pixels below the low threshold are considered noise, and pixels above the high threshold are connected to form initial edges.

[0126] In the Canny edge detection algorithm, double threshold detection is a key step, which helps to distinguish true edge points from noise points. The following are specific examples and explanations of these two thresholds:

[0127] Further:

[0128] Low Threshold:

[0129] The lower threshold is usually set based on the prevalent strength level of edges in the image. It should be low enough to include most edge points, but high enough to exclude most noise points.

[0130] For example, if edge points in an image generally have low intensities (e.g., 0 to 50), then a lower threshold value such as 10 can be set so that most edge points will be included.

[0131] The selection of the lower threshold can also be determined by statistical methods, such as calculating the mean and standard deviation of all gradient amplitudes in the image, and then selecting a value lower than the mean plus a certain multiple (for example, 2 times the standard deviation) as the lower threshold.

[0132] High Threshold:

[0133] The upper threshold is usually set higher than the lower threshold to ensure that only really strong edge points are detected as edges.

[0134] The selection of the upper threshold can be based on the maximum strength of the edge in the image. For example, if the maximum edge strength in the image is 200, then an upper threshold such as 150 can be set.

[0135] Similar to the lower threshold, the upper threshold can also be determined by more complex statistical methods, such as using percentiles to select a value of the maximum gradient magnitude above a certain percentage (e.g., 90%) as the upper threshold.

[0136] In practical applications, the selection of the lower threshold and upper threshold is very important because they directly affect the sensitivity and accuracy of edge detection. If the lower threshold is set too high, some edges may be missed; if it is set too low, it may contain too much noise. If the upper threshold is set too low, it may cause edge breakage; if it is set too high, some important edge information may be missed.

[0137] In order to determine the best threshold, experiments are usually conducted to find the best threshold combination by observing the edge detection results under different threshold settings. In addition, adaptive threshold methods are sometimes used to automatically adjust the threshold according to the local characteristics of the image to improve the adaptability and accuracy of edge detection.

[0138] Q5: Apply the hysteresis threshold algorithm to connect the edge pixels detected by the lower threshold to the edge pixels detected by the upper threshold;

[0139] It should be noted that:

[0140] ⒈Basic principle of hysteresis threshold algorithm:

[0141] The hysteresis threshold algorithm consists of two thresholds: a lower threshold and a higher upper threshold.

[0142] The lower threshold is used to preliminarily detect edge pixels, while the upper threshold is used to confirm whether these edge pixels are actually edges.

[0143] The algorithm constructs a complete edge by connecting pixels detected by the lower threshold to pixels detected by the upper threshold.

[0144] ⒉Specific technical steps:

[0145] Initialize a marker image to store the final edge pixels.

[0146] The gradient magnitude image is binarized using the lower threshold to obtain preliminary edge pixels.

[0147] For each edge pixel initially detected, check whether the pixels in its neighborhood also meet the lower threshold condition. If so, mark it as an edge pixel.

[0148] Next, for each pixel in the labeled image, if its gradient magnitude is less than an upper threshold, it is removed from the labeled image.

[0149] Repeat the above steps until all pixels in the labeled image meet the upper threshold condition.

[0150] ⒊Techniques and precautions:

[0151] The lower threshold is usually set low in order to capture as many edge pixels as possible.

[0152] The upper threshold is set higher to ensure that the marked pixels actually belong to the edge.

[0153] In practical applications, the selection of the lower threshold and the upper threshold should be adjusted according to the characteristics of the image and the required edge accuracy.

[0154] Neighborhood checking usually uses a 3x3 or 5x5 square window, but this can be adjusted as needed.

[0155] This helps to increase edge connectivity and reduce disconnected edges.

[0156] Q6: Use Robert's thinning algorithm to thin the edges detected by double threshold;

[0157] If you need to further improve the accuracy of the edge, you can use a thinning algorithm (such as Robert's thinning algorithm) to thin the edge detected by the double threshold.

[0158] It should be noted that:

[0159] Ⅰ. The basic principle of Robert's thinning algorithm:

[0160] Robert's thinning algorithm is an iterative process based on gradient magnitude.

[0161] It uses gradients in two directions (usually a pair of diagonal directions) to decide whether to keep pixels on the edge line.

[0162] If the gradient magnitude of a pixel in one direction is greater than the gradient magnitude in another direction, the pixel is considered to be part of the edge and will be retained.

[0163] During the iteration process, the algorithm removes pixels that do not meet the conditions, thereby refining the edges.

[0164] II. Specific technical steps:

[0165] Initialize a marker image of the same size as the original gradient image to store the refined edge pixels.

[0166] Starting from the edge line, select a pixel as the starting point.

[0167] For the starting point, calculate the gradient magnitude in the horizontal and vertical directions.

[0168] According to the Robert's algorithm rule, if the gradient magnitude in the horizontal direction is greater than the gradient magnitude in the vertical direction, the pixel point is retained; otherwise, the pixel point is removed.

[0169] Use a similar method to process the pixels around the starting point.

[0170] Repeat the above steps until all the pixels on the edge lines are traversed.

[0171] III. Technology and precautions:

[0172] The rules of Robert's thinning algorithm can be adjusted on a case-by-case basis to accommodate different types of edges.

[0173] In practical applications, it may be necessary to adjust parameters according to the characteristics of the image and the required edge accuracy.

[0174] The number of iterations of the algorithm is also a key factor that can affect the refinement effect.

[0175] This helps remove small noise points and connect unnecessary edges.

[0176] Q7: Based on the edge points detected in the above steps, extract the initial edges of the multi-touch electrodes.

[0177] These edge points can be used in subsequent segmentation, analysis or other image processing steps.

[0178] Through the above steps, the initial edges of the multi-contact electrodes can be effectively extracted from the initial brain CT image, providing necessary feature information for subsequent image segmentation and analysis.

[0179] It should be noted that:

[0180] ①Basic principles of initial edge extraction:

[0181] The edge points are detected from the gradient image using the hysteresis threshold algorithm and Robert's thinning algorithm.

[0182] From the detected edge points, those points with specific shape, size or texture features that match the edges of the multi-contact electrode are extracted.

[0183] ②Specific technical steps:

[0184] Firstly, the edge points are detected from the gradient image using the hysteresis threshold algorithm and Robert's thinning algorithm.

[0185] Then, a set of feature parameters are defined, such as the minimum and maximum distances of edge points, the curvature of the edge line, the texture features of the edge points, etc.

[0186] Next, all detected edge points are traversed, and points matching the edge of the multi-touch electrode are screened out according to the above-mentioned characteristic parameters.

[0187] Finally, the screened points are connected into lines to extract the initial edges of the multi-contact electrodes.

[0188] ③Technology and precautions:

[0189] The definition of feature parameters should be adjusted according to the actual shape and size of the multi-contact electrode to ensure that the extracted edges match the actual edges of the electrode.

[0190] In practical applications, parameter optimization may be required according to the specific multi-contact electrode type and the characteristics of the CT image.

[0191] The extracted edges should be post-processed, such as denoising, smoothing, and thinning, to improve the accuracy and reliability of the edges.

[0192] S3: Perform region growing on the initial edge to obtain the initial segmentation result of the multi-contact electrode, see Figure 3 , specifically including the following steps:

[0193] W1: Select one or more significant edge points from the initial edge image as initial seed points;

[0194] These seed points should be located at the expected locations of the multi-contact electrodes so that subsequent region growing can be performed around these points.

[0195] It should be noted that:

[0196] The basic principle of selecting significant edge points:

[0197] Salient edge points are those that have obvious features in an image, such as large gradient magnitude, unique shape, or significant texture features.

[0198] Selecting these points as initial seed points can ensure that the segmentation process starts from areas with obvious distinction, thereby improving the accuracy and efficiency of segmentation.

[0199] Specific technical steps:

[0200] First, edge points are extracted from the edge image obtained by Robert's thinning algorithm.

[0201] Then, a set of feature parameters are defined to describe the saliency of edge points, such as gradient amplitude, size, shape and texture characteristics of edge points.

[0202] Next, the significance score of each edge point is calculated, and the comprehensive score of each edge point is calculated according to the defined feature parameters.

[0203] Finally, one or more points are selected from the edge points with the highest scores as initial seed points.

[0204] Techniques and considerations:

[0205] The selection of feature parameters should be adjusted according to the characteristics of the actual multi-contact electrodes and CT images to ensure that the selected seed points have sufficient discrimination.

[0206] In practical applications, parameter optimization may be required according to the specific multi-contact electrode type and the characteristics of the CT image.

[0207] You can select a single edge point with the highest significance score, or you can select multiple edge points as initial seed points as needed.

[0208] W2: Calculate the neighborhood pixels for each seed point;

[0209] The neighborhood is usually all pixels within a certain radius around the seed point.

[0210] The neighborhood radius can be determined based on the resolution of the image and the size of the electrode to ensure that the pixels within the neighborhood have similar characteristics to the seed point.

[0211] It should be noted that:

[0212] Definition of neighborhood pixels:

[0213] Neighborhood pixels refer to the set of pixels around the seed point, which is usually defined as a square or circular neighborhood centered on the seed point.

[0214] The size of the neighborhood can be adjusted as needed. Common neighborhood sizes include 3x3, 5x5, 7x7, etc.

[0215] In some cases, the neighborhood may also be irregularly shaped, for example defined according to a specific filter kernel or edge detection operator.

[0216] Calculation steps for neighborhood pixels:

[0217] Determines the size and shape of the neighborhood.

[0218] For each seed point, calculate all the pixels in its neighborhood. This usually involves defining a neighborhood window around the seed point and then adding all the pixels in the window to the neighborhood pixel set.

[0219] Neighborhood pixel sets are usually stored in an array or list for subsequent image processing operations.

[0220] Techniques and considerations:

[0221] The size and shape of the neighborhood should be chosen based on the specific image processing task and the accuracy required. For example, for images with rich details, a larger neighborhood may be required, while for images where only basic features are required, a smaller neighborhood may be used.

[0222] In practical applications, the calculation of neighborhood pixels may need to consider the resolution of the image to ensure that the number and position of neighborhood pixels meet the requirements.

[0223] The calculation of neighborhood pixels usually involves the coordinate system of the image, and it is necessary to ensure that the neighborhood window is correctly positioned and applied in the image coordinate space.

[0224] W3: For each neighborhood pixel, determine whether the pixel belongs to the target area where the seed point is located based on the predefined similarity metric;

[0225] For each neighborhood pixel, a predefined similarity metric (such as gray value, texture, gradient direction, etc.) is used to determine whether the pixel belongs to the target area where the seed point is located.

[0226] Similarity metrics can be designed based on the characteristics of the electrodes and surrounding brain tissue to ensure that only pixels that truly belong to the electrodes are included in the segmentation results.

[0227] It should be noted that:

[0228] Rationale for similarity metrics:

[0229] The similarity metric is a metric that quantifies the similarity between pixels and is used to determine whether two pixels belong to the same target region.

[0230] Commonly used similarity metrics include grayscale similarity, color similarity, texture similarity, etc.

[0231] The selection of an appropriate similarity metric depends on the specific image processing task and the characteristics of the target region.

[0232] Steps to determine whether a neighborhood pixel belongs to the target area:

[0233] For each seed point, calculate the similarity measure of all pixels in its neighborhood.

[0234] Define a threshold to distinguish whether a neighborhood pixel belongs to the target region. If the similarity measure of a neighborhood pixel is greater than or equal to the threshold, the pixel is considered to belong to the target region.

[0235] According to the similarity measure and threshold, the neighborhood pixels are divided into two categories: those belonging to the target area and those not belonging to the target area.

[0236] Merge the neighboring pixels belonging to the target area into the area where the seed point is located.

[0237] Techniques and considerations:

[0238] The definition of similarity metric should be selected and adjusted according to the characteristics of the image and the characteristics of the target area. For example, for grayscale images, grayscale difference can be selected as the similarity metric; for color images, color distance or color space conversion may need to be considered.

[0239] The determination of the threshold usually needs to be optimized according to the statistical characteristics of the image to ensure that the target area and non-target area can be accurately distinguished.

[0240] In practical applications, it may be necessary to adjust and optimize parameters according to specific circumstances to improve the accuracy and robustness of segmentation.

[0241] W4: Add the neighboring pixels belonging to the target area to the seed point set to form a new seed point set;

[0242] This step requires multiple iterations to gradually expand the scope of the target area until the stopping condition is met (such as the number of seed points no longer increases).

[0243] It should be noted that:

[0244] The basic principle of adding neighborhood pixels:

[0245] The expansion of the target area is achieved by gradually adding pixels in the neighborhood to the seed point set based on a similarity metric.

[0246] At each iteration, new neighborhood pixels are added to the set of seed points that are sufficiently similar to the seed point in terms of the similarity metric and are therefore considered to be part of the target region.

[0247] In this way, the target region can be gradually enlarged until a certain stopping condition is met.

[0248] Steps to add neighborhood pixels to the seed point set:

[0249] Initialize a seed point set, which contains the initial seed point.

[0250] For each seed point, the similarity measure of all pixels in its neighborhood is calculated.

[0251] The threshold value of whether the neighborhood pixels belong to the target area is determined, and the neighborhood pixels belonging to the target area are screened out according to the threshold value.

[0252] The filtered neighborhood pixels belonging to the target area are added to the seed point set to form a new seed point set.

[0253] The above steps are repeated until a stopping condition is met (for example, no new neighborhood pixels satisfy the similarity metric, or the upper limit of the number of iterations is reached).

[0254] Techniques and considerations:

[0255] In practical applications, the choice of stopping conditions should be determined according to the specific image processing task and the characteristics of the target area. For example, an upper limit on the number of iterations can be set, or the algorithm can be stopped when the number of newly added neighborhood pixels in adjacent iterations is lower than a certain threshold.

[0256] The definition of similarity metric should be selected and adjusted according to the characteristics of the image and the characteristics of the target area. For example, for grayscale images, grayscale difference can be selected as the similarity metric; for color images, color distance or color space conversion may need to be considered.

[0257] The determination of the threshold usually needs to be optimized according to the statistical characteristics of the image to ensure that the target area and non-target area can be accurately distinguished.

[0258] W5: Repeat steps 2 to 4 for the new set of seed points to perform iterative region growing;

[0259] After each iteration, the target area will gradually expand until no new pixels can be added to the seed point set, or the predetermined number of iterations is reached.

[0260] W6: The iterative process ends and the final segmentation result is output, where pixels belonging to the target area are marked as 1 and pixels not belonging to the target area are marked as 0.

[0261] Once the iterative process is finished, the final segmentation result is output. This result is a binary image, in which pixels belonging to the target area (i.e., multi-touch electrodes) are marked as 1, and pixels not belonging to the target area are marked as 0.

[0262] Through the above steps, the initial segmentation results of multi-contact electrodes can be obtained. This result can serve as the basis for subsequent image processing and analysis, helping doctors to accurately locate the position and shape of electrodes during surgery.

[0263] S4: Perform fine segmentation on the initial segmentation result, see Figure 4 , specifically including the following steps:

[0264] T1: Extract the region of multi-contact electrodes from the initial segmentation results, calculate the total number of pixels in the region, and obtain the area A of the electrode;

[0265] The region of multi-contact electrodes is extracted from the initial segmentation result.

[0266] Count the total number of pixels in this region to obtain the area of ​​the electrode.

[0267] T2: For all pixels in the multi-contact electrode area, calculate their average grayscale value B;

[0268] For all pixels in the multi-contact electrode area, calculate their average grayscale value.

[0269] The average gray value reflects the overall brightness level of the electrode area.

[0270] T3: Construct a threshold adaptive acquisition model, input the electrode area A and average gray value B, and output the acquired adaptive threshold;

[0271] The adaptive threshold is calculated based on the area and average gray value of the electrode region.

[0272] The calculation method of the adaptive threshold can be determined according to specific conditions (such as area and gray value range). For example, if the electrode area is small, a lower adaptive threshold can be set; if the electrode area is large, a higher adaptive threshold can be set.

[0273] Furthermore, the present invention provides a threshold adaptive acquisition model, specifically:

[0274]

[0275] Among them, δ is the adaptive threshold, A is the area of ​​the electrode, B is the average gray value, 1.25, 1.251 and 2.77 are adjustment constants, and dx is the integral operation.

[0276] T4: Use the calculated adaptive threshold to binarize the initial segmentation result.

[0277] The initial segmentation result is binarized using the calculated adaptive threshold.

[0278] Set the pixel value of the multi-contact electrode area to 1 (white) and the pixel value of other areas to 0 (black).

[0279] The basic principle of adaptive threshold binarization:

[0280] Adaptive thresholding is an algorithm that determines the threshold based on the local characteristics of each region in the image, rather than using a global fixed threshold.

[0281] This approach is better able to adapt to local variations in the image, such as uneven lighting or contrast changes.

[0282] The purpose of calculating an adaptive threshold is to classify the pixel values ​​in an image into two classes, usually a lower class (usually set to 0 or black) and an upper class (usually set to 255 or white).

[0283] Steps to binarize the initial segmentation result using adaptive thresholding:

[0284] First, the local properties of each region in the image are calculated, such as the mean, median, variance, etc.

[0285] Calculate an adaptive threshold for each region based on local characteristics. This can be achieved through different algorithms such as minimum cross entropy thresholding, maximum between-class variance (OTSU) algorithm, etc.

[0286] For each region, the pixel values ​​are classified into two classes using the calculated adaptive threshold. Typically, pixels with values ​​below the threshold are classified into the lower class, while pixels with values ​​above or equal to the threshold are classified into the higher class.

[0287] Repeat the above steps until all areas have been treated.

[0288] Techniques and considerations:

[0289] The calculation method of the adaptive threshold should be selected and adjusted according to the characteristics of the image and the required segmentation effect. For example, the OTSU algorithm is suitable for images with obvious contrast between the background and foreground, while the minimum cross entropy algorithm is more effective when the contrast between the background and foreground is low.

[0290] In practical applications, it may be necessary to adjust and optimize parameters according to specific circumstances to improve the accuracy and robustness of segmentation.

[0291] The selection of adaptive threshold should take into account the local characteristics of the image, such as pixel value distribution, noise level, illumination changes, etc.

[0292] The binarized image will more clearly distinguish the electrode from the surrounding tissue, thereby improving the segmentation accuracy.

[0293] Through the above steps, more accurate segmentation of multi-contact electrodes can be achieved. The adaptive threshold segmentation algorithm takes into account the characteristics of the electrode region, such as area and average grayscale value, thereby improving the accuracy and robustness of the segmentation. This segmentation method facilitates subsequent image analysis and processing, providing more accurate data support for brain surgery.

[0294] S5: Use the refined segmentation results to perform 3D reconstruction of the multi-contact electrodes to obtain a 3D model of the multi-contact electrodes. Please refer to Figure 5 , specifically including the following steps:

[0295] R1: Extract the region of multi-contact electrodes from the fine segmentation result;

[0296] The region of multi-contact electrodes is extracted from the refined segmentation result.

[0297] Typically, this will be a binary image where electrode regions are labeled as 1 and other regions are labeled as 0.

[0298] It should be noted that:

[0299] The basic principle of multi-contact electrode area extraction:

[0300] The region extraction of multi-contact electrodes is achieved by identifying and tracking the contours or edges of the electrodes.

[0301] Typically, the area of ​​an electrode is described as a set of continuous points that define the edge or outline of the electrode.

[0302] The purpose of extracting these regions is to use these electrode regions as key reference information during subsequent surgical planning or navigation.

[0303] Steps to extract multi-contact electrode areas from the refined segmentation results:

[0304] First, the fine segmentation results are post-processed, such as denoising, smoothing, and thinning, to improve the accuracy of the extracted region.

[0305] Then, edge detection is performed on the post-processed image using an edge detection operator (such as Sobel, Robert, Canny, etc.) to obtain edge information of the electrode area.

[0306] Next, based on the edge information, the electrode area is extracted using a region growing or contour tracing algorithm. The region growing algorithm can gradually expand the initial seed point based on the similarity of neighboring pixels, while the contour tracing algorithm tracks point by point along the edge to eventually form a complete region outline.

[0307] Finally, the electrode region is extracted from the extracted contour, usually by connecting the contour points into lines or filling the region to obtain a binary image of the electrode region.

[0308] Techniques and considerations:

[0309] In practical applications, the electrode region may have complex shapes and features, so choosing appropriate edge detection operators and region extraction algorithms is crucial.

[0310] Post-processing steps such as denoising and smoothing can reduce noise and interference and improve the quality of the extracted regions.

[0311] The accuracy of the extracted region depends on the performance of the edge detection algorithm and the parameter settings of the region growing or contour tracking algorithm, which need to be adjusted and optimized according to the specific image and electrode characteristics.

[0312] R2: Construct a three-dimensional coordinate system based on the CT scan parameters;

[0313] According to the parameters of CT scanning, a three-dimensional coordinate system is constructed.

[0314] This coordinate system should correspond to the coordinate system used during CT scanning to ensure the accuracy and consistency of 3D reconstruction.

[0315] It should be noted that:

[0316] Steps to construct a three-dimensional coordinate system based on CT scan parameters:

[0317] Obtain the parameters of the CT scan, which typically include information such as slice thickness, slice orientation, and patient position and orientation.

[0318] The direction and length of the x-axis and y-axis are determined by the slice thickness and orientation. The slice thickness usually corresponds to the direction and length of the z-axis.

[0319] According to the patient's positioning information, the starting point of the x-axis and y-axis is determined, which is usually the patient's coordinate origin.

[0320] Construct a three-dimensional coordinate system, in which the x-axis, y-axis, and z-axis are set according to the directions and lengths determined in the above steps.

[0321] The pixel coordinates in the CT image are mapped to a three-dimensional coordinate system, and each pixel corresponds to a coordinate in a three-dimensional space.

[0322] Techniques and considerations:

[0323] Slice thickness and orientation are key parameters for constructing a three-dimensional coordinate system, which determine the direction and length of the x-axis and y-axis.

[0324] The patient's position and orientation information helps determine the starting points of the x-axis and y-axis, which is critical for correctly constructing the three-dimensional coordinate system.

[0325] In practical applications, adjustments and optimizations may need to be made based on the model and settings of the specific CT scanner to ensure that the constructed 3D coordinate system matches the actual scan results.

[0326] R3: interpolating the extracted electrode regions to generate a continuous three-dimensional surface;

[0327] The extracted electrode regions are interpolated to generate a continuous three-dimensional surface.

[0328] There are many interpolation methods, such as linear interpolation, bilinear interpolation, bicubic interpolation, etc. The specific choice depends on the required accuracy and computing resources.

[0329] It should be noted that:

[0330] The basic principle of interpolation calculation:

[0331] Interpolation is a mathematical technique used to estimate or generate new data points based on known data points (e.g., the boundary points of an extracted electrode region).

[0332] In 3D modeling, interpolation is used to connect the pixels in a 2D image to create a continuous 3D surface that approximates the true shape of the electrode.

[0333] Commonly used interpolation methods include linear interpolation, quadratic interpolation, cubic interpolation and spline interpolation.

[0334] Steps for interpolation calculation of the extracted electrode area:

[0335] First, the boundary points of the electrode area are extracted, which define the contour of the electrode in the two-dimensional image.

[0336] Then, choose an appropriate interpolation method to connect these boundary points. Linear interpolation is used to produce simpler surfaces, while spline interpolation is used to produce smoother and continuous surfaces.

[0337] Next, new points are calculated based on the interpolation method, which will be used to generate the 3D surface. These new points are generated between the boundary points to form a continuous 3D surface.

[0338] Finally, these new points are converted into coordinates in three-dimensional space to construct a three-dimensional model of the electrode.

[0339] Techniques and considerations:

[0340] The choice of interpolation method depends on the accuracy and complexity of the 3D surface required. Simple applications may only require linear interpolation, while complex applications may require spline interpolation or other more advanced interpolation methods.

[0341] The accuracy of the interpolation calculation depends on the quantity and quality of the extracted boundary points. If the boundary points are inaccurate or incomplete, the generated 3D surface may be inaccurate or erroneous.

[0342] In practical applications, the interpolation parameters may need to be optimized to obtain better surface quality.

[0343] R4: Generate a three-dimensional model of the multi-contact electrode using the continuous surface obtained by interpolation calculation;

[0344] The three-dimensional model of the multi-contact electrode is generated using the continuous surface obtained by interpolation calculation.

[0345] This 3D model can be a surface model or a voxel model, depending on the requirements of subsequent applications.

[0346] It should be noted that:

[0347] The basic principles of 3D model generation:

[0348] A 3D model is a virtual representation of a real-world object that can be created and manipulated in .

[0349] The continuous surface obtained by interpolation can generate a three-dimensional model that can approximate the shape and structure of the electrode in the real world.

[0350] The 3D models can be used in a variety of computer-aided design and analysis applications, such as surgical planning, simulation, and visualization.

[0351] Steps to generate a 3D model using a continuous surface obtained by interpolation:

[0352] First, ensure that the continuous surface obtained by interpolation is accurate and smooth enough to reflect the actual shape of the electrode.

[0353] The interpolated surface points are then converted to coordinates in three-dimensional space that define the location of the electrode surface.

[0354] Then, the 3D model is post-processed as needed, such as thinning, smoothing, or hole filling to improve the appearance and integrity of the model.

[0355] Finally, save the processed 3D model in a standard 3D file format, such as STL (Stereolithography), OBJ (Object File) or PLY (Polygon File Format), so that it can be used and further processed in other software.

[0356] Techniques and considerations:

[0357] The accuracy of 3D model generation depends on the precision of interpolation calculation and the quality of boundary points. Ensure that the interpolation parameters and boundary point data are accurate to generate high-quality 3D models.

[0358] In practical applications, it may be necessary to adjust and optimize parameters according to specific 3D modeling tasks and application scenarios to obtain better model effects.

[0359] When saving a 3D model, choose a 3D file format suitable for subsequent applications and ensure the compatibility and accuracy of the file format.

[0360] R5: Optimize the generated 3D model.

[0361] Perform necessary optimization on the generated 3D model, such as smoothing and noise removal, to improve the quality of the model.

[0362] Use professional visualization software or tools to visualize the three-dimensional model to facilitate doctors' evaluation and analysis.

[0363] Through the above steps, a three-dimensional model of multi-contact electrodes can be obtained, providing more intuitive and accurate data support for brain surgery. The three-dimensional model helps doctors more accurately understand the location, shape and interaction of electrodes with surrounding brain tissue, thereby formulating more effective surgical plans and strategies.

[0364] S6: Evaluate the segmentation results.

[0365] Define the evaluation metrics:

[0366] Choose appropriate evaluation metrics to quantify the accuracy of the segmentation results. Common metrics include Dice coefficient, Jaccard index, precision, recall, etc.

[0367] Determine how to calculate the evaluation metric and prepare a standard answer (i.e., gold standard) for comparison, such as manually annotated segmentation results.

[0368] Calculate the segmentation error:

[0369] To calculate the difference between the segmentation result and the gold standard, various error metrics can be used, such as average pixel error, mean square error, etc.

[0370] These error metrics can quantify how close the segmentation result is to the true result.

[0371] Evaluate the segmentation effect:

[0372] Use the previously defined evaluation metrics to quantitatively evaluate the segmentation results.

[0373] Calculate the Dice coefficient, Jaccard index, etc. to evaluate the accuracy of the segmentation results.

[0374] Precision and recall were analyzed to assess the sensitivity and specificity of the segmentation.

[0375] Result visualization:

[0376] The segmentation results are compared with the gold standard and a visualization is generated to intuitively demonstrate the segmentation quality.

[0377] Different colors or markers can be used to distinguish the segmentation results from the gold standard for easier observation and analysis.

[0378] Statistical analysis:

[0379] If possible, statistical analysis was performed to compare the results of the segmentation method with other methods.

[0380] The p-value or other statistical significance index is calculated to determine whether the segmentation method of the present invention has a significant advantage over other methods.

[0381] Summary and analysis:

[0382] The evaluation results are summarized and the advantages and possible improvement space of the segmentation method of the present invention are analyzed.

[0383] According to the evaluation results, necessary adjustments and improvements are made to the segmentation method to further improve the accuracy and robustness of the segmentation.

[0384] Through the above steps, the performance of the segmentation method of the present invention can be systematically evaluated and its superiority over the prior art can be verified. The evaluation results are helpful to improve the segmentation method and provide a reliable basis for clinical application.

[0385] In order to verify the beneficial effects of the present invention, the following experiments are performed:

[0386] Experimental purpose: To verify the effectiveness and accuracy of the automatic segmentation method of multi-contact electrodes in brain surgery based on CT images.

[0387] Test materials and equipment:

[0388] 1. Computer hardware equipment: A computer with high computing power to run image processing software and algorithms.

[0389] 2. CT scanning equipment: used to obtain CT images of the brain.

[0390] 3. Multi-contact electrodes: used for electrode implantation in brain surgery.

[0391] 4. Image processing software: used to realize CT image preprocessing, segmentation and feature extraction.

[0392] Test method:

[0393] 1. CT image acquisition: Perform CT scan on the experimental subjects to obtain brain CT images.

[0394] 2. Image preprocessing: De-noise and smooth the acquired CT images to improve image quality. The preprocessing method can use filters to filter the images to remove noise and artifacts.

[0395] 3. Image segmentation: The preprocessed CT images are segmented using methods such as threshold segmentation, region growing and machine learning algorithms to extract multi-contact electrodes.

[0396] 4. Feature extraction: Extract features of the segmented multi-contact electrodes, such as size, shape, position, etc.

[0397] 5. Contact positioning: Based on the extracted features, each contact point of the multi-contact electrode is positioned and the coordinates of the contact point are calculated.

[0398] 6. Accuracy evaluation: Compare the touch point coordinates obtained by automatic segmentation with the actual touch point coordinates to evaluate the accuracy of the segmentation method.

[0399] 7. Repeatability evaluation: Perform multiple segmentations on the same set of CT images to evaluate the repeatability of the method.

[0400] Test data table:

[0401] Table 1

[0402] Number of trials Noise removal rate (%) Artifact removal rate (%) Threshold segmentation accuracy (%) Region growing accuracy (%) Machine Learning Algorithm Accuracy (%) Contact positioning error (mm) 1 85 70 90 85 95 2.5 2 88 72 92 87 96 2.3 3 86 71 91 86 95 2.6 4 87 73 93 88 96 2.4 average value 86.5 71.5 91.5 87.0 95.5 2.45

[0403] Analysis of test results:

[0404] 1. The noise removal rate and artifact removal rate both reached more than 85%, indicating that the preprocessing method has a good denoising effect.

[0405] 2. The accuracy of the three image segmentation methods all reached more than 90%, indicating that the segmentation methods have high accuracy.

[0406] 3. The contact positioning error is within 2.5 mm, indicating that the method of the present invention can achieve accurate segmentation of multi-contact electrodes.

[0407] 4. The repeatability evaluation results show that the method of the present invention has high repeatability and is suitable for clinical surgery.

[0408] The present invention provides a method for automatic segmentation of multi-contact electrodes in brain surgery based on CT images, which has the following beneficial effects:

[0409] 1. The present invention provides an automated brain surgery multi-contact electrode segmentation method that does not require manual intervention and greatly improves segmentation efficiency and accuracy.

[0410] 2. By preprocessing CT images, denoising and smoothing, the image quality is improved and the impact of noise and artifacts on the segmentation results is reduced.

[0411] 3. The use of multiple image segmentation and feature extraction techniques, such as threshold segmentation, region growing and machine learning algorithms, enhances the adaptability and robustness of the segmentation algorithm.

[0412] 4. The present invention can accurately segment the individual contacts of a multi-contact electrode, provide precise image guidance for brain surgery, and improve the safety and effectiveness of the surgery.

[0413] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.

Claims

1. A method for automatic segmentation of multi-contact electrodes in brain surgery based on CT images, characterized in that: The steps include: S1: Multi-contact electrodes are implanted in the patient's brain to obtain the initial CT image of the patient's brain; S2: Use the Canny edge detection algorithm to perform edge detection on the initial brain CT image and extract the initial edges of the multi-contact electrodes; S3: Performing region growing on the initial edge to obtain the initial segmentation result of the multi-contact electrode; S4: Perform fine segmentation on the initial segmentation result; S5: performing three-dimensional reconstruction of the multi-contact electrode using the refined segmentation result to obtain a three-dimensional model of the multi-contact electrode; S6: Evaluate the segmentation results; Wherein, after obtaining the initial brain CT image, the method further includes performing image preprocessing on the initial brain CT image; Among them, the preprocessing steps include: grayscale, smoothing filtering, gray gradient enhancement, and multi-scale gradient enhancement; Among them, the Canny edge detection algorithm is used to perform edge detection on the initial brain CT image, and the initial edge extraction of the multi-contact electrode specifically includes the following steps: Q1: Obtain the initial brain CT image after preprocessing; Q2: Use the Sobel operator or Prewitt operator to calculate the horizontal and vertical gradients of the image to obtain a gradient image, and simultaneously calculate the magnitude and direction of the gradient. The magnitude represents the strength of the edge, and the direction represents the direction of the edge. Q3: Perform non-maximum suppression on the gradient amplitude image, remove pixels that are not local maxima, and retain potential edge points; Q4: Set the lower threshold and upper threshold. Pixels below the lower threshold are considered as noise, and pixels above the upper threshold are connected to form the initial edge. Q5: Apply the hysteresis threshold algorithm to connect the edge pixels detected by the lower threshold to the edge pixels detected by the upper threshold; Q6: Use Robert's thinning algorithm to thin the edges detected by double threshold; Q7: Extract the initial edge of the multi-touch electrode based on the edge points detected in the above steps; The process of performing region growing on the initial edge to obtain the initial segmentation result of the multi-contact electrode specifically includes the following steps: W1: Select one or more significant edge points from the initial edge image as initial seed points; W2: Calculate the neighboring pixels for each seed point; W3: For each neighborhood pixel, determine whether the pixel belongs to the target area where the seed point is located based on the predefined similarity metric; W4: Add the neighboring pixels belonging to the target area to the seed point set to form a new seed point set; W5: Repeat steps 2 to 4 for the new set of seed points to perform iterative region growing; W6: The iteration process ends and the final segmentation result is output, where pixels belonging to the target area are marked as 1 and pixels not belonging to the target area are marked as 0; The fine segmentation of the initial segmentation result specifically includes the following steps: T1: Extract the region of multi-contact electrodes from the initial segmentation results, calculate the total number of pixels in the region, and obtain the area A of the electrode; T2: For all pixels in the multi-contact electrode area, calculate their average grayscale value B; T3: Construct a threshold adaptive acquisition model, input the electrode area A and average gray value B, and output the acquired adaptive threshold; T4: Use the calculated adaptive threshold to binarize the initial segmentation result; The threshold adaptive acquisition model constructed is specifically: ; Among them, δ is the adaptive threshold, A is the area of ​​the electrode, B is the average gray value, 1.25, 1.251 and 2.77 are adjustment constants, and dx is the integral operation; The three-dimensional reconstruction of the multi-contact electrode using the fine segmentation result to obtain the three-dimensional model of the multi-contact electrode specifically includes the following steps: R1: Extract the region of multi-contact electrodes from the fine segmentation result; R2: Construct a three-dimensional coordinate system based on the CT scan parameters; R3: interpolating the extracted electrode regions to generate a continuous three-dimensional surface; R4: Generate a three-dimensional model of the multi-contact electrode using the continuous surface obtained by interpolation calculation; R5: Optimize the generated 3D model.

Citation Information

Patent Citations

  • Method for extracting regions of interest of pedestrian by using image segmentation method on the basis of road restriction

    CN105261017A

  • Electrode dirt detection method

    CN111833338A