Non-invasive measurements of ictal and interictal epileptiform activity using optically pumped magnetometers

Magneto- and electroencephalography (MEG/EEG) are important techniques for the diagnosis and pre-surgical evaluation of epilepsy. Yet, in current cryogen-based MEG systems the sensors are offset from the scalp, which limits the signal-to-noise ratio (SNR) and thereby the sensitivity to activity from deep structures such as the hippocampus. This effect is amplified in children, for whom adult-sized fixed-helmet systems are typically too big. Moreover, ictal recordings with fixed-helmet systems are problematic because of limited movement tolerance and/or logistical considerations. Optically Pumped Magnetometers (OPMs) can be placed directly on the scalp, thereby improving SNR and enabling recordings during seizures. We aimed to demonstrate the performance of OPMs in a clinical population. Seven patients with challenging cases of epilepsy underwent MEG recordings using a 12-channel OPM-system and a 306-channel cryogen-based whole-head system: three adults with known deep or weak (low SNR) sources of interictal epileptiform discharges (IEDs), along with three children with focal epilepsy and one adult with frequent seizures. The consistency of the recorded IEDs across the two systems was assessed. In one patient the OPMs detected IEDs that were not found with the SQUID-system, and in two patients no IEDs were found with either system. For the other patients the OPM data were remarkably consistent with the data from the cryogenic system, noting that these were recorded in different sessions, with comparable SNRs and IED-yields overall. Importantly, the wearability of OPMs enabled the recording of seizure activity in a patient with hyperkinetic movements during the seizure. The observed ictal onset and semiology were in agreement with previous video- and stereo-EEG recordings. The relatively affordable technology, in combination with reduced running and maintenance costs, means that OPM-based MEG could be used more widely than current MEG systems, and may become an affordable alternative to scalp EEG, with the potential benefits of increased spatial accuracy, reduced sensitivity to volume conduction/field spread, and increased sensitivity to deep sources. Wearable MEG thus provides an unprecedented opportunity for epilepsy, and given its patient-friendliness, we envisage that it will not only be used for presurgical evaluation of epilepsy patients, but also for diagnosis after a first seizure.

Table S1: Patient characteristics, recording preparation, and clinical information, which includes the location of IEDs in MEG and EEG, ictal EEG onset, interictal and ictal sEEG findings, PET and CT abnormalities, MRI findings, and semiology. All patients were male, and all patients slept less than usual the night before the recordings. onset; * contained artefacts due to orthodontic material, yet data was interpretable; # after trying many: anti-seizure medication resulted in either one or more of the following: itchiness, eczema, drowsiness, memory problems, mood disturbances, fear, and had no sustained effect on the severity or frequency of seizures; ‡ on average 8 seizures/night in the weeks before the OPM recording.

Cold-head coil
The motor unit in the cryocooler generates a magnetic field of ~1 μT. At the location of the subject's head, about 1.5 meters away from the cold-head, this corresponds to a remnant field of ~300 nT. From this distance, the motor unit can be approximated as a magnetic dipole. A compensation coil was built tightly around the motor unit to generate a magnetic dipole at the same location as the motor unit, and with opposing orientation, in order to generate a compensating field pattern that matches the field pattern of the motor unit at the measurement volume. Specifically, the coil consisted of two segments, one wrapped around the motor unit and one mounted on the other side of the cold-head, that were connected in series so that the current was flowing in the same direction in both coils. The surface area of the coil was small and, therefore, a large current was needed in order to generate an opposing field of about 300 nT in the measurement volume.

Automatic identification of interictal epileptiform discharges
Interictal epileptiform discharges (IEDs) were automatically identified using a matlabimplementation of the BrainSpike algorithm in BrainWave (version 0.9.162.4; developed by C.J.S.; available from https://home.kpn.nl/stam7883/). The algorithm detects spikes in sliding 1-sec windows, using steps of half a second. The windoweddata in a channel is converted to Z-scores, based on the mean and standard deviation for that window. If an event with a maximum Z-score exceeds a threshold within the middle 500 msec of the window (a threshold of 4, 3.5, 3.5, and 4.5 was used for patient #1, #3, #4, and #6, respectively), and if the event has a minimum and maximum duration (defined as the time between zero-crossings) of 20 and 200 msec, respectively, then it is marked as a potential IED. The algorithm was re-run on negated data in order to also identify 'negative' IEDs, and the IED with the maximum Z-score within a window, and across channels, was kept. Thus, a single Z-value was obtained for each IED, which was used as a proxy for the IED's SNR.
In order to reduce the number of false positives, the algorithm was run on only a selection of channels. The channel-selection was based on the field maps of the IEDs that had already been identified on the basis of a visual analysis of the data.

Comparison between systems
The noise level of OPMs (7-13 fT/√Hz in our case) is higher than for SQUIDs (~3 fT/√Hz), yet this is compensated for by the increase in signal amplitude due to the onscalp placement of OPMs (reducing the source-sensor distance by ~2 cm compared to fixed-helmet SQUID-based systems). Simulations 1,2 and experimental data 3,4 have shown that the SNR of OPM-based measurements is indeed higher than for SQUIDbased recordings. The largest gains are found for cortical sources, as the relative reduction in source-sensor distance is larger there than for deeper brain structures.
To demonstrate the advantages of a reduced source-sensor distance we quantified and compared the SNR and IED-yield for OPM data with data from the SQUID-based system.
For each patient, the average Z-scores of all identified true positive IEDs were compared between SQUID and OPM recordings using the Mann-Whitney U test (ranksum.m in Matlab (R2018b)) with an alpha of .05. Hence, we used the assumption that the observations between the separate recordings were independent (since the recordings were performed at different times, and the IEDs themselves could therefore have changed over time). This is a conservative approach though, and one could increase statistical power by taking into account that the within-patient observations were not completely independent, for example through mixed-effects modelling 5 .
For patient #1 the SWI was comparable between systems, after taking the unilateral OPM placement into account. The difference between the SNR of the IEDs in the OPM data and SQUID data was negligible (4.47 versus 4.57; U = -3.81, d = -0.14, p = 1e-4). The OPM-recordings for patient #3 revealed more IEDs (SWI = 9.00) than the SQUID-recordings (SWI = 6.76), but the difference in SNRs was negligible IEDs that were not observable in the SQUID data.
Thus, for one patient the OPMs identified IEDs that were missed by the SQUID-based system, and for one patient the IED-yield was higher for the OPMs. Somewhat surprisingly, for two patients the IED-yield was higher for the SQUIDs (for one of these patients the IED-yield was comparable when the unilateral coverage of the OPMs was taken into account), and for three patients the SNRs of IEDs were (slightly) lower in the OPM data than in the SQUID data, although with negligible effect sizes for two of these patients.
These differences in performance should be interpreted with caution though, as several factors could have affected the SNRs and IED-yields for the two systems: The recordings with the two systems were performed on the same day, but in different sessions, so state-changes could have affected the IED-yields. Moreover, the freedom to move during the OPM-recordings could have introduced movement-related artefacts that may have obscured IEDs. On-scalp OPM arrays have more focal fields-of-view 1 , implying that a more exact placement with respect to the underlying sources is required in order to capture the field extrema. Using a small number of OPMs may therefore have resulted in a reduced SNR, and possibly a lower IED-yield (especially for IEDs with low SNR). Interestingly, the more focal fields-of-view also means that with equal SNR, OPMs still offer higher spatial resolution than SQUIDs. SNR may also have been affected by the use of two-axial recordings 6,7 . Besides these general considerations, other factors may have also affected the SNR and/or IED-yield: For patient #1, clinical MEG and sEEG recordings had previously shown the involvement of an extended epileptogenic network (Table S1) Somewhat surprisingly, given the superficial origin of the IEDs, the average SNR of IEDs in patient #3 was comparable between the two systems. However, the SNR of the IEDs was low for both systems, and more IEDs were observed with the OPMs than with the SQUIDs. The inclusion of more, low-amplitude, IEDs reduced the average SNR for the IEDs in the OPM data. This would lead to the conclusion that the OPMs actually outperformed the SQUIDs, by their ability to detect such weak IEDs.
However, sensor placement also had a big effect on the detectability of IEDs in this patient, as displacement of one OPM by 2.8 cm ( Figure S4) made the IEDs undetectable. Another explanation for the findings could therefore be that the SNR was, also in this patient, reduced by sub-optimal placement of the OPMs. This is also the most likely explanation for the observed lower SNR for OPMs compared to SQUIDs for patient #4, who also had IEDs with a superficial origin (Table   S1, Figure 3). It should be noted that even though the SNR differed significantly for this patient, due to the large number of IEDs, the actual difference in SNR was small (i.e. within the standard deviation of the SNR for the individual systems), with a medium effect size.

Increasing signal quality
Although one of the main advantages of OPMs is their wearability, a consequence of this wearability is that signal quality is largely affected by movement of the OPMs through the remnant field-gradients. However, with appropriate preprocessing, using motion-regression, HFC, and beamforming, movements of at least 1 meter can be tolerated 9 . It may be possible to improve on this by generating a model of the remnant fields inside the MSR, and using this model to predict and remove movement-related artefacts 10 . Moreover, reducing the field gradients in custom-designed MSRs with degaussing coils 11 , or by using field-nulling 'matrix-coils' that allow for accurate field control in a large volume 12 , would reduce the amplitude of movement-related artefacts to begin with. Finally, closed-loop designs can be used to further reduce movementrelated artefacts, either at the OPM-level using a feedback signal to drive the on-board coils (requiring tri-axial sensitivity 7 ), or through the field-nulling coils by 'real-time' updating of the coil calibration matrix, which would ensure optimal field cancellation during movements.

Helmet design
Bespoke rigid sensor arrays were created for all patients ( Figure S2 Flexible caps on the other hand can be re-used, but recordings may be more noisy due to sensor movements/rotations, and the exact sensor locations and orientations need to be determined. A compromise may be the use of a limited number of different-sized rigid helmets, with holders in which OPMs can be pressed onto the scalp 13 . The depth of the OPMs within their holder could be measured manually, or sensor positions and orientations could be determined automatically, using either an optical approach 14 or utilising the field-nulling coils 15 . The latter approach has the advantage that any changes in the orientations of the OPM's sensitive axes due to crosstalk from neighbouring OPMs are already taken into account. These automatic approaches could also be used in combination with a design consisting of a bespoke rigid base to which a generic flexible cap with OPM-holders can be attached (https://quspin.com/experimental-megcap/).
Another important consideration is that with increased coverage, heatdissipation may become an important issue, especially for long-term recordings, for the Rubidium-based sensors used in this study, although less-so for Helium-based OPMs 16 or solid-state sensors 17 that can operate at room temperatures. Figure S1: Bi-planar nulling coils. The natural symmetry shared by pairs of coils (Bx & dBx/dz, By & dBy/dz, and Bz & dBz/dz) was used in order to reduce the number of coils needed to minimise the field in all 3 directions, as well as the (linear) field gradients in the z-direction by a co-optimised coil design process 18 . Red and blue coloured wirepaths denote regions of opposing current flow. For the Bx & dBx/dz, By & dBy/dz coils driving the two planes with equal and opposite input currents generates a uniform magnetic field, driving the two planes with equal and same-signed currents generates a linear magnetic field gradient. For the Bz & dBz/dz coil, driving the two planes with equal and same-signed input currents generates a uniform magnetic field, driving the two planes with equal and opposite currents generates a linear magnetic field gradient. Two coils were added to allow nulling of the dBy/dy and dBx/dy gradients, in this case there is no shared symmetry which can be exploited so the windings of each plane were connected in anti-series. Grooves for each coil wirepath were routed into Forex PVC (polyvinylchloride) planes of 1.8 x 1.8 m 2 . Enamelled copper wire of diameter 0.56mm was pressed into the grooves and fixed in place with tape at strategic positions. A front panel was added to prevent galvanic contact between the patients and the coils, and the stacked planes were placed inside a PVC frame (see lower-right sub- figure). The balanced coil pairs were connected individually, and the dBy/dy and dBx/dy coils in anti-series, to low-noise, 4 V, coil drivers (QuSpin Inc). Using this setup, the coils can generate uniform fields or field gradients within a 40 x 40 x 40 cm 3 volume between the centre of the panels. Biplanar coil systems similar to those described here are commercially available (e.g. from Cerca Magnetics Limited, Nottingham, UK). Figure S2: Helmet design, and helmet-models for all 7 patients. A 3D model of the scalp surface was created from the patient's anatomical MRI, from which the basic helmet-shape was extracted (top-left panel). A standard layout was projected onto this helmet (red markers; top-middle panel), and holes for heat-dissipation were created at these positions. A removable cap was created and holes for a chin-strap were added, as well as individual sensor-holders (top-right panel). The field maps of IEDs that had been identified in the previously recorded clinical MEG were used to guide the sensor placement (see Figure  3). That is, the sensors were placed so that the (expected) dipolar pattern would be captured with the sensors, including the two field extrema. Stereo-EEG recordings were used as gold-standard for confirmation of the location of the IEDs as identified in the previously recorded clinical MEG.    Source-reconstructed OPM data for temporal (a) and subcortical (b) channels in the BNA atlas (see 19 for nomenclature). Channels from left and right hemisphere are alternated. The grey vertical lines mark 1 second of data, that were filtered between 3 -48 Hz. Note the increase in fast activity, simultaneously in both hemispheres, after about 9 secs (red vertical line), marking the start of the seizure. This is followed by artefacts due to movement during the seizure. Panel c shows a segment of seizure activity, Type 1, from a video-EEG recorded in 2021. Seizure from drowsy state, EEG applied according to the 10-20 system with extra electrodes from the 10-10 system (anterior frontal (AF7/8), frontotemporal (FT9/10, FT7/8), temporal (T9/10), centroparietal (CP5/6)). Average montage. The grey vertical lines mark 1 second of data, amplitude 70 µV/cm, high and low pass filter of 0.27 Hz and 15.0 Hz, respectively. The seizure starts with attenuation of the background pattern (1 st blue vertical line from the left), followed with diffuse beta activity (2nd blue vertical line; mainly frontotemporal), then beta mixed with muscle artefact (although no patient movements were visible yet), followed by large movement artefacts. Note the similarity in temporal evolution in the video-EEG and OPM recording. Panel d shows a segment of seizure activity, Type 1, from an sEEG recording from 2021. Only electrodes involved in the seizure onset are depicted (05INSL: entry: frontal, target: anterior insula. 06HCL: entry: temporal, target: left hippocampus. 07GFL: entry: temporal, target: left fusiform gyrus). Bipolar montage. The grey vertical lines mark 1 second of data, amplitude 700 µV/cm, high and low pass filter of 0.27 Hz and 100 Hz, respectively. UEO: unequivocal electrographic onset. UCO: unequivocal clinical onset. Seizure onset (1st blue vertical line): 2.5 Hz spike-wave complexes on position 6HCL1-3, also visible at 5INSL1-8 and less pronounced at 7GFL1-8, followed by irregular high frequency activity and subsequent beta activity with a frequency of ~20 Hz on 06HCL1-3. Seizure propagation (not shown) in consecutive order: left posterior temporal lobe (GFL), left anterior cingulate cortex (anterior and dorsal part) and left frontobasal area. Figure S7: Interictal activity for patient #7. Independent IEDs were observed over the left (a) and right (b) temporal lobes, as well as simultaneously over both temporal lobes (b). The first 6 channels were placed over the right hemisphere and the last 6 channels over the left hemisphere; alternating channels show recording in the OPMs' By and Bz direction. Note the ECG artefact on channel 2 and 8, which was removed/reduced through beamforming (c). Panel c shows the same segment of data as in panel b, source-reconstructed to the subcortical channels in the BNA atlas. Channels from left and right hemisphere are alternated. The grey vertical lines mark 1 second of data, that were filtered between 3 -48 Hz.