RGRyan Gallagher

Ryan Gallagher

*This is an algorithmically generated author record based on publicly available information.

Current Organizations / Institutes

The organizations/institutes from the scholar's latest article

Previous Organizations / Institutes

The organizations / institutes from the scholar's other articles in the past ten years


Ryan Gallagher has a total of 70 co-authors. Here are the top co-authors by number of shared publications:


Latest Publications

  • Open Access

    Unsupervised seizure annotation and detection with neural dynamic divergence

    by William K. S. Ojemann, Zhongchuan Xu, Haoer Shi, Katie Walsh, Akash Ranjan Pattnaik, Nishant Sinha, Sarah Lavelle, Carlos Aguila, Ryan Gallagher, Andrew Y Revell, et al.

    Annotating seizure onset and spread in intracranial EEG is essential for epilepsy surgical planning, yet manual annotation is unreliable and cannot scale to large datasets. We introduce Neural Dynamic Divergence (NDD), an unsupervised framework that detects seizure activity by measuring deviation from patient-specific baseline neural dynamics using autoregressive models. NDD requires no labeled training data and adapts to individual patients, channels, and brain states. Validating against expert consensus annotations from 46 seizures, NDD achieves human-level agreement ( ϕ = 0.58 vs. inter-rater ϕ = 0.64) and outperforms existing algorithms on 1,019 seizures with soft labels (AUROC = 0.87). We demonstrate clinical utility by automatically annotating 2,017 seizures, revealing that seizure spread patterns distinguish epilepsy subtypes and predict surgical outcomes. NDD also generalizes to continuous ICU scalp EEG monitoring (AUROC = 0.77). We provide NDD as an open-source Python package to enable scalable seizure annotation across research centers.


  • Open Access

    The Seizure Embedding Map: A Spatio-Temporal Transformer for Comparing Patients by Ictal Intracranial EEG Features at Scale

    by Akash R. Pattnaik, Zhongchuan Xu, William K. S. Ojemann, Carlos A. Aguila, Alfredo Lucas, Sarah Lavelle, Zack Goldblum, Peter D. Galer, Ryan Gallagher, Kathryn A. Davis, et al.

    Objective: Planning invasive treatment for medication-resistant epilepsy relies on qualitatively interpreting seizure recordings from intracranial EEG (iEEG) recordings. Clinicians recommend treatment by mapping seizure onset patterns and locations, integrating multimodal data with their clinical experience and interpretation of the literature. Referencing a new patient’s seizures against past cases remains subjective, as implant strategies, electrode placement, and the electrodes’ relation to seizure onset vary across patients and centers. This study aims to rigorize this process by introducing a transformer model that embeds spatial and temporal information in iEEG recordings to categorize seizure networks and their relation to outcome across a large cohort of drug-resistant epilepsy patients. Our ultimate goal is to quantitatively compare multiple characteristics of new patients presenting for surgical intervention to thousands of prior patients to recommend best treatment. Methods: We design and implement a custom spatiotemporal transformer that extracts features from iEEG seizure onset epochs. The model consists of convolutional layers that tokenize multi-channel iEEG, a spatiotemporal positional encoder that learns the relationship between sequences of tokens and the anatomical regions of the implantation to extract features across channels and time. Importantly, our model is flexible regarding to the number of iEEG contacts and the location of implants, being trained on both stereotactic EEG and electrocorticography implants. We validate seizure embeddings using unsupervised clustering to group seizure onset patterns using a cross-validated multi-class logistic regression model. Results: The spatiotemporal model is applied to 882 clinical seizures from 102 subjects with drug-resistant epilepsy. Unsupervised clustering reveals 74 clusters of seizures that span multiple subjects, and a multi-class logistic regression model with 10-fold cross-validation reveals significant clustering of onset patterns in embedding space (validation accuracy = 0.8159). At the group level, seizures occurring closer in time exhibit more similar embeddings ( p < 0.05), modeled with subject-specific random slopes and intercepts. Seizure clusters did not differentiate patients by therapy or postsurgical outcome, but they showed significant associations with the anatomical region of onset and seizure classification. Conclusions: We propose a method for representing iEEG recordings of seizures with embeddings that contain spatial and temporal information. These embeddings can be characterized and compared across subjects to reveal common patterns in seizure onset. While this clustering did not separate patients by therapy and postsurgical outcome, there were significant associations with the anatomical region of onset and seizure classification. Future work will refine these methods to build a framework for characterizing seizures with deep learning incorporating multimodal data, including structural and functional imaging, semiology, patient history and demographics. We present this work as a first step toward quantitative, evidence-based decision making for patients with drug resistant epilepsy.

  • Open Access

    Normative intracranial EEG highlights epileptic abnormalities across wakefulness and sleep

    by Akash R. Pattnaik, Ian Z. Ong, John Bernabei, Carlos A. Aguila, Alfredo Lucas, Daniel J. Zhou, Ryan Gallagher, William K. S. Ojemann, Mariam Josyula, Nina Petillo, et al.

    There is great interest in using quantitative methods to localize epileptic networks from intracranial EEG, a vital part of care for patients with drug resistant epilepsy (DRE). In particular, there is evidence that using interictal data for this purpose, which could eliminate the need to record seizures, has great potential to reduce morbidity from precipitated seizures and to decrease length of stay. How much of this data is required for this purpose, and from what state(s) of consciousness, is not known. In this study we analyzed interictal intracranial EEG (iEEG) data from 30 subjects and compared it against normative reference iEEG derived from 106 additional patients. We summarized brain activity and connectivity by computing spectral power and coherence in 6 frequency bands and computed z -scores relative to normal features within the same anatomical region. We used a validated algorithm to estimate the sleep or wake state. We applied a cross-validated random forest model to assign predicted abnormality value to each channel for each state of wakefulness. To determine the effectiveness of this approach for each unseen patient, we computed the area under the precision recall curve (AUPRC) between predicted abnormality within and outside of the resection zone. We further identified associations between predicted abnormalities and neuropsychological testing performance, highlighting applications of quantitative biomarkers to epilepsy comorbidities. We found that subjects with good seizure outcome (Engel 1) at 2 years had higher AUPRC than subjects with poor seizure outcome for predicted abnormalities in N2 sleep (Mann-Whitney test; p Holm=Bonferroni < 0.05). Combining features from wakefulness and NREM sleep best separated good and poor seizure outcome subgroups (Mann-Whitney test; p Holm=Bonferroni < 0.05, Cohen’s d = 1.62). Combinations of wake and sleep abnormalities and interictal spikes explained the variance in pre-surgical neuropsychological testing ( R 2 = 0.57-0.58).


  • Open Access

    Lumbar Spinal Fusion Outcomes in Patients With Cancer Compared to Matched Peers Without Cancer

    by Ryan S. Gallagher, Ritesh Karsalia, Emily Xu, Connor A. Wathen, Austin J. Borja, Jianbo Na, Tara Collier, Scott McClintock, Neil R. Malhotra

    Study Design: Retrospective Matched Cohort Study. Objectives: Optimization of medical comorbidities is an essential part of preoperative management. However, the isolated effects of individual comorbidities have not been evaluated within a homogenous spine surgery population. This exact matching study aims to assess the independent effects of cancer on outcomes following single-level lumbar fusions for non-cancer surgery. Methods: 4680 consecutive patients undergoing single-level posterior-only lumbar fusion were retrospectively enrolled. Univariate statistics and coarsened exact matching (CEM) were computed to evaluate outcomes between cancer patients and those without comorbidities. Results: By logistic regression, malignancy conferred a higher risk of surgical complication ( P = 0.016, OR = 2.64, CI = [1.200,5.790]), 30- and 90- day readmission ( P = 0.012, OR = 2.025, CI = [1.170-3.510]; P < 0.001, OR = 2.34, CI = [1.430, 3.830], respectively), 90-day reoperation ( P < 0.001, OR = 2.16, [1.110, 4.200]), and death at 90-days ( P = 0.032, OR = 8.27, CI = [1.200, 56.850]). After matching, malignancy was associated with increased odds of incidental durotomy (6 vs 0 cases, P = 0.048) and death at both 30 and 90 days (both: OR = 8.0, P = 0.020, CI = [1.00, 63.960]). No cases of durotomy occurred in cases with mortality in the matched sample, suggesting independent relationships. There were no differences in length of stay, non-home discharge, ED evaluation, readmission, or reoperations. Conclusion: Among otherwise exact-matched patients undergoing single level lumbar fusion, history of malignancy conferred a higher risk of short-term mortality, but not other outcomes suggestive of surgical failure. Increased mortality after lumbar fusion should be studied further and may play a role in surgical decision-making and patient discussions.

  • Open Access

    The sixth sense: how much does interictal intracranial EEG add to determining the focality of epileptic networks?

    by Ryan S Gallagher, Nishant Sinha, Akash R Pattnaik, William K S Ojemann, Alfredo Lucas, Joshua J LaRocque, John M Bernabei, Adam S Greenblatt, Elizabeth M Sweeney, Iahn Cajigas, et al.

    Intracranial EEG is used for two main purposes: to determine (i) if epileptic networks are amenable to focal treatment and (ii) where to intervene. Currently, these questions are answered qualitatively and differently across centres. There is a need to quantify the focality of epileptic networks systematically, which may guide surgical decision-making, enable large-scale data analysis and facilitate multi-centre prospective clinical trials. We analysed interictal data from 101 patients with drug-resistant epilepsy who underwent pre-surgical evaluation with intracranial EEG at a single centre. We chose interictal data because of its potential to reduce the morbidity and cost associated with ictal recording. Sixty-five patients had unifocal seizure onset on intracranial EEG, and 36 were non-focal or multi-focal. We quantified the spatial dispersion of implanted electrodes and interictal intracranial EEG abnormalities for each patient. We compared these measures against the ‘5 Sense Score,’ a pre-implant prediction of the likelihood of focal seizure onset, assessed the ability to predict unifocal seizure onset by combining these metrics and evaluated how predicted focality relates to subsequent treatment and outcomes. The spatial dispersion of intracranial EEG electrodes predicted network focality with similar performance to the 5-SENSE score [area under the receiver operating characteristic curve = 0.68 (95% confidence interval 0.57, 0.78)], indicating that electrode placement accurately reflected pre-implant information. A cross-validated model combining the 5-SENSE score and the spatial dispersion of interictal intracranial EEG abnormalities significantly improved this prediction [area under the receiver operating characteristic curve = 0.79 (95% confidence interval 0.70, 0.88); P < 0.05]. Predictions from this combined model differed between surgical- from device-treated patients with an area under the receiver operating characteristic curve of 0.81 (95% confidence interval 0.68, 0.85) and between patients with good and poor post-surgical outcome at 2 years with an area under the receiver operating characteristic curve of 0.70 (95% confidence interval 0.56, 0.85). Spatial measures of interictal intracranial EEG abnormality significantly improved upon pre-implant predictions of network focality by area under the receiver operating characteristic curve and increased sensitivity in a single-centre study. Quantified focality predictions related to ultimate treatment strategy and surgical outcomes. While the 5-SENSE score weighed for specificity in their multi-centre validation to prevent unnecessary implantation, sensitivity improvement found in our single-centre study by including intracranial EEG may aid the decision on whom to perform the focal intervention. We present this study as an important step in building standardized, quantitative tools to guide epilepsy surgery.


  • Open Access

    Interictal intracranial EEG asymmetry lateralizes temporal lobe epilepsy

    by Erin C Conrad, Alfredo Lucas, William K S Ojemann, Carlos A Aguila, Marissa Mojena, Joshua J LaRocque, Akash R Pattnaik, Ryan Gallagher, Adam Greenblatt, Ashley Tranquille, et al.

    Patients with drug-resistant temporal lobe epilepsy often undergo intracranial EEG recording to capture multiple seizures in order to lateralize the seizure onset zone. This process is associated with morbidity and often ends in postoperative seizure recurrence. Abundant interictal (between-seizure) data are captured during this process, but these data currently play a small role in surgical planning. Our objective was to predict the laterality of the seizure onset zone using interictal intracranial EEG data in patients with temporal lobe epilepsy. We performed a retrospective cohort study (single-centre study for model development; two-centre study for model validation). We studied patients with temporal lobe epilepsy undergoing intracranial EEG at the University of Pennsylvania (internal cohort) and the Medical University of South Carolina (external cohort) between 2015 and 2022. We developed a logistic regression model to predict seizure onset zone laterality using several interictal EEG features derived from recent publications. We compared the concordance between the model-predicted seizure onset zone laterality and the side of surgery between patients with good and poor surgical outcomes. Forty-seven patients (30 female; ages 20–69; 20 left-sided, 10 right-sided and 17 bilateral seizure onsets) were analysed for model development and internal validation. Nineteen patients (10 female; ages 23–73; 5 left-sided, 10 right-sided, 4 bilateral) were analysed for external validation. The internal cohort cross-validated area under the curve for a model trained using spike rates was 0.83 for a model predicting left-sided seizure onset and 0.68 for a model predicting right-sided seizure onset. Balanced accuracies in the external cohort were 79.3% and 78.9% for the left- and right-sided predictions, respectively. The predicted concordance between the laterality of the seizure onset zone and the side of surgery was higher in patients with good surgical outcome. We replicated the finding that right temporal lobe epilepsy was harder to distinguish in a separate modality of resting-state functional MRI. In conclusion, interictal EEG signatures are distinct across seizure onset zone lateralities. Left-sided seizure onsets are easier to distinguish than right-sided onsets. A model trained on spike rates accurately identifies patients with left-sided seizure onset zones and predicts surgical outcome. A potential clinical application of these findings could be to either support or oppose a hypothesis of unilateral temporal lobe epilepsy when deciding to pursue surgical resection or ablation as opposed to device implantation.


  • Open Access

    Utility of intracranial EEG networks depends on re-referencing and connectivity choice

    by Haoer Shi, Akash Ranjan Pattnaik, Carlos Aguila, Alfredo Lucas, Nishant Sinha, Brian Prager, Marissa Mojena, Ryan Gallagher, Alexandra Parashos, Leonardo Bonilha, et al.

    Studies of intracranial EEG networks have been used to reveal seizure generators in patients with drug-resistant epilepsy. Intracranial EEG is implanted to capture the epileptic network, the collection of brain tissue that forms a substrate for seizures to start and spread. Interictal intracranial EEG measures brain activity at baseline, and networks computed during this state can reveal aberrant brain tissue without requiring seizure recordings. Intracranial EEG network analyses require choosing a reference and applying statistical measures of functional connectivity. Approaches to these technical choices vary widely across studies, and the impact of these technical choices on downstream analyses is poorly understood. Our objective was to examine the effects of different re-referencing and connectivity approaches on connectivity results and on the ability to lateralize the seizure onset zone in patients with drug-resistant epilepsy. We applied 48 pre-processing pipelines to a cohort of 125 patients with drug-resistant epilepsy recorded with interictal intracranial EEG across two epilepsy centres to generate intracranial EEG functional connectivity networks. Twenty-four functional connectivity measures across time and frequency domains were applied in combination with common average re-referencing or bipolar re-referencing. We applied an unsupervised clustering algorithm to identify groups of pre-processing pipelines. We subjected each pre-processing approach to three quality tests: (i) the introduction of spurious correlations; (ii) robustness to incomplete spatial sampling; and (iii) the ability to lateralize the clinician-defined seizure onset zone. Three groups of similar pre-processing pipelines emerged: common average re-referencing pipelines, bipolar re-referencing pipelines and relative entropy-based connectivity pipelines. Relative entropy and common average re-referencing networks were more robust to incomplete electrode sampling than bipolar re-referencing and other connectivity methods (Friedman test, Dunn–Šidák test P < 0.0001). Bipolar re-referencing reduced spurious correlations at non-adjacent channels better than common average re-referencing (Δ mean from machine ref = −0.36 versus −0.22) and worse in adjacent channels (Δ mean from machine ref = −0.14 versus −0.40). Relative entropy-based network measures lateralized the seizure onset hemisphere better than other measures in patients with temporal lobe epilepsy (Benjamini–Hochberg-corrected P < 0.05, Cohen’s d: 0.60–0.76). Finally, we present an interface where users can rapidly evaluate intracranial EEG pre-processing choices to select the optimal pre-processing methods tailored to specific research questions. The choice of pre-processing methods affects downstream network analyses. Choosing a single method among highly correlated approaches can reduce redundancy in processing. Relative entropy outperforms other connectivity methods in multiple quality tests. We present a method and interface for researchers to optimize their pre-processing methods for deriving intracranial EEG brain networks.


  • Open Access

    Low Household Income Increases Hospital Length of Stay and Decreases Home Discharge Rates in Lumbar Fusion

    by Ryan S. Gallagher, Ritesh Karsalia, Austin J. Borja, Emelia G. Malhotra, Maria A. Punchak, Jianbo Na, Scott D. McClintock, Neil R. Malhotra

    Study Design: Retrospective Matched Cohort Study. Objectives: Low median household income (MHI) has been correlated with worsened surgical outcomes, but few studies have rigorously controlled for demographic and medical factors at the patient level. This study isolates the relationship between MHI and surgical outcomes in a lumbar fusion cohort using coarsened exact matching. Methods: Patients undergoing single-level, posterior lumbar fusion at a single institution were consecutively enrolled and retrospectively analyzed (n = 4263). Zip code was cross-referenced to census data to derive MHI. Univariate regression correlated MHI to outcomes. Patients with low MHI were matched to those with high MHI based on demographic and medical factors. Outcomes evaluated included complications, length of stay, discharge disposition, 30- and 90 day readmissions, emergency department (ED) visits, reoperations, and mortality. Results: By univariate analysis, MHI was significantly associated with 30- and 90 day readmission, ED visits, reoperation, and non-home discharge, but not mortality. After exact matching (n = 270), low-income patients had higher odds of non-home discharge (OR = 2.5, P = .016) and higher length of stay (mean 100.2 vs 92.6, P = .02). There were no differences in surgical complications, ED visits, readmissions, or reoperations between matched groups. Conclusions: Low MHI was significantly associated with adverse short-term outcomes from lumbar fusion. A matched analysis controlling for confounding variables uncovered longer lengths of stay and higher rates of discharge to post-acute care (vs home) in lower MHI patients. Socioeconomic disparities affect health beyond access to care, worsen surgical outcomes, and impose costs on healthcare systems. Targeted interventions must be implemented to mitigate these disparities.


  • Open Access

    Remote delivery of cardiac rehabilitation can achieve equivalent health-related quality of life outcomes to in-person methods in patients with coronary heart disease: a multi-site study

    by R Gallagher, A Kirkness, M Farrell, K Roach, L Gooley, S Ashcroft, A Fletcher, C Stephenson, H Glinatsis, C Bruntsch, et al.

    Type of funding sources: None. Background In-person exercise-based cardiac rehabilitation (CR) has well-established benefits for health-related quality of life (HRQL) for patients with coronary heart disease (CHD). During COVID-19 pandemic restrictions, remote delivery replaced in-person CR, but the impact on HRQL is unclear. This study addresses this gap. Methods Consecutive patients commencing CR at four sites in one Local Health District in Sydney were recruited (n = 194), recruited from December 2019 to October 2020. Remote delivery from March 2020 created a natural comparison group to in-person CR. HRQL was measured at CR entry and completion using the SF-12v2 and linear regression was used for analyses. Results Participants were aged mean 65.94 (SD 10.45) years, were 80.9% male and diagnoses included elective PCI (37.9%), CABG (26.7%), and MI (34.9%) either with PCI (23.6%) or alone (11.3%). Participants received remote (n = 103, 53.1%) or in-person (n = 91, 46.9%; ≥ assessment + 2 sessions) CR, with more completions for in-person (75.8% vs 63.1%, p=.03). Remote participants were more likely to be white than ethnic minority (35.2% vs 13.6% p<.001), however, there were no differences in baseline HRQL for delivery group after adjustment. HRQL improved from CR entry to completion regardless of delivery mode (adjusted). Most improvements occurred in physical function (SMD 6.37, 95% CI 4.81,7.92), role physical (SMD 5.72, 95% CI 4.29. 7.16) and physical component (SMD 5.77 95% CI 4.43, 7.12) scores. Least improvement occurred in mental component scores (SMD 1.65, 95%CI .53, 2.78). Conclusion Remotely delivered CR provides comparable HRQL outcomes to in-person delivery, thus providing a promising alternative. Data are needed on cost-effectiveness, as well as staff and patient preferences.