*2.4. EEG Acquisition*

The EEG recordings were derived from ward recordings conducted during the patients' stay at the RPAH. The EEG was recorded using Compumedics hardware and software. The ward nurse applied the individual electrodes to the patient's head in the standard 10/20 format using the gold standard measurement process. Once the routine clinical recording was complete, the raw EEG files were obtained, and the seizure segments annotated by the EEG technician and reviewed by a senior neurologist. All seizures were then analysed in Curry 8 ("Curry", Compumedics Neuroscan) to obtain the functional connectomes. Curry is a neuroimaging software suite that allows the combination and analysis of multimodal data and is optimised for evaluating epilepsy-related data.

#### *2.5. EEG Processing to Obtain Functional Connectomes*

Curry was used to pre-process the EEG and obtain the sensor-based coherence matrices which represented the functional connectomes. First, we applied Curry's automated artifact reduction and filtering tool to obtain a clean signal. Next, Curry's coherence calculation process (shown in Figure 1, Step 1, b, ii) was used to generate coherence matrices for the first five seconds of each seizure. Specifically, using one-second non-overlapping windows starting from the annotated seizure onset time, the coherence matrices were computed from the cross-spectral densities *Gxy* and auto-spectral densities *Gxx* and *Gyy* of the channels *x* and *y*, using the equation

*Cxy* **= (***Gxy <sup>×</sup> Gxy***)**/**(***Gxx <sup>×</sup> Gyy***)**. The resulting coherence matrices were 21 *<sup>×</sup>* 21; row and column headers represented single electrodes. The reference electrodes and their corresponding scores were then removed, resulting in 19 *×* 19 matrices, which were used as the functional connectomes ("FC", Figure 1, Step 1, b, iii). Therefore, each electrode pair's corresponding value was a composite of the normalised maximum similarity between the waveforms and the time-shift (delay) when the maximum similarity occurred. The

electrode pair value represented the highest percentage of coherence achieved by that electrode pair in the one-second window after factoring in the signal time lag between the two electrodes.

#### *2.6. Mapping Cortical Regions to the Nearest Electrode*

This section details the processes in Step 2 of Figure 1, where we used our previously described method [30] to create a subject-specific electrode warp and map each subject's cortical regions from the DK atlas to the nearest electrode. First, using the ANTs nonlinear registration tool, 21 electrodes in the standard MNI template space were warped to each participant's T1 image that had been registered to the diffusion image space (Figure 1 Step 2, a, i–iii). Next, we applied our inverse square method, which incorporates the inverse square equation shown in Figure 1 (Step 2, b, i) to produce a subject-specific, one-to-one mapping of each cortical region to its nearest electrode. The inputs were each subject's electrode warp and the cortical structure labels from Step 1. The inverse square equation holds that the light intensity of a source is inversely proportional to the square of the distance from the source. Thus, the inverse square method enabled the consideration of MRI voxel intensity in assessing the distance of each cortical region from each electrode's centre. Voxel intensity may represent the cortex's topological arrangement, endorsing postulation of the EEG signal strength from a given region relative to that region's distance from the scalp. The matrix in Figure 1, (Step 2, b, ii) depicts each region with one electrode name assigned—this electrode was the closest to that region. Subcortical regions (such as the hippocampus) were not assigned electrodes as their physical distance from the scalp and positioning below other cortical regions deemed them inaccessible for accurate measurement; thus they were removed from the analysis.

## *2.7. Mapping the Structural Connectome to the Functional Connectome*

To enable the direct, one-to-one comparison of the values in the structural and functional connectomes, the structural connectome was first condensed to match the size of the functional connectomes (from 70 *×* 70 to 19 *×* 19). Only the upper triangle of the structural connectome was used in the calculation. The output file shown in Figure 1 (Step 2, b, ii) provided the electrode names and corresponding regions (and their values) for the new structural matrix. To calculate the new value for a given electrode pair in the condensed structural connectome, the values for all regions between that given electrode pair were summed. An example is provided in Figure 1, (Step 3, a), where all values between electrodes Fz ("E*x*") and Fp2 ("E*y*") are coloured in purple. The total sum of all values between E*x* and E*y* was used as the new value for Fz-Fp2 (black square) in the condensed structural connectome. Once new values were computed for all electrode pairs, the diagonal line (self correlations) was removed from the structural and functional connectomes, and the connectomes were converted to a 1D array for statistical analysis.
