Python API Reference¶
This is the reference for classes (CamelCase names) and functions
(underscore_case names) of MNE-Python, grouped thematically by analysis
stage. Functions and classes that are not
below a module heading are found in the mne namespace.
MNE-Python also provides multiple command-line scripts that can be called directly from a terminal, see Command line tools using Python.
mne:
MNE software for MEG and EEG data analysis.
Most-used classes¶
| 
 | Raw data in FIF format. | 
| 
 | Epochs extracted from a Raw instance. | 
| 
 | Evoked data. | 
| 
 | Measurement information. | 
Reading raw data¶
IO module for reading raw data.
| 
 | Anonymize measurement information in place. | 
| 
 | Read raw file. | 
| 
 | Read Artemis123 data as raw object. | 
| 
 | Raw object from 4D Neuroimaging MagnesWH3600 data. | 
| 
 | Read CNT data as raw object. | 
| 
 | Raw object from CTF directory. | 
| 
 | Read raw data from Curry files. | 
| 
 | Reader function for EDF or EDF+ files. | 
| 
 | Reader function for BDF files. | 
| 
 | Reader function for GDF files. | 
| 
 | Reader function for Ricoh/KIT conversion to FIF. | 
| 
 | Read Nicolet data as raw object. | 
| 
 | Reader for a NIRX fNIRS recording. | 
| 
 | Reader for a continuous wave SNIRF data. | 
| 
 | Read an EEGLAB .set file. | 
| 
 | Reader for Brain Vision EEG file. | 
| 
 | Read EGI simple binary as raw object. | 
| 
 | Reader function for Raw FIF data. | 
| 
 | Reader for an eXimia EEG file. | 
| 
 | Load continuous (raw) data from a FieldTrip preprocessing structure. | 
| 
 | Reader for a Persyst (.lay/.dat) recording. | 
| 
 | Reader for an Nihon Kohden EEG file. | 
Base class:
| 
 | Base class for Raw data. | 
KIT module for reading raw data.
| 
 | Marker Point Extraction in MEG space directly from sqd. | 
File I/O¶
| 
 | Get channel type. | 
| 
 | Get indices of channels by type. | 
| 
 | Load the subject head surface. | 
| 
 | Load the MEG helmet associated with the MEG sensors. | 
| 
 | Return a list of names and colors of segmented volumes. | 
| 
 | Return a list of Label of segmented volumes included in the src space. | 
| 
 | Parse a config file (like .ave and .cov files). | 
| 
 | Read labels from a FreeSurfer annotation file. | 
| 
 | Read the BEM solution from a file. | 
| 
 | Read the BEM surfaces from a FIF file. | 
| 
 | Read a noise covariance from a FIF file. | 
| 
 | Read .dip file from Neuromag/xfit or MNE. | 
| 
 | Read epochs from a fif file. | 
| 
 | Reader function for Ricoh/KIT epochs files. | 
| 
 | Reader function for EEGLAB epochs files. | 
| 
 | Load epoched data from a FieldTrip preprocessing structure. | 
| 
 | Read events from fif or text file. | 
| 
 | Read evoked dataset(s). | 
| 
 | Load evoked data from a FieldTrip timelocked structure. | 
| 
 | Read a Freesurfer-formatted LUT. | 
| 
 | Read a forward solution a.k.a. | 
| 
 | Read FreeSurfer Label file. | 
| 
 | Read morph map. | 
| 
 | Read projections from a FIF file. | 
| 
 | Read rejection parameters from .cov or .ave config file. | 
| 
 | Read channel selection from file. | 
| 
 | Read a source estimate object. | 
| 
 | Read the source spaces from a FIF file. | 
| 
 | Load a Freesurfer surface mesh in triangular format. | 
| 
 | Read a -trans.fif file. | 
| 
 | Read triangle definitions from an ascii file. | 
| 
 | Create a FreeSurfer annotation from a list of labels. | 
| 
 | Write a BEM model with solution. | 
| 
 | Write BEM surfaces to a fiff file. | 
| 
 | Write a noise covariance matrix. | 
| 
 | Write events to file. | 
| 
 | Write an evoked dataset to a file. | 
| 
 | Write forward solution to a file. | 
| 
 | Write a FreeSurfer label. | 
| 
 | Write projections to a FIF file. | 
| 
 | Write source spaces to a file. | 
| 
 | Write a triangular Freesurfer surface mesh. | 
| 
 | Write a -trans.fif file. | 
| 
 | Try to determine the type of the FIF file. | 
| 
 | Read measurement info from a file. | 
| 
 | Show FIFF information. | 
Base class:
| 
 | Abstract base class for Epochs-type classes. | 
Creating data objects from arrays¶
| 
 | Evoked object from numpy array. | 
| 
 | Epochs object from numpy array. | 
| 
 | Raw object from numpy array. | 
| 
 | Create a basic Info instance suitable for use with create_raw. | 
Datasets¶
Functions for fetching remote datasets.
See Datasets Overview for more information.
| 
 | Get path to local copy of brainstorm (bst_auditory) dataset. | 
| 
 | Get path to local copy of brainstorm (bst_resting) dataset. | 
| 
 | Get path to local copy of brainstorm (bst_raw) dataset. | 
| 
 | Get paths to local copies of EEGBCI dataset files. | 
| 
 | Standardize channel positions and names. | 
| 
 | Fetch the modified subdivided aparc parcellation. | 
| 
 | Fetch and update fsaverage. | 
| 
 | Fetch the HCP-MMP parcellation. | 
| 
 | Get path to local copy of fnirs_motor dataset. | 
| 
 | Get path to local copy of the high frequency SEF dataset. | 
| 
 | Get path to local copy of the kiloword dataset. | 
| 
 | Fetch subjects epochs data for the LIMO data set. | 
| 
 | Get path to local copy of misc dataset. | 
| 
 | Get path to local copy of mtrf dataset. | 
| 
 | Get path to local copy of multimodal dataset. | 
| 
 | Get path to local copy of opm dataset. | 
| 
 | Get paths to local copies of PhysioNet Polysomnography dataset files. | 
| 
 | Get paths to local copies of PhysioNet Polysomnography dataset files. | 
| 
 | Get path to local copy of sample dataset. | 
| 
 | Get path to local copy of somato dataset. | 
| 
 | Get path to local copy of spm dataset. | 
| 
 | Get path to local copy of visual_92_categories dataset. | 
| 
 | Get path to local copy of phantom_4dbti dataset. | 
| 
 | Get path to local copy of refmeg_noise dataset. | 
Visualization¶
Visualization routines.
| 
 | Class for visualizing a brain. | 
| 
 | Display an image so you can click on it and store x/y positions. | 
| 
 | Add a background image to a plot. | 
| 
 | Convert center points to edges. | 
| 
 | Compare the contents of two fiff files using diff and show_fiff. | 
| 
 | Create layout arranging nodes on a circle. | 
| 
 | Create iterator over channel positions. | 
| 
 | Return a colormap similar to that used by mne_analyze. | 
| 
 | Plot BEM contours on anatomical slices. | 
| 
 | Plot a colorbar that corresponds to a brain activation map. | 
| 
 | Visualize connectivity as a circular graph. | 
| 
 | Plot Covariance data. | 
| 
 | Plot CSD matrices. | 
| 
 | Plot the amplitude traces of a set of dipoles. | 
| 
 | Plot dipole locations. | 
| 
 | Show the channel stats based on a drop_log from Epochs. | 
| 
 | Visualize epochs. | 
| 
 | Plot the topomap of the power spectral density across epochs. | 
| 
 | Plot events to get a visual display of the paradigm. | 
| 
 | Plot evoked data using butterfly plots. | 
| 
 | Plot evoked data as images. | 
| 
 | Plot 2D topography of evoked responses. | 
| 
 | Plot topographic maps of specific time points of evoked data. | 
| 
 | Plot evoked data as butterfly plot and add topomaps for time points. | 
| 
 | Plot MEG/EEG fields on head surface and helmet in 3D. | 
| 
 | Plot whitened evoked response. | 
| 
 | Plot properties of a filter. | 
| 
 | Plot head positions. | 
| 
 | Plot an ideal filter response. | 
| 
 | Plot evoked time courses for one or more conditions and/or channels. | 
| 
 | Plot estimated latent sources given the unmixing matrix. | 
| 
 | Project mixing matrix on interpolated sensor topography. | 
| 
 | Display component properties. | 
| 
 | Plot scores related to detected components. | 
| 
 | Overlay of raw and cleaned signals given the unmixing matrix. | 
| 
 | Plot Event Related Potential / Fields image. | 
| 
 | Plot the sensor positions. | 
| 
 | Plot a montage. | 
| 
 | Plot topographic maps of SSP projections. | 
| 
 | Plot raw data. | 
| 
 | Plot the power spectral density across channels. | 
| 
 | Plot sensors positions. | 
| 
 | Visualize the sensor connectivity in 3D. | 
| 
 | Plot a data SNR estimate. | 
| 
 | Plot SourceEstimate. | 
| 
 | Plot multiple SourceEstimate objects with PyVista. | 
| 
 | Plot Nutmeg style volumetric source estimates using nilearn. | 
| 
 | Plot VectorSourceEstimate with PySurfer. | 
| 
 | Plot source estimates obtained with sparse solver. | 
| 
 | Plot topographic maps of specific time-frequency intervals of TFR data. | 
| 
 | Plot Event Related Potential / Fields image on topographies. | 
| 
 | Plot a topographic map as image. | 
| 
 | Plot head, sensor, and source space alignment in 3D. | 
| 
 | Take a snapshot of a Mayavi Scene and project channels onto 2d coords. | 
| 
 | Plot arrow map. | 
| 
 | Set the backend for MNE. | 
| Return the backend currently used. | |
| 
 | Create a viz context. | 
| 
 | Set 3D rendering options. | 
| 
 | Configure the view of the given scene. | 
| 
 | Configure the title of the given scene. | 
| 
 | Return an empty figure based on the current 3d backend. | 
| Return the proper Brain class based on the current 3d backend. | 
Preprocessing¶
Projections:
| Projection vector. | |
| 
 | Compute SSP (spatial space projection) vectors on Epochs. | 
| 
 | Compute SSP (spatial space projection) vectors on Evoked. | 
| 
 | Compute SSP (spatial space projection) vectors on Raw. | 
| 
 | Read projections from a FIF file. | 
| 
 | Write projections to a FIF file. | 
Module dedicated to manipulation of channels.
Can be used for setting of sensor locations used for processing and plotting.
| 
 | Sensor layouts. | 
| 
 | Montage for digitized electrode and headshape position data. | 
| 
 | Compute the native-to-head transformation for a montage. | 
| 
 | Fix magnetometer coil types. | 
| 
 | Read Polhemus FastSCAN digitizer data from a  | 
| Get a list of all builtin montages. | |
| 
 | Make montage from arrays. | 
| 
 | Read Polhemus digitizer data from a file. | 
| 
 | Read electrode locations from CapTrak Brain Products system. | 
| 
 | Read electrode positions from a  | 
| 
 | Read electrode locations from EGI system. | 
| 
 | Read digitized points from a .fif file. | 
| 
 | Read historical .hpts mne-c files. | 
| 
 | Read a generic (built-in) montage. | 
| 
 | Read a montage from a file. | 
| 
 | Compute device to head transform from a DigMontage. | 
| 
 | Read layout from a file. | 
| 
 | Choose a layout based on the channels in the info ‘chs’ field. | 
| 
 | Create .lout file from EEG electrode digitization. | 
| 
 | Generate .lout file for custom data, i.e., ICA sources. | 
| 
 | Find the adjacency matrix for the given channels. | 
| 
 | Parse FieldTrip neighbors .mat file. | 
| 
 | Equalize channel picks and ordering across multiple MNE-Python objects. | 
| 
 | Rename channels. | 
| 
 | Generate a custom 2D layout from xy points. | 
| 
 | Return dict mapping from ROI names to lists of picks for 10/20 setups. | 
| 
 | Combine channels based on specified channel grouping. | 
Preprocessing with artifact detection, SSP, and ICA.
| 
 | M/EEG signal decomposition using Independent Component Analysis (ICA). | 
| 
 | Implementation of the Xdawn Algorithm. | 
| 
 | Annotate flat segments of raw data (or add to a bad channel list). | 
| 
 | Detect segments with movement. | 
| 
 | Create annotations for segments that likely contain muscle artifacts. | 
| 
 | Get new device to head transform based on good segments. | 
| 
 | Get the current source density (CSD) transformation. | 
| 
 | Compute fine calibration from empty-room data. | 
| 
 | Compute SSP/PCA projections for ECG artifacts. | 
| 
 | Compute SSP/PCA projections for EOG artifacts. | 
| 
 | Conveniently generate epochs around ECG artifact events. | 
| 
 | Conveniently generate epochs around EOG artifact events. | 
| 
 | Find bad channels using Maxwell filtering. | 
| 
 | Find ECG peaks. | 
| 
 | Locate EOG artifacts. | 
| 
 | Eliminate stimulation’s artifacts from instance. | 
| 
 | Find ECG peaks from one selected ICA source. | 
| 
 | Locate EOG artifacts from one selected ICA source. | 
| 
 | Run (extended) Infomax ICA decomposition on raw data. | 
| 
 | Maxwell filter data using multipole moments. | 
| 
 | Denoise MEG channels using leave-one-out temporal projection. | 
| 
 | Noise-tolerant fast peak-finding algorithm. | 
| 
 | Restore ICA solution from fif file. | 
| 
 | Regress artifacts using reference channels. | 
| 
 | Find similar Independent Components across subjects by map similarity. | 
| 
 | Load ICA information saved in an EEGLAB .set file. | 
| 
 | Read fine calibration information from a .dat file. | 
| 
 | Write fine calibration information to a .dat file. | 
NIRS specific preprocessing functions.
| 
 | Convert NIRS raw data to optical density. | 
| 
 | Convert NIRS optical density data to haemoglobin concentration. | 
| 
 | Determine the distance between NIRS source and detectors. | 
| 
 | Determine which NIRS channels are short. | 
| 
 | Calculate scalp coupling index. | 
| Apply temporal derivative distribution repair to data. | 
EEG referencing:
| 
 | Add reference channels to data that consists of all zeros. | 
| 
 | Re-reference selected channels using a bipolar referencing scheme. | 
| 
 | Specify which reference to use for EEG data. | 
IIR and FIR filtering and resampling functions.
| 
 | Use IIR parameters to get filtering coefficients. | 
| 
 | Create a FIR or IIR filter. | 
| 
 | Estimate filter ringing. | 
| 
 | Filter a subset of channels. | 
| 
 | Notch filter for the signal x. | 
| 
 | Resample an array. | 
Functions for fitting head positions with (c)HPI coils.
| 
 | Compute time-varying cHPI amplitudes. | 
| 
 | Compute locations of each cHPI coils over time. | 
| 
 | Compute time-varying head positions. | 
| 
 | Extract cHPI locations from CTF data. | 
| 
 | Remove cHPI and line noise from data. | 
| 
 | Convert Maxfilter-formatted head position quaternions. | 
| 
 | Read MaxFilter-formatted head position parameters. | 
| 
 | Write MaxFilter-formatted head position parameters. | 
Helpers for various transformations.
| 
 | A transform. | 
| 
 | Convert a set of quaternions to rotations. | 
| 
 | Convert a set of rotations to quaternions. | 
| 
 | Read a subject’s RAS to MNI transform. | 
Events¶
| 
 | Annotation object for annotating segments of raw data. | 
| 
 | Parser for Elekta data acquisition settings. | 
| 
 | Concatenate event lists to be compatible with concatenate_raws. | 
| 
 | Find events from raw file. | 
| 
 | Find all steps in data from a stim channel. | 
| 
 | Make a set of events separated by a fixed duration. | 
| 
 | Divide continuous raw data into equal-sized consecutive epochs. | 
| 
 | Merge a set of events. | 
| 
 | Parse a config file (like .ave and .cov files). | 
| 
 | Select some events. | 
| 
 | Read annotations from a file. | 
| 
 | Read events from fif or text file. | 
| 
 | Write events to file. | 
| 
 | Concatenate a list of epochs into one epochs object. | 
| 
 | Get events and event_id from an Annotations object. | 
| 
 | Convert an event array to an Annotations object. | 
IO with fif files containing events.
| 
 | Define new events by co-occurrence of existing events. | 
| 
 | Shift an event. | 
Tools for working with epoched data.
| 
 | Concatenate channels, info and data from two Epochs objects. | 
| 
 | Average data using Maxwell filtering, transforming using head positions. | 
| 
 | Collapse event_ids from an epochs instance into a new event_id. | 
| 
 | Equalize the number of trials in multiple Epoch instances. | 
Sensor Space Data¶
| 
 | Merge evoked data by weighted addition or subtraction. | 
| 
 | Concatenate raw instances as if they were continuous. | 
| 
 | Equalize channel picks and ordering across multiple MNE-Python objects. | 
| 
 | Make grand average of a list of Evoked or AverageTFR data. | 
| 
 | Pick channels by names. | 
| 
 | Pick channels from covariance matrix. | 
| 
 | Pick channels from forward operator. | 
| 
 | Pick channels using regular expression. | 
| 
 | Pick channels by type and names. | 
| 
 | Pick by channel type and names from a forward operator. | 
| 
 | Restrict an info structure to a selection of channels. | 
| 
 | Read epochs from a fif file. | 
| 
 | Read rejection parameters from .cov or .ave config file. | 
| 
 | Read channel selection from file. | 
| 
 | Rename channels. | 
Utility functions to baseline-correct data.
| 
 | Rescale (baseline correct) data. | 
Covariance computation¶
| 
 | Noise covariance matrix. | 
| 
 | Estimate noise covariance matrix from epochs. | 
| 
 | Estimate noise covariance matrix from a continuous segment of raw data. | 
| 
 | Compute whitening matrix. | 
| 
 | Prepare noise covariance matrix. | 
| 
 | Regularize noise covariance matrix. | 
| 
 | Compute the rank of data or noise covariance. | 
| 
 | Create an ad hoc noise covariance. | 
| 
 | Read a noise covariance from a FIF file. | 
| 
 | Write a noise covariance matrix. | 
MRI Processing¶
Step by step instructions for using gui.coregistration():
| 
 | Estimate fiducials for a subject. | 
| 
 | Coregister an MRI with a subject’s head shape. | 
| 
 | Set the fiducials for an MRI subject. | 
| 
 | Create an average brain subject for subjects without structural MRI. | 
| 
 | Create a scaled copy of an MRI subject. | 
| 
 | Scale a bem file. | 
| 
 | Scale labels to match a brain that was previously created by scaling. | 
| 
 | Scale a source space for an mri created with scale_mri(). | 
Forward Modeling¶
| Forward class to represent info from forward solution. | |
| 
 | Represent a list of source space. | 
| 
 | Compute inter-source distances along the cortical surface. | 
| 
 | Project source space currents to sensor space using a forward operator. | 
| 
 | Project source space currents to sensor space using a forward operator. | 
| 
 | Average forward solutions. | 
| 
 | Convert forward solution between different source orientations. | 
| 
 | Decimate surface data. | 
| 
 | Compute distances between head shape points and the scalp surface. | 
| 
 | Compute depth prior for depth weighting. | 
| 
 | Compute orientation prior. | 
| 
 | Restrict forward operator to labels. | 
| 
 | Restrict forward operator to active sources in a source estimate. | 
| 
 | Create a BEM model for a subject. | 
| 
 | Create a BEM solution using the linear collocation approach. | 
| 
 | Convert dipole object to source estimate and calculate forward operator. | 
| 
 | Calculate a forward solution for a subject. | 
| 
 | Compute surface maps used for field display in 3D. | 
| 
 | Create a spherical model for forward solution calculation. | 
| 
 | Morph an existing source space to a different subject. | 
| 
 | Read the BEM surfaces from a FIF file. | 
| 
 | Read a forward solution a.k.a. | 
| 
 | Read a -trans.fif file. | 
| 
 | Read the source spaces from a FIF file. | 
| 
 | Load a Freesurfer surface mesh in triangular format. | 
| 
 | Compute sensitivity map. | 
| 
 | Set up bilateral hemisphere surface-based source space with subsampling. | 
| 
 | Set up a volume source space with grid spacing or discrete source space. | 
| 
 | Complete surface information. | 
| 
 | Load in curvature values from the ?h.curv file. | 
| 
 | Use a custom coil definition file. | 
| 
 | Write BEM surfaces to a fiff file. | 
| 
 | Write a -trans.fif file. | 
| BEM or sphere model. | |
| 
 | Fit a sphere to the headshape points to determine head center. | 
| 
 | Get digitization points suitable for sphere fitting. | 
| 
 | Create BEM surfaces using the FreeSurfer watershed algorithm. | 
| 
 | Create 3-Layer BEM model from prepared flash MRI images. | 
| 
 | Convert DICOM files for use with make_flash_bem. | 
Inverse Solutions¶
Linear inverse solvers based on L2 Minimum Norm Estimates (MNE).
| InverseOperator class to represent info from inverse operator. | |
| 
 | Apply inverse operator to evoked data. | 
| 
 | Apply inverse operator to covariance data. | 
| 
 | Apply inverse operator to Epochs. | 
| 
 | Apply inverse operator to Raw data. | 
| 
 | Compute source power spectral density (PSD). | 
| 
 | Compute source power spectral density (PSD) from Epochs. | 
| 
 | Compute the rank of a linear inverse operator (MNE, dSPM, etc.). | 
| 
 | Estimate the SNR as a function of time for evoked data. | 
| 
 | Assemble inverse operator. | 
| 
 | Prepare an inverse operator for actually computing the inverse. | 
| 
 | Read the inverse operator decomposition from a FIF file. | 
| 
 | Compute source space induced power in given frequency bands. | 
| 
 | Compute induced power and phase lock. | 
| 
 | Write an inverse operator to a FIF file. | 
| 
 | Compute resolution matrix for linear inverse operator. | 
| 
 | Compute spatial resolution metrics for linear solvers. | 
| 
 | Get cross-talk (CTFs) function for vertices. | 
| 
 | Get point-spread (PSFs) functions for vertices. | 
Non-Linear sparse inverse solvers.
| 
 | Mixed-norm estimate (MxNE) and iterative reweighted MxNE (irMxNE). | 
| 
 | Time-Frequency Mixed-norm estimate (TF-MxNE). | 
| 
 | Hierarchical Bayes (Gamma-MAP) sparse source localization method. | 
| 
 | Convert a list of spatio-temporal dipoles into a SourceEstimate. | 
Beamformers for source localization.
| A computed beamformer. | |
| 
 | Read a beamformer filter. | 
| 
 | Compute LCMV spatial filter. | 
| 
 | Apply Linearly Constrained Minimum Variance (LCMV) beamformer weights. | 
| 
 | Apply Linearly Constrained Minimum Variance (LCMV) beamformer weights. | 
| 
 | Apply Linearly Constrained Minimum Variance (LCMV) beamformer weights. | 
| 
 | Apply Linearly Constrained Minimum Variance (LCMV) beamformer weights. | 
| 
 | Compute a Dynamic Imaging of Coherent Sources (DICS) spatial filter. | 
| 
 | Apply Dynamic Imaging of Coherent Sources (DICS) beamformer weights. | 
| 
 | Apply Dynamic Imaging of Coherent Sources (DICS) beamformer weights. | 
| 
 | Apply Dynamic Imaging of Coherent Sources (DICS) beamformer weights. | 
| 
 | RAP-MUSIC source localization method. | 
| 
 | 5D time-frequency beamforming based on DICS. | 
| 
 | Warning DEPRECATED: tf_lcmv is deprecated and will be removed in 0.22, use LCMV with a covariances computed on band-passed data or DICS instead | 
| 
 | Compute resolution matrix for LCMV beamformer. | 
| 
 | Dipole class for sequential dipole fits. | 
| 
 | Dipole class for fixed-position dipole fits. | 
| 
 | Fit a dipole. | 
Single-dipole functions and classes.
| 
 | Get standard phantom dipole locations and orientations. | 
Source Space Data¶
| 
 | A freesurfer/MNE label with vertices in both hemispheres. | 
| 
 | A FreeSurfer/MNE label with vertices restricted to one hemisphere. | 
| 
 | Container for mixed surface and volume source estimates. | 
| 
 | Container for volume source estimates. | 
| 
 | Container for surface source estimates. | 
| 
 | Container for vector surface source estimates. | 
| 
 | Container for volume source estimates. | 
| 
 | Container for volume source estimates. | 
| 
 | Morph source space data from one subject to another. | 
| 
 | Create a SourceMorph from one subject to another. | 
| 
 | Convert pos from head coordinate system to MNI ones. | 
| 
 | Convert pos from head coordinate system to MRI ones. | 
| 
 | Extract label time course for lists of labels and source estimates. | 
| 
 | Get tris defined for a certain grade. | 
| 
 | Convert a grade to source space vertices for a given subject. | 
| 
 | Select sources from a label. | 
| 
 | Generate circular labels in source space with region growing. | 
| 
 | Compute sign for label averaging. | 
| 
 | Convert a set of labels and values to a STC. | 
| 
 | Morph a set of labels. | 
| 
 | Generate random cortex parcellation by growing labels. | 
| 
 | Read labels from a FreeSurfer annotation file. | 
| 
 | Read .dip file from Neuromag/xfit or MNE. | 
| 
 | Read FreeSurfer Label file. | 
| 
 | Read a source estimate object. | 
| 
 | Load the morph for source estimates from a file. | 
| 
 | Split a Label into two or more parts. | 
| 
 | Compute a label from the non-zero sources in an stc object. | 
| 
 | Transform surface to the desired coordinate system. | 
| 
 | Convert the array of vertices for a hemisphere to MNI coordinates. | 
| 
 | Create a FreeSurfer annotation from a list of labels. | 
| 
 | Write a FreeSurfer label. | 
Time-Frequency¶
Time frequency analysis tools.
| 
 | Container for Time-Frequency data. | 
| 
 | Container for Time-Frequency data on epochs. | 
| 
 | Cross-spectral density. | 
Functions that operate on mne-python objects:
| 
 | Estimate cross-spectral density from an array using short-time fourier. | 
| 
 | Estimate cross-spectral density from epochs using a multitaper method. | 
| 
 | Estimate cross-spectral density from epochs using Morlet wavelets. | 
| 
 | Pick channels from cross-spectral density matrix. | 
| 
 | Read a CrossSpectralDensity object from an HDF5 file. | 
| 
 | Fit an AR model to raw data and creates the corresponding IIR filter. | 
| 
 | Compute the power spectral density (PSD) using Welch’s method. | 
| 
 | Compute the power spectral density (PSD) using multitapers. | 
| 
 | Compute Time-Frequency Representation (TFR) using Morlet wavelets. | 
| 
 | Compute Time-Frequency Representation (TFR) using DPSS tapers. | 
| 
 | Compute Time-Frequency Representation (TFR) using Stockwell Transform. | 
| 
 | Read TFR datasets from hdf5 file. | 
| 
 | Write a TFR dataset to hdf5. | 
Functions that operate on np.ndarray objects:
| 
 | Estimate cross-spectral density from an array using short-time fourier. | 
| 
 | Estimate cross-spectral density from an array using a multitaper method. | 
| 
 | Estimate cross-spectral density from an array using Morlet wavelets. | 
| 
 | Compute Discrete Prolate Spheroidal Sequences. | 
| 
 | Compute Morlet wavelets for the given frequency range. | 
| 
 | STFT Short-Term Fourier Transform using a sine window. | 
| 
 | ISTFT Inverse Short-Term Fourier Transform using a sine window. | 
| 
 | Compute frequencies of stft transformation. | 
| 
 | Compute power spectral density (PSD) using a multi-taper method. | 
| 
 | Compute power spectral density (PSD) using Welch’s method. | 
| 
 | Compute Time-Frequency Representation (TFR) using Morlet wavelets. | 
| 
 | Compute Time-Frequency Representation (TFR) using DPSS tapers. | 
| 
 | Compute power and intertrial coherence using Stockwell (S) transform. | 
A module which implements the time-frequency estimation.
Morlet code inspired by Matlab code from Sheraz Khan & Brainstorm & SPM
| 
 | Compute time freq decomposition with continuous wavelet transform. | 
| 
 | Compute Morlet wavelets for the given frequency range. | 
Connectivity Estimation¶
Spectral and effective connectivity measures.
| 
 | Compute the undirected degree of a connectivity matrix. | 
| 
 | Compute the envelope correlation. | 
| 
 | Compute the Phase Slope Index (PSI) connectivity measure. | 
| 
 | Generate indices parameter for seed based connectivity analysis. | 
| 
 | Compute frequency- and time-frequency-domain connectivity measures. | 
Statistics¶
Functions for statistical analysis.
Parametric statistics (see scipy.stats and statsmodels for more
options):
| 
 | Perform one-sample t-test. | 
| 
 | Independent samples t-test without p calculation. | 
| 
 | Perform a 1-way ANOVA. | 
| 
 | Compute M-way repeated measures ANOVA for fully balanced designs. | 
| 
 | Compute F-value thresholds for a two-way ANOVA. | 
| 
 | Fit Ordinary Least Squares regression (OLS). | 
| 
 | Estimate regression-based evoked potentials/fields by linear modeling. | 
Mass-univariate multiple comparison correction:
| 
 | P-value correction with Bonferroni method. | 
| 
 | P-value correction with False Discovery Rate (FDR). | 
Non-parametric (clustering) resampling methods:
| 
 | Create a sparse binary adjacency/neighbors matrix. | 
| 
 | Cluster-level statistical permutation test. | 
| 
 | Non-parametric cluster-level paired t-test. | 
| 
 | One sample/paired sample permutation test based on a t-statistic. | 
| 
 | Non-parametric cluster-level test for spatio-temporal data. | 
| Non-parametric cluster-level paired t-test for spatio-temporal data. | |
| 
 | Assemble summary SourceEstimate from spatiotemporal cluster results. | 
| 
 | Get confidence intervals from non-parametric bootstrap. | 
Compute adjacency matrices for cluster-level statistics:
| 
 | Find the adjacency matrix for the given channels. | 
| 
 | Parse FieldTrip neighbors .mat file. | 
| 
 | Compute adjacency from distances in a source space. | 
| 
 | Compute adjacency for a source space activation. | 
| 
 | Compute adjacency from triangles. | 
| 
 | Get vertices on each hemisphere that are close to the other hemisphere. | 
| 
 | Compute adjacency for a source space activation over time. | 
| 
 | Compute adjacency from triangles and time instants. | 
| 
 | Compute adjacency from distances in a source space and time instants. | 
Simulation¶
Data simulation code.
| 
 | Add cHPI activations to raw data. | 
| 
 | Add ECG noise to raw data. | 
| 
 | Add blink noise to raw data. | 
| 
 | Create noise as a multivariate Gaussian. | 
| 
 | Generate noisy evoked data. | 
| 
 | Simulate raw data. | 
| 
 | Simulate sources time courses from waveforms and labels. | 
| 
 | Generate sparse (n_dipoles) sources time courses from data_fun. | 
| 
 | Select source positions using a label. | 
| 
 | Class to generate simulated Source Estimates. | 
Decoding¶
Decoding and encoding, including machine learning and receptive fields.
| 
 | M/EEG signal decomposition using the Common Spatial Patterns (CSP). | 
| 
 | Transformer to compute event-matched spatial filters. | 
| 
 | Estimator to filter RtEpochs. | 
| 
 | Compute and store patterns from linear models. | 
| 
 | Compute power spectral density (PSD) using a multi-taper method. | 
| 
 | Standardize channel data. | 
| 
 | Estimator to filter data array along the last dimension. | 
| 
 | Time frequency transformer. | 
| 
 | Use unsupervised spatial filtering across time and samples. | 
| Transform n-dimensional array into 2D array of n_samples by n_features. | |
| 
 | Fit a receptive field model. | 
| 
 | Ridge regression of data with time delays. | 
| 
 | Search Light. | 
| 
 | Generalization Light. | 
| 
 | Implementation of the SPoC spatial filtering. | 
Functions that assist with decoding and model fitting:
| 
 | Compute event-matched spatial filter on epochs. | 
| 
 | Evaluate a score by cross-validation. | 
| 
 | Retrieve the coefficients of an estimator ending with a Linear Model. | 
Realtime¶
Realtime functionality has moved to the standalone module mne_realtime.
MNE-Report¶
mne:
| 
 | Object for rendering HTML. | 
| 
 | Read a saved report or, if it doesn’t exist yet, create a new one. | 
Logging and Configuration¶
| 
 | Get path to standard mne-python config file. | 
| 
 | Read MNE-Python preferences from environment or config file. | 
| 
 | Launch a new web browser tab with the MNE documentation. | 
| 
 | Set the logging level. | 
| 
 | Set the log to print to a file. | 
| 
 | Set a MNE-Python preference key in the config file and environment. | 
| 
 | Set the directory to be used for temporary file storage. | 
| 
 | Print the system information for debugging. | 
| 
 | Verbose decorator to allow functions to override log-level. | 
| 
 | Mark a function or class as deprecated (decorator). | 
| 
 | Emit a warning with trace outside the mne namespace. | 
| 
 | Get the amount of free memory for CUDA operations. | 
| 
 | Initialize CUDA functionality. | 
| 
 | Set the CUDA device temporarily for the current session. |