Electrode contact calibration method and device for stereotactic electroencephalogram
By constructing a three-dimensional point cloud network topology diagram and using breadth-first search and spindle analysis algorithms, the problem of large electrode bending and positioning errors in the existing technology is solved, and the accurate automatic labeling and positioning of electrode contacts is achieved.
Patent Information
- Application Number
- CN202411799829.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2044-12-09
AI Technical Summary
The prior art cannot adapt to electrode bending situations under non-ideal conditions, the electrode contact positioning error is large, the electrode contact coordinates cannot be fully automatically marked, and it is difficult to accurately identify the number of electrode contacts.
By constructing a three-dimensional point cloud network topology map based on the three-dimensional point cloud data of multiple SEEG electrodes in the patient's brain, using the breadth-first search algorithm and spindle analysis algorithm, automatically screening and calibration of electrode contact coordinates, optimizing contact positioning, and adapting to electrode bending and fuzzy imaging.
The accurate resolution and positioning of the electrode contact coordinates is achieved. Even if the electrode is severely bent or deformed, the central coordinates of the positioning electrode contact area can be accurately determined, which reduces positioning errors and realizes fully automated electrode contact labeling.
Smart Images

Figure CN119791684A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electroencephalogram (EEG) data processing, and in particular to a method and device for calibrating electrode contacts of a stereotactic electroencephalogram (EEG). Background Art
[0002] Intracranial electrodes are multi-contact electrodes made of special materials. Their biggest advantage is that they can directly record electrical activity in the cerebral cortex or deep brain, and can be implanted in the skull for a short or long term. Electrodes implanted in the subject's brain can be used to record brain waves or emit current to stimulate the subject to cause changes in his or her brain. Stereotactic electroencephalography (SEEG), which belongs to deep intracranial electrodes, is an invasive brain wave recording method currently commonly used in clinical practice. It can accurately record EEG signals in subcortical structures and deep cortex, and is of great significance in the study and evaluation of the electrophysiological mechanisms of epilepsy.
[0003] There are mainly two methods in the related art. The first method is to align the CT image to the standard template, take the CT image where the electrode to be tested is located and binarize it, and take out the binarized image and merge it by image superposition, calculate the two-dimensional coordinates of the starting point and end point of the electrode to be tested on the superimposed image, restore it to three-dimensional coordinates according to the projection transformation, determine the number of contacts of the electrode to be tested according to the number of coronal image layers spanned by the electrode to be tested, and perform linear equidistant interpolation on the contacts of the electrode to be tested according to the starting point and end point of the electrode to be tested and the number of contacts, obtain the spatial coordinates of all contacts of the electrode to be tested, and then know the position of each contact of the electrode to be tested in the brain area. The number of contacts determined by this method is the number of coronal layer layers that the electrode passes through, but in actual situations, the same electrode contact may be captured by multiple layers, and for electrodes at some imaging angles, the imaging results in the CT image may be continuous image blocks that are adhered, and it is impossible to clearly distinguish the discrete contacts from each other. Therefore, it is difficult to accurately determine the number of contacts, and the obtained contact coordinates have large deviations. In addition, linear interpolation using the line connecting the starting point and the end point as the electrode axis cannot adapt to the bending situation and introduces systematic errors in the electrode contact coordinates. The method of calibrating the starting point and the end point one by one is very cumbersome and greatly affects the accuracy of subsequent contact positioning. The robustness is poor. There will be information loss based solely on the superposition of coronal images, and the final contact positioning error is large.
[0004] The second method uses semi-automatic operation, manually marking the entry point and target point coordinates of each electrode and providing prior information on electrode parameters such as contact radius, spacing, and number. The algorithm then calibrates the coordinates of the electrode contact sequence one by one along the search path determined by the electrode position and direction formed by the entry point and target point, and calculates the position of each electrode contact point through linear interpolation. This method has a high threshold for operation, low accuracy in contact point coordinate positioning, and cannot adapt to electrodes under non-ideal conditions such as curved electrodes. Summary of the invention
[0005] In view of this, the present invention provides a method and device for calibrating electrode contacts of a stereotactic electroencephalogram to solve the problems that the related technology cannot adapt to the electrode bending under non-ideal conditions, the electrode contact positioning error is large, and the electrode contact coordinates cannot be fully and automatically marked, and it is difficult to accurately identify the number of electrode contacts.
[0006] In a first aspect, the present invention provides a method for calibrating electrode contacts of a stereotactic electroencephalogram, the method comprising:
[0007] Based on the 3D point cloud data of multiple SEEG electrodes in the patient's brain, a 3D point cloud network topology map is constructed;
[0008] Using a breadth-first search algorithm, the three-dimensional point cloud network topology map is gradually searched to obtain an initial electrode tree set that records the contact coordinate information of multiple SEEG electrodes, and the target electrode tree set is screened out based on the initial electrode tree;
[0009] If the number of electrode trees in the target electrode tree set is greater than or equal to a first preset number, estimating the predicted coordinates of the contact points of each SEEG electrode in the target electrode tree set using a principal axis analysis algorithm;
[0010] Based on the predicted coordinates of the contact of each SEEG electrode, the contact envelope area of each SEEG electrode is drawn, and the target localization area of each SEEG electrode is determined from the contact envelope area of each SEEG electrode;
[0011] The current coordinates of all contacts in the target localization area of each SEEG electrode are optimized, and the optimal coordinates of all contacts in the target localization area are output.
[0012] By executing the above-mentioned embodiments, the present invention can clearly and accurately distinguish the coordinates of discrete electrode contacts. Even in the case of irregularities such as severe bending or deformation of the implanted electrode, the center coordinates of the electrode contact area can still be accurately located. In addition, for the case where the imaging is fuzzy and it is difficult to distinguish adjacent contacts, it still has accurate resolution capabilities. In addition, by executing the above-mentioned embodiments, different electrodes can be automatically segmented, the spatial axis and target orientation of each electrode can be independently determined, and the marking path of the electrode contacts can be calculated. There is no need to manually mark the position and direction of the electrode. The operation process is convenient. Through three-dimensional point cloud data, the complete spatial distribution of the electrode can be obtained, which can avoid the problem of feature information loss.
[0013] In some optional embodiments, before the step of constructing a three-dimensional point cloud network topology map based on the three-dimensional point cloud data of multiple SEEG electrodes in the patient's brain, the step further includes:
[0014] Obtain postoperative CT imaging data of multiple SEEG electrodes implanted in the patient's brain;
[0015] Based on the postoperative CT image data, construct the three-dimensional point cloud data of multiple SEEG electrodes;
[0016] Cleaning actions are performed on the three-dimensional point cloud data in turn according to the coordinate screening method, point cloud clustering method, and morphological filtering method;
[0017] Obtain three-dimensional point cloud data of multiple SEEG electrodes in the patient's brain after cleaning.
[0018] By executing the above-mentioned implementation method, advanced spatial point cloud detection technology is adopted, and the three-dimensional point cloud data is cleaned in sequence according to the coordinate screening method, the point cloud clustering method, and the morphological filtering method, and the electrode contacts are morphologically analyzed one by one, which is conducive to the complete and accurate determination of the electrode contact coordinates, and the morphological characteristics of the key contacts of electrodes in different orientations can be obtained to avoid information loss.
[0019] In some optional embodiments, if the number of electrode trees in the target electrode tree set is less than the first preset number, the step of performing cleaning actions on the three-dimensional point cloud data in sequence according to the coordinate screening method, the point cloud clustering method, and the morphological filtering method is returned.
[0020] By executing the above implementation, in order to prevent the morphological filtering from being inaccurate, the three-dimensional point cloud data is further optimized, thereby ensuring the detection accuracy of the three-dimensional point cloud data.
[0021] In some optional implementations, the three-dimensional point cloud data is cleaned in sequence according to the coordinate screening method, the point cloud clustering method, and the morphological filtering method, including:
[0022] From the constructed three-dimensional point cloud data of multiple SEEG electrodes, three-dimensional point cloud data with coordinates greater than a preset threshold are selected to generate a three-dimensional point cloud coordinate matrix;
[0023] Based on the three-dimensional point cloud coordinate matrix, the three-dimensional point cloud coordinate matrix is clustered according to a preset radius and a preset density, thereby generating a three-dimensional point cloud clustering result;
[0024] The three-dimensional point cloud clustering results are filtered according to the morphological filtering method to obtain the three-dimensional point cloud data of multiple SEEG electrodes in the patient's brain after cleaning.
[0025] By executing the above-mentioned implementation method, a specific spatial point cloud detection technology is adopted, and the three-dimensional point cloud data is cleaned in sequence according to the coordinate screening method, the point cloud clustering method, and the morphological filtering method, and the electrode contacts are morphologically analyzed one by one, which is conducive to the complete and accurate determination of the electrode contact coordinates, and the morphological characteristics of the key contacts of electrodes in different orientations can be obtained to avoid information loss.
[0026] In some optional embodiments, a breadth-first search algorithm is used to gradually search the three-dimensional point cloud network topology map to obtain an initial electrode tree set recording the contact coordinate information of multiple SEEG electrodes, and a target electrode tree set is screened out based on the initial electrode tree, including:
[0027] An initial node is selected from the three-dimensional point cloud network topology map, and each node in the three-dimensional point cloud network topology map is gradually searched from the initial node using a breadth-first search algorithm, thereby obtaining an initial electrode tree set recording contact coordinate information of multiple SEEG electrodes;
[0028] Obtain the maximum distance between two points in each electrode tree in the initial electrode tree set;
[0029] If the maximum distance between two points in each electrode tree in the initial electrode tree set is greater than a preset threshold, the electrode tree is regarded as an electrode structure;
[0030] Electrode trees that meet the electrode structure are counted from the initial electrode tree set, and the electrode trees that meet the electrode structure are taken as the target electrode tree set.
[0031] In some optional embodiments, if the number of electrode trees in the target electrode tree set is greater than or equal to a first preset number, the predicted contact coordinates of each SEEG electrode in the target electrode tree set are estimated using a principal axis analysis algorithm, including:
[0032] If the number of electrode trees in the target electrode tree set is greater than or equal to a first preset number, using a principal axis analysis algorithm to calculate the principal axis vector of each electrode tree in the target electrode tree set;
[0033] Based on the main axis vector of each electrode tree in the target electrode tree set, the main axis direction of each electrode tree in the target electrode tree set is calculated;
[0034] The predicted coordinates of the contact points of each SEEG electrode were estimated based on the contact radius of each SEEG electrode, the preset spacing between electrodes, and the main axis direction of each electrode tree in the target electrode tree set.
[0035] By executing the above-mentioned implementation mode, the principal axis analysis algorithm can automatically adapt to the situation of slight bending and compression of the electrode under non-ideal conditions, and accurately locate at the center of the contact area. Even if the imaging is fuzzy and it is difficult to distinguish adjacent contacts, it still has accurate resolution capabilities.
[0036] In some optional embodiments, based on the predicted coordinates of the contact of each SEEG electrode, the contact envelope area of each SEEG electrode is drawn, and the target positioning area of each SEEG electrode is determined from the contact envelope area of each SEEG electrode, including:
[0037] Taking the predicted coordinates of the contact of each SEEG electrode as the center and according to the contact radius of each SEEG electrode, draw the contact envelope area of each SEEG electrode;
[0038] Obtain the number of electrodes within the contact envelope area of each SEEG electrode;
[0039] If the number of electrodes within the contact envelope area of each SEEG electrode is less than or equal to the second preset number, the contact envelope area of the SEEG electrode is used as the target positioning area.
[0040] By executing the above implementation, for curved electrodes under non-ideal conditions, the target positioning area of each SEEG electrode is screened out from the contact envelope area, thereby achieving accurate positioning of each SEEG electrode.
[0041] In some optional embodiments, the current coordinates of all contacts in the contact location area of each SEEG electrode are optimized, and the optimal coordinates of all contacts in the target location area are output, including:
[0042] Calculate the mean coordinates of all touch points in the target positioning area;
[0043] The mean coordinates are used as the optimized coordinates, and the current coordinates of all touch points in the target positioning area are optimized according to the optimized coordinates;
[0044] Output the optimized coordinates of all contacts in the target positioning area.
[0045] By executing the above implementation, the current coordinates of all contacts in the target positioning area are optimized, and high-precision fully automatic marking of electrode contacts can be achieved, thereby reducing the positioning error of the electrode contact coordinates.
[0046] In a second aspect, the present disclosure provides a device for calibrating electrode contacts of a stereotactic electroencephalogram, the device comprising:
[0047] A network topology construction module is used to construct a 3D point cloud network topology map based on the 3D point cloud data of multiple SEEG electrodes in the patient's brain;
[0048] A three-dimensional point cloud search module is used to gradually search the three-dimensional point cloud network topology map using a breadth-first search algorithm to obtain an initial electrode tree set that records the contact coordinate information of multiple SEEG electrodes, and screen out a target electrode tree set based on the initial electrode tree;
[0049] A point cloud coordinate prediction module, used for estimating the predicted coordinates of the contact points of each SEEG electrode in the target electrode tree set by using a principal axis analysis algorithm if the number of electrode trees in the target electrode tree set is greater than or equal to a first preset number;
[0050] A target region positioning module, used to determine the predicted coordinates of the contact points based on each SEEG electrode, draw the contact envelope area of each SEEG electrode, and determine the target positioning area of each SEEG electrode from the contact envelope area of each SEEG electrode;
[0051] The optimal coordinate output module is used to optimize the current coordinates of all contacts in the target positioning area of each SEEG electrode and output the optimal coordinates of all contacts in the target positioning area.
[0052] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the electrode contact calibration method for stereotactic electroencephalogram according to the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0053] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the stereotactic electroencephalogram electrode contact calibration method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0055] Figure 1 is a schematic diagram of SEEG epilepsy diagnosis and treatment according to an embodiment of the present invention;
[0056] Figure 2 is a schematic diagram of electrode contact calibration for postoperative CT images according to an embodiment of the present invention;
[0057] Figure 3 is a schematic diagram of coronal image comparison before and after postoperative CT image electrode contact marking according to an embodiment of the present invention;
[0058] Figure 4 is a schematic flow chart of a method for calibrating electrode contacts of a stereotactic electroencephalogram according to an embodiment of the present invention;
[0059] Figure 5 is a schematic diagram of segmenting an electrode point cloud into an electrode tree according to a node mapping method according to an embodiment of the present invention;
[0060] Figure 6 is another schematic flow chart of a method for calibrating electrode contacts of a stereotactic electroencephalogram according to an embodiment of the present invention;
[0061] Figure 7 is another flow chart of a method for calibrating electrode contacts of a stereotactic electroencephalogram according to an embodiment of the present invention;
[0062] Figure 8 2 is a schematic diagram showing the comparison before and after clustering of electrode point cloud data using the DBSCAN algorithm according to an embodiment of the present invention;
[0063] Fig. 9 is a schematic diagram of an electrode point cloud image after morphological filtering according to an embodiment of the present invention;
[0064] Fig.10 is another schematic flow chart of a method for calibrating electrode contacts of a stereotactic electroencephalogram according to an embodiment of the present invention;
[0065] Fig.11 is a schematic diagram of a high-precision fully automatic identification result of electrode contact structure according to an embodiment of the present invention;
[0066] Fig.12 is a schematic diagram of a visualized image of a labeling result in a medical imaging software according to an embodiment of the present invention;
[0067] Fig.13 is a schematic diagram of a semi-automatic annotation result of the SEEGA open source tool according to an embodiment of the present invention;
[0068] Fig.14 is a schematic diagram of adaptation of a curved electrode according to an embodiment of the present invention;
[0069] Fig.15 is a schematic diagram of an adaptive method for electrodes with difficult-to-resolve images according to an embodiment of the present invention;
[0070] Fig.16 is a simplified schematic diagram of the execution process of the electrode contact calibration method of the stereotactic electroencephalogram according to an embodiment of the present invention;
[0071] Fig.17 is a structural block diagram of an electrode contact calibration device for a stereotactic electroencephalogram according to an embodiment of the present invention;
[0072] Fig.18 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0073] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0074] Intracranial electrodes are multi-contact electrodes made of special materials. Their biggest advantage is that they can directly record electrical activity in the cerebral cortex or deep brain, and can be implanted in the skull for a short or long term. Electrodes implanted in the subject's brain can be used to record brain waves or emit current to stimulate the subject to cause changes in his or her brain. SEEG electrodes are deep intracranial electrodes. After the SEEG electrode implantation surgery is completed, the morphological characteristics of the implanted electrodes can be clearly seen in the acquired intracranial CT images. By analyzing the images, the three-dimensional coordinates, i.e., the spatial position, of the electrode contacts in the skull can be obtained.
[0075] There are two main methods in the related technology. The first method is to align the CT image to the standard template, take the CT image where the electrode to be tested is located and binarize it, take out the binarized image and merge it by image superposition, calculate the two-dimensional coordinates of the starting point and end point of the electrode to be tested on the superimposed image, restore it to three-dimensional coordinates according to the projection transformation, determine the number of contacts of the electrode to be tested according to the number of coronal image layers spanned by the electrode to be tested, and perform linear equidistant interpolation on the electrode to be tested along its axis according to the starting point and end point of the electrode to be tested and the number of contacts to obtain the spatial coordinates of all contacts of the electrode to be tested, and then know the position of each contact of the electrode to be tested in the brain area. The second method uses semi-automatic operation, manually marks the entry point and target point coordinates of each electrode, and provides prior information on electrode parameters such as contact radius, spacing and number. The algorithm then calibrates the coordinates of the electrode contact sequence one by one along the search path determined by the electrode position and direction formed by the entry point and target point, and infers the position of each electrode contact.
[0076] In the related technologies, the main technical problems are as follows:
[0077] 1. The number of contacts is inaccurate. The number of contacts determined by the first solution is the number of coronal layers that the electrode passes through, but in reality, the same electrode contact may be captured by multiple layers. And for electrodes at some imaging angles, the imaging results in the CT image may be continuous image blocks that are adhered, and the discrete contacts cannot be clearly distinguished from each other. Therefore, it is difficult to determine the exact number of contacts by relying on this method, and the contact coordinates obtained will have a large deviation.
[0078] 2. Limitations of linear interpolation. The above two schemes perform linear equidistant interpolation based on the three-dimensional coordinates of the electrode starting point and end point and the number of contacts in the middle to determine the spatial coordinates of all contacts. However, in reality, affected by environmental factors, the actual relative position between electrode contacts will drift and may not be equidistantly distributed as under ideal conditions. In addition, in a few cases, the electrode may have a slight curvature in three-dimensional space after being implanted in the skull. Linear interpolation using the line connecting the starting point and the end point as the electrode axis cannot adapt to the bending situation and introduces systematic errors in the coordinates of the electrode contacts.
[0079] 3. No automatic calculation method for the electrode starting point and end point is introduced. Neither of the above two solutions introduces a method for automatically calculating the electrode starting point and end point after obtaining the two-dimensional superposition image of the electrode. Manual calibration and calculation are required to determine the electrode starting point and end point to provide a search path for the subsequent calculation of the contact coordinates. In the actual SEEG implementation process, the number of electrodes implanted in patients can be as high as more than ten. The method of calibrating the starting point and end point one by one is very cumbersome and greatly affects the accuracy of subsequent contact positioning, and has poor robustness.
[0080] 4. Information loss will occur when simply superimposing images on the coronal plane. The above scheme 1 determines the electrode morphology based on the superimposed projection of the coronal plane layer of the CT image. However, in actual situations, the directions of electrode implantation are very diverse. When implanted relatively perpendicular to the coronal plane, this method will greatly lose electrode morphology information, causing large errors in the final contact positioning results.
[0081] 5. High threshold for operation and low accuracy. The above-mentioned solution 2 adopts semi-automatic operation, which requires manual segmentation of electrodes and determination of the target point and entry point of each electrode, and then inserting the electrode contacts one by one through linear interpolation to obtain the inferred contact position. This method has a high threshold for operation, low contact accuracy, and cannot adapt to electrodes under non-ideal conditions such as bent electrodes.
[0082] In view of this, the disclosed embodiments provide a method for calibrating electrode contacts of a stereotactic electroencephalogram. The application scenario of this method is the SEEG epilepsy diagnosis and treatment field. SEEG is a minimally invasive surgical procedure that implants SEEG electrodes into the brain of an epileptic patient to analyze intracranial epileptic discharges and accurately detect the starting area of the epileptic seizure in the brain. Before the operation, the patient needs to undergo an MRI to determine the structural details of the intracranial brain tissue; after the operation, the patient needs to undergo a CT imaging examination (MRI cannot be performed if metal electrodes are implanted) to determine the implantation position of the electrode, such as Figure 1 As shown in Figure 1, there are two key steps: 1. align the CT image containing the electrode position information with the MRI image containing the intracranial brain tissue structure information; 2. calibrate the spatial coordinates of each contact point of each electrode on the CT image to determine its position in the skull (e.g. Figure 2 shown).
[0083] Among them, there are many mature algorithms that can be automatically completed with high quality for the first key step (image registration). The second key step (calibration of electrode contacts on postoperative CT images) currently still relies on manual semi-automatic labeling with the help of certain tools, which is time-consuming and cumbersome. There is also a lot of room for improvement in labeling accuracy, and often complex and time-consuming manual post-processing operations are required to further correct the contact coordinates. The electrode contact calibration method for stereotactic EEG in the disclosed embodiment mainly focuses on the second key step, which automatically calibrates the electrode contacts on the postoperative CT images, such as Figure 3 As shown, the spatial coordinates of each contact on each electrode are automatically and accurately marked, so that when analyzing the SEEG acquisition signal, it is possible to accurately know in which brain tissue area the epileptic lesion is located within the skull, providing an accurate position reference for subsequent radiofrequency thermocoagulation treatment or minimally invasive surgical resection.
[0084] According to an embodiment of the present invention, an embodiment of a method for calibrating electrode contacts of a stereotactic electroencephalogram is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0085] In this embodiment, a method for calibrating electrode contacts of a stereotactic electroencephalogram is provided, which can be used in computer devices, mobile terminals, such as mobile phones, tablet computers, etc. Figure 4 is a flow chart of a method for calibrating electrode contacts of a stereotactic electroencephalogram according to an embodiment of the present invention. Figure 4 As shown, the process includes the following steps:
[0086] Step S401, constructing a three-dimensional point cloud network topology map based on the three-dimensional point cloud data of multiple SEEG electrodes in the patient's brain.
[0087] Specifically, SEEG is the abbreviation of Stereo-electroencephalography, and its Chinese name is stereotactic electroencephalogram. It is an intracranial invasive diagnostic technology for epilepsy and the clinical gold standard for epilepsy diagnosis. SEEG electrodes are multi-contact electrodes made of special materials. Their biggest advantage is that they can directly record electrical activity in the cerebral cortex or deep brain, and can be implanted in the skull for a short or long term. Multiple SEEG electrodes are implanted in the patient's brain to record brain waves or emit current to stimulate the subject to cause changes in his brain. Three-dimensional point cloud data refers to a set of tightly packed points in space. The spatial coordinates of a point are the three-dimensional vectors [x, y, z] in the coordinate system. The coordinates of all points form a [N, 3] matrix, where N is the number of points in the set.
[0088] Furthermore, the three-dimensional point cloud data here is pre-cleaned to improve the accuracy of detecting the coordinates of the contact points of multiple SEEG electrodes. The three-dimensional point cloud data before cleaning is further reconstructed based on the postoperative CT image data of the patient. The disclosed embodiment uses three-dimensional point cloud data to accurately obtain the complete spatial distribution of the electrodes.
[0089] In a specific example, based on the three-dimensional point cloud data of multiple SEEG electrodes in the patient's brain, a three-dimensional point cloud network topology map is constructed, including:
[0090] Step a1, defining attribute information of nodes and edges, wherein the attribute information includes voxel coordinates of three-dimensional point cloud data and adjacency relationships with adjacent points.
[0091] Exemplarily, in step a1, a node class is defined, and a node class Node is defined, which includes the following attributes: a value representing the voxel coordinates of the node. A neighbor node list is used to store voxel nodes adjacent to the current node, and also represents the voxel coordinates of the three-dimensional point cloud data and the adjacent relationship between the adjacent three-dimensional point cloud data.
[0092] Step a2: construct a three-dimensional point cloud network topology map based on the attribute information of nodes and edges.
[0093] Exemplarily, a node instance is initialized. For each voxel coordinate, a node instance is created and encapsulated as a Node class object. Neighbor nodes are collected. For each node, all voxels with a distance of 1 from it are found as its neighbor nodes. The found neighbor nodes are added to the neighbor list of the current node. Isolated nodes are processed. For nodes without neighbors, they are marked as isolated nodes. The nearest other nodes are found for these isolated nodes, the distance between them is calculated, and the nearest neighbor nodes are added to the neighbor list of the isolated node. After traversing each voxel coordinate of the point cloud in turn, the network topology of the three-dimensional point cloud can be obtained.
[0094] The disclosed embodiment traverses the three-dimensional point cloud data of multiple SEEG electrodes in the patient's brain to construct a three-dimensional point cloud network topology map, thereby effectively segmenting the electrodes and ultimately achieving automated structured labeling of electrode contacts.
[0095] Step S402, using a breadth-first search algorithm, gradually searching the three-dimensional point cloud network topology map to obtain an initial electrode tree set recording contact point coordinate information of multiple SEEG electrodes, and filtering out a target electrode tree set based on the initial electrode tree.
[0096] Specifically, the Breadth-First Search (BFS) algorithm is a blind search method that aims to systematically expand and check all nodes in a graph to find a result.
[0097] Exemplarily, the breadth-first search algorithm is mainly performed through the following process:
[0098] Step b1, initialize the visited node set.
[0099] Specifically, create a visited collection to store the nodes that have been visited.
[0100] Step b2: Based on the 3D point cloud network topology, perform BFS traversal starting from unvisited nodes.
[0101] Specifically, in the 3D point cloud network topology, an unvisited node is selected as the starting point to start the breadth-first search (BFS).
[0102] Step b3, traverse the neighbor nodes of the three-dimensional point cloud network topology.
[0103] Specifically, for each unvisited neighbor node of the current node, the distance between it and the current node is calculated. If the distance is less than a preset threshold, the neighbor node is added to the set of electrode voxels, and the neighbors of the neighbor node are traversed continuously.
[0104] Step b4, setting the stop condition.
[0105] Specifically, when the distance exceeds a threshold, the search for the current path is stopped, and the collected nodes are saved as all voxel coordinates of the electrode.
[0106] Step b5, performing multiple repeated search actions.
[0107] Specifically, for each unvisited node, the above steps b2-b4 are repeated until all nodes are visited, ensuring that the voxel coordinates of all electrodes are collected.
[0108] Step b6, output the result.
[0109] Specifically, the voxel coordinate set of each electrode is saved, and the coordinate set of all electrodes is output, that is, the initial electrode tree set mentioned above.
[0110] like Figure 5 As shown, it is a schematic diagram of segmenting the electrode point cloud into an electrode tree using the node mapping method.
[0111] Furthermore, the electrode trees in the initial electrode tree set are filtered using prior information about the electrodes. The cleaning operation performed on the three-dimensional point cloud data before this step cannot completely remove the impurity components, and the initial electrode tree set still contains impurity structures. Therefore, it is necessary to further screen out the real electrodes from the electrode tree based on the electrode prior information. Specifically, the maximum two-point spacing of each electrode tree in the initial electrode tree set is calculated. When the spacing is less than a certain value, it is considered to be noise or impurities that have not been filtered out; when the spacing is greater than a certain value and the number of electrodes is in a certain empirical interval, the tree is considered to be an electrode structure. According to this rule, each electrode tree is traversed to obtain a filtered electrode tree. The upper and lower bounds of the empirical value interval depend on the specific electrode size information, and the settings are adjusted during actual deployment and use.
[0112] Step S403: if the number of electrode trees in the target electrode tree set is greater than or equal to the first preset number, the contact point prediction coordinates of each SEEG electrode in the target electrode tree set are estimated using a principal axis analysis algorithm.
[0113] Step S404: based on the predicted coordinates of the contact points of each SEEG electrode, draw the contact point envelope area of each SEEG electrode, and determine the target positioning area of each SEEG electrode from the contact point envelope area of each SEEG electrode.
[0114] Step S405, optimizing the current coordinates of all contact points in the target positioning area of each SEEG electrode, and outputting the optimal coordinates of all contact points in the target positioning area.
[0115] Specifically, due to the irregular SEEG electrodes implanted in the patient's brain with some slight bends and deformations, if the line connecting the starting point and the end point is still used as the electrode axis for linear interpolation, it cannot adapt to the bending situation and easily causes large errors in the calibration of the electrode contacts. In addition, this solution is difficult to distinguish adjacent contacts when the electrode imaging is relatively blurred in CT, resulting in calibration failure.
[0116] Therefore, the embodiment of the present disclosure uses the principal axis analysis algorithm to estimate the predicted coordinates of the contacts of each SEEG electrode in the target electrode tree set for each electrode tree, and further uses the coordinates of the point cloud around the contacts to perform local optimization correction on the contact coordinates to achieve flexible coordinate positioning, and derive a contact space coordinate group that is structured and classified according to the electrodes belonging to different electrodes.
[0117] In summary, the electrode contact calibration method of the stereotactic electroencephalogram in the embodiment of the present disclosure is based on the three-dimensional point cloud data of multiple SEEG electrodes in the patient's brain, and a three-dimensional point cloud network topology map is constructed. The breadth-first algorithm is further used to gradually search the three-dimensional point cloud network topology map, segment and extract each SEEG electrode structure, and estimate the predicted coordinates of the contacts of each SEEG electrode in combination with the principal axis analysis algorithm, and then optimize the current coordinates of all contacts in the target positioning area of each SEEG electrode. Finally, the present invention can clearly and accurately distinguish the discrete electrode contact coordinates, even in the case of bending or deformation of the electrode, it can still accurately locate the center of the electrode contact area, and for the situation where the imaging is relatively blurred and it is difficult to manually distinguish the center of the contact, it still has accurate resolution ability. In addition, the present invention can also automatically complete the segmentation and electrode contact calibration tasks between electrodes in the whole process, and independently determine the position and direction of each electrode, without manually marking the coordinates of the electrode entry point and the target point to determine the electrode contact search path, and the operation process is convenient. In addition, through the three-dimensional point cloud data, the complete spatial distribution of the electrode is obtained, and the problem of feature information loss can also be avoided.
[0118] In this embodiment, a method for calibrating electrode contacts of a stereotactic electroencephalogram is provided, which can be used in computer devices, mobile terminals, such as mobile phones, tablet computers, etc. Figure 6 is a flow chart of a method for calibrating electrode contacts of a stereotactic electroencephalogram according to an embodiment of the present invention. Figure 6 As shown, before step 401 of constructing a 3D point cloud network topology map based on the 3D point cloud data of multiple SEEG electrodes in the patient's brain, the following steps are also included:
[0119] Step S601, obtaining postoperative CT image data of multiple SEEG electrodes implanted in the patient's brain.
[0120] Specifically, when analyzing the condition of epilepsy patients, the patient needs to undergo an MRI examination before surgery to determine the structural details of the intracranial brain tissue, and the patient needs to undergo a CT imaging examination after surgery, and then postoperative CT imaging data of the patient's brain containing multiple SEEG electrodes needs to be collected.
[0121] Step S602: construct three-dimensional point cloud data of multiple SEEG electrodes based on postoperative CT image data.
[0122] Specifically, after reading the patient's postoperative CT image data, it is reconstructed into three-dimensional point cloud data to obtain the three-dimensional voxel data of the CT image in the three-dimensional space (the coordinates are integers) The coordinate system is the RAS coordinate system of the CT image. The value of the voxel at each coordinate is a grayscale value. The brighter the voxel area in the CT image, the larger the grayscale value.
[0123] The disclosed embodiment reconstructs the 3D point cloud of CT image data to obtain the complete spatial distribution of the electrodes, which is conducive to accurately obtaining the coordinates of the electrode contacts.
[0124] Step S603 , performing cleaning operations on the three-dimensional point cloud data in sequence according to the coordinate screening method, the point cloud clustering method, and the morphological filtering method.
[0125] Step S604, obtaining three-dimensional point cloud data of multiple SEEG electrodes in the patient's brain after cleaning.
[0126] The disclosed embodiment adopts advanced spatial point cloud detection technology, and performs cleaning operations on the three-dimensional point cloud data in sequence according to the coordinate screening method, the point cloud clustering method, and the morphological filtering method, and performs morphological analysis on the electrodes one by one, which is conducive to completely and accurately determining the electrode shape, direction and position, and obtaining the morphological characteristics of the key contacts of electrodes in different orientations to avoid information loss.
[0127] In some optional embodiments, such as Figure 7 As shown, the above step S603 performs cleaning actions on the three-dimensional point cloud data in sequence according to the coordinate screening method, the point cloud clustering method, and the morphological filtering method, including:
[0128] Step S6031, from the constructed three-dimensional point cloud data of multiple SEEG electrodes, three-dimensional point cloud data with a value greater than a preset coordinate threshold is screened out, and then a three-dimensional point cloud coordinate matrix is generated.
[0129] Specifically, first set the initial threshold (preset coordinate threshold) η = η 0 , the CT point cloud is filtered according to the threshold, and only the coordinates of pixels with grayscale values higher than the threshold are retained All the retained voxel coordinates are grouped into the electrode three-dimensional point cloud coordinate matrix [N, 3], where N is the number of coordinates. The preset coordinate threshold here can be combined with the actual optimization results and can be adjusted step by step according to the preset step size.
[0130] Step S6032, based on the three-dimensional point cloud coordinate matrix, point cloud clustering is performed on the three-dimensional point cloud coordinate matrix according to a preset radius and a preset density, thereby generating a three-dimensional point cloud clustering result.
[0131] Specifically, the DBSCAN algorithm is used to cluster the selected point cloud coordinates. DBSCAN (Density-Based Spatial Clustering of Applications with Noise) is a density-based clustering algorithm that is mainly used to discover clusters of arbitrary shapes and can effectively process noisy data. Its basic idea is to identify high-density areas and form clusters by specifying the radius and density of points, while marking the data points in low-density areas as noise. After clustering, clusters are obtained, each cluster contains several points. After adjusting the parameters appropriately, most electrode structures are clustered into clusters, such as Figure 8 shown.
[0132] For example, first, the basic terms of the DBSCAN algorithm are defined. Core points: If the number of points in the ε neighborhood of a point (including itself) is greater than or equal to the specified minimum point threshold, the point is a core point. Boundary points: It does not meet the core point conditions, but is located in the ε neighborhood of a core point. Noise points: It is neither a core point nor belongs to the ε neighborhood of any core point. Such points will be marked as noise. The point cloud clustering process includes the following processes:
[0133] Step c1, initialize all points in the point cloud as unvisited;
[0134] Step c2, for each point P in the point cloud:
[0135] a. If P has been visited, skip
[0136] b. Mark P as visited
[0137] c. Find the ε neighborhood of P
[0138] d. If the number of points in the ε neighborhood <MinPts:
[0139] i. Mark P as noise
[0140] Otherwise, create a new cluster and add all points in P and its ε neighborhood to the cluster.
[0141] f. For each point Q in the cluster:
[0142] i. If Q has not been visited, mark Q as visited and calculate the ε neighborhood of Q
[0143] ii. If Q is a core point, add all points in the ε neighborhood of Q to the current cluster in step c3 and return all clusters and noise points.
[0144] Step S6033, filtering the three-dimensional point cloud clustering results according to the morphological filtering method, and then obtaining the three-dimensional point cloud data of multiple SEEG electrodes in the patient's brain after cleaning.
[0145] Specifically, after clustering the three-dimensional point cloud data into different clusters, the impurity components that do not belong to the SEEG electrode are filtered out. The filtering rules need to introduce the morphological information of the electrode. The number of coordinate points of a complete electrode is generally within a range. Clusters with fewer points are generally noise points, and clusters with more points are generally impurities such as teeth and electrode wire devices. After filtering according to the volume of the cluster (the number of points), most of the impurities in the three-dimensional point cloud can be filtered out. The electrode after filtering the impurities is as follows Fig. 9 shown.
[0146] The disclosed embodiment executes the above-mentioned steps S6031 to S6033, adopts advanced spatial point cloud detection technology, and performs cleaning operations on the three-dimensional point cloud data in sequence according to the coordinate screening method, the point cloud clustering method, and the morphological filtering method, and performs morphological analysis on the electrodes one by one, which is conducive to completely and accurately determining the electrode shape, direction and position, and obtaining the morphological characteristics of the key contacts of electrodes in different orientations to avoid information loss.
[0147] In some optional embodiments, Figure 6 If the number of electrode trees in the target electrode tree set is less than the first preset number, the process returns to step S603 of performing cleaning operations on the three-dimensional point cloud data in sequence according to the coordinate screening method, the point cloud clustering method, and the morphological filtering method.
[0148] Specifically, the first preset number here is the number of implanted electrodes given in combination with the prior information. If the number of electrode trees in the target electrode tree set after the first screening is less than the number of implanted electrodes K given by the first preset number (prior information), it is considered that the initial threshold (first preset number) is too high, resulting in the distortion of some electrode images and failure to extract them. In this case, the preset coordinate threshold η=η-Δη in the above-mentioned method is automatically reduced according to a certain step length, and the above-mentioned step S604 is automatically returned to re-optimize the three-dimensional point cloud data, thereby ensuring the detection accuracy of the three-dimensional point cloud data.
[0149] In some optional embodiments, such as Fig.10 As shown, in the above step S402, a breadth-first search algorithm is used to gradually search the three-dimensional point cloud network topology map to obtain an initial electrode tree set recording the contact coordinate information of multiple SEEG electrodes, and a target electrode tree set is screened out based on the initial electrode tree, including:
[0150] Step S4021, select an initial node from the three-dimensional point cloud network topology map, and use a breadth-first search algorithm to gradually search each node in the three-dimensional point cloud network topology map starting from the initial node, thereby obtaining an initial electrode tree set that records the contact coordinate information of multiple SEEG electrodes.
[0151] Specifically, an unvisited node is selected as the starting point in the three-dimensional point cloud network topology map, and a breadth-first search action is performed to finally obtain an initial electrode tree set recording contact coordinate information of multiple SEEG electrodes. The specific process of the breadth-first search action is referred to the above steps b1 to b6, which will not be repeated here.
[0152] Step S4022, obtaining the maximum distance between two points in each electrode tree in the initial electrode tree set.
[0153] Step S4023: if the maximum distance between two points in each electrode tree in the initial electrode tree set is greater than a preset threshold, the electrode tree is used as the electrode structure.
[0154] Step 4024, counting electrode trees that satisfy the electrode structure from the initial electrode tree set, and taking the electrode trees that satisfy the electrode structure as the target electrode tree set.
[0155] Specifically, the morphological filtering method mentioned above cannot completely remove impurity components. Therefore, it is necessary to further screen out the real electrodes from the electrode tree based on the electrode prior information. The maximum two-point distance is calculated for each electrode tree in the initial electrode tree set. When the two-point distance is less than or equal to the preset threshold, it is considered to be noise or impurities that have not been filtered out; when the two-point distance is greater than the preset threshold and the number of electrodes is in a certain empirical interval, the tree is considered to be an electrode structure. According to this rule, each electrode tree is traversed to obtain an electrode tree that meets the electrode structure, and then a target electrode tree set is formed.
[0156] The embodiment of the present disclosure executes the above steps S4021 to S4024 to accurately screen out the contact coordinates of multiple SEEG electrodes.
[0157] In some optional embodiments, Fig.10 In the above step S403, if the number of electrode trees in the target electrode tree set is greater than or equal to the first preset number, the contact prediction coordinates of each SEEG electrode in the target electrode tree set are estimated using the principal axis analysis algorithm, including:
[0158] Step S4031: If the number of electrode trees in the target electrode tree set is greater than or equal to a first preset number, a principal axis analysis algorithm is used to calculate the principal axis vector of each electrode tree in the target electrode tree set.
[0159] Exemplarily, the coordinates of the electrode tree can be represented as a data matrix Each row represents the spatial voxel coordinates of a point in the electrode tree, and n is the total number of points in the electrode tree. First, the average coordinates of the electrode tree are calculated and the data matrix is centered;
[0160]
[0161]
[0162] Then calculate the covariance matrix of the centered data matrix;
[0163]
[0164] Calculate eigenvalues and eigenvectors for the covariance matrix;
[0165] Cv i =λ i v i , i = 1, 2, ..., p
[0166] Take the maximum eigenvalue λ 1 The corresponding eigenvector v 1 , which is the main axis direction of the electrode tree, calculate its unit vector v e As the principal axis vector:
[0167]
[0168] Step S4032, based on the main axis vector of each electrode tree in the target electrode tree set, calculate the main axis direction of each electrode tree in the target electrode tree set.
[0169] Step S4033, based on the contact radius of each SEEG electrode, the preset spacing between electrodes and the main axis direction of each electrode tree in the target electrode tree set, the predicted contact coordinates of each SEEG electrode are estimated.
[0170] Specifically, the contact radius of each SEEG electrode is r, and the preset spacing between electrodes is d, which is the prior information of the electrodes.
[0171] Starting from the end of the electrode on the main axis, the main axis coordinates of the contact point are determined based on prior knowledge (contact point spacing);
[0172] Calculate the electrode end point x on the principal axis n (close to the target point), and the electrode initial point x 1 (near the electrode handle), calculate the sign function s of the main axis direction
[0173] s=sign((x n -x 1 )·v e )
[0174] According to the prior information of the electrode: electrode contact radius r and electrode contact distance d, the predicted coordinates of the contact of each SEEG electrode are reversed from the target point along the main axis direction:
[0175] p i =x n -s·[(i-1)·d+r]·v e ,,i=1,2,...,P
[0176] The number of predicted contact coordinates of each SEEG electrode can be inferred to be an empirical maximum value P, which is ensured to be greater than the maximum number of all electrode contacts, such as 15 or 20.
[0177] The disclosed embodiment executes the above-mentioned steps S4031 to S4033 and utilizes the principal axis analysis algorithm to automatically adapt to the situation of slight bending and deformation of the electrode under non-ideal conditions, and accurately locates the electrode at the center of the contact area. Even when the imaging is blurry and it is difficult to distinguish the centers of the contacts in the electrode area, the embodiment still has accurate resolution capability.
[0178] In some optional embodiments, Fig.10In the above step S404, based on the predicted coordinates of the contact of each SEEG electrode, the contact envelope area of each SEEG electrode is drawn, and the target positioning area of each SEEG electrode is determined from the contact envelope area of each SEEG electrode, including:
[0179] Step S4041, taking the predicted coordinates of the contact of each SEEG electrode as the center and according to the contact radius of each SEEG electrode, draw the contact envelope area of each SEEG electrode.
[0180] Step S4042, obtaining the number of electrodes within the contact envelope area of each SEEG electrode.
[0181] Step S4043: If the number of electrodes in the contact envelope area of each SEEG electrode is less than or equal to a second preset number, the contact envelope area of the SEEG electrode is used as a target positioning area.
[0182] Specifically, according to the inferred touch point coordinates on the main axis, touch point verification and local optimization are performed according to prior knowledge (touch point radius) to determine the coordinates of the actual touch point.
[0183] First, for each predicted contact point p i , find all points x within the contact envelope with radius r j , obtain the number of electrodes in the contact envelope area of each SEEG electrode. If the number of electrodes in the contact envelope area of each SEEG electrode is less than or equal to the second preset number, the contact envelope area of the SEEG electrode is used as the target positioning area. The second preset number belongs to an empirical value range. Those exceeding the range are regarded as non-electrode contacts and excluded. The empirical value is determined by experiments. In this way, the target positioning area of each SEEG electrode is screened out from the contact envelope area, thereby achieving accurate positioning of each SEEG electrode.
[0184] In some optional embodiments, Fig.10 In the above step S405, the current coordinates of all contacts in the contact positioning area of each SEEG electrode are optimized, and the optimal coordinates of all contacts in the target positioning area are output, including:
[0185] Step S4051, calculating the mean coordinates of all touch points in the target positioning area.
[0186] Step S4052: Use the mean coordinates as optimized coordinates, and optimize the current coordinates of all touch points in the target positioning area according to the optimized coordinates.
[0187] Step S4053, outputting the optimized optimal coordinates of all touch points in the target positioning area.
[0188] For example, for each retained contact point in the target positioning area, all points x within the envelope surface with a radius of r are calculated. j The mean coordinates of the contact point are used as the optimized coordinates of
[0189]
[0190] n * All points x in the target location area j The number of .
[0191] Finally, the optimized coordinates of the contact points are obtained The coordinates output by the algorithm are structured and outputted in units of each electrode. For example, the coordinates of the contact points of electrodes A and B are outputted separately:
[0192]
[0193] The embodiment of the present disclosure optimizes the current coordinates of all contacts in the target positioning area by executing the above steps S4051-S4052, and can achieve high-precision fully automatic marking of electrode contacts. Fig.11 As shown in FIG. 1 , the electrode contact coordinates in three-dimensional space are annotated and output in a structured manner according to the electrodes belonging to different electrodes. The exported electrode contact coordinates can be visualized in commonly used medical image analysis software, such as Fig.12 shown.
[0194] For example, based on experiments with five clinical data, it is found that the contact point calibration method of the stereotactic EEG in the embodiment of the present disclosure can accurately identify the contacts of multiple SEEG electrodes at a rate of 98.2%, as shown in Table 1 below.
[0195] Table 1
[0196]
[0197] The marking results of the related semi-automatic operation mode have poor contact coordinate positioning accuracy and cannot adapt to non-ideal conditions such as bending of electrode contact tracks. Fig.13 As shown, in comparison, the electrode contact calibration method of the stereotactic EEG in the embodiment of the present disclosure can adapt to curved electrodes, such as Fig.14 As shown. And for electrodes that are difficult to distinguish on the image, the scheme has a high-precision recognition capability that is better than that of human experts, such as Fig.15 As shown. Fig.16 , which is a simplified schematic diagram of the execution process of the electrode contact calibration method for stereotactic EEG in the embodiment of the present disclosure.
[0198] In this embodiment, a device for calibrating electrode contacts of a stereotactic electroencephalogram is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and will not be repeated hereafter. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0199] This embodiment provides a device for calibrating electrode contacts of a stereotactic electroencephalogram. Fig.17 As shown, including:
[0200] A network topology construction module 1701 is used to construct a three-dimensional point cloud network topology map based on the three-dimensional point cloud data of multiple SEEG electrodes in the patient's brain;
[0201] The three-dimensional point cloud search module 1702 is used to use a breadth-first search algorithm to gradually search the three-dimensional point cloud network topology map to obtain an initial electrode tree set that records the contact point coordinate information of multiple SEEG electrodes, and screen out a target electrode tree set based on the initial electrode tree;
[0202] A point cloud coordinate prediction module 1703 is used to estimate the predicted contact coordinates of each SEEG electrode in the target electrode tree set by using a principal axis analysis algorithm if the number of electrode trees in the target electrode tree set is greater than or equal to a first preset number;
[0203] A target region positioning module 1704 is used to determine the predicted coordinates of the contact points based on each SEEG electrode, draw the contact point envelope area of each SEEG electrode, and determine the target positioning area of each SEEG electrode from the contact point envelope area of each SEEG electrode;
[0204] The optimal coordinate output module 1705 is used to optimize the current coordinates of all contact points in the target positioning area of each SEEG electrode and output the optimal coordinates of all contact points in the target positioning area.
[0205] In some optional implementations, the electrode contact calibration device for stereotactic electroencephalogram in the embodiment of the present disclosure further includes:
[0206] A CT data acquisition module is used to acquire postoperative CT image data of multiple SEEG electrodes implanted in the patient's brain;
[0207] The 3D point cloud acquisition module is used to construct the 3D point cloud data of multiple SEEG electrodes based on the postoperative CT image data;
[0208] The 3D point cloud cleaning module is used to perform cleaning operations on the 3D point cloud data in sequence according to the coordinate screening method, point cloud clustering method, and morphological filtering method;
[0209] The cleaning result acquisition module is used to obtain the three-dimensional point cloud data of multiple SEEG electrodes in the patient's brain after cleaning.
[0210] In some optional embodiments, the electrode contact calibration device of the stereotactic electroencephalogram in the embodiment of the present disclosure further includes: a data return module, which is used to return the steps of performing cleaning actions on the three-dimensional point cloud data in sequence according to the coordinate screening method, the point cloud clustering method, and the morphological filtering method if the number of electrode trees in the target electrode tree set is less than the first preset number.
[0211] In some optional embodiments, the 3D point cloud cleaning module includes:
[0212] The point cloud screening submodule is used to screen out the three-dimensional point cloud data with a coordinate value greater than a preset threshold value from the three-dimensional point cloud data of the constructed multiple SEEG electrodes, and then generate a three-dimensional point cloud coordinate matrix;
[0213] The point cloud clustering submodule is used to perform point cloud clustering on the three-dimensional point cloud coordinate matrix according to a preset radius and a preset density based on the three-dimensional point cloud coordinate matrix, and then generate a three-dimensional point cloud clustering result;
[0214] The point cloud clustering submodule is used to filter the three-dimensional point cloud clustering results according to the morphological filtering method, and then obtain the three-dimensional point cloud data of multiple SEEG electrodes in the patient's brain after cleaning.
[0215] In some optional implementations, the three-dimensional point cloud search module includes:
[0216] A data search submodule is used to select an initial node from the three-dimensional point cloud network topology map, and use a breadth-first search algorithm to gradually search each node in the three-dimensional point cloud network topology map from the initial node, thereby obtaining an initial electrode tree set that records the contact coordinate information of multiple SEEG electrodes;
[0217] A data acquisition submodule, used for acquiring the maximum distance between two points in each electrode tree in the initial electrode tree set;
[0218] An electrode determination submodule, for determining, if the maximum distance between two points in each electrode tree in the initial electrode tree set is greater than a preset threshold, the electrode tree as an electrode structure;
[0219] The electrode tree determination submodule is used to count the electrode trees that meet the electrode structure from the initial electrode tree set, and use the electrode trees that meet the electrode structure as the target electrode tree set.
[0220] In some optional implementations, the point cloud coordinate prediction module includes:
[0221] a data analysis submodule, configured to calculate the principal axis vector of each electrode tree in the target electrode tree set by using a principal axis analysis algorithm if the number of electrode trees in the target electrode tree set is greater than or equal to a first preset number;
[0222] A data calculation submodule, for calculating the main axis direction of each electrode tree in the target electrode tree set based on the main axis vector of each electrode tree in the target electrode tree set;
[0223] The data estimation submodule is used to estimate the predicted coordinates of the contact points of each SEEG electrode based on the contact point radius of each SEEG electrode, the preset spacing between electrodes, and the main axis direction of each electrode tree in the target electrode tree set.
[0224] In some optional implementations, the target area positioning module includes:
[0225] The envelope area drawing submodule is used to draw the contact envelope area of each SEEG electrode according to the contact radius of each SEEG electrode, with the predicted contact coordinates of each SEEG electrode as the center;
[0226] The electrode number acquisition submodule is used to obtain the number of electrodes in the contact envelope area of each SEEG electrode;
[0227] The target area positioning submodule is used to use the contact envelope area of each SEEG electrode as the target positioning area if the number of electrodes in the contact envelope area of each SEEG electrode is less than or equal to a second preset number.
[0228] In some optional implementations, the optimal coordinate output module includes:
[0229] The mean coordinate calculation submodule is used to calculate the mean coordinates of all touch points in the target positioning area;
[0230] The current coordinate optimization submodule is used to use the mean coordinate as the optimized coordinate and optimize the current coordinates of all contacts in the target positioning area according to the optimized coordinate;
[0231] The optimal coordinate output submodule is used to output the optimized optimal coordinates of all contacts in the target positioning area.
[0232] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0233] The electrode contact calibration device of the stereotactic EEG in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0234] An embodiment of the present invention further provides a computer device having the above-mentioned electrode contact calibration device for body-oriented electroencephalogram.
[0235] See also Fig.18 , Fig.18 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Fig.18 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Fig.18 A processor 10 is taken as an example.
[0236] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0237] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0238] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0239] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0240] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0241] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0242] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A method for calibrating electrode contacts of a stereotactic electroencephalogram, characterized in that: The method comprises: Based on the 3D point cloud data of multiple SEEG electrodes in the patient's brain, a 3D point cloud network topology map is constructed; Using a breadth-first search algorithm, the three-dimensional point cloud network topology map is gradually searched to obtain an initial electrode tree set recording contact point coordinate information of the plurality of SEEG electrodes, and a target electrode tree set is screened out based on the initial electrode tree; If the number of electrode trees in the target electrode tree set is greater than or equal to a first preset number, estimating the predicted contact coordinates of each SEEG electrode in the target electrode tree set using a principal axis analysis algorithm; Based on the predicted coordinates of the contact of each SEEG electrode, drawing the contact envelope area of each SEEG electrode, and determining the target positioning area of each SEEG electrode from the contact envelope area of each SEEG electrode; The current coordinates of all contact points in the target positioning area of each SEEG electrode are optimized, and the optimal coordinates of all contact points in the target positioning area are output.
2. The method according to claim 1, characterized in that Before the step of constructing a 3D point cloud network topology map based on the 3D point cloud data of multiple SEEG electrodes in the patient's brain, it also includes: Obtain postoperative CT imaging data of multiple SEEG electrodes implanted in the patient's brain; Constructing three-dimensional point cloud data of the plurality of SEEG electrodes based on the postoperative CT image data; Performing cleaning actions on the three-dimensional point cloud data in turn according to a coordinate screening method, a point cloud clustering method, and a morphological filtering method; Acquire three-dimensional point cloud data of multiple SEEG electrodes in the patient's brain after cleaning.
3. The method according to claim 2, characterized in that If the number of electrode trees in the target electrode tree set is less than the first preset number, return to the step of performing cleaning actions on the three-dimensional point cloud data in sequence according to the coordinate screening method, the point cloud clustering method, and the morphological filtering method.
4. The method according to claim 2 or 3, characterized in that: The cleaning operation is performed on the three-dimensional point cloud data in sequence according to the coordinate screening method, the point cloud clustering method, and the morphological filtering method, including: From the constructed three-dimensional point cloud data of the plurality of SEEG electrodes, three-dimensional point cloud data having a coordinate value greater than a preset threshold value are selected to generate a three-dimensional point cloud coordinate matrix; Based on the three-dimensional point cloud coordinate matrix, point cloud clustering is performed on the three-dimensional point cloud coordinate matrix according to a preset radius and a preset density, thereby generating a three-dimensional point cloud clustering result; The three-dimensional point cloud clustering result is filtered according to a morphological filtering method, thereby obtaining the cleaned three-dimensional point cloud data of the multiple SEEG electrodes in the patient's brain.
5. The method according to claim 1, characterized in that Using a breadth-first search algorithm, the three-dimensional point cloud network topology map is gradually searched to obtain an initial electrode tree set recording the contact coordinate information of the plurality of SEEG electrodes, and a target electrode tree set is screened out based on the initial electrode tree, including: Selecting an initial node from the three-dimensional point cloud network topology map, and using a breadth-first search algorithm to gradually search each node in the three-dimensional point cloud network topology map starting from the initial node, thereby obtaining an initial electrode tree set recording contact point coordinate information of the plurality of SEEG electrodes; Obtaining the maximum distance between two points in each electrode tree in the initial electrode tree set; If the maximum distance between two points in each electrode tree in the initial electrode tree set is greater than a preset threshold, the electrode tree is used as an electrode structure; Electrode trees satisfying the electrode structure are counted from the initial electrode tree set, and the electrode trees satisfying the electrode structure are used as the target electrode tree set.
6. The method according to claim 1, characterized in that If the number of electrode trees in the target electrode tree set is greater than or equal to a first preset number, the predicted contact coordinates of each SEEG electrode in the target electrode tree set are estimated using a principal axis analysis algorithm, including: If the number of electrode trees in the target electrode tree set is greater than or equal to a first preset number, using a principal axis analysis algorithm to calculate the principal axis vector of each electrode tree in the target electrode tree set; Calculating the main axis direction of each electrode tree in the target electrode tree set based on the main axis vector of each electrode tree in the target electrode tree set; Based on the contact radius of each SEEG electrode, the preset spacing between electrodes and the main axis direction of each electrode tree in the target electrode tree set, the predicted contact coordinates of each SEEG electrode are estimated.
7. The method according to claim 1, characterized in that Based on the predicted coordinates of the contact of each SEEG electrode, drawing the contact envelope area of each SEEG electrode, and determining the target positioning area of each SEEG electrode from the contact envelope area of each SEEG electrode, including: Taking the predicted coordinates of the contact of each SEEG electrode as the center and according to the contact radius of each SEEG electrode, drawing the contact envelope area of each SEEG electrode; Obtaining the number of electrodes within the contact envelope area of each SEEG electrode; If the number of electrodes within the contact envelope area of each SEEG electrode is less than or equal to a second preset number, the contact envelope area of the SEEG electrode is used as the target positioning area.
8. The method according to claim 1, characterized in that Optimizing the current coordinates of all contacts in the contact location area of each SEEG electrode, and outputting the optimal coordinates of all contacts in the target location area, including: Calculate the mean coordinates of all touch points in the target positioning area; Taking the mean coordinates as optimized coordinates, and optimizing the current coordinates of all touch points in the target positioning area according to the optimized coordinates; Output the optimized optimal coordinates of all contacts in the target positioning area.
9. A device for calibrating electrode contacts of a stereotactic electroencephalogram, characterized in that: The device comprises: A network topology construction module is used to construct a 3D point cloud network topology map based on the 3D point cloud data of multiple SEEG electrodes in the patient's brain; A three-dimensional point cloud search module is used to gradually search the three-dimensional point cloud network topology map using a breadth-first search algorithm to obtain an initial electrode tree set recording contact point coordinate information of the plurality of SEEG electrodes, and screen out a target electrode tree set based on the initial electrode tree; A point cloud coordinate prediction module, used for estimating the predicted contact coordinates of each SEEG electrode in the target electrode tree set by using a principal axis analysis algorithm if the number of electrode trees in the target electrode tree set is greater than or equal to a first preset number; A target area positioning module, used to determine the predicted coordinates of the contact points based on each SEEG electrode, draw the contact envelope area of each SEEG electrode, and determine the target positioning area of each SEEG electrode from the contact envelope area of each SEEG electrode; The optimal coordinate output module is used to optimize the current coordinates of all contact points in the target positioning area of each SEEG electrode and output the optimal coordinates of all contact points in the target positioning area.
10. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the electrode contact calibration method for stereotactic electroencephalogram according to any one of claims 1 to 8 by executing the computer instructions.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the electrode contact calibration method for stereotactic electroencephalography according to any one of claims 1 to 8.
Citation Information
Patent Citations
Three-dimensional electroencephalogram electrode positioning method
CN112465900A
Electroencephalogram-based epileptic region positioning device and method, electronic equipment and storage medium
CN114869300A
Method and system for planning SEEG deep electrode implantation path based on medical image
CN118902604A
Method and system for localizing implanted intracranial electrode
US20200111207A1
Computerized three-dimensional cardiac mapping with interactive visual displays
US5687737A