Project Summary During the past three decades non-invasive functional brain imaging has developed immensely in terms of measurement technologies, analysis methods, and innovative paradigms to capture information about brain function both in healthy and diseased individuals. While functional MRI (fMRI) provides a wealth of information by measuring the indirect slow hemodynamic signals. Magnetoencephalography (MEG) and electroencephalography (EEG) remain the only noninvasive techniques capable of directly measuring the electrophysiological activity directly with a millisecond resolution. During the past twelve years we have developed, with NIH support, the MNE-Python software, which covers multiple methods of data preprocessing, source localization, statistical analysis, and estimation of functional connectivity between distributed brain regions. All algorithms and utility functions are implemented in a consistent manner with well-documented interfaces, enabling users to create M/EEG data analysis pipelines by writing Python scripts. To further extend our software to meet the needs of a growing user base and reflect recent developments in MEG/EEG as well as in invasive electrophysiological recordings. Optically Pumped Magnetometers (OPMs) are sensitive room- temperature magnetic field sensors that have begun to provide movable, flexible, lightweight, on-scalp MEG systems, and may soon provide higher signal-to-noise ratio and more complete spatial frequency sampling than SQUID-based systems. However, analysis tools optimal processing of OPM-MEG data are largely missing. Therefore, in Aim 1, we will introduce tools for High-Resolution On-Scalp OPM-MEG Data Analysis. Electrocorticography (ECoG) and subcortical EEG (sEEG) provide focal spatial measurements of the electrophysiological activity. In Aim 2, we will develop sEEG and ECoG workflows, which includes electrode localization and intracranial inverse and forward modeling. Recent methodological advances by our group and the availability of on-scalp OPM-MEG systems (Aim 1) and ECoG/sEEG (Aim 2) have expanded the possibilities for improved localization of deep (cortical and subcortical) sources in basic and clinical research applications. In Aim 3, we will introduce these methods to the repertoire of MNE-Python and will use phantom recordings, human data with known ground truth, and existing MEG databases to validate the new methods. Finally, in Aim 4, we will continue to develop MNE-Python using best programming practices ensuring multiplatform compatibility, extensive web-based documentation, training and forums, and hands-on training workshops.