NUTMEG in a Nutshell: Basic Documentation

nutmeg logo

NUTMEG uses an adaptive eigenspace vector beamformer (Sekihara et al. 2001) to reconstruct the time series of neural activity at every grid point within a brain volume of interest.

Requirements
Getting Started
Coregister MRI
Volume Selection
Sensor Data
Lead Field Computation
Beamformer Parameter Selection
Visualization of Results
Common Variables Explained
Advanced Topics
References
Acknowledgements

Requirements

- Matlab 6.5 or 7
- Signal Processing Toolbox needed for filtering functions
- Image Processing Toolbox needed for graphical VOI selection
- SPM2   (Matlab-based software commonly used for fMRI and PET analysis)
- at least 1GB of RAM recommended
- developed under Red Hat Linux for Intel 32-bit
- runs well on MacOS X and Windows 2000/XP

Getting Started

Add both NUTMEG and SPM2 to your path within Matlab, (either using 'addpath' command to temporarily add, or to File>Set Path to permanently add).

Type nutmeg or simply nm at the command prompt to bring up the main GUI (graphical user interface).  To ease file selection during your session, it is recommended that you first change your working directory to the location your data exists before opening NUTMEG.

main GUI (nut_meg_mri_toolbox.fig)

For a new subject with a new MEG dataset, proceed to "Coregister MRI" to include the structural MRI, fiducial points, and digitized headshape for that subject.  Digitized headshape information is completely optional, but may improve coregistration accuracy if you have it. Alternatively, if an MRI is not available, headshape information will be used to create an image for visualization. If no MRI or headshape is specified at all, activations will be displayed over a "blank" image volume.

At any stage of loading data and processing, you may click "save session" which will save your working session into a ".mat" file with a name of your choice.  You may then exit out, and resume your work at a later time by clicking "open session" and selecting the saved file. This is especially useful for, e.g., saving coregistration and VOI selections for a given subject, while processing different MEG runs. It can also help you revert to a certain stage of processing if you make a mistake or experience a crash. We will refer to this file as "session.mat" later on.
Top

Coregister MRI

Note that MRI coregistration is optional and this step may be skipped; if no MRI is loaded, activations will be displayed on a "blank" MRI volume using head MEG coordinates.
The following dialog box appears when "Coregister MRI" is clicked.   However, not all of the buttons will be enabled, as shown, right away.  Each will be enabled as you load the necessary information to proceed to the next step.
nut_coregister.fig

To load a subject's MRI, click "Change MRI" and a file selection box will appear.  The image must be in Analyze format.  Select the *.img file; the corresponding *.hdr file must also exist in the same directory.  To first convert an image to Analyze from most other common formats, such as DICOM, we recommend MRIcro.

Select the appropriate image orientation (neurological/radiological) for your particular image volume.   Please note that neurological orientation is necessary for 3D display of results (including head surface rendering and SPM's brain rendering.) You may use an image rotated within SPM, and NUTMEG will use the additional rotation matrix stored in the "imagename.mat" file associated with the *.hdr and *.img files.  However, an image flipped in SPM may not coregister correctly (i.e. if any element along the diagonal of the rotation matrix is -1).

If you do not have saved fiducials yet, first click on a point on the MR image where the left preauricular point is, then click "set left PA."  Proceed for right PA and nasion.  You may then review these locations by clicking "show ..."  To save these points, click "Export fiducials" which will save these coordinates in a ".txt" file with a name of your choice.

If you have fiducials already coregistered with the MRI, you may load them with "Import fiducials" and then click on "show left/right PA or nasion" to check that they loaded and coregistered correctly.  If the saved fiducials are ones you created by using the "set ..." buttons, then the file to load is the ".txt" file you created earlier.  If your data is from a CTF system, you may also load predefined fiducials that are stored in the dataset's default.hdm file.

Note:  If you used the exact nasion and PA points during MEG acquistion, you should indicate those points here.  If you used localizing coils placed, for example, 1cm away from the PA points, you should indicate those shifted points here.

You may optionally extract a scalp surface from the MRI, and view the fiducials in 3D. 

If you have digitized headshape information, you may load it at this step.  You can then use it to reduce the error of coregistry between fiducials and the headshape derived from the structural MRI.  You may also use it without, or in place of, a structural MRI.  If you load the headshape first without an MRI, NUTMEG will then create a headshapename.img for you, and this will then be used in place of an MRI for VOI selection, viewing of results, etc. 
Top


Volume Selection

voicursor

First move your cursor on the image to a point where you have the best view of your region of interest to select. 

The click "Select VOI" on the main GUI.

You may select a region as large as you wish, within the memory and CPU constraints of your computer.  We typically select one hemisphere and use a 5-8mm grid for quick initial analyses. Larger VOIs and smaller grid sizes result in exponential increases in computing time and memory requirements. Whole head VOIs with a fine grid may require more than 3-4GB of RAM and a lunch break.


voi axial The axial view will be outlined in red first, indicating the slice to select. Click once at the edge of your desired VOI to start selection; trace your desired region, clicking to set anchor points. Double-click or right-click to finish selection.
voi cor The region you selected in the axial section will now be highlighted in green, and the coronal slice will now be bordered in red.  Select the coronal section of interest in the same way, and double-click or right-click when you are finished.
voi sagittal
The green area now indicates the volume selected from both axial and coronal planes.  The sagittal slice is now bordered in red to indicate the final slice to select. 
voi final
Once you are finished, the final volume will be highlighted in green.  A file save box will pop up, and you may optionally save your VOI to a ".mat" file for future use with other datasets. It can be useful to do this if you want to process different MEG runs with the same VOI, or different VOIs with the same subject. You may also hit "Cancel" to proceed without saving. Either way, the VOI is also part of your NUTMEG "session" and would be saved along with the rest of your data and computations when you "save session".


If you have already selected and saved a VOI for this subject, you may load it by using "Load/View VOI" button on the main GUI. Hitting "Cancel" here will display the VOI currently loaded into NUTMEG, if available. Otherwise, selecting a saved VOI will load and display it.

Top


Sensor Data

Load sensor data by clicking on "Load MEG data" on the main interface.   Select the file with the MEG data (for CTF data, this is the *.meg4 file). (KIT/Yokogawa users, please click here for further instructions.) The dataset name should now be displayed on the main interface text box.

You may view the sensor data and manipulate it by clicking "View/Select MEG Channels."  The following GUI will be shown:
channel selection toolbox

Within this window, you may bandpass filter the timeseries, select specific channels, and view either an amplitude or power spatial plot for a given time range.  These parameters will be remembered if you close the window and open it again.   This window is for viewing/manipulating your data in the sensor-domain only. 

You should use this tool to select the sensors you want to use for further analysis (lead field computation).

Since the standard beamformers don't perform well with two neural sources highly correlated in time (such as bilateral auditory activation), it is currently recommended that you choose the sensors near the source of interest (e.g., right sensors for looking at right auditory cortex, and then process separately the left sensors for looking at left auditory cortex).  Our lab has developed a coherent suppression technique to allow an accurate source reconstruction in spite of correlated sources (Dalal et al., 2004; Sahani & Nagarajan, 2004), but this is still in development and so not part of this first official release. 
Top

Lead Field Computation

First, select the sensors you want in the "View/Select MEG Channels" window.  Then fill in the desired voxel size in the text box next to the button "Compute Lead Field" and finally click on the button itself.   This will compute the lead field for the voxels within the current VOI, at the specified grid sampling, and for the selected sensors only.  This lead field algorithm uses a single-shell spherical head model, and is based on Sarvas (1987).  After computation, remember to re-save your session.mat file if you want this lead field to be saved within it.
Top

Beamformer Parameter Selection

Once you have computed the forward lead field, next compute the weights and source activation estimates.  Click on the "Compute Activations" button on the main GUI, and the following will appear.

beamformer tool

This type of beamformer is data-dependent, and thus you must select which aspect of your data to use to calculate the weights, which use the sensor data covariance.  The weights will then be applied to your sensor data to reconstruct a time series at every voxel point within the head within your VOI.

You want to select the portion of your data that has the signal/peak of interest in it (e.g. the peak at 50ms shown above) but also a large enough time window around this peak so that the sensor covariance matrix is not too singular (in other words, so that the data from each sensor aren't too similar to the other sensors over the selected time window.)  A very singular matrix cannot be reliably inverted, resulting in poor source reconstructions. For the shown SEF dataset above, a time window of 0-235ms works well.  Note that the source activations will be computed for the entire time window (e.g. here -150ms to 240ms), but only 0-235ms will be used for calculating the sensor covariance used in weight computation.

You may remove the DC offset of the prestimulus period.  Also in that pulldown menu you may linearly detrend, however highpass filtering at 1Hz is also recommended instead of linear detrending.  Notch filters for 60Hz or 50Hz power line noise can be applied, but they should only be used if absolutely necessary (i.e., the power supply is still clearly visible in your averaged dataset.)  The upper limit of the bandpass filter is set to half the sampling rate. 

The right plot is the magnitude of eigenvalues, ordered from largest to smallest.  Each represents a component of your chosen dataset.  The beamformer of this toolbox uses just the "signal" subspace of the sensor data.  Presumably, the largest eigenvalues correspond to the "signal" space whereas the smaller ones correspond to the "noise" space.  Between 2-4 eigenvalues is generally recommended, however you should examine your dataset and choose the appropriate number based on each individual dataset.  The first three eigenvalues of the shown dataset appear to stand out well above the rest, so three would be a good choice here.

You can view the eigenvector for each eigenvalue in the inset plot within the righthand window, as shown above.  You can view several at a time by entering a vector in the "view single eigenprojection" textbox, such as 1:4, which will show the first four eigenvectors at once. 

The more eigenvalues chosen, the more spatial variations of your results will be seen.  In the limit of only 1 eigenvalue, the time series at every grid point will have an identical shape, only at different scales. Two eigenvalues will show a little spatial variation in the timeseries, but also is less likely to have "noisy" spatial blobs; therefore, if you are interested in one or two major peaks, then two eigenvalues is best.  For several areas of interest, 3-4 eigenvalues are recommended, and maybe up to 5-6.

The condition number of your selected interval will appear in the Matlab command window.  Lower conditions numbers are better since they indicate that the covariance matrix is less singular (and therefore can be inverted more reliably). A condition number as high as 10^12 is okay, however if the condition number is higher, some method of regularization will occur (Tikhonov by default).  This regularizaton usually leads to more spatially blurred images, and therefore is not ideal.   Thus, you should alter the number of sensors, the time window, and the filtering, to reduce the condition number.  The general rule of thumb:  more sensors -> higher condition number; smaller time window -> higher condition number; and smaller bandpass window -> higher condition number. 

Once you have selected the time window, filtering, and number of eigenvalues, then you may edit the name of the file that the activations will be saved to.  A default name will appear as s_beam_datasetname.mat.  You may use this name, or also append additional information, such as how many eigenvalues used and the time window. 

Currently, only a "default" beamformer method is available, based on Sekihara et al. (2001).   Click proceed to compute activations and close this window. 

With Matlab 7, these results will be automatically displayed, otherwise you will be prompted for the file you just created to load the results and view them.

Top

Visualization of Results

To view activation results, click "Display MEG Activations" on the main GUI.  Select the s_beam*.mat file created previously that you wish to view.  This file can stand alone; in other words you may open up a new instance of Nutmeg and go directly to viewing a saved result without reloading MRI information, or other session.mat file information.   The following windows will be shown:

activation viewer

Upon opening, the maximum peak across space and time will be shown.  You may move your cursor around anywhere within your VOI on the MRI and the corresponding time-series will be updated in the left-hand window (click on "Selected Voxel" to bring you to the max time point at that voxel).  Alternatively, you may select a different time peak (or time window) and then the spatial activations at that new time will be updated in the right-hand window (click on "Selected Time Points(s)" to bring you to the max voxel for that time of interest).  To get back to the maximum activation across all time and space, click on "All Space & Time." 

The activations shown are power magnitude maps, and the scale of the activations is arbitrarily set to range from 0-1000.  Selecting "Source Time Series" in the display option pulldown menu will show amplitude ranging from -1000 to 1000. Note that polarities may be ambiguous between voxels using the currently implemented beamformer. The threshold is automatically set to 500 (half the maximum activation), and you may change that as desired. 

The time series can be filtered.  If the bandpass button is selected, it will filter only the time series at the selected voxel that is displayed.  Clicking "Apply Filters to Volume" will apply to the whole volume, but then the working copy of your activations will be altered and the filtering cannot be undone unless you re-open that s_beam*.mat file.   (Sorry the notch filter doesn't work at this step at present...you should apply it to your sensor data before applying the beamformer anyway).

The display style may be changed for better viewing when shown in posters, presentations, or publication.

"Display on Rendered Brain" will display the results on the 3D rendered brain as created in SPM2's render function (which must be done first before clicking on the button here.)  Note this will bring the display to the rendered view, and you will have to reload the activation to get back to the standard activation viewer. 

Top


Common Variables Explained

To make a global variable viewable at any given time, on the command line type 'global variablename' (e.g. 'global nuts').
nuts
Global variable structure which contains all of your session information.   When you save your work into a session.mat file, this information will be saved there. 
nuts.VOIvoxels
#voxels x 3, listing of coordinates of the current VOI, in MEG coordinate space, with 1mm spacing.
st
Global variable structure (from SPM) with all of the information related to the structural MRI and blobs painted on it.
bolts
Global variable structure used internally for processing, not saved anywhere.
beam
Global variable structure with all of activation results infomation.










Top


Advanced Topics

Batch Processing

Top

References

Dalal SS, (2004)

Sahani M & Nagarajan SS (2004).

Sarvas J (1987).  Basic mathematical and electromagnetic concepts of the biomagnetic inverse problem.  Phys Med Biol, 32(1):11-22.

Sekihara K, Nagarajan SS, Poeppel D, Marantz A, Miyashita Y (2001).  Reconstructing spatiotemporal activities of neural sources using an MEG vector beamformer technique.   IEEE Trans Biomed Eng, 48(7):760-771.

Top


Acknowledgements

Authors:
   Sarang S. Dalal
   Johanna Zumer
   Kenneth Hild
   Kensuke Sekihara
   Srikantan Nagarajan
   Alex Wade
   Vineet Agrawal
   DoSik Hwang

Special Thanks:
   Dave McGonigle
   Janine Lupo
   Tony Norcia
   Darren Weber
   Anne Findlay

Top