A method for positioning electrodes of stereo electroencephalogram
Through CT image registration, binarization and image superposition processing, electrode coordinates are calculated and spatial transformation is performed, which solves the problem of electrode site positioning in low-resolution images and achieves efficient and accurate electrode site positioning, which is suitable for Different systems and scenarios.
Patent Information
- Application Number
- CN202011433249.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-09
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2040-12-09
AI Technical Summary
In MRI and CT images with low resolution, it is difficult to accurately locate the EEG electrode sites. The existing technology requires a variety of image data and a large number of parameter settings, and the process is complex and inefficient.
The CT images after electrode implantation are obtained for registration, binary processing and image superposition are performed, the electrode start and end point coordinates are calculated, spatial coordinate transformation is performed to locate the electrode site, and standard templates are used for registration and denoising. , simplify parameter settings and improve positioning accuracy and efficiency.
It achieves accurate positioning of electrode sites in low-resolution images, simplifies the process, improves work efficiency, is suitable for different systems and scenarios, and has strong generalization capabilities and portability.
Smart Images

Figure CN112465900B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of medical image processing, and in particular to a stereo electroencephalogram electrode positioning method using CT image data. Background Art
[0002] Stereotactic electroencephalography (SEEG) is a minimally invasive surgical procedure used to identify the starting area of epileptic seizures in the brain. During the operation, the doctor places electrodes containing multiple sites in the target brain area, and then analyzes the EEG signals collected by the electrodes to accurately locate the epileptogenic area of the epilepsy disease. Stereotactic EEG can provide accurate, reliable and targeted treatment, and can detect epileptic seizure sites deep in the brain that cannot be found by conventional electroencephalography (EEG) tests. However, the position of the electrodes and each site on the electrodes is difficult to locate in MRI and CT images with low resolution, which has a great impact on the subsequent processing and analysis of the images. Therefore, how to effectively locate the position of the brain area where the electrode sites are located is an urgent problem to be solved.
[0003] The existing technology uses a positioning method that first uses a computer to identify and preliminarily screen the electrode sites, and then obtains the selected electrode signals through manual confirmation and screening to ensure the accuracy of the positioning of the electrode sites. Compared with the traditional method of manual labeling, this method improves the positioning accuracy, but the positioning process requires the use of a variety of patient image data, high resolution requirements for image data, and the need to process electrode image signals and voxels; moreover, due to the slight differences in the structure of different human bodies, a large number of calculations are required during the positioning process, and a large number of parameters need to be reset for different situations, which makes the process complicated. Summary of the invention
[0004] In view of this, in order to overcome the above-mentioned defects of the prior art, the present invention proposes a method for positioning stereo EEG electrodes in images with low resolution.
[0005] Specifically, the stereo electroencephalogram electrode positioning method includes:
[0006] S1: Obtain CT images after electrode implantation for registration;
[0007] S2: Binarize the multi-layer image obtained by registration;
[0008] S3: All images containing the target electrode are superimposed into one picture;
[0009] S4: Determine the starting coordinates and the ending coordinates of the target electrode according to the image obtained in step S3, and calculate the electrode site coordinates; the specific execution process includes:
[0010] S41: Determine the two-dimensional coordinates of the starting point and the end point of the target electrode in the image obtained in step S3;
[0011] S42: Obtaining the three-dimensional coordinates of the starting point and the end point according to the two-dimensional coordinates of the starting point and the end point and the image numbers of the starting point and the end point of the target electrode;
[0012] S43: Calculating the coordinates of the electrode site according to the three-dimensional coordinates of the starting point and the end point;
[0013] S5: Transform the electrode site coordinates obtained in step S4 into spatial coordinates, and locate the brain region according to the transformed coordinates. Preferably, the CT image is registered using a standard template.
[0014] Furthermore, step S2 also includes performing denoising on the image obtained by the binarization process to improve the quality of the obtained image.
[0015] The specific algorithm of step S43 is:
[0016] According to the starting coordinates (X1, Y1, Z1) and the end coordinates (X N ,Y N ,Z N ), where N is the number of sites in the electrode, and the coordinates of the kth electrode site (X k , Y k , Z k ):
[0017] signX=sign(X N -X1), where sign is a mathematical function that obtains the + / - sign of a number;
[0018] X k =X1+stepX·k,(k=0,1,...,N-1);
[0019] signY=sign(Y N -Y1), where sign is a mathematical function that obtains the + / - sign of a number;
[0020] Y k =Y1+stepY·k,(k=0,1,...,N-1);
[0021] signZ=sign(Z N -Z1), where sign is a mathematical function that obtains the + / - sign of a number;
[0022] Zk =Z1+stepZ·k, (k=0,1,...,N-1).
[0023] Specifically, the number of electrode midpoints N is the number of coronal plane images containing the target electrode. Further, the values of the three-dimensional coordinates calculated in step S43 are rounded.
[0024] The specific execution process of step S5 includes:
[0025] S51: transform the spatial coordinates obtained in step S4 into coordinates in the standard template according to the formula (X, Y, Z) = T*(Xk, Yk, Zk) + b, where T is the linear mapping matrix and b is the vector required for the translation representation;
[0026] S52: superimposing the registered CT image with the standard template;
[0027] S53: Locate the brain region according to the transformed coordinates.
[0028] The specific process of the binarization includes: setting a threshold, comparing the image pixels obtained in step S1 with the threshold, adjusting the pixels of the part greater than the threshold to 255, and adjusting the pixels of the part less than the threshold to 0.
[0029] Based on the above-mentioned stereo electroencephalogram electrode positioning method, the present invention also provides a stereo electroencephalogram electrode positioning system, comprising:
[0030] A registration module, used for registering the acquired CT images after electrode implantation;
[0031] A binarization module is used to perform binarization processing on the multi-layer image obtained by registration;
[0032] An image superposition module, used for superimposing all images containing the target electrode into one picture;
[0033] A coordinate calculation module, used to determine the starting point coordinates and the end point coordinates of the target electrode according to the image obtained in step S3, and calculate the electrode site coordinates;
[0034] The coordinate transformation module is used to transform the electrode site coordinates obtained in step S4 into spatial coordinates, and locate the brain area according to the transformed coordinates.
[0035] In summary, the stereo EEG positioning method of the present invention can work with only postoperative CT images, does not require multiple imaging data of patients, and does not require setting a large number of parameters, and has strong generalization ability; it can still be used when the CT image resolution is low, and is not affected by the obtained CT image resolution, thereby improving the work efficiency of the experiment. Furthermore, the application of the calculation steps can be applied to development scenarios on different systems, has strong portability, and the positioning method is practical and effective. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0037] Figure 1 Schematic diagram of the workflow of the stereo electroencephalogram electrode positioning method of the present invention;
[0038] Figure 2 It is the CT coronal image of a certain electrode after binarization;
[0039] Figure 3 To include Figure 2 Mosaic of all CT coronal images of the electrodes shown
[0040] Figure 4 is a partial coronal image of the target electrode in Example 2;
[0041] Figure 5 It is a structural schematic diagram of the stereo electroencephalogram electrode positioning system of the present invention. DETAILED DESCRIPTION
[0042] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only 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 ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0043] The present invention provides a stereo electroencephalogram electrode positioning method, which uses a reference image to register a CT image obtained after electrode implantation; performs binarization processing on each layer of images obtained by the registration; determines each layer of images spanned by a target electrode to be positioned, and splices them; calculates the coordinates of the electrode site in the CT image according to the starting point coordinates and the end point coordinates of the target electrode; converts the coordinates of the electrode site in the CT image into coordinates in a standard template through spatial coordinate transformation, and locates the brain region corresponding to the electrode according to the coordinates in the standard template.
[0044] Example 1
[0045] See the instruction manual Figure 1 The specific working process of the stereo electroencephalogram electrode positioning method of the present invention is as follows:
[0046] S1: Align the CT image obtained after electrode implantation to the reference image. Among them, the reference image uses a standard template, and the open source tools fsl or spm can be used in the alignment process. In this embodiment, the linear alignment function in the fsl tool is used to align the patient's postoperative CT image to the CT template. Specifically, the selection of some parameters during alignment is: -in: the image to be aligned, -ref: the reference image, -omat: the affine matrix saved in the alignment process, -out: the alignment result; wherein, the affine transformation serves to align the target image with the reference image at the voxel level during the alignment process. Other parameters such as cost function weighting make different voxels have different weights, degrees of freedom, interpolation method, cost function and other parameters use the default settings.
[0047] In some embodiments, the MNI152 template is used as a standard template for registration. The above CT template and the MNI152 template have the same structure. Optionally, the ICBM152 template can also be used as a standard template.
[0048] S2: The CT image after registration forms a multi-layer image, and each layer of the image is first binarized. The specific process of binarization includes: setting a threshold, comparing the image pixels obtained in step S1 with the threshold, adjusting the pixels of the part greater than the threshold to 255, and adjusting the pixels of the part less than the threshold to 0. In the image after binarization, the pixel value of the skull and the electrode is 255, displayed in white, and the background pixel value is 0, displayed in black. In this embodiment, the OTSU binarization method is used. Then, the binarized image is denoised to improve the image quality. Specifically, the morphological operation in digital image processing can be used. The image obtained after the execution of step S2 is as follows Figure 2 shown.
[0049] S3: Determine each layer of image spanned by the target electrode, and superimpose all binary images between the start and end positions of the electrode into one image to obtain an image that can clearly show the shape of the electrode. Optionally, the above image superposition can be performed using add() in OpenCV, or other image superposition methods, such as resize() and addWeighted(). The spliced image is as follows Figure 3 As shown, the white electrodes are clearly visible.
[0050] S4: The spliced image obtained in step S3 is regarded as the projection of the electrode from the three-dimensional position to the two-dimensional position. The two-dimensional coordinates of the starting point and the end point of the electrode are calculated in the spliced image. Then, the original three-dimensional coordinates are restored according to the projection, which is the coordinate position of the electrode in the CT image after registration. For example, the process of calculating the coordinates of the electrode site named A and the number of electrode sites N is as follows: mark all the sites on the electrode as A1, A2, ..., A N The electrode site deep inside the skull is A1, which is the starting position of the electrode. Its three-dimensional coordinates are (X1, Y1, Z1); the electrode site close to the skull is A N , as the electrode end point, its three-dimensional coordinates are (X N ,Y N ,Z N ). Specifically, the number of sites is equal to the number of coronal images containing the target electrode.
[0051] The following formula is used to calculate the X-direction coordinates of all electrode sites:
[0052] signX=sign(X N -X1), where sign is a mathematical function that obtains the + / - sign of a number; X k =X1+stepX·k, (k=0,1,...,N-1).
[0053] Similarly, the calculation process of the Y-direction coordinates of the electrode sites is:
[0054] signY=sign(Y N -Y1), where sign is a mathematical function that obtains the + / - sign of a number; Y k =Y1+stepY·k, (k=0, 1, ..., N-1).
[0055] The calculation process of the Z-direction coordinates of the electrode sites is:
[0056] signZ=sign(Z N -Z1), where sign is a mathematical function that obtains the + / - sign of a number; Z k =Z1+stepZ·k, (k=0, 1, ..., N-1).
[0057] S5: After obtaining the coordinates of the electrode sites in the CT image, due to the different deviation directions of the CT / MNI voxel location coordinates (voxellocation) and the MNI spatial coordinates (MNI coordinates), the coordinates need to be transformed into spatial coordinates: (X, Y, Z) = T*(Xk, Yk, Zk) + b, where T is the linear mapping matrix and b is the vector required for translation. When using the formula specifically, it is necessary to select different transformation matrices according to the actual situation. Afterwards, the registered CT image is superimposed with the MNI152 standard template, and the brain region position of this site is obtained by locating the brain region according to the transformed coordinates. Repeat this process to obtain the brain region coordinates of all electrode sites.
[0058] Example 2
[0059] This embodiment provides a specific calculation process for locating a target electrode.
[0060] Specifically, this embodiment locates a target electrode numbered 86-99, and the above-mentioned electrode has a total of 14 coronal plane images, see the attached manual Figure 4 , which are 7 images extracted from it, and you can see the changes of the electrode in different images. Since CT images are a set of images formed by several images, each image can only reflect a part of the electrode, so the images need to be superimposed to show the shape of the complete electrode.
[0061] The electrodes span numbers 86-99, and the Z coordinates of the MNI voxel space position are 86-99. Then Z1=86 is the position where the electrode penetrates deep into the skull, which is considered to be the starting position of the electrode. N =99 is the electrode position close to the skull, which is considered to be the end position. In the superimposed image, the electrode starting x is 85, y is 160, and the end x is 38, y is 163. Here, it is assumed that there is an electrode site at the starting point and there is no electrode site at the end point. The position deviation of the electrode site needs to be considered in the actual calculation, that is, the electrode site coordinates of the starting position are A1 (X1=85, Y1=160, Z1=86), and the end point coordinates are A N (X N =38, Y N =163, Z N =99). According to the number of electrode sites 14, the positions of all electrodes can be calculated:
[0062] signX=sign(X N -X1),
[0063]
[0064] Similarly, we can get:
[0065]
[0066] Then, perform a spatial affine transformation When used specifically, it is necessary to select a different transformation matrix T according to the actual situation. X, Y, Z are the coordinates of the electrode site in the Talairach space, and X′, Y′, Z′ are the obtained MNI space coordinates.
[0067] To convert Talairach coordinates to MNI coordinates, perform the following transformation: The transformation matrix T is obtained as follows:
[0068] If the voxel position coordinates are converted to MNI coordinates, since the voxel coordinates can only be positive integers and 0, it is necessary to calculate round(X1+stepX·k), round(Y1+stepY·k), round(Z1+stepZ·k), where round is the rounding sign; the spatial affine transformation is as follows:
[0069]
[0070] Then we get
[0071]
[0072] Among them, X, Y, Z are the coordinates of the electrode site in the MNI voxel space, and X′, Y′, Z′ are the obtained MNI space coordinates.
[0073] Example 3
[0074] This embodiment is a stereo EEG electrode positioning system using the stereo EEG electrode positioning method provided in Embodiment 1.
[0075] See the instruction manual Figure 5 , the stereo EEG electrode positioning system includes:
[0076] A registration module, used for registering the acquired CT images after electrode implantation;
[0077] A binarization module is used to binarize the multi-layer image obtained by the registration, and then denoise the binarized image;
[0078] An image superposition module, used to superimpose all images containing the target electrode into one picture;
[0079] A coordinate calculation module, used to determine the starting coordinates and the ending coordinates of the target electrode according to the image obtained in step S3, and calculate the electrode site coordinates;
[0080] The coordinate transformation module is used to transform the electrode site coordinates obtained in step S4 into spatial coordinates, and locate the brain area according to the transformed coordinates.
[0081] In summary, the present invention provides a method for stereoscopic EEG electrode positioning in images with low resolution, which can work with only post-operative CT images, does not require multiple imaging data of patients, and does not require setting a large number of parameters, and has strong generalization ability; it is not affected by the resolution of the obtained CT images, and can still be used when the CT image resolution is low, thereby improving the work efficiency of the experiment; the brain region where the site is located can be found according to the calculated coordinates of the electrode site, which is a prerequisite for subsequent processing and analysis at the brain region level; moreover, except for the alignment step, the other calculation steps of the method can be used on all platforms, with strong portability, adapting to development scenarios on different systems, and thus more practical and effective.
[0082] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. In addition to the above embodiments, there may also be different variations. The technical features of the above embodiments may be combined with each other. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A stereo electroencephalogram electrode positioning method, characterized in that: S1: Acquire a CT image after electrode implantation, and register the CT image using a reference image; the reference image uses a standard template; S2: Binarize the multi-layer image obtained by registration; S3: All images containing the target electrode are superimposed into one picture; S4: Determine the starting coordinates and the end coordinates of the target electrode according to the image obtained in step S3, and calculate the electrode site coordinates; the specific execution process includes: S41: Determine the two-dimensional coordinates of the starting point and the end point of the target electrode in the image obtained in step S3; S42: Obtaining the three-dimensional coordinates of the starting point and the end point according to the two-dimensional coordinates of the starting point and the end point and the image numbers of the starting point and the end point of the target electrode; S43: Calculating the coordinates of the electrode site according to the three-dimensional coordinates of the starting point and the end point; The specific algorithm of step S43 is: According to the starting coordinates (X1, Y1, Z1) and the end coordinates (X N ,Y N ,Z N ), where N is the number of sites in the electrode, and the coordinates of the kth electrode site (X k ,Y k ,Z k ): signX=sign(X N -X1), where sign is a mathematical function that obtains the + / - sign of a number; X k =X1+stepX·k,(k=0,1,...,N-1); signY=sign(Y N -Y1), where sign is a mathematical function that obtains the + / - sign of a number; Y k =Y1+stepY k,(k=0,1,...,N-1); signZ=sign(Z N -Z1), where sign is a mathematical function that obtains the + / - sign of a number; Z k =Z1+stepZ·k,(k=0,1,...,N-1); S5: Performing spatial coordinate transformation on the electrode site coordinates obtained in step S4, and locating the brain region according to the transformed coordinates.
2. The stereo electroencephalogram electrode positioning method according to claim 1, characterized in that: Step S2 also includes performing denoising processing on the image obtained by the binarization processing.
3. The stereo electroencephalogram electrode positioning method according to claim 1, characterized in that: The values of the three-dimensional coordinates calculated in step S43 are rounded.
4. The stereo electroencephalogram electrode positioning method according to claim 3, characterized in that: The number N of sites in the electrode is the number of coronal images containing the target electrode.
5. The stereo electroencephalogram electrode positioning method according to claim 1, characterized in that: The specific execution process of step S5 includes: S51: transform the spatial coordinates obtained in step S4 into coordinates in the standard template according to the formula (X, Y, Z) = T*(Xk, Yk, Zk) + b, where T is the linear mapping matrix and b is the vector required for the translation representation; S52: superimposing the registered CT image with the reference image; S53: Locate the brain region according to the transformed coordinates.
6. The stereo electroencephalogram electrode positioning method according to claim 1, characterized in that: The specific process of the binarization includes: Setting a threshold, comparing the image pixels obtained in step S1 with the threshold; The pixels of the part larger than the threshold are adjusted to 255, and the pixels of the part smaller than the threshold are adjusted to 0.
7. A stereo electroencephalogram electrode positioning system, used to perform the method according to any one of claims 1 to 6, characterized in that: include, A registration module, used for registering the acquired CT images after electrode implantation; A binarization module is used to perform binarization processing on the multi-layer image obtained by registration; An image superposition module, used for superimposing all images containing the target electrode into one picture; A coordinate calculation module, used to determine the starting point coordinates and the end point coordinates of the target electrode according to the image obtained in step S3, and calculate the electrode site coordinates; The coordinate transformation module is used to transform the electrode site coordinates obtained in step S4 into spatial coordinates, and locate the brain area according to the transformed coordinates.
Citation Information
Patent Citations
Two-dimensional image and CT or MR image three-dimensional fusion method
CN106204511A
Alzheimer's disease prediction method and device, equipment and medium
CN108682009A
Human-computer interaction type intracranial electrode positioning method and system based on three-dimensional convolution
CN109662778A
Method and system for locating intracranial electrode
TWI680744B
System and method for image registration
US20120314923A1
