These codes were used for the analysis of transcranial focused ultrasound (tFUS) EEG source imaging data as part of the study: Transcranial focused ultrasound induces source localizable cortical activation in resting state humans when applied concurrently with transcranial electric stimulation [1]. Raw EEG data from the study can be found at the FigShare repository [2]. Due to subject confidentiality, we are sharing defaced [3] MRI files (also uploaded to the FigShare repository).
In many cases, MNE Python based codes were copied, with some alteration, from MNE Python tutorials. I have done my best to mark all of the direct copied and pasted lines of code with their source. Please note that, for these marked lines, the license is BSD-3-Clause, and original copyright belongs to the MNE-Python contributors.
This work was supported in part by NIH grants R01NS124564-01 (PI: B.H.), RF1NS131069 (PI: B.H.), R01NS127849 (PI: B.H.), R01NS096761 (PI: B.H.), RF1NS124564-02, and T32EB029365 (J.K. and C.G.; PI: B.H.). J.K.’s work was supported in part by the National Science Foundation Graduate Research Fellowship Program under Grant No. DGE2140739. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of the National Institutes of Health and the National Science Foundation.
Please direct correspondence about the paper to: Dr. Bin He, Carnegie Mellon University, Department of Biomedical Engineering, Pittsburgh, PA 15213. E-mail: bhe1@andrew.cmu.edu
These files contain the python functions used in the analysis. They have been named in a (mostly) intuitive way.
- preprocessing_utils.py : contains the function process_mne_raw2epoch for the preprocessing pipeline.
- mne_utils.py : contains helper functions for interacting with MNE Python data structures. The SourceImage class was used to perform EEG source imaging.
- stats_utils.py : contains helper functions for the statistical analysis performed in the paper.
- R_utils.py : contains the function for Bayes Factor ANOVA analysis. This script is kept seperate from the stats_utils.py file in order to allow calling functions from stats_utils without R installed. Loading R_utils.py without R installed will lead to a crash.
This file contains the R code to run the linear mixed effect models on the data (corresponding to the analysis in Supplemental Figure S1).
[1] Kosnoff, J., Gonsisko, C., Yu, K., Zhang, J., Ding, Y., Zhang, Y., & He, B. (2025). Transcranial focused ultrasound induces source localizable cortical activation in resting state humans when applied concurrently with transcranial electric stimulation. bioRxiv : the preprint server for biology, 2025.12.03.692212.
[2] Kosnoff, J. et al. (2026). tFUS-ESI EEG Data Set for ‘Transcranial focused ultrasound induces source localizable cortical activation in resting state humans when applied concurrently with transcranial electric stimulation’. https://doi.org/10.6084/m9.figshare.31029691.v1.
[3] Bischoff-Grethe, A., Ozyurt, I. B., Busa, E., Quinn, B. T., Fennema-Notestine, C., Clark, C. P., Morris, S., Bondi, M. W., Jernigan, T. L., Dale, A. M., Brown, G. G., & Fischl, B. (2007). A technique for the deidentification of structural brain MR images. Human brain mapping, 28(9), 892–903. https://doi.org/10.1002/hbm.20312