Magnetocardiogram-based epilepsy epileptogenic focus positioning method and system and medium

By employing a magnetoencephalography (MEG)-based method for locating epileptogenic foci, combined with magnetic dipole and clustering algorithms, we have achieved automated, rapid, and accurate localization of epileptogenic foci. This solves the problems of time-consuming and experience-dependent methods in traditional approaches, and improves diagnostic efficiency and consistency of results.

CN120959749BActive Publication Date: 2025-12-30ARTIFICIAL INTELLIGENCE RES INST OF HEFEI COMPREHENSIVE NAT SCI CENT (ANHUI ARTIFICIAL INTELLIGENCE LAB)
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511500667.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-21
Publication Date
2025-12-30
Estimated Expiration
2045-10-21

AI Technical Summary

Technical Problem

Traditional methods of locating epileptogenic foci using electroencephalography (EEG) are inaccurate due to the high electrical resistance of the skull. Stereotactic EEG treatment is expensive and highly invasive. Existing MEG-based methods are time-consuming and dependent on the doctor's experience, resulting in large differences in diagnostic results and a high error rate.

Method used

An epileptogenic focus localization method based on magnetoencephalography (MEG) was adopted. By preprocessing the patient's structural images and registering them with MEG, the cerebral cortex was divided into grids. The source coordinates and directions of the spike time points were calculated using the magnetic dipole algorithm. Combined with clustering algorithm, a clinical report was generated to achieve automated localization.

Benefits of technology

It shortens the time for locating the epileptogenic focus, improves the accuracy and consistency of diagnosis, reduces reliance on doctors' experience, and enhances work efficiency and diagnostic quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120959749B_ABST
    Figure CN120959749B_ABST
Patent Text Reader

Abstract

The application discloses a method and system for locating an epileptogenic focus of epilepsy based on magnetoencephalography and a medium, and relates to the technical field of artificial intelligence, and comprises the following steps: registering a structural image of a patient after preprocessing with a magnetoencephalogram of the patient, dividing a cerebral cortex region into a grid based on the preprocessed structural image and the registration result, and obtaining a forward model of the patient; preprocessing the magnetoencephalogram and detecting a spike wave, and obtaining a spike wave time point sequence; calculating source coordinates and source directions of the spike wave time points based on the forward model and the spike wave time point sequence, classifying the spike wave time point sequence based on the source coordinates and the source directions, and obtaining a clustering result; calculating source coordinates and source directions of a class center of each class in the clustering result by using a magnetic dipole algorithm; and generating a clinical report of the patient; the locating method solves the problem that epilepsy diagnosis is greatly different and prone to errors due to differences in the levels of different doctors, and can quickly determine the location of an epileptogenic focus.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, and in particular to a method, system, and medium for locating epileptogenic foci based on magnetoencephalography (MEG). Background Technology

[0002] Currently, there are two main approaches to treating drug-resistant epilepsy: precision medicine and neuromodulation. Precision medicine includes targeted therapy for some patients with a genetic predisposition to epilepsy through gene therapy, or radiofrequency ablation guided by stereotactic electroencephalography (EEG). This method is superior to traditional resection and can reduce cognitive impairment. In neuromodulation, vagus nerve stimulation and deep brain stimulation can reduce the frequency of seizures to some extent. All of these treatments require knowledge of the location of the epileptogenic focus for effective treatment. Traditional EEG-based methods for locating the epileptogenic focus are inaccurate because the skull's high electrical resistance severely attenuates and obscures EEG signals. Stereotactic EEG, while a minimally invasive procedure, requires drilling into the skull and is expensive, hindering its widespread adoption. With the development of magnetoencephalography (MEG), a technique for determining the location of the epileptogenic focus based on MEG has emerged because MEG has higher spatial resolution than EEG, resulting in more precise localization.

[0003] Currently, when doctors use MEG and Magnetic Resonance Imaging (MRI) combined with magnetic dipole algorithms to determine the time-point sequences of abnormal waveforms and the epileptogenic focus in patients, they need to carefully review the patient's MEG images, which usually takes 2-3 hours, consuming a significant amount of the doctor's time and energy. Furthermore, interpreting the images and determining the location of the epileptogenic focus requires doctors to have extensive experience, placing high demands on their professional skills and limiting the effective treatment of epilepsy. Summary of the Invention

[0004] Based on the technical problems existing in the background technology, the present invention proposes a method, system and medium for locating epileptogenic foci based on magnetoencephalography (MEG), which can quickly determine the location of epileptogenic foci.

[0005] The present invention proposes a method for localizing epileptogenic foci based on magnetoencephalography (MEG), comprising:

[0006] After preprocessing the patient's structural images, they were registered with the patient's magnetoencephalogram (MEG). Based on the preprocessed structural images and the registration results, the cerebral cortex regions were divided into grids to obtain the patient's forward model.

[0007] Preprocessing and spike detection of magnetoencephalograms (MEGs) are performed to obtain spike time point sequences.

[0008] Based on the forward model and the spike time point sequence, the source coordinates and source direction of the spike time point are calculated using the magnetic dipole algorithm, and the spike time point sequence is classified accordingly to obtain the clustering results.

[0009] The magnetic dipole algorithm is used to calculate the source coordinates and source orientation of the cluster center for each category in the clustering results;

[0010] Generate a patient's clinical report, including an IED distribution map, waveform diagrams of typical spike waves, a whole-brain region pathway layout map, a 3D topology map, a source localization result map, and an overview map of interictal dipoles.

[0011] Furthermore, the preprocessing of the patient's structural images and their registration with the patient's magnetoencephalogram (MEG) specifically involves:

[0012] Preprocessing operations such as coordinate system transformation, noise reduction, artifact removal, skull dissection, and cerebral cortex reconstruction were performed on the patient's structural images;

[0013] The reference points of the magnetoencephalogram (MEG) and the reference points of the preprocessed structural image are registered to transform the coordinate system of the MEG reference points to the coordinate system of the structural image reference points.

[0014] Based on the nearest point search matching algorithm, the coordinates of the scalp points of the magnetoencephalogram are mapped to the scalp of the processed structural image, thereby obtaining the registration matrix between the structural image and the magnetoencephalogram.

[0015] During the registration process, the weights of the scalp points from the magnetoencephalogram and the various parts of the scalp from the structural image can be set to adjust the registration fit.

[0016] Furthermore, the process of dividing the cerebral cortex region into a grid based on the preprocessed structural image and registration results to obtain the patient's forward model is as follows:

[0017] After preprocessing the patient's structural image, the cerebral cortex region is divided into surface grids, and the spatial coordinates of the grid vertices are obtained.

[0018] Based on the registration matrix, the spatial coordinates of the grid vertices and the positions of the scalp points on the magnetoencephalogram are transformed into the same coordinate system to obtain the forward model.

[0019] Furthermore, the preprocessing of the magnetoencephalogram (MEG) specifically includes:

[0020] The magnetoencephalogram (MEG) was sequentially processed by bandpass filtering for noise reduction, notch filtering, removal of power frequency noise, removal of ECG artifacts, resampling for dimensionality reduction, and data normalization.

[0021] Furthermore, the calculation of the source coordinates and source direction of the spike time points based on the forward model and the spike time point sequence using the magnetic dipole algorithm is specifically as follows:

[0022] Take the magnetoencephalogram (MEG) data of the time neighborhood of the spike time point, calculate the MEG channels involved in source localization and remove bad channels;

[0023] Data from the time neighborhood of the spike time point on the brain magnetic channel after removing bad channels are taken, and the source coordinates and source direction of the spike time point are calculated using the magnetic dipole algorithm.

[0024] Furthermore, a clustering algorithm is used to classify all the spike time points to obtain clustering results. The parameters set for the clustering algorithm include:

[0025] The clustering algorithm internally calls the Gof threshold, the time neighborhood range for averaging the waveform amplitude at the spike moment, the influence weight of the magnetometer at the spike moment on the clustering effect, the influence weight of the gradient meter at the spike moment on the clustering effect, the influence weight of the magnetometer in the set time neighborhood at the spike moment on the clustering effect, the influence weight of the sphere source dipole position at the spike moment on the clustering effect, the influence weight of the sphere source dipole direction at the spike moment on the clustering effect, whether to normalize the distance matrix of each feature, the set threshold for the number of clusters generated by the clustering algorithm, and the entire cluster will be removed if the number of categories in the clustering result is less than the set number of clusters.

[0026] Furthermore, the calculation of the source coordinates and source direction of the cluster center for each category in the clustering result using the magnetic dipole algorithm specifically involves:

[0027] Iterate through all spike time points in each category, sum the magnetoencephalogram data of the time neighborhood of each spike time point, and take the average of the number of spike time points.

[0028] The source coordinates and source direction of the class center are calculated by applying the magnetic dipole algorithm to the average data.

[0029] Furthermore, the generated patient clinical report includes an IED distribution map, a waveform diagram of typical spike waves, a whole-brain region pathway layout map, a 3D topological map, a source localization result map, and an interictal dipole overview map, specifically:

[0030] The IED distribution map is a distribution map drawn according to brain regions and time of the spike time point sequence;

[0031] The waveform diagram of a typical spike, the whole brain region channel layout diagram, the 3D topology diagram, and the source localization result diagram are drawn based on the most typical moment point of the waveform in the spike moment point sequence, wherein the most typical moment point is the moment point with the highest confidence obtained in the spike detection algorithm;

[0032] The interictal dipole overview diagram refers to the selection of the most representative cluster of spike moments based on the clustering results, and the capture of multiple images from the coronal, sagittal, and horizontal planes to indicate the location of the epileptogenic focus in the patient's epilepsy. The most representative cluster of spike moments represents the set with the most moments in the clustering algorithm classification.

[0033] A computer system includes a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the method described above.

[0034] A computer-readable storage medium storing a plurality of classification programs, the plurality of classification programs being invoked by a processor to execute the method described above.

[0035] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as ROM, RAM, magnetic disk, or optical disk.

[0036] The advantages of the method, system, and medium for locating epileptogenic foci based on magnetoencephalography (MEG) provided by this invention are as follows: Based on MEG-MRI images, it automates the process of manually determining the location of the epileptogenic focus, reducing the time required for location determination and solving the problem of significant diagnoses and errors caused by differences in the skill levels of different doctors. Furthermore, this location method can complete all steps with a single click, directly generating the final clinical report, or it can execute each step individually, allowing doctors to adjust the results of each step before generating the final clinical report, offering high flexibility. Compared to traditional software, this method also effectively improves doctors' work efficiency and diagnostic quality, addressing the problem of inconsistent diagnostic skills among doctors in different epilepsy centers, leading to significant differences in diagnostic results and a high risk of errors. Attached Figure Description

[0037] Figure 1 A flowchart illustrating the method for locating the epileptogenic focus in epilepsy;

[0038] Figure 2 The diagrams show the registration results of the registration module. A, B, and C provide the registration results in the coronal, sagittal, and horizontal planes, respectively. D provides a 3D view of the registration results, comprehensively assisting doctors in judging whether the registration between the magnetoencephalogram (MEG) and the structural image is accurate.

[0039] Figure 3 This is a distribution map of IEDs;

[0040] Figure 4 The image shows the source localization results. Row A represents the coronal plane source localization results, row B represents the sagittal plane source localization results, and row C represents the horizontal plane source localization results.

[0041] Figure 5 A flowchart illustrating the epileptogenic focus localization system.

[0042] Figure 6 This is a schematic diagram of the electronic terminal. Detailed Implementation

[0043] The technical solution of the present invention will now be described in detail through specific embodiments. Many specific details are set forth in the following description to provide a thorough understanding of the 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 modifications without departing from the spirit of the invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.

[0044] Before further elaborating on the present invention, the nouns and terms involved in the present invention will be described in detail below.

[0045] Magnetoencephalography (MEG): MEG is a technique that detects the weak magnetic fields generated by the electrical activity of neurons. MEG (Metal-Oriented Electroencephalography) is a non-invasive neuroimaging technique used to study brain function (on the order of Tesla). Its core principle is based on the electromagnetic induction law of bioelectric currents: when neurons fire synchronously, the magnetic field generated by the intracellular current can be captured by a superconducting quantum interference device (SQUID) array. MEG has millisecond-level temporal resolution, directly reflecting the dynamic process of neural electrical activity, with spatial accuracy reaching 3-5 millimeters, and is particularly sensitive to tangential current sources (such as the sulci cortex). Compared to EEG, which is easily affected by the ambiguity of electrical signals due to the skull, MEG is more sensitive to abnormal discharges in deep epilepsy, and in some cases, more accurately locates the epileptogenic focus.

[0046] Magnetic Resonance Imaging (MRI): MRI is a non-invasive imaging technique based on the spin properties of atomic nuclei. By applying a strong magnetic field (1.5-7 Tesla) and radio frequency pulses, hydrogen protons in the human body are excited (…). 1 H) Magnetic resonance imaging (MRI) is performed, and the electromagnetic signals released during relaxation are then detected. Anatomical images are reconstructed through spatial coding. MRI has the advantages of multi-parameter and multi-contrast capabilities, and can clearly distinguish soft tissues, making it the gold standard imaging modality for preoperative assessment of epilepsy. MRI is divided into T1-weighted images and T2-weighted images. T1-weighted images display anatomical structures, and the registration described in step one of the examples uses T1-weighted images.

[0047] The nearest-point search matching algorithm is a matching method based on spatial distance metrics. It calculates the distances between a target point and multiple candidate points, selecting the closest one or more points as the optimal matching result. This algorithm is efficient and stable in handling spatial registration, point cloud fusion, or point mapping in bioelectromagnetic maps, and can quickly determine correspondences in complex structures. In this application, it can be used to achieve spatial matching between sensors or feature points in MEG and MRI data, thereby improving the accuracy and automation of multimodal image fusion.

[0048] Watershed Algorithm: The watershed algorithm is an image segmentation method based on topological deformation, commonly used to divide different regions in an image according to gray-level gradients. This algorithm treats the image as a topographic map, with gray values ​​representing height. By simulating the flow of water from high to low altitudes, it constructs boundaries at the confluence of different "basins," achieving precise extraction of structural edges. In this application, the watershed algorithm can be used for segmentation of brain regions or abnormal tissue areas in MRI images, improving the clarity of lesion boundaries and the accuracy of segmentation results, providing a reliable structural basis for subsequent epileptogenic focus localization and 3D reconstruction.

[0049] Magnetic Dipole Algorithm: The magnetic dipole algorithm is a classic model method for locating magnetoencephalography (MEG) data sources. Its principle is based on the assumption that neural activity at a specific time point can be equivalent to a magnetic dipole, and by fitting the observed magnetic field distribution, the spatial position and orientation of this dipole can be inferred. This algorithm has the advantages of high computational efficiency and good localization accuracy, and is widely used in the analysis of epileptogenic foci in neurological diseases such as epilepsy. In this embodiment, the magnetic dipole algorithm is used to estimate the location of neural activity sources from MEG data, providing initial candidate regions for the spatial localization of epileptogenic foci, thus improving the accuracy and reliability of the overall localization system.

[0050] like Figures 1 to 6 As shown, the method for localizing epileptogenic foci based on magnetoencephalography proposed in this invention includes:

[0051] Step 1: After preprocessing the patient's structural image, register it with the patient's magnetoencephalogram (MEG). Based on the preprocessed structural image and the registration result, divide the cerebral cortex region into a grid to obtain the patient's forward model.

[0052] Step 2: Preprocess the magnetoencephalogram (MEG) and detect spikes to obtain a spike time point sequence;

[0053] Based on the forward model and the spike time point sequence, the source coordinates and source direction of the spike time point are calculated using the magnetic dipole algorithm, and the spike time point sequence is classified accordingly to obtain the clustering results.

[0054] Step 3: Use the magnetic dipole algorithm to calculate the source coordinates and source direction of the cluster center for each category in the clustering results;

[0055] Step 4: Generate the patient's clinical report, including an IED distribution map, waveform diagram of typical spike waves, whole brain region channel layout map, 3D topology map, source localization result map, and interictal dipole overview map.

[0056] like Figure 5 As shown, this embodiment is implemented through system 100, specifically as follows: the structural image preprocessing module 110 preprocesses the patient's structural image; the registration module 120 registers the head coordinate system of the magnetoencephalogram (MEG) with the MRI coordinate system of the preprocessed structural image; the forward task module 130 calculates the forward model required by the source localization algorithm; the spike detection module 140 automatically detects spike time points in the MEG to obtain the patient's intracranial spike time point sequence; the spike time point source localization module 150 locates the spike time points to obtain the epileptogenic focus location (i.e., the source coordinates and source direction of the spike time points); the clustering module 160 classifies the spike time point sequence detected by the spike detection module 140, which can eliminate some false positives; the clustering result source localization module 170 locates the average value of the clustering classification results, which is more representative of the epileptogenic focus location; and the report generation module 180 automatically generates a clinical report to provide a basis for clinicians to determine the treatment method.

[0057] This embodiment uses artificial intelligence algorithms to automatically interpret magnetoencephalograms (MEGs), reducing the interpretation time of a 60-minute MEG to less than 2 minutes. Simultaneously, an automatic registration technique based on MEG and MRI reference points is implemented, replacing manual registration by doctors. This process also implements a source localization technique based on the magnetic dipole algorithm, which can quickly determine the location of the epileptogenic focus. This workflow reduces the epileptogenic focus localization process, which previously took 2-3 hours, to less than 10 minutes. Furthermore, it performs well on datasets from multiple hospitals, accurately predicting the location of the epileptogenic focus.

[0058] This embodiment, based on MEG-MRI images, automates the process of manually determining the location of the epileptogenic focus, reducing the time required to determine the location of the epileptogenic focus and solving the problem of large differences in epilepsy diagnosis and easy errors caused by differences in the skill levels of different doctors.

[0059] In this embodiment, the structural image preprocessing module 110, registration module 120, forward task module 130, spike detection module 140, and clustering module 160 are all packaged into Docker images for application calls. The Docker images and the application communicate via message queue RabbitMQ (message queue middleware). Consumers in the application process and save the results of the Docker image algorithm execution. In addition, the Docker images share physical machine disks with the application by mounting server data directories.

[0060] This embodiment divides structural image preprocessing, registration, and forward task into three modules (structural image preprocessing module 110, registration module 120, and forward task module 130), making it more flexible in use. Noise reduction processing is added during structural image preprocessing to adapt to structural image data acquired by different devices in various hospitals. The forward task is relatively time-consuming; however, performing forward model calculation only after the registration results have been adjusted and verified to be accurate makes it easier to obtain an accurate forward model, saving users significant time.

[0061] Furthermore, this embodiment separates the forward task module 130 and the spike time point tracing and localization module 150 to avoid requiring a forward task for each tracing and localization step. Additionally, the forward task module 130 and the spike detection module 140 can run in parallel, saving execution time. Currently, a single tracing can be completed within 100 milliseconds. The spike detection module 140 can be configured to handle bad segments and return multiple time point parameters for the spike, adapting to various magnetoencephalogram (MEG) data and meeting different user needs. When tracing and localizing spike time points, the associated channel is automatically selected for tracing, resulting in more accurate localization results.

[0062] I. Structural Image Preprocessing Module 110;

[0063] The application encapsulates parameters into environment variables and then calls the structural image preprocessing Docker image. The structural image preprocessing Docker image corrects the coordinate orientation of the patient's structural image, so that the coordinate system of the structural image of patients from different hospitals can be unified. Noise and artifacts are corrected on the structural image with unified coordinates. The skull is dissected on the denoised structural image to separate white matter, gray matter and cerebrospinal fluid, and the cerebral cortex is reconstructed.

[0064] It should be noted that the FreeSurfer toolbox can be used in this embodiment to preprocess structural images. FreeSurfer is a powerful software for automated processing and quantitative analysis of MRI data. It can generate gray and white matter boundary surfaces through voxel segmentation, construct a three-dimensional cortical model (including pial / white surfaces), support topological correction, and eliminate holes or self-intersections caused by segmentation errors.

[0065] II. Registration Module 120;

[0066] The application encapsulates parameters into environment variables, then calls the registration Docker image based on the preprocessed structural image (i.e., normalized structural image) obtained by the structural image preprocessing module 110, calculates the registration matrix between the scalp points of the magnetoencephalogram and the structural image, and automatically performs registration to obtain the following result: Figure 2 The registration results are shown. Figure 2 The three images A, B, and C in the image provide registration results in the coronal, sagittal, and horizontal planes, respectively. Image D provides a 3D view of the registration results, comprehensively assisting doctors in judging whether the registration between the magnetoencephalogram (MEG) and the structural image is accurate; it also detects whether the structural image is tilted, automatically interpolates and rotates the tilted structural image, and saves it.

[0067] Specifically, in this embodiment, the system first registers the reference points of the magnetoencephalogram (MEG) and the preprocessed structural image, thereby transforming the coordinate system of the MEG reference points to that of the structural image reference points. Based on a nearest-point search matching algorithm, the coordinates of the MEG scalp points are mapped onto the processed structural image scalp, achieving registration between the structural image and the MEG and obtaining a registration matrix. Furthermore, during the registration process, the weights of the MEG scalp points and various parts of the structural image scalp can be set to allow for higher fit in certain areas.

[0068] III. Forward Task Module 130;

[0069] The forward task module 130 is connected to the registration module 120. The application encapsulates parameters into environment variables and calls the forward task Docker image to divide the cerebral cortex region obtained by the structural image preprocessing module 110 into a surface mesh, obtaining the spatial coordinates of the mesh vertices. Based on the registration matrix obtained by the registration module 12, the spatial coordinates of the mesh vertices are transformed to the same coordinate system as the positions of the scalp points on the magnetoencephalogram.

[0070] It should be noted that, in this embodiment, when the application calls the forward task Docker image, it can set an environment variable for the density of the surface grid in the cerebral cortex region. After balancing computing power and efficiency, the desired effect can be achieved by setting an appropriate density.

[0071] IV. Spike Detection Module 140;

[0072] The application encapsulates environment variables, and calls the spike detection Docker image to preprocess the patient's magnetoencephalogram (MEG) and perform spike detection on the MEG file to obtain the spike time point sequence.

[0073] It should be noted that the preprocessing performed on the magnetoencephalogram (MEG) in this embodiment includes: bandpass filtering for noise reduction (3~40Hz), notch filtering (50Hz), removal of power line noise, removal of ECG artifacts, resampling for dimensionality reduction, and data normalization. In this embodiment, the spike detection Docker image supports settings for whether to perform bad channel processing, thereby addressing the issue of some MEG files containing a large number of bad channels. Furthermore, the spike detection Docker image supports settings for whether each spike returns multiple time points to meet the needs of different scenarios.

[0074] V. Spike Time Point Tracing and Positioning Module 150;

[0075] The application uses the magnetic dipole algorithm to calculate the source coordinates and source direction of each spike moment in the forward model of the forward task module 130 and the spike moment sequence of the spike detection module 140, and saves the source coordinates and source direction of each spike moment as the location of the epileptogenic focus.

[0076] It should be noted that, in this embodiment, when the application calculates the source coordinates and source direction of a certain spike moment, it first takes the magnetoencephalogram (MEG) data of the time neighborhood of the spike moment, calculates the MEG channels involved in the source tracing and localization and removes bad channels, takes the data of the MEG channels in the time neighborhood of the spike moment after removing bad channels, and uses the magnetic dipole algorithm to calculate the source coordinates and source direction of the spike moment.

[0077] VI. Clustering Module 160;

[0078] Clustering module 160 is connected to spike moment point tracing and localization module 150. The application encapsulates environment variables and then calls the clustering Docker image. The clustering Docker image combines the spike moment point sequence of spike detection module 140 and the magnetoencephalography tracing results of spike moment point tracing and localization module 150 to obtain the classification result of spike moment point sequence.

[0079] It should be noted that when calculating the clustering results of the spike time point sequence in this embodiment, the Docker image can be configured with multiple parameters, including: the Gof threshold called internally by the clustering algorithm, the time neighborhood range for averaging the waveform amplitude at the spike time point, the weight of the magnetometer's influence on the clustering effect at the spike time point, the weight of the gradiometer's influence on the clustering effect at the spike time point, the weight of the magnetometer's influence on the clustering effect within the set time neighborhood at the spike time point, the weight of the spherical source dipole position's influence on the clustering effect, the weight of the spherical source dipole direction's influence on the clustering effect, whether to normalize the distance matrix of each feature, the threshold for the number of clusters generated by the clustering algorithm, and the exclusion of clusters with fewer than the set number of categories in the clustering results. By adjusting the above parameters, clustering results that meet the requirements can be obtained.

[0080] In this embodiment, the clustering module 160 not only supports the classification of spike time points detected by the algorithm, but also supports the classification of manually labeled time points and externally imported time points, making it more flexible. In addition, different source localization algorithms can be selected for classification during clustering, resulting in different classifications, as well as different cluster center source coordinates and source directions, which can be cross-referenced to help users obtain more representative epileptogenic focus source coordinates and source directions.

[0081] VII. Clustering Result Source Tracing and Location Module 170;

[0082] The clustering result tracing and location module 170 is connected to the clustering module 160. The application uses the forward model and magnetic dipole algorithm to calculate the source coordinates and source direction of the cluster center for each cluster classification of the clustering module 160.

[0083] It should be noted that in this embodiment, the application calculates the source coordinates and source direction of the cluster center for each category in the clustering results. It first needs to traverse all spike time points in each category, add up the magnetoencephalogram data of the time neighborhood of each spike time point, and then take the average value of the number of spike time points. The source coordinates and source direction of the cluster center can be calculated by applying the magnetic dipole algorithm to the average value data.

[0084] 8. Report Generation Module 180;

[0085] The report generation module 180 is connected to the clustering result tracing and localization module 170 and is used to generate the final clinical report.

[0086] The clinical report includes an IED distribution map, waveform diagrams of typical spike waves, a whole-brain region pathway layout map, a 3D topological map, a source localization result map, and an overview map of interictal dipoles.

[0087] The IED distribution map is a distribution map plotted according to brain regions and time based on the spike wave time point sequence. It can intuitively reflect the brain regions where spike wave time points frequently occur, such as... Figure 3 As shown in the figure, the Chinese names of the brain regions corresponding to the English abbreviations are: RF (right frontal lobe), LF (left frontal lobe), RO (right occipital lobe), LO (left occipital lobe), RP (right parietal lobe), LP (left parietal lobe), RT (right temporal lobe), LT (left temporal lobe).

[0088] The waveform diagram, whole-brain channel layout diagram, and 3D topology diagram of typical spike waves are drawn based on the most typical moment points of the waveform in the spike wave moment point sequence. These spike wave moment points have a strong guiding role in determining the location of the epileptogenic focus. The most typical moment point is the moment point with the highest confidence obtained in the spike wave detection algorithm. The most representative cluster of spike wave moment points represents the set with the most moment points in the clustering algorithm classification.

[0089] The interictal dipole overview diagram refers to the selection of the most representative cluster of spike moments based on the clustering results, and the capture of multiple images from the coronal, sagittal, and horizontal planes to indicate the location of the epileptogenic focus in the patient.

[0090] In the report generation module 180, Figure 4 As shown, the system can automatically generate source tracing results diagrams containing four slices each from three cross-sections: coronal, sagittal, and horizontal. Row A represents the coronal source tracing results, row B represents the sagittal source tracing results, and row C represents the horizontal source tracing results, clearly presenting the location and directional distribution of interictal dipoles. Users can flexibly adjust the number and position of each slice layer and the number of dipoles displayed, and update the report content. Furthermore, the report generation module 180 also supports users manually modifying the timing of typical spikes, correspondingly updating their waveform diagrams, whole-brain region channel layout diagrams, 3D topology diagrams, and source localization results diagrams. Users can also edit the report text and save or export the final modified report. This design, while achieving efficient automatic generation, significantly enhances the user's autonomous control during the report generation process, balancing automation efficiency and operational flexibility.

[0091] It should be understood that this embodiment preprocesses the patient's structural image to register the magnetoencephalogram (MEG) and structural image; then, in the forward module, the cerebral cortex is divided into grid points based on the preprocessed structural image, and the coordinates of the grid point vertices are transformed using a registration matrix; the MEG file is preprocessed, and a trained model is used to infer the spike time point sequence of the MEG file; the magnetic dipole algorithm is used to locate the source of the spike time points, obtaining the source coordinates and source direction of the spike time points; the spike time points are clustered according to the location results to obtain different cluster classifications; the magnetic dipole algorithm is used to locate the source of the cluster classification results, obtaining the source coordinates and source direction of the cluster classification center; based on the above results, a clinical report of the patient is generated. This system can provide an efficient method for locating epileptogenic foci, solving the problem of large differences in diagnostic results and easy errors caused by the uneven skill levels of doctors in different epilepsy centers.

[0092] To achieve the above and other related objectives, this application provides a computer system including a memory, a processor, and a computer program stored in the memory, characterized in that the processor executes the computer program to implement the method.

[0093] To achieve the above objectives and other related objectives, such as Figure 6As shown, this application provides an electronic terminal, including: a memory, a graphics card, and a processor. The memory is used to store computer programs; the graphics card is used to accelerate data processing and algorithm reasoning; and the processor is used to execute the computer programs stored in the memory to implement the method for locating epileptogenic foci based on magnetoencephalography.

[0094] The memory can be a non-volatile storage device, such as a solid-state drive (SSD), flash memory, hard disk drive (HDD), or other forms of computer-readable storage media. This memory is used to store the operating system, basic drivers, third-party library files, and computer program instructions for implementing the technical solutions of this application. The aforementioned computer program may include a structural preprocessing module, a registration module, a spike detection module, and a spike moment point tracing and localization module, etc.

[0095] The graphics card (also known as a graphics processing unit, GPU) can be an integrated graphics card or a discrete graphics card, preferably a high-performance GPU that supports general-purpose computing, such as a GPU that supports parallel computing frameworks like CUDA and OpenCL. This graphics card is used for spike detection inference, spike moment point tracing and localization calculations, etc.

[0096] The processor can be a central processing unit (CPU), which may have a multi-core architecture, used to control and schedule the entire electronic terminal's computational flow. This processor loads and executes the computer program stored in the memory, coordinates data transmission and logical judgments between modules, and works with the graphics card to process input image data and analyze the location of epileptogenic foci.

[0097] To achieve the above and other related objectives, this embodiment provides a computer-readable storage medium storing a plurality of classification programs, which are used by a processor to call and execute the method described above.

[0098] The epileptogenic focus localization method provided in this embodiment can complete all steps with a single click to directly generate the final clinical report, or it can execute each step individually, allowing doctors to adjust the results of each step before finally generating the clinical report, offering great flexibility. Compared to traditional software, this method also effectively improves doctors' work efficiency and diagnostic quality, addressing the problem of inconsistent diagnostic skills among doctors in different epilepsy centers, leading to significant differences in diagnostic results and a high risk of errors.

[0099] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. A method for locating epileptogenic zone based on magnetoencephalography, comprising: registering a pre-processed structural image of a patient with a magnetoencephalography of the patient, dividing a cerebral cortex region based on the pre-processed structural image and a registration result to obtain a forward model of the patient; pre-processing and spike detection of the magnetoencephalography to obtain a sequence of spike time points; based on the forward model and the sequence of spike time points, using a magnetic dipole algorithm to calculate source coordinates and source directions of the spike time points, and using a clustering algorithm to classify the sequence of spike time points to obtain a clustering result, wherein parameters of the clustering algorithm include: a gof threshold value called by the clustering algorithm, a time neighborhood range for averaging waveform amplitudes of the spike time points, an influence weight of magnetometer of the spike time points on clustering effect, an influence weight of gradiometer of the spike time points on clustering effect, an influence weight of magnetometer of the spike time points in a set time neighborhood on clustering effect, an influence weight of spherical source dipole position of the spike time points on clustering effect, an influence weight of spherical source dipole direction of the spike time points on clustering effect, whether to normalize a distance matrix of each feature, a set number threshold value of clusters generated by the clustering algorithm, and the number of classes in the clustering result being less than the set number of clusters being entirely removed; using the magnetic dipole algorithm to calculate source coordinates and source directions of a class center of each class in the clustering result; generating a clinical report of the patient, including an IED distribution map, a waveform graph of a typical spike, a whole brain region channel layout map, a 3D topology map, a source localization result map, and an interictal dipole overview map.

2. The positioning method according to claim 1, characterized in that, The registration of the pre-processed structural image of the patient with the magnetoencephalography of the patient comprises: performing pre-processing operations of coordinate system conversion, noise reduction, artifact removal, skull stripping, and cerebral cortex reconstruction on the structural image of the patient; registering a reference point of the magnetoencephalography with a reference point of the pre-processed structural image to convert a coordinate system of the reference point of the magnetoencephalography to the coordinate system of the reference point of the structural image; based on a nearest point search matching algorithm, mapping coordinates of scalp points of the magnetoencephalography to the processed structural image scalp to obtain a registration matrix of the registration between the structural image and the magnetoencephalography; in the registration process, the weights of the magnetoencephalography scalp points and the structural image scalp in the registration process can be set to adjust the registration fit.

3. The positioning method according to claim 2, characterized in that, The division of the cerebral cortex region based on the pre-processed structural image and the registration result to obtain the forward model of the patient comprises: dividing a surface grid of the cerebral cortex region obtained after the pre-processing of the structural image of the patient to obtain spatial coordinates of grid vertices; based on the registration matrix, converting the spatial coordinates of the grid vertices and the positions of the magnetoencephalography scalp points to the same coordinate system to obtain the forward model.

4. The positioning method of claim 1, wherein, The pre-processing of the magnetoencephalography comprises: performing band-pass filtering noise reduction, notch filtering, removing power frequency noise, removing electrocardiogram artifacts, resampling dimension reduction, and data normalization processing on the magnetoencephalography in sequence.

5. The positioning method of claim 1, wherein, The calculation of the source coordinates and the source directions of the spike time points based on the forward model and the sequence of spike time points using the magnetic dipole algorithm comprises: taking magnetoencephalography data of a time neighborhood of the spike time points, calculating brain magnetic channels involved in source localization and removing bad channels; The data of the time neighborhood of the spike point on the brain magnetic channel after removing the bad channel is used to calculate the source coordinates and source direction of the spike point by using the magnetic dipole algorithm.

6. The positioning method of claim 1, wherein, The source coordinates and source direction of the class center of each class in the clustering result are calculated by using the magnetic dipole algorithm, and the method comprises the following steps: All spike points in each class are traversed, the magnetoencephalogram data of the time neighborhood of each spike point is added, and the average value of the number of spike points is obtained. The average value data is applied to the magnetic dipole algorithm to calculate the source coordinates and source direction of the class center.

7. The positioning method of claim 1, wherein, The clinical report of the patient is generated, including an IED distribution map, a waveform diagram of a typical spike, a whole brain region channel layout diagram, a 3D topological diagram, a source positioning result diagram and an interictal dipole overview diagram, and the method comprises the following steps: The IED distribution map is a distribution map drawn according to the brain region and time of the spike point sequence; The waveform diagram of the typical spike, the whole brain region channel layout diagram, the 3D topological diagram and the source positioning result diagram are obtained according to the most typical time point in the spike point sequence, wherein the most typical time point is the time point with the highest confidence in the spike detection algorithm; The interictal dipole overview diagram refers to selecting a most representative cluster of spike points from the clustering result, and cutting a plurality of pictures from the coronal plane, the sagittal plane and the horizontal plane, respectively, to indicate the location of the epileptogenic focus of the patient, wherein the most representative cluster of spike points represents the set with the most time points in the clustering algorithm classification.

8. A computer system comprising a memory, a processor, and a computer program stored on the memory, wherein the computer program comprises instructions that, when executed by the processor, cause the processor to perform the method of any one of claims 1 to 7. The processor executes the computer program to realize the method of any one of claims 1-7.

9. A computer readable storage medium, characterized in that, The computer readable storage medium stores a plurality of classification programs, and the plurality of classification programs are used to be called and executed by the processor to realize the method of any one of claims 1-7.

Citation Information

Patent Citations

  • High-frequency oscillation rhythm detection method intelligent algorithm optimized fuzzy clustering

    CN110584600A

  • Flexible brain magnetic helmet and sensor array space positioning method thereof

    CN116392132A