Personal tools
  • Help

nutmeg:TFstats

From NITRC Wiki

Jump to: navigation, search

Contents

What you need

  • The assembled time-frequency beamformer data containing all time windows and frequency bands of each subject and condition.
  • Optionally, the spatially normalized structural MRI of each subject in the Analyze format (w*.img files, necessary for analysis across subjects)

Creating "Pointer Files"

via GUI

Display the data of subject 1 and condition 1:

tv s_beamtf_somename.mat

This should bring up the nut_results_viewer windows.

Click on Special, Modify Coregistration to check if the the correct MRI is defined or load it in if not. If you would like to perform an analysis across subjects later, you will also need the spatially normalized structural MRI. 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…”.

In the File Browser panel, load in the s_beamtf*.mat file of each condition and each subject by clicking on "Condition", "New", or "Subject", "New", and then "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! Note: If you already have spatially normalized the functional data, load in the non-normalized file at this point!

When finished, click on “Save Pointer File”. This will save the path and filename of the s_beamtf*.mat files of each subject and condition, as well as optional voxel coordinates 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 Pointer File.

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

nut_results_viewer yourpointerfile.mat 

via command line

Use the function nut_voinew. This is much faster than using the GUI, but you need to name the individual files according to a common pattern.

To remove subjects, conditions, or voxel labels from a pointer file (also if you have created it with the GUI), you can use the function nut_voiremove.


Spatial normalization of the functional data

This will only work if you have a spatially normalized structural MRI for each subject. Also make sure 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..."

A new dialog should appear. Click on "All datasets" to spatially normalize all individual s_beamtf*.mat files. 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. 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.

You can view the normalized data by clicking on "Display Spat Norm".


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 the MATLAB Command Window type:

nut_timef_stats

This will open a GUI.


Panel “Test”

If you just want to average across subjects without any statistical tests, click “Mean activation from baseline w/o stats”.

If you want to test for significant activations (this may be in a single or in each of several conditions), choose "Mean activation and SnPM t-test for one sample".

If you have 2 conditions for each subject and you want to test for differences between the 2 conditions, choose "Mean difference and SnPM t-tests for one sample". This corresponds to paired t-tests.

If you have 2 subject groups (e.g., patients and controls) and want to test for differences between these groups, choose "SnPM unpaired t-tests".

If you have >2 conditions for each subject and you want to test whether there are differences among these conditions, choose "SnPM within subject ANOVA". This corresponds to a one-way repeated-measures ANOVA.

If you want to correlate your functional data at each voxel with some behavioral variable, choose "SnPM correlation". Note that the permutation we use is slightly different from the original SnPM permutations for correlations. Originally, the order of the behavioral scores is permuted. We leave the order as is, but invert the centered (=0 mean) scores of some subjects, just as for the activation test. This has the advantage that it necessitates less permutations, but should produce more or less the same result.

For SnPM, you must specify the number of permutations performed. If you have less than 14 subjects, you can leave "automatic". For 14 and more subjects, you can save some time by limiting the number of permutations to 10000.


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 "activation" options, or [1 2;3 4] for the “difference” options)


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.

"Use only significant freq bands": This can be useful when you want to average across multiple (typically high-gamma) frequency bands. See below for more details on this option.

If you are analyzing multiple frequency bands, you can optionally "correct for multiple frequency bands". However, since the relatively broad frequency bands of TFBF contain rather different information, this may be overly conservative.


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 area under curve": The statistical test is performed with the area under curve 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 testing multiple time windows, but the disadvantage of not obtaining 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

"Synchronization" means the test will only check whether there are significant positive power changes (one-tailed test). "Desynchronization" checks only for negative power changes. "Both" corresponds to a two-tailed test.

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.


Some examples of settings

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. 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.
  • In the hypothesis panel, choose "Synchronization" to look for high-gamma power increases corresponding to activations.


Panel “Filetype”

If you have a Pointer or Population File available, check these options.

Otherwise choose “s_beamtf files”. Note that some options are not available without Pointer File.


Ok, let's go!

Click “Check”. If you have chosen the "Pointer file" or "Population file" option, you will have to open the corresponding file in the file dialogue. If you have chosen the “s_beamtf 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.

If you do not want only the average across subject but save the individual data of each subject (e.g., for other statistical tests), click "Get population". This will then create a Population File.

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 above.


Visualize the results

Type

nutmeg
nut_results_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”.

Powered by MediaWiki
  • This page was last modified 11:35, 28 July 2011.
  • This page has been accessed 676 times.
  •