NIMH MEG Core Facility

National Institute of Mental Health, Bethesda, Maryland


MEG Analysis

Valid XHTML 1.0!

Valid CSS!

view · edit · attach · print
Meg » Meg

MEG Analysis

This section covers everything from experimental design through MEG data analysis, but since analysis is usually the most time consuming part of a study, and since the type of analysis you want to do will guide your design, it's really all about the analysis. happy smiley

Continuous head localization (CHL)

A new feature with the 5.2 tools is CHL. Head position is recorded continuously throughout a run. Special channels in the dataset store the (x, y, z) coordinates of the head coils. Since this is a major interface change in acquisition, it warrants a special mention here.

To use it, select "continuous" in the Channel Settings window. There will only be one "localizer window" at the beginning, so you may want to modify your Presentation scripts to reflect that.

After a recording, the "Run Status" window pops up. We usually click OK on that, but now that window contains the final Max Head movement number. So instead of the post-run localization movement number you can use that. Note: it's not the difference between pre and post, it's the max movement, no matter where that occurred. If you click OK on Run Status by accident, the same number is still available in the lower left of the Acq window (that we normally dismiss with File→Close Window).

Furthermore, there is a new program, headMotionDetect, which will scan a dataset and identify (and optionally mark as bad) segments with motion exceeding a threshold.

 headMotionDetect -th .25 dataset.ds

will identify segments by trial and time with motion exceeding 2.5 mm, and in this case it doesn't create any markers, it just reports. The default threshold is 5 mm.

Also, newDs will now always report the max head movement when it creates a new dataset.


If you're looking for MEG analysis software, that's here.

Analysis basics

MEG datasets are large, complex, and rich with information. There are many ways to look at them. Here I'll briefly outline the basics.

  • Signal Space

Averaging. Spectral analysis (ctf2st). Artifact rejection. Dipole fitting.

  • Source Space

A common processing flow for group analysis is as follows:


The SAMsrc step depends on a head model, usually derived from the subject's structural MRI scan.

The steps above are covered in more detail here, and the Software page has lots of tools you'll need.

See a list of all the pages in the Meg group.

Known Bugs

This section details known bugs in the CTF MEG software.

Version 5.4

The last version. The "new" feature in this release is brain shapes instead of head shapes. It has oddities that will never be investigated. Don't use it, stick with 5.2.

Version 5.2

  • The bandwidths allowed by the SAMcov tool were too restrictive; our version relaxes the limits, so you can do narrower bands, if you like.

Version 5.0

  • DataEditor's threshold detect GUI can't use ADCs. You'll have to use the command-line version. Fixed in 5.0.1.
  • MRIViewer's headshape extraction feature doesn't work on Fedora. You'll have to use RHEL or RH8, or AFNI/brainhull.
  • AFNI does not support the new V4 .mri format. That format uses a variable length header that must be parsed. wall bashing smiley It's too much effort, and pointless besides, to support yet another bizarre MRI format. There is an easy workaround. Simply use the MRIViewer program to convert to the V2 format (look under the File menu). AFNI reads this format just fine.
  • DataEditor still doesn't work if you have NumLock on.

Version 4.17

  • Don't use marker names of 16 characters or more; it'll break.
  • localSpheres can sometimes produce garbage results. Use checkSpheres to check, or just look at the MultiSphere file and make sure it doesn't have ridiculous values in it. Fixed in 5.0.1.
  • DataEditor doesn't work if you have NumLock on.
  • other bugs that I forget right now


This is a list of things that we'd like to have.

  • AFNI plugin to make adding fiducials easier. Right now, the Edit Tagset plugin is used for this purpose. Some features that would be helpful here include:
    • Automatically know the fiducial names (eliminate the null.tag file).
    • Optionally specify an MEG dataset containing headcoil information. A button could then run fiddist, and report on the amount of mismatch between the MRI and the MEG fiducials.
    • A button that performs the orthogonalization.
view · edit · attach · print · history · recent changes
Page last modified on February 04, 2017, at 09:06 AM
Department of Health and Human Services image and link First Gov image and link