Analysis of Time-Frequency Data

 

 

What you need

Display individual data

Analysis across subjects

Loading in all subjects and conditions

Spatial normalization of the functional data

Averaging and Statistics

 

 


1. What you need

 

The imported SAM images of each subject and condition:
 s_beamtf*.mat  files

A structural MRI of each subject in the Analyze format:
 *.img  files

An MEG fiducial file for each subject:
 *.txt  or  *.hdm  files

Optionally, the spatially normalized structural MRI of each subject in the Analyze format (necessary for analysis across subjects):
 w*.img  files


Top


2. Display individual data

 

  1. Start nutmeg.

nutmeg

 

  1. Open the data of subject 1 and condition 1:

nut_timef_viewer   s_beamtf_somename.mat

 

This should bring up the following windows.

 

 

 

  1. Click on Special, Modify Coregistration.

 

 

Load the subject’s structural MRI and fiducial file. You will also need to open the spatially normalized structural MRI at this point, if you would like to perform an analysis across subjects later. Loading a normalized MRI will also allow you to obtain a description of the anatomical location of each voxel in the brain while surfing through your data.

 



When finished, click “Done”. DO NOT FORGET to save the modifications by choosing the menu “Special”, ”Save s_beam volume…”.

 

  1. By clicking on one of the time-frequency windows, you can display the corresponding power changes at each voxel. By clicking at one of the voxels in the brain, you can display the corresponding time-frequency decomposition.

 

  1. By changing the “Threshold +/-” values, you can limit the display of power changes to values above and below a certain power change cutoff.


             

 

  1. You can label, store, redisplay, and export voxels of interest (VOI) with the Voxel Marker Panel of nut_timef_viewer.
     

Top


3. Analysis across subjects

3.1 Loading in all subjects and conditions

 

In the nut_timef_viewer window, subsequently load in the s_beam*.mat file of each subject by clicking on “Subject”, “New”.
Note: If you already have spatially normalized the functional data, load in the non-normalized file at this point.
Load the structural MRI, the spatially normalized structural MRI, and the fiducials of each subject as described above.

  1. If you have more than 1 condition, load in the s_beamtf*.mat file of each condition and each subject by clicking on “Condition”, “New”, or by clicking on “Load”. It doesn’t matter in which order you load the files, but make sure you match the files with the correct subject and condition number!
  2. Click on “Save Marker File”. This will save the path and filename of the s_beamtf*.mat files of each subject and condition, as well as optional VOI positions and labels. For practical reasons, we recommend saving the file in the parent directory of the individual data, but you can choose any directory and filename. This file will further be referred to as Voxel Marker File.



    You can later load the information saved in this file by clicking on “Load Marker File”, or by opening nut_timef_viewer with this file:

    nut_timef_viewer   yourvoxelmarkerfile.mat

 

3.2 Spatial normalization of the functional data

 

This will only work if you have a spatially normalized structural MRI. Therefore, make sure that you had specified the spatially normalized structural MRI for EACH subject and condition during step 3.1.
Also make sure that nut_timef_viewer is open, and that the subject and condition numbers displayed in the File Browser match the actual number of subjects and conditions you have.

In the "Extras" Panel, click on "Spatially Normalize..."

The following dialog should appear:


Click on "All datasets" to spatially normalize all individual s_beamtf*.mat files and resave them as s_beamtf*_spatnorm.mat.
Depending on your file sizes, voxel size, and number of subjects/conditions, this may take a while!
Note: The program will automatically recognize if a file has already been normalized in a previous session and will only process the remaining files.

Choose "Currently displayed dataset only" to normalize only the current s_beamtf*.mat file.

You can also determine the voxel size of the spatially normalized datasets. The first (default) option will keep the same voxel size after normalization as before. The second option will look up the SPM default voxel size value for normalization of structural MRIs (see line defaults.normalise.write.vox in the M-file "spm_defaults.m"). The third option allows you to change to a custom voxel size (e.g., [5 5 5] corresponds to 5x5x5 mm).

Click on "Ok", and wait until a message window confirms the successful completion of the calculations. Then, you can view the normalized data by clicking on "Display Spat Norm".

3.3. Averaging and Statistics

 

For an introduction to analysis of MEG data across subjects with SnPM, we recommend the following paper:
Singh KD et al. Group imaging of task-related in cortical synchronization using nonparametric permutation testing. NeuroImage 2003; 19: 1589.

 

In order to save memory, close nut_timef_viewer and nutmeg, and clear the MATLAB workspace.
clear all

In the MATLAB Command Window type:
nut_timef_stats

This will open the following window:
nut_timef_stats

Specify the averaging/statistics settings.


Panel “Average across subjects and perform”

If you just want to average across subjects without any statistical tests, click “No statistics”.

We recommend “SnPM” rather than “T-tests” for statistical testing across subjects. For SnPM, you must specify the number of permutations performed. If you have less than 14 subjects, you can leave “2^number_of_subjects”. For 14 and more subjects, you can save some time by limiting the number of permutations to 10000.

 

Panel “Calculate”

If you would like to test the significance of SAM power changes themselves, choose the (default) “Activation” option.

If you would like to contrast condition pairs, choose the “Comparisons” option.

 

Panel “Subjects and Conditions”

Here you can exclude subjects and specify which conditions you would like to analyze.

Use the MATLAB convention for lists of numbers ([1 3 5:8] for the "Activations" option, or [1 2;3 4] for the “Comparisons” option)

 

Panel “Frequency Bands”

"Include bands number" field:
You have the possibility to specify the frequency bands that you want to include in your analysis by entering the corresponding numbers. The lowest frequency band corresponds to number 1.

For most analyses, we recommend the following settings:

Uncheck (or leave unchecked) “Use only significant frequency bands”.

Choose “Analyze each band separately”.

Optionally, you can correct for testing at multiple frequency bands.

In the “Hypothesis” Panel, select “Both” or the hypothesis you want to test.

If you are looking at several (high-)gamma frequency bands, you might notice that individual subjects show activations in similar brain regions but in different frequency bands. In this case, analyzing each band separately might not be optimal since you might lose the significance of some brain regions due to this inter-individual variability. What you are really interested in is whether a certain brain region is active at a certain time point, and you don't really care about which (high-)gamma band(s) are involved. In this case, we recommend the following settings:

If you have at least 5 time windows in your time-frequency analysis, check “Use only significant frequency bands”. At each voxel, this will test which of the included frequency bands are significantly different from 0, by performing t-tests for one sample with the time windows of each frequency band. A False Discovery Rate (FDR) of (by default) 5% is used to correct for testing at multiple frequency bands. For each voxel and for each subject, only the significant frequency band(s) are then selected.
If you have less than 5 time windows, uncheck this option (you cannot perform t-tests with less than 5 values).

Choose "Average bands". If you have the "Use only significant frequency bands" option checked, this will average across significant frequency bands only.
Otherwise, this will average across all frequency bands that you have included in the "Include bands number" field.

Panel “Time Windows”

"Include windows number" field:

You can limit the time windows used for analysis by entering the corresponding numbers.

 

The radio buttons in this panel determine, how the time windows are treated in the statistical analysis. In contrast, they do not affect the calculation of average power values. 

"Use sum":  The statistical test is performed with the sum of all included time windows of a given frequency band. Like in a fMRI or PET experiment, this will test which brain regions are overall significant in the entire analyzed time period. This has the big advantage that you do not get the problem of multiple testing, but the disadvantage of not yielding statistical information about the timing of activations.
NOTE: If you have strong power increases and decreases within the same frequency band in your data, the increases and decreases may cancel each other out and might therefore not reach statistical significance (e.g., beta-synchronization and -desynchronization before and after voluntary movements). In this case, you might prefer another option.

"Analyze each window separately": This will perform a separate statistical test for each time window, which has the advantage that you do not have to worry about mixed synchronizations and desynchronizations within frequency bands. However, you should correct for multiple testing, and the test might therefore be less sensitive for weaker activations.

"Use mean of significant time points": We do not generally recommend using this option at this time. You can only use it, if you have at least 5 frequency bands in the (high-)gamma frequency range or at least 5 frequency bands in the alpha/beta range, and several time windows.

NOTE: If you have only one time window to analyze, choose either the "Use sum" or the "Analyze each time window separately" options; they will both yield the same result. The "Correct for multiple windows" option will have no effect. In contrast, the "Use mean of significant time points" option does not make sense in this case.

 

“Hypothesis” Panel:
If you have checked the "Use only significant frequency bands" option, you have to choose between “Synchronization” or “Desynchronization”. If you want to test both hypotheses, run the corresponding tests sequentially.
Otherwise, you can set this menu to "Both" or the hypothesis you are interested in.

 

Panel “Filetype”

If you have a Voxel Marker File available, check this option.

Otherwise choose “Beam Files”. Note that some options are not available without Voxel Marker File.

 

 

Click “Check”.
If you have chosen the "Voxel Marker File" option, you will have to open the corresponding file in the file dialogue.
If you have chosen the "Beam Files" option, you will have to open the (spatially normalized !) s_beam files of each subject.
Afterwards, the program will make sure that all required files are available. If no error is found, the “Run” Button will be enabled.

 

Click “Run” and follow the readout of the analysis process in the MATLAB Command Window. The results will be saved in the current directory under
s_beamtf|conditionnumber|_|frequency_settings|_|time_settings|_avg.mat
with the terms in | | depending on your settings.

IMPORTANT:

The program is always looking for an existing file with the same name before performing the analysis. If it does find one, it will use the average data from this file and only add the statistical results. This allows you to save different statistical tests (SnPM for synchronization, SnPM for desynchronization, T-Test) within one file without recalculating the average.

However, if you re-run the averaging/statistics with different s_beam*.mat datasets (e.g., different subjects), you must rename (or move to another directory) the file created during the previous run before starting the next run! This will avoid using the wrong average data and overwriting the previous statistical results.

Also, you must avoid attributing the same condition number to different conditions! Therefore, if you have several conditions, load them in properly as described in 3.1.

 

 

Visualize the results by typing

nutmeg
nut_timef_viewer   s_beamtfyourcond_yourfreqs_yourtimes_avg.mat


or short

tv  s_beamtfyourcond_yourfreqs_yourtimes_avg.mat

in the MATLAB Command Window.

You can now look at the average across subjects. If you have run a statistical analysis, you can statistically threshold your data by choosing the corresponding option in the “Threshold” popup menu. “Corr p” refers to p values after correction for testing at multiple voxels.



By clicking on “Display 3D”, you can display your data 3 dimensionally on a rendered brain.
NOTE: If you only have 1 frequency band with more than 4 time windows, activations will be shown with a line plot rather than with colored squares.

You can export voxel activations at the currently selected time-frequency point to the Analyze format by clicking on the menu “Special”, “Export Analyze Image”.


Top


2006 Adrian G. Guggisberg