A method and system for generating a magnetoencephalogram diagnosis report of epileptogenic focus
Through structural preprocessing, spike wave detection and cluster analysis of traceability results, the magnetoencephalography diagnosis process is automatically completed, solving the problem of time and difficulty of magnetoencephalography diagnosis, generating detailed diagnostic reports, and improving diagnostic efficiency and quality.
Patent Information
- Application Number
- CN202411165242.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-23
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2044-08-23
AI Technical Summary
The existing magnetoencephalography diagnostic methods are time-consuming and difficult. Doctors need long-term training and practice, and are difficult to promote, and lack data analysis functions, resulting in a subjective and low information on the diagnostic report.
A method for generating a magnetoencephalogram diagnostic report for epilepsy-induced epilepsy foci is proposed, including structural image preprocessing and registration, spike wave detection, traceability calculation and cluster analysis, to generate detailed diagnostic reports, and to automatically complete magnetoencephalogram judgment process, providing quantitative characteristics and personalized analysis.
It effectively reduces the doctor's boring labeling workload, improves diagnostic efficiency and quality, and the reports generated are detailed and comprehensive, with clinical guidance significance, reduces the doctor's working time and provides objective analysis.
Smart Images

Figure CN118711742B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a method and system for generating a magnetoencephalogram diagnosis report of an epileptic focus. Background Art
[0002] Epilepsy is a chronic disease caused by abnormal brain discharges, with diverse clinical manifestations, including motor, sensory, autonomic, conscious and mental disorders. The goal of epilepsy treatment is to control seizures. About 70% of patients can control seizures with anti-epileptic drugs, and the rest require surgical control. Preoperative evaluation of epilepsy patients usually requires multimodal comprehensive evaluations such as neuroimaging, structural imaging, and functional imaging to locate the epileptogenic focus.
[0003] Magnetoencephalography (MEG) is a high-end neuroimaging technology developed in recent years. It uses electrodes outside the scalp to measure the weak magnetic field emitted by brain neurons to evaluate brain function. A large number of studies have shown that doctors with rich clinical experience can use MEG to accurately locate the epileptogenic focus of epilepsy patients. The consistency with invasive detection methods such as intracranial electroencephalography and stereo electroencephalography is over 80%, which is a technology with great potential for clinical application.
[0004] The general process of magnetoencephalography (MEG) interpretation is as follows: the doctor browses the patient's MEG images segment by segment, looking for suspicious spike wave (pathological spike waves, sharp waves, multiple spike waves, etc. are all related to the epileptogenic focus, here referred to as spike wave) time points in the images; the spike wave time point waveform data is combined with the structural image data, and the possible location of the epileptogenic focus is obtained using the source tracing algorithm; after completing the full browsing of the MEG images, the most likely location of the epileptogenic focus is determined by analyzing all the spike wave point images and source tracing positions of the patient.
[0005] In clinical practice, the amount of MEG data is huge, and it takes a long time for doctors to browse MEG images and annotate spike waves, usually more than 3 hours for one case. In addition, spike wave identification is difficult, and doctors need a long period of training and practice to be competent, which indirectly makes it difficult to promote it. The existing MEG image judgment software does not have a supporting data analysis function. The doctor's comprehensive analysis of the lesion location of the case is completely summarized in his mind, and the diagnosis report is subjective and contains less information, only the final lesion location. Summary of the invention
[0006] Based on the technical problems existing in the background technology, the present invention proposes a method and system for generating a magnetoencephalogram diagnostic report of epileptogenic foci, which effectively reduces the doctor's tedious labeling workload and provides quantitative features to help understand the degree of case personalization.
[0007] The present invention provides a method for generating a magnetoencephalogram diagnosis report of an epileptic focus, comprising the following steps:
[0008] Step 1: pre-process and register the structural image of the case to be diagnosed, and obtain the guidance field matrix and source position of the case magnetoencephalogram forward problem;
[0009] Step 2: Perform spike wave detection on the magnetoencephalogram of the case to be diagnosed to obtain a spike wave time point sequence, and intercept the time neighborhood data of all spike wave time points in the magnetoencephalogram of the case according to the spike wave time point sequence to construct a magnetoencephalogram spike wave sequence data matrix group containing different data matrices;
[0010] Step 3: Based on the guidance field matrix and source position of the case magnetoencephalogram forward problem, traverse each data matrix in the magnetoencephalogram spike wave sequence data matrix group, combine the set constraints, approximately solve the source coordinates and source direction of each spike wave moment under the underdetermined condition, and take the source coordinates and source direction of each spike wave moment as the spike wave sequence magnetoencephalogram source tracing result and save it;
[0011] Step 4: Normalize the magnetoencephalogram spike wave sequence data matrix group and the spike wave sequence magnetoencephalogram source tracing results respectively, calculate the spike wave similarity between each pair of data in each data matrix of the normalized magnetoencephalogram spike wave sequence data matrix group, and perform weighted summation to obtain the total similarity matrix of the spike wave sequence, cluster the total similarity matrix of the spike wave sequence to obtain the class center data matrix, set constraints on the class center data matrix, approximately solve the source coordinates and source direction of each class center data under the underdetermined condition, and save the source coordinates and source direction of each class center data as the class center magnetoencephalogram source tracing result;
[0012] Step 5: Generate a diagnostic report based on the magnetoencephalogram spike wave sequence data matrix group, the spike wave sequence magnetoencephalogram tracing results, the class center data matrix, and the class center magnetoencephalogram tracing results.
[0013] Furthermore, in step one, it specifically includes:
[0014] S11, normalizing the structural image of the case to be diagnosed to obtain a normalized structural image of the case, registering the pre-set template structural image with the normalized structural image of the case to obtain a registration transformation matrix, and transforming the pre-set anatomical reference points of the template structural image to the normalized structural image using the registration transformation matrix to obtain reference points of the normalized structural image of the case;
[0015] S12, pairing the reference points stored in the magnetoencephalogram of the case to be diagnosed with the reference points of the standardized case structural image, transforming the coordinate system of the case magnetoencephalogram to the coordinate system of the standardized case structural image, and correcting the scalp position points stored in the case magnetoencephalogram using the nearest point search method ICP to match the scalp points in the standardized case structural image, and obtaining a registration matrix of the case magnetoencephalogram and the standardized case structural image, wherein the registration matrix includes the relative spatial position information of the magnetoencephalogram helmet and the patient's brain;
[0016] S13, obtaining the scalp, skull, and cerebral cortex regions by image segmentation of the standardized case structure image, dividing the cerebral cortex region into surface grids, and obtaining the spatial coordinates of the grid vertices;
[0017] S14, based on the registration matrix of step S12, converting the spatial coordinates of the grid vertices and the spatial positions of the sensor coils in the magnetoencephalography helmet into the same coordinate system;
[0018] S15. Use the Biot-Savart law in electromagnetism to solve the forward magnetoencephalogram problem, obtain the guiding field matrix and source position of the forward magnetoencephalogram problem of the case and save them.
[0019] Furthermore, in step 4, the generation of the class center data matrix specifically includes:
[0020] Extracting channel data corresponding to spike wave moment points from the magnetoencephalogram spike wave sequence data matrix group, separating the channel data according to magnetometer and gradiometer channels, merging the time dimension with the channel dimension to obtain a spike wave neighborhood matrix group, normalizing the row vectors of the spike wave neighborhood matrix group to obtain a normalized magnetoencephalogram spike wave sequence data matrix group, wherein the magnetoencephalogram spike wave sequence data matrix group includes a magnetometer neighborhood matrix, a gradiometer neighborhood matrix, a magnetometer spike wave matrix, a gradiometer spike wave matrix, a source coordinate matrix of spike wave moment points, and a source direction matrix of spike wave moment points;
[0021] For each data matrix in the normalized magnetoencephalogram spike sequence data matrix group, the spike similarity between each pair of data in each matrix is calculated to obtain the similarity matrix corresponding to each matrix, and the total similarity matrix of the spike sequence is obtained by weighted summation of all similarity matrices;
[0022] The total similarity matrix of the spike wave sequence is clustered to obtain the spike wave category sequence. Based on the defined K typical spike wave categories, the corresponding typical spike wave categories are taken out from the spike wave category sequence, and the corresponding data of the taken out typical spike wave categories in the magnetoencephalogram spike wave sequence data matrix group are taken out to form a class center data matrix.
[0023] Furthermore, in step 5, the diagnostic report generation process is as follows:
[0024] S51, taking the brain magnetic data corresponding to K typical spike wave classes in the class center data matrix and drawing the waveform diagrams of the magnetometer and the gradiometer respectively according to the magnetometer and the gradiometer;
[0025] S52, taking the EEG magnetic data corresponding to K typical spike wave classes in the class center data matrix, calculating the duration, amplitude, left and right slopes, and sharpness of the fast wave in which the spike wave is located as the fast wave characteristics of the typical spike wave, and displaying them in parallel with the waveform diagram in S51;
[0026] S53: Take the source coordinates and source directions corresponding to the K typical classes of the brain magnetic source tracing results of the class center, and display them at the corresponding coordinates of the case structure image schematic diagram; take the source coordinates of each spike wave time point in the brain magnetic source tracing results of the spike wave sequence, and display them at the corresponding coordinates of the case structure image schematic diagram;
[0027] S54: taking the spike wave sequence in the magnetoencephalogram spike wave sequence data matrix group, dividing the number of spike waves N by the total duration of the magnetoencephalogram to obtain the frequency of spike wave attacks, and multiplying by the unit time to obtain the frequency of spike wave attacks per unit time;
[0028] S55: Take the spike wave sequence in the magnetoencephalogram spike wave sequence data matrix group, divide each data into 8 brain regions according to the channel position and calculate the fourth power of the spike wave amplitude at the moment of all channels in each brain region, select the brain region where the fourth power of the spike wave amplitude at the moment of the maximum value is located as the brain region of the spike wave, count the brain region distribution of all spike waves, obtain the brain region distribution of the patient's spike wave attack channel, and combine it with the spike wave attack frequency per unit time of S54 to draw a schematic diagram of the brain region and time attack analysis of the spike wave;
[0029] S56: Combine the fast wave characteristics, the frequency of spike wave attacks per unit time, the brain area distribution of the spike wave attack channels, and all the schematic diagrams drawn from S51 to S55 into a report to generate a diagnosis report.
[0030] A system for generating a magnetoencephalogram (MEG) diagnosis report of an epileptic focus, comprising an image preprocessing module, a MEG preprocessing module, a first calculation module, a second calculation module and a generation module;
[0031] The structural image preprocessing module is used to preprocess and register the structural images of the case to be diagnosed, and obtain the guidance field matrix and source position of the case magnetoencephalogram forward problem;
[0032] The magnetoencephalogram preprocessing module is used to perform spike wave detection on the magnetoencephalogram of the case to be diagnosed, obtain a spike wave time point sequence, and intercept the time neighborhood data of all spike wave time points in the magnetoencephalogram of the case according to the spike wave time point sequence to construct a magnetoencephalogram spike wave sequence data matrix group containing different data matrices;
[0033] The first calculation module traverses each data matrix in the MEG spike wave sequence data matrix group based on the guidance field matrix and source position of the case MEG forward problem, and approximately solves the source coordinates and source direction of each spike wave moment point under the underdetermined condition in combination with the set constraints, and takes the source coordinates and source direction of each spike wave moment point as the result of the spike wave sequence MEG tracing and saves it;
[0034] The second calculation module is used for normalizing the magnetoencephalogram spike wave sequence data matrix group and the spike wave sequence magnetoencephalogram source tracing result respectively, calculating the spike wave similarity between each pair of data in each data matrix of the normalized magnetoencephalogram spike wave sequence data matrix group and performing weighted summation to obtain the total similarity matrix of the spike wave sequence, clustering the total similarity matrix of the spike wave sequence to obtain the class center data matrix, setting constraints on the class center data matrix, approximately solving the source coordinates and source direction of each class center data under the underdetermined condition, and taking the source coordinates and source direction of each class center data as the class center magnetoencephalogram source tracing result and saving it;
[0035] The generation module generates a diagnosis report based on the magnetoencephalogram spike wave sequence data matrix group, the spike wave sequence magnetoencephalogram tracing results, the class center data matrix, and the class center magnetoencephalogram tracing results.
[0036] The advantages of the method and system for generating a magnetoencephalogram diagnosis report of an epileptogenic focus provided by the present invention are: the method and system for generating a magnetoencephalogram diagnosis report of an epileptogenic focus provided in the structure of the present invention automatically completes the entire process of magnetoencephalogram judgment and produces an objective analysis and diagnosis report, thereby improving the doctor's diagnostic efficiency and quality. It effectively reduces the doctor's tedious annotation workload, and provides quantitative features to help understand the degree of case personalization. The produced diagnostic report describes the case situation in a detailed and comprehensive manner, which has clinical guidance significance. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 It is a schematic diagram of the structure flow of the present invention;
[0038] Figure 2a This is a typical spike magnetometer neighborhood display;
[0039] Figure 2b A diagram showing a typical gradiometer neighborhood;
[0040] Figure 3 Schematic diagram for calculation of spike wave morphological characteristics;
[0041] Figure 4 Provide 3D display for tracing and locating the structure image;
[0042] Figure 5 This is the frequency distribution diagram of spike wave attacks in brain areas and time dimensions. DETAILED DESCRIPTION
[0043] Below, the technical solution of the present invention is described in detail through specific embodiments. Many specific details are set forth in the following description to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific implementation disclosed below.
[0044] like Figures 1 to 5 As shown, the present invention proposes a method for generating a magnetoencephalogram diagnosis report of an epileptogenic focus, comprising the following steps:
[0045] Step 1: pre-process and register the structural image of the case to be diagnosed to obtain the guidance field matrix and source position of the case magnetoencephalogram forward problem; specifically including steps S11 to S15:
[0046] S11, normalizing the structural image of the case to be diagnosed to obtain a normalized structural image of the case, registering the pre-set template structural image with the normalized structural image of the case to obtain a registration transformation matrix, and transforming the pre-set anatomical reference points (NAS points, LPA points, RPA points) of the template structural image to the normalized structural image using the registration transformation matrix to obtain reference points of the normalized structural image of the case;
[0047] In this embodiment, the magnetoencephalogram of the case to be diagnosed has completed the spatiotemporal signal separation filter (maxwell_filter) preprocessing by default. If the input magnetoencephalogram of the case has not undergone such preprocessing, the preprocessing operation can be supplemented in the algorithm flow.
[0048] The case structural image data coordinate system was rotated to the standard coordinate system, and the resolution was adjusted using the interpolation method. A single pixel point corresponded to a 1mm step in space and was homogeneous in all directions. The image was then cropped to an appropriate size to obtain a standardized case structural image.
[0049] After obtaining the reference points of the standardized case structure image, the common image features of the human brain structure image are used to locate the position of the external auditory canal and the tragus, and the positions of the anatomical reference points (NAS points, LPA points, RPA points) obtained by alignment are locally fine-tuned. The local fine-tuning process of the NAS points, LPA points, and RPA points can be achieved by referring to Patent No. CN115797293A (an automatic labeling method for brain image reference points based on magnetic resonance imaging), which will not be repeated in this embodiment.
[0050] In this embodiment, the resolution of the standardized case structure image is 1 mm, the center of mass of the head is translated to the middle of the standardized case structure image, and the size of the standardized case structure image is generally The template structural image uses the MNI152-Linear template. The preset anatomical reference points of the template structural image are manually selected on the standard template and permanently saved, and do not need to be re-specified during the process. The registration algorithm in this example uses the affine transformation (Affine) registration method, but is not limited to this. Other registration algorithms with equal or better effects can be used instead.
[0051] S12, pairing the reference points stored in the magnetoencephalogram of the case to be diagnosed with the reference points of the standardized case structural image, transforming the coordinate system of the case magnetoencephalogram to the coordinate system of the standardized case structural image, and correcting the scalp position points stored in the case magnetoencephalogram using the nearest point search method (ICP (Iterative Closest Point) matching algorithm) to match the scalp points in the standardized case structural image, and obtaining a registration matrix of the case magnetoencephalogram and the standardized case structural image, wherein the registration matrix includes the relative spatial position information of the magnetoencephalogram helmet and the patient's brain;
[0052] The ICP matching algorithm is as follows:
[0053]
[0054]
[0055]
[0056]
[0057]
[0058] Where: the source point cloud corresponds to the scalp position points stored in the case magnetoencephalogram, and the target point cloud corresponds to the scalp points in the standardized case structural image. Respectively represent the centroid of the source point cloud and the centroid of the target point cloud after matching, Represents the first Points, Indicates the target point Points, They represent the centroid of the source point cloud and the centroid of the target point cloud before matching, are the matrices after SVD decomposition, is the total number of source point cloud or target point cloud. The number of point clouds of source point cloud and target point cloud is the same. is the number of iterations of the ICP matching algorithm, is the orthogonal matrix of rotation transformation; is the translation vector for the translation transformation.
[0059] S13, obtaining the scalp, skull, and cerebral cortex regions by image segmentation of the standardized case structure image, dividing the cerebral cortex region into surface grids, and obtaining the spatial coordinates of the grid vertices;
[0060] The image segmentation algorithm in this example uses the watershed algorithm, and other segmentation algorithms with equal or better effects can be used instead.
[0061] S14. Based on the registration matrix of step S12, the spatial coordinates of the mesh vertices obtained in step S13 and the spatial positions of the sensor coils in the magnetoencephalogram helmet are converted to the same coordinate system.
[0062] S15. Use the Biot-Savart law in electromagnetism to solve the forward magnetoencephalogram problem. The resulting magnetoencephalogram of the case uses the guidance field matrix and source position of the forward problem and is saved.
[0063] Taking Elekta Neuromag TRIUX as an example, the principle of guiding field calculation is briefly described. If the sensor is a magnetometer, the calculation formula is as follows:
[0064]
[0065] Where: is the number of the magnetic sensor on the scalp surface, is the number of the grid points in the cerebral cortex, For the The current at the grid point is The magnetic field strength component measured by the magnetic sensor, is the magnetic permeability of the brain tissue, which is approximately equal in different brain tissues. is the circumference of a circle, For the The current intensity at each grid vertex is For the The spatial position vector of the magnetic sensor, For the The spatial position vector of the mesh vertex, for , The relative position between For the The unit vector normal to the magnetic sensor coil, represents the vector cross product, Represents vector dot product.
[0066] If the sensor is a gradiometer, the calculation formula is as follows:
[0067]
[0068] Where: is the number of the scalp surface gradient sensor, is the number of the grid points in the cerebral cortex, For the The current at the grid point is The magnetic field intensity gradient component measured by the gradient sensor, is the magnetic permeability of the brain tissue, which is approximately equal in different brain tissues. is the circumference of a circle, is the Euclidean distance between the two coils of the gradiometer in space, For the The current intensity at each grid vertex is For the The spatial position vector of the first coil of the gradient sensor, For the The spatial position vector of the second coil of the gradient sensor, For the The spatial position vector of the mesh vertex, for , The relative position between For the The unit vector of the normal direction of the first coil of the gradient sensor, for , The relative position between For the The unit vector normal to the second coil of the gradient sensor, represents the vector cross product, Represents vector dot product.
[0069] Under overdetermined conditions, the leading matrix of the forward model of the sensor array is calculated. The forward model is a special term for source tracing, representing the physical model of the current propagation from the current source to the magnetoencephalogram sensor. The most important thing to solve the forward model is the leading matrix. The equation of the forward model is as follows:
[0070]
[0071] Where: is the observation value of all sensors at a certain moment; is the guidance field matrix of the forward model; is the current intensity vector of all grid points at that moment; is the noise received by the sensor.
[0072] Among them, the sensor observation value , is a length of vector of;
[0073] Among them, the vectors of all grid points ,for The current intensity vector at each grid point Composition, length ;
[0074] Among them, noise , is a length of The vector can be ignored in the data augmentation method.
[0075] Among them, the guidance field matrix of the forward model is , is a OK, The two-dimensional matrix of columns is calculated as follows:
[0076] i) Traverse the guidance field matrix Elements at all positions, for values at any position , the column coordinates The corresponding current component is set to 1, and the other current components are set to 0, and the unit current intensity vector is obtained. ;
[0077] ii) The current intensity Split into The current intensity vector at each grid point ;
[0078] iii) The row coordinates of the matrix As the sensor number , according to The type of sensor is substituted into formula (5) or formula (6), and the obtained indivual ,or indivual , that is, if When the first sensor is a magnetic sensor, substitute it into formula (5). When the sensor is a gradient sensor, substitute into formula (6);
[0079] iv) indivual ,or indivual Sum, as The numerical value of .
[0080] Step 2: Perform spike wave detection on the magnetoencephalogram of the case to be diagnosed to obtain a spike wave time point sequence, and intercept the time neighborhood data of all spike wave time points in the magnetoencephalogram of the case according to the spike wave time point sequence to construct a magnetoencephalogram spike wave sequence data matrix group containing different data matrices;
[0081] The magnetoencephalogram spike sequence data matrix group includes 6 matrices, namely: magnetometer neighborhood matrix, gradiometer neighborhood matrix, magnetometer spike matrix, gradiometer spike matrix, source coordinate matrix of spike moment points, and source direction matrix of spike moment points.
[0082] The spike wave detection in this step can be specifically referred to Patent No. CN116340735A (A spike wave detection method and system based on long-field feature fusion) to obtain the spike wave moment point sequence. The following briefly describes the generation process of the spike wave moment point sequence. Please refer to Patent No. CN116340735A for details.
[0083] S21: Preprocessing the case MEG, the preprocessing process includes bandpass filtering noise reduction, ECG artifact removal, resampling dimension reduction, and data normalization, which are performed in sequence to obtain the normalized case MEG data; wherein, the bandpass filtering parameter is 1Hz-40Hz, resampling to 250Hz, and data normalization uses channel-by-channel mean variance normalization;
[0084] S22: extracting single-channel waveform features from the magnetoencephalogram data of the standardized cases, the waveform features including waveform amplitude, waveform slope, and waveform sharpness; and performing normalization operation on the single-channel waveform features within the long field of view to obtain long field of view normalized features;
[0085] S23: The long-view normalized features are spliced with the normalized case MEG data to obtain a fused multi-channel feature data matrix, and then the data is sliced in the time dimension; the total length of the time dimension of the normalized case MEG data is recorded as , the number of channels is C, the number of long-view features is D (plus the original data, a total of D+1 dimensional data), and the time length of the data slice is , then the size of the slice matrix is ( ;
[0086] In this example The input of the case magnetoencephalogram is uncertain, so it can be assumed to be 500s data at 250Hz. =125000, long-field features include waveform amplitude, waveform slope, and waveform sharpness, D=4, magnetoencephalogram was collected using Elekta equipment, the total number of channels C=306, and the data slice time length is =200, the slice matrix size is (625, 306, 200, 5).
[0087] S24: Input the slice matrix into the trained long-view feature fusion spike detection model to obtain the probability of whether each time point in each slice is a spike, and splice the prediction results in the time dimension to obtain the probability matrix of whether each time point of the magnetoencephalogram is a spike;
[0088] S25: Use the non-maximum suppression algorithm to select the spike wave moment sequence of the case MEG, and intercept the time neighborhood data of all spike wave moment sequences in the original case MEG. And save them. Let the number of moment points be N, the time neighborhood range be S, and the number of MEG channels be C, then the size of the intercepted time neighborhood data is (N, C, S);
[0089] In this example, the number of time points N varies with the input case magnetoencephalogram data. It is assumed to be 100, the number of channels C is 306 with S23, and the time neighborhood range S is 25 (12 points on each side). Then the size of the intercepted spike wave data matrix is (100, 306, 25).
[0090] Step 3: Based on the guidance field matrix and source position of the case magnetoencephalogram forward problem, traverse each data matrix in the magnetoencephalogram spike wave sequence data matrix group, combine the set constraints, approximately solve the source coordinates and source direction of each spike wave moment under the underdetermined condition, and take the source coordinates and source direction of each spike wave moment as the spike wave sequence magnetoencephalogram source tracing result and save it;
[0091] Depending on the method of tracing and positioning, the constraints can be set to be dipole fit, beamforming, wMNE, sLORETA, MUSIC, dSPM, etc., all of which are commonly used methods in the industry.
[0092] Step 4, after normalizing the magnetoencephalogram spike wave sequence data matrix group and the spike wave sequence magnetoencephalogram source tracing results respectively, calculate the spike wave similarity between each pair of data in each data matrix of the normalized magnetoencephalogram spike wave sequence data matrix group and perform weighted summation to obtain the total similarity matrix of the spike wave sequence, cluster the total similarity matrix of the spike wave sequence to obtain the class center data matrix, set constraints on the class center data matrix, approximately solve the source coordinates and source direction of each class center data under the underdetermined condition, and save the source coordinates and source direction of each class center data as the class center magnetoencephalogram source tracing result, specifically including S41 to S45;
[0093] S41. Get the neighborhood data matrix of the spike sequence , from which the channel data corresponding to the spike wave time point is taken as , separated by magnetometer and gradiometer channels, and the time dimension is combined with the channel dimension to obtain the magnetometer neighborhood matrix , the gradiometer neighborhood matrix , Magnetometer spike matrix , gradiometer spike matrix , take the source coordinate matrix of the spike wave time point and the source direction matrix at the spike moment The row vectors of the above six matrices (magnetometer neighborhood matrix, gradiometer neighborhood matrix, magnetometer spike matrix, gradiometer spike matrix, source coordinate matrix at spike moment, source direction matrix at spike moment) are normalized by L2 norm (Euclidean norm):
[0094]
[0095] in, represents the normalization operation, where is a two-dimensional matrix that can represent the magnetometer neighborhood matrix, the gradiometer neighborhood matrix, the magnetometer spike matrix, the gradiometer spike matrix, the source coordinate matrix of the spike moment, and the source direction matrix of the spike moment as input; Represents a two-dimensional matrix The row subscript of Represents a two-dimensional matrix Column subscripts, Represents a two-dimensional matrix The total number of columns, that is Represents a two-dimensional matrix Middle Line The element value corresponding to the column, Represents a two-dimensional matrix Middle Line The element value corresponding to the column.
[0096] The physical meaning of normalization is: when it is assumed that each dimension of the row vector to be normalized obeys a Gaussian distribution with zero mean and homoscedasticity, then, Normalization can be seen as The dimensional data vector is projected onto the unit hypersphere;
[0097] This example uses Elekta magnetoencephalography data. =102, =204, the neighborhood selected in step S25 is 12 points on each side, so S=25, and the spike moment is the 13th point in the time dimension.
[0098] S42, for each matrix in the normalized magnetoencephalogram spike sequence data matrix group, calculating the spike similarity between each pair of data in each matrix to obtain a similarity matrix corresponding to each matrix, and performing weighted summation of all similarity matrices to obtain a total similarity matrix of the spike sequence;
[0099] The normalized magnetometer neighborhood matrix , the gradiometer neighborhood matrix , Magnetometer spike matrix , gradiometer spike matrix , source coordinate matrix of spike wave time point , the source direction matrix at the spike time point Use Euclidean distance to calculate the similarity between two pairs:
[0100]
[0101] in, Represents the Euclidean distance similarity calculation operation, where is a two-dimensional matrix that can represent the normalized magnetometer neighborhood matrix, the normalized gradiometer neighborhood matrix, the normalized magnetometer spike matrix, the normalized gradiometer spike matrix, the normalized source coordinate matrix of spike moments, and the normalized source direction matrix of spike moments as input; Represents the input two-dimensional matrix and returns the row subscripts of the similarity matrix, Represents the input two-dimensional matrix and return the column subscripts of the similarity matrix, Represents a two-dimensional matrix The total number of columns. Represents a two-dimensional matrix Middle Line The element value corresponding to the column, Represents a two-dimensional matrix Middle Line The element value corresponding to the column.
[0102] That is, according to the above Formula, if the spike similarity between two data in the normalized magnetometer neighborhood matrix is calculated, then corresponds to the normalized magnetometer neighborhood matrix, represents the normalized magnetometer neighborhood matrix Line The magnetometer neighborhood values corresponding to the columns, Represents a two-dimensional matrix Middle Line Column corresponds to the magnetometer neighborhood value.
[0103] The magnetometer neighborhood similarity matrix , gradiometer neighborhood similarity matrix , magnetometer spike similarity matrix , gradiometer spike similarity matrix , source coordinate similarity matrix , and the source direction similarity matrix simi_dir is weighted summed to obtain the total similarity matrix of the spike sequence ;
[0104]
[0105] in, is the magnetometer neighborhood weighting coefficient, is the gradiometer neighborhood weighting coefficient, is the magnetometer spike weighting coefficient, is the gradiometer spike weighting coefficient, is the source coordinate weighting coefficient, is the source direction weighting coefficient, and the above weighting coefficients are all hyperparameters;
[0106] In this example, =0.5, =0.5, =1, =0.5, =1, =0.75. In the specific implementation process, the specific value can be determined according to actual needs.
[0107] S44, clustering the total similarity matrix of the spike wave sequence to obtain a spike wave category sequence, extracting the corresponding typical spike wave category from the spike wave category sequence based on the defined K typical spike wave categories, extracting the data corresponding to the extracted typical spike wave category in the magnetoencephalogram spike wave sequence data matrix group, and forming a class center data matrix;
[0108] In this embodiment, K can be 5, but the minimum number of samples in the K classes should be greater than or equal to 3, otherwise K is equal to the number of samples of all classes and greater than or equal to 3 classes.
[0109] S45. Based on the class center data matrix and the set constraints, approximately solve the source coordinates and source direction of each class center data under the underdetermined condition, and save the source coordinates and source direction of each class center data as the class center brain magnetic tracing result.
[0110] Step 5: Generate a diagnosis report based on the magnetoencephalogram spike wave sequence data matrix group, the spike wave sequence magnetoencephalogram traceability results, the class center data matrix, and the class center magnetoencephalogram traceability results. The diagnosis report includes information such as typical spike wave images of the case, typical spike wave characteristics of the case, typical traceability locations of the case, frequency of spike wave attacks in the case, distribution of brain regions of spike wave attacks in the case, and heat map of the case traceability location. The generation of the diagnosis report specifically includes steps S51 to S55:
[0111] S51, taking the brain magnetic data corresponding to K typical spike wave classes in the class center data matrix, and drawing the waveform diagrams of the magnetometer and the gradiometer respectively according to the magnetometer and the gradiometer, where the abscissa is the time dimension, and the ordinate is the magnetic field intensity or the gradient of the magnetic field intensity;
[0112] S52, take the EEG data corresponding to the K typical spike wave classes of the class center data matrix, such as Figure 3 As shown, the duration, amplitude, left and right slopes, and sharpness of the fast wave in which the spike wave is located are calculated as the fast wave characteristics of the typical spike wave, and are displayed side by side with the waveform diagram in S51;
[0113] S53: Take the source coordinates and source directions corresponding to the K typical classes of the brain magnetic source tracing results of the class center, and draw a five-pointed star at the corresponding coordinates of the case structure image schematic diagram; take the source coordinates of each spike wave time point in the brain magnetic source tracing results of the spike wave sequence, and display them as black dots at the corresponding coordinates of the case structure image schematic diagram, such as Figure 4 As shown;
[0114] S54: Take the spike wave sequence in the MEG spike wave sequence data matrix group, divide the number of spike waves N by the total MEG duration to obtain the frequency of spike wave attacks, and multiply by the unit time to obtain the frequency of spike wave attacks per unit time; for example, X times / 5min means that the patient has an average of X spike wave attacks in 5 minutes in the MEG test;
[0115] S55: Take the spike sequence in the magnetoencephalogram spike sequence data matrix group, divide each data into 8 brain regions according to the channel position (left\right frontal lobe, left\right temporal lobe, left\right parietal lobe, left\right occipital lobe) and calculate the fourth power of the spike amplitude at the moment of all channels in each brain region, select the brain region where the fourth power of the spike amplitude at the moment is the maximum as the brain region of the spike, count the brain region distribution of all spikes, and obtain the brain region distribution of the patient's spike attack channel, and combine it with the spike attack frequency per unit time of S54 to draw a schematic diagram of the brain region and time attack analysis of the spike, as shown below: Figure 5 As shown; wherein the brain area division is divided according to the magnetoencephalogram sensor number.
[0116]
[0117] in, The function represents the calculation function of the fourth power of the spike wave amplitude. It is the data of a certain brain area (left / right frontal lobe, left / right temporal lobe, left / right parietal lobe, left / right occipital lobe) at the time of the input spike wave. Note that The brain area channel contains magnetometers and gradiometers, but the normalized data is used to eliminate the unit difference between the magnetometer and gradiometer. Represents input data The number of channels, Represents the channel subscript.
[0118] S56: Combine the fast wave characteristics, the frequency of spike wave attacks per unit time, the brain area distribution of the spike wave attack channels, and all the schematic diagrams drawn from S51 to S55 into a report to generate a diagnosis report.
[0119] According to steps one to five, the entire process of magnetoencephalography diagnosis of epileptogenic foci from raw image data to the final diagnosis report is completed, including the automation of registration of case structural images and case magnetoencephalograms, automation of case magnetoencephalogram spike wave detection, automation of spike wave typical case analysis, automation of spike wave feature calculation, and automation of diagnostic report generation. This embodiment greatly reduces the time spent on clinicians' work, and at the same time provides a variety of spike wave morphological features and statistical analysis features for individualized case analysis, which is helpful for the planning of diagnosis and treatment plans and case analysis. The output diagnostic report describes the case situation in a detailed and comprehensive manner and has clinical guiding significance.
[0120] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. A method for generating a magnetoencephalogram diagnosis report of an epileptic focus, It is characterized in that The steps include: Step 1: pre-process and register the structural image of the case to be diagnosed, and obtain the guidance field matrix and source position of the case magnetoencephalogram forward problem; Step 2: Perform spike wave detection on the magnetoencephalogram of the case to be diagnosed to obtain a spike wave time point sequence, and intercept the time neighborhood data of all spike wave time points in the magnetoencephalogram of the case according to the spike wave time point sequence to construct a magnetoencephalogram spike wave sequence data matrix group containing different data matrices; Step 3: Based on the guidance field matrix and source position of the case magnetoencephalogram forward problem, traverse each data matrix in the magnetoencephalogram spike wave sequence data matrix group, combine the set constraints, approximately solve the source coordinates and source direction of each spike wave moment under the underdetermined condition, and take the source coordinates and source direction of each spike wave moment as the spike wave sequence magnetoencephalogram source tracing result and save it; Step 4: Normalize the magnetoencephalogram spike wave sequence data matrix group and the spike wave sequence magnetoencephalogram source tracing results respectively, calculate the spike wave similarity between each pair of data in each data matrix of the normalized magnetoencephalogram spike wave sequence data matrix group, and perform weighted summation to obtain the total similarity matrix of the spike wave sequence, cluster the total similarity matrix of the spike wave sequence to obtain the class center data matrix, set constraints on the class center data matrix, approximately solve the source coordinates and source direction of each class center data under the underdetermined condition, and save the source coordinates and source direction of each class center data as the class center magnetoencephalogram source tracing result; Step 5, generating a diagnosis report based on the magnetoencephalogram spike wave sequence data matrix group, the spike wave sequence magnetoencephalogram source tracing results, the class center data matrix, and the class center magnetoencephalogram source tracing results; In step 4, the generation of the class center data matrix specifically includes: Extracting channel data corresponding to spike wave moment points from the magnetoencephalogram spike wave sequence data matrix group, separating the channel data according to magnetometer and gradiometer channels, merging the time dimension with the channel dimension to obtain a spike wave neighborhood matrix group, normalizing the row vectors of the spike wave neighborhood matrix group to obtain a normalized magnetoencephalogram spike wave sequence data matrix group, wherein the magnetoencephalogram spike wave sequence data matrix group includes a magnetometer neighborhood matrix, a gradiometer neighborhood matrix, a magnetometer spike wave matrix, a gradiometer spike wave matrix, a source coordinate matrix of spike wave moment points, and a source direction matrix of spike wave moment points; For each data matrix in the normalized magnetoencephalogram spike sequence data matrix group, the spike similarity between each pair of data in each matrix is calculated to obtain the similarity matrix corresponding to each matrix, and the total similarity matrix of the spike sequence is obtained by weighted summation of all similarity matrices; The total similarity matrix of the spike wave sequence is clustered to obtain the spike wave category sequence. Based on the defined K typical spike wave categories, the corresponding typical spike wave categories are taken out from the spike wave category sequence, and the corresponding data of the taken out typical spike wave categories in the magnetoencephalogram spike wave sequence data matrix group are taken out to form a class center data matrix.
2. The method for generating a magnetoencephalogram diagnosis report of an epileptic focus according to claim 1, It is characterized in that In step one, it specifically includes: S11, normalizing the structural image of the case to be diagnosed to obtain a normalized structural image of the case, registering the pre-set template structural image with the normalized structural image of the case to obtain a registration transformation matrix, and transforming the pre-set anatomical reference points of the template structural image to the normalized structural image using the registration transformation matrix to obtain reference points of the normalized structural image of the case; S12, pairing the reference points stored in the magnetoencephalogram of the case to be diagnosed with the reference points of the standardized case structural image, transforming the coordinate system of the case magnetoencephalogram to the coordinate system of the standardized case structural image, and correcting the scalp position points stored in the case magnetoencephalogram using the nearest point search method ICP to match the scalp points in the standardized case structural image, and obtaining a registration matrix of the case magnetoencephalogram and the standardized case structural image, wherein the registration matrix includes the relative spatial position information of the magnetoencephalogram helmet and the patient's brain; S13, obtaining the scalp, skull, and cerebral cortex regions by image segmentation of the standardized case structure image, dividing the cerebral cortex region into surface grids, and obtaining the spatial coordinates of the grid vertices; S14, based on the registration matrix of step S12, converting the spatial coordinates of the grid vertices and the spatial positions of the sensor coils in the magnetoencephalography helmet into the same coordinate system; S15. Use the Biot-Savart law in electromagnetism to solve the forward magnetoencephalogram problem, obtain the guiding field matrix and source position of the forward magnetoencephalogram problem of the case and save them.
3. The method for generating a magnetoencephalogram diagnosis report of an epileptic focus according to claim 1, It is characterized in that In step 5, the diagnostic report generation process is as follows: S51, taking the brain magnetic data corresponding to K typical spike wave classes in the class center data matrix and drawing the waveform diagrams of the magnetometer and the gradiometer respectively according to the magnetometer and the gradiometer; S52, taking the EEG magnetic data corresponding to K typical spike wave classes in the class center data matrix, calculating the duration, amplitude, left and right slopes, and sharpness of the fast wave in which the spike wave is located as the fast wave characteristics of the typical spike wave, and displaying them in parallel with the waveform diagram in S51; S53: Take the source coordinates and source directions corresponding to the K typical classes of the brain magnetic source tracing results of the class center, and display them at the corresponding coordinates of the case structure image schematic diagram; take the source coordinates of each spike wave time point in the brain magnetic source tracing results of the spike wave sequence, and display them at the corresponding coordinates of the case structure image schematic diagram; S54: taking the spike wave sequence in the magnetoencephalogram spike wave sequence data matrix group, dividing the number of spike waves N by the total duration of the magnetoencephalogram to obtain the frequency of spike wave attacks, and multiplying by the unit time to obtain the frequency of spike wave attacks per unit time; S55: Take the spike wave sequence in the magnetoencephalogram spike wave sequence data matrix group, divide each data into 8 brain regions according to the channel position and calculate the fourth power of the spike wave amplitude at the moment of all channels in each brain region, select the brain region where the fourth power of the spike wave amplitude at the moment of the maximum value is located as the brain region of the spike wave, count the brain region distribution of all spike waves, obtain the brain region distribution of the patient's spike wave attack channel, and combine it with the spike wave attack frequency per unit time of S54 to draw a schematic diagram of the brain region and time attack analysis of the spike wave; S56: Combine the fast wave characteristics, the frequency of spike wave attacks per unit time, the brain area distribution of the spike wave attack channels, and all the schematic diagrams drawn from S51 to S55 into a report to generate a diagnosis report.
4. A system for generating magnetoencephalogram diagnosis reports of epileptogenic foci, It is characterized in that A structural image preprocessing module, a magnetoencephalogram preprocessing module, a first calculation module, a second calculation module and a generation module; The structural image preprocessing module is used to preprocess and register the structural images of the case to be diagnosed, and obtain the guidance field matrix and source position of the case magnetoencephalogram forward problem; The magnetoencephalogram preprocessing module is used to perform spike wave detection on the magnetoencephalogram of the case to be diagnosed, obtain a spike wave time point sequence, and intercept the time neighborhood data of all spike wave time points in the magnetoencephalogram of the case according to the spike wave time point sequence to construct a magnetoencephalogram spike wave sequence data matrix group containing different data matrices; The first calculation module traverses each data matrix in the MEG spike wave sequence data matrix group based on the guidance field matrix and source position of the case MEG forward problem, and approximately solves the source coordinates and source direction of each spike wave moment point under the underdetermined condition in combination with the set constraints, and takes the source coordinates and source direction of each spike wave moment point as the result of the spike wave sequence MEG tracing and saves it; The second calculation module is used for normalizing the magnetoencephalogram spike wave sequence data matrix group and the spike wave sequence magnetoencephalogram source tracing result respectively, calculating the spike wave similarity between each pair of data in each data matrix of the normalized magnetoencephalogram spike wave sequence data matrix group and performing weighted summation to obtain the total similarity matrix of the spike wave sequence, clustering the total similarity matrix of the spike wave sequence to obtain the class center data matrix, setting constraints on the class center data matrix, approximately solving the source coordinates and source direction of each class center data under the underdetermined condition, and taking the source coordinates and source direction of each class center data as the class center magnetoencephalogram source tracing result and saving it; The generation module generates a diagnosis report based on the magnetoencephalogram spike wave sequence data matrix group, the spike wave sequence magnetoencephalogram source tracing result, the class center data matrix, and the class center magnetoencephalogram source tracing result; In the second calculation module, the generation of the class center data matrix specifically includes: Extracting channel data corresponding to spike wave moment points from the magnetoencephalogram spike wave sequence data matrix group, separating the channel data according to magnetometer and gradiometer channels, merging the time dimension with the channel dimension to obtain a spike wave neighborhood matrix group, normalizing the row vectors of the spike wave neighborhood matrix group to obtain a normalized magnetoencephalogram spike wave sequence data matrix group, wherein the magnetoencephalogram spike wave sequence data matrix group includes a magnetometer neighborhood matrix, a gradiometer neighborhood matrix, a magnetometer spike wave matrix, a gradiometer spike wave matrix, a source coordinate matrix of spike wave moment points, and a source direction matrix of spike wave moment points; For each data matrix in the normalized magnetoencephalogram spike sequence data matrix group, the spike similarity between each pair of data in each matrix is calculated to obtain the similarity matrix corresponding to each matrix, and the total similarity matrix of the spike sequence is obtained by weighted summation of all similarity matrices; The total similarity matrix of the spike wave sequence is clustered to obtain the spike wave category sequence. Based on the defined K typical spike wave categories, the corresponding typical spike wave categories are taken out from the spike wave category sequence, and the corresponding data of the taken out typical spike wave categories in the magnetoencephalogram spike wave sequence data matrix group are taken out to form a class center data matrix.
