Keywords

1 Introduction

1.1 Background

NUTMEG (nutmeg.berkeley.edu) (Dalal et al. 2004, 2011) was initially developed by researchers and collaborators at the University of California San Francisco Biomagnetic Imaging Lab. The primary objective was to provide an open-source, easy-to-use toolbox for beamformer source reconstruction from MEG data, along with intuitive visualization and navigation of the source level analyses. It has since implemented a variety of other source reconstruction methods, support for EEG and, experimentally, intracranial EEG.

1.2 Data and Experiment Types Supported

NUTMEG includes custom import functions for several major MEG manufacturers, including CTF, 4D/BTi, KIT/Yokogawa, and Elekta Neuromag. In addition, all of the MEG, EEG and intracranial EEG data types that are supported with the FieldTrip fileio (Oostenveld et al. 2011) may also be read into the NUTMEG sensor data structure. This is achieved either via a NUTMEG graphical user interface (GUI) which calls FieldTrip functions, or by converting a dataset already loaded using standard FieldTrip into the NUTMEG data style.

Essentially all experiment and analysis types are supported in NUTMEG. Task-based evoked responses, task-based induced oscillatory changes, and task-based or resting connectivity analysis have been successfully analyzed using NUTMEG.

1.3 Integration with Other Toolboxes

NUTMEG is easily compatible with other MATLAB-based toolboxes. NUTMEG uses two primary data structures, a sensor level data structure and a source level data structure. Both may be converted to or from FieldTrip, for sharing of preprocessing, source inversion, or statistical testing steps between packages. Preprocessed data in ELAN (Aguera et al. 2011) may also be imported into NUTMEG.

Lead fields computed in other software packages, including OpenMEEG (Gramfort et al. 2011), Cartool (Brunet et al. 2011), FieldTrip (including Simbio [https://www.mrt.uni-jena.de/simbio] and FNS (Dang and Ng, 2011)), MNE (www.martinos.org/mne), EMSE (www.sourcesignal.com), SMAC (Spinelli et al. 2000), and Brainstorm (Tadel et al. 2011), may be imported for use with NUTMEG inverse solutions.

Visualization of NUTMEG source data primarily utilizes SPM8 (www.fil.ion.ucl.ac.uk/spm/software/spm8) to overlay activations on an MRI, without requiring conversion to the SPM8 MEG/EEG data format. The NUTMEG source data may also be explicitly converted to Analyze format for further visualization or manipulation in Cartool, mri3dX (www.cubric.cf.ac.uk/Documentation/mri3dX), DataViewer3D (Gouws et al. 2009) and MRIcro (mricro.com).

1.4 Interface

NUTMEG has been designed with a graphical interface that facilitates the most common data processing workflow scenarios involving evoked responses as well as time-frequency modulations (Fig. 1a). This comprises data import, MRI coregistration, source analysis parameters, and statistical analysis. Additionally, most features of the graphical interface call underlying functions that can be manually used from the command line or batch analysis scripts. This feature allows any potentially intensive calculations, such as permutation testing or processing raw data with large filter banks, to be conveniently passed to high-performance computing clusters. Finally, the GUI features interactive visualization and navigation of the analyzed results, described in further detail below.

Fig. 1
figure 1

Example components of the NUTMEG graphical user interfaces (GUIs). a The main GUI is designed to guide the user through sequential stages of the data analysis process. b The coregristration interface allows the user to load MRI data along with normalization data and mark the fiducial points. c The SPM8 window allows the user to navigate the MRI, define fiducial points, and visualize activation overlays. d The NUTMEG results viewer showing time-frequency data: the user can specify which frequency band and time point to visualize on the activation overlay in the dynamically linked SPM8 window. The results viewer can also display time-domain data, depending on the type of analysis used

2 Processing Steps

2.1 Loading MEG/EEG Data

See Sect. 1.2 for which MEG and EEG data formats can be loaded and how they may be loaded. The open source format of NUTMEG allows for the seamless implementation of customized scripts from third parties to load additional file formats. During the M/EEG data loading process, sensor coordinates can also be imported for both visualization of field/potential topographies and lead field/potential calculation. This is done automatically for some MEG datasets. For EEG datasets, Polhemus-localized sensor positions are supported.

2.2 Loading Anatomical Information

Through SPM8, NUTMEG is able to load Analyze and Nifti MRI file formats for coregistration (Fig. 1b). The option of loading an additional, spatially normalized MRI allows for the computation of MNI coordinates for inter-subject comparison. For the purposes of coregistering M/EEG sensors, fiducials can be manually marked on the imported MRI, as well as imported from saved text files or CTF MEG localsphere head model files.

2.3 Computation of Head Models

NUTMEG provides several options for computing the lead field. Forward fields and potentials can be computed for spherical head models using built-in functions. The sphere center can either be specified manually, or loaded from a CTF local sphere head model file. The loading of CTF multisphere head models is supported for MEG datasets. For EEG datasets, a multisphere model can be generated using a provided function that adjusts the sphere centers to minimize the difference between the forward potentials generated for a few sparsely sampled points using the multisphere method and those derived using the boundary element method (BEM).

The calculation of lead fields/potentials using more computationally intensive BEM head models is provided via integration between NUTMEG and either the Helsinki BEM (Stenroos et al. 2007) or the OpenMEEG (Gramfort et al. 2010) toolboxes. NUTMEG provides the necessary tools for importing tissue surface meshes from either BrainSuite or BrainVisa MRI segmenting software, thereby presenting the user with a complete BEM pipeline. Finally, see Sect. 1.3 for loading forward lead fields computed in other software for use in NUTMEG.

2.4 Inverse Methods

Many variants of popular inverse methods are included; furthermore, NUTMEG is stylized to allow easy drop-in and incorporation of newly developed inverse methods. The use of the time-domain LCMV beamformer for localizing both the oscillatory power changes over many time-frequency windows as well as evoked responses (ERF/ERPs) is well supported in NUTMEG. Minimum-norm methods also supported include sLORETA and dSPM.

Several Bayesian methods have been developed in the research group of Prof. Nagarajan for improved source estimation and denoising. These localization methods include Champagne (Owen et al. 2012b), SAKETINI (Zumer et al. 2007), and NSEFALoc (Zumer et al. 2008), which all involve the idea of denoising and localizing data in one step, for improved spatial specificity and reduced sensitivity to correlated sources. Prior to inversion, data may also be preprocessed to remove artifacts. Several versions of Bayesian factor analysis (Nagarajan et al. 2007) are implemented which identify artifact components present in a control condition so that they can be removed from a condition of interest in the sensor data; this denoised sensor data may then be input to the beamformer or minimum-norm inverse methods.

3 Visualization

Neural activity can be visualized as a tomographic map overlaid on the MRI in SPM (Fig. 1c). Using the modified SPM orthogonal-slice navigator, the researcher can explore the source reconstructed M/EEG dataset in 3D space overlaid on the MRI, while an extra, integrated GUI allows the user to explore the dataset over time by displaying the virtual sensor time course for the voxel selected on the SPM navigator. For time-freqency analysis (Dalal et al. (2008), Fig. 7 of Dalal et al. (2011), and Fig. 1d), the virtual sensor data plot is replaced by a time-frequency image of the power for the selected voxel.

A link to SPM functions offers the ability to display the activations on a normalized rendered brain surface. Neural activity can also be projected on a 3D brain surface imported from BrainSuite. If dipole orientation vectors are provided for each voxel, this display has the option of attenuating surface projections from voxels that do not contain a dipole orientation that is orthogonal to the cortical surface.

4 Statistics

Both within-subject and across-subject parametric and non-parametric statistics are available to compute. Within-subject statistics may use the Wilcoxon signed rank test based on the variability of responses across trials in a single subject. For across-subject analyses, NUTMEG uses statistical non-parametric mapping (SnPM) (Singh et al. 2003), which has the advantage that it does not depend on an assumption of a normal distribution and that it is robust even for small populations of as few as 5 subjects (though having more subjects will allow detection of weaker effects). SnPM also allows correcting for multiple voxels, time windows, and frequency bands. Most common study designs are supported including paired and unpaired comparisons, as well as correlations with behavioral variables. It is also possible to account for confounding covariates. The computed statistical probabilities can be used to display thresholded functional images.

5 Connectivity

NUTMEG offers a functional connectivity map (FCM) toolbox that enables the localization of functional connectivity (FC) among brain areas from EEG and MEG recordings. The FCM toolbox takes advantage of the rich set of source analysis algorithms available in NUTMEG and reconstructs neural oscillations in the cortex. From this, the toolbox efficiently computes several measures of functional connectivity (FC) between voxels, including imaginary coherence (Nolte et al. 2004), magnitude squared coherence, the phase lag index (Stam et al. 2007), amplitude envelope correlations (Brookes et al. 2011), and the general lagged coherence (Pascual-Marqui et al. 2011). Efficient algorithms enable the computation of interactions of all-to-all voxels on standard single computers. The highly multidimensional connectivity datasets can be interactively visualized together with structural brain images. The toolbox is therefore particularly suitable for explorative studies into the function and pathology of brain networks (Guggisberg et al. 2008). Both cortico-cortical as well as cortico-peripheral (e.g., cortico-muscular; Guggisberg et al. (2011)) measures of FC can be calculated. Several utilities for defining anatomical or functional regions of interest are available. The analyses can be applied to resting-state recordings (e.g., Dubovik et al. (2012)) as well as to event-locked datasets. Moreover, the toolbox offers parametric and non-parametric statistical analysis including correlations with behavioral data. The analyses can be performed either via the intuitive graphical user interface or via the Matlab command line for efficient batch scripting.

6 Extensions and Future Directions

Extensions include support for specific processing steps of (1) EEG data via ‘NUTEEG’, and (2) intracranial EEG. Incorporation of recently developed statistical thresholding for sparse source reconstruction methods (Owen et al. 2012a) is also planned. Extensions of the code from the MATLAB to Python language are in place and support additional viewing tools via Xipy (https://github.com/miketrumpis/xipy) and integration with other imaging modalities such as DTI. Future directions include further integration with other existing toolboxes.