Grand Averages

Robert Oostenveld r.oostenveld at FCDONDERS.RU.NL
Wed May 4 09:16:46 CEST 2005


Hi Theresa

We do not work with "databases", structuring the analysis of a larger 
group of subject is something that you have to do yourself in your own 
scripts. My preferred way of doing this is something like

subj = {
'A001'
'A002'
'A003'
'A004'
};

Nsubj = 4;
for s=1:Nsubj
   dataset = ['E:\Data\AD_Project\Patients\' subj{i} '.ds'];
   matfile = ['E:\Data\AD_Project\Matlab\'   subj{i} '.mat'];
   cfg = [];
   cfg.dataset = subj{s};
   cfg.otheroption = ...
   cfg.otheroption = ...
   cfg.otheroption = ...
   raw = preprocessing(cfg)
   save(matfile, raw);
   clear raw
end

This ensures that you are using the same analysis options for each 
subject. Then in the next step (e.g. timelockanalysis or ferqanalysis), 
you can repeat the for-loop over the subjects, read the raw data and 
perform the nest step. Grand averaging is done using the 
TIMELOCKGRANDAVERAGE function or the FERQGRANDAVERAGE function. For MEG 
data, it is preferable to spatially realign them prior to averaging, 
since the helmet location is different for each subject.

best,
Robert

On 2 May 2005, at 9:20, Montez, T. wrote:

> Hi,
>
> I would like to make two multiplots of power spectrum: one for
> controls and one for patients.
> I wrote a code to compute the planar gradiometers, the average over
> trials for each subject and the power spectrum (see attachment).
> I want to run it through the two groups and grand average within the
> groups to have a first glance at the differences between them.
>   
> The database is structured like:
>   
> E:\Data\AD_Project\Patients\A001 ... E:\Data\AD_Project\Patients\A017
>   
> And E:\Data\AD_Project\Controls\C001 ... 
> E:\Data\AD_Project\Controls\C018
>   
> Inside each folder there is a "data" Matlab file (*).
>   
> - How are your databases organized and how do you compute Grand
> Averages?
>   
> Thanks,
> Teresa
>   
>   
> (*) Example of how the data was read from CTF.
>   
>  cfg = [];
>  cfg.dataset = 'E:\Data\AD-EC\A001-ED_20020719_02.ds'
>  cfg.trl= [[ones(1,37)]', [4096*ones(1,37)]', [zeros(1,37)]']
>  cfg.channel='all'
>  data = preprocessing(cfg)
>   
>  It is just no-task eyes closed data acquired with 37 trials of 4096
>  samples.
>  So I want to apply the filters later as if it is continuous data.
>  - How is it handled in the last 0.9.6 version?
>
> <script_home_database.m>
----------------------------------------------------------------------
Robert Oostenveld, PhD
F.C. Donders Centre for Cognitive Neuroimaging
Radboud University Nijmegen
phone: +31-24-3619695
http://www.ru.nl/fcdonders/
----------------------------------------------------------------------
N.B. Starting from 1 September 2004, the University of Nijmegen has 
changed its name to Radboud University Nijmegen. All web- and 
email-addresses ending in ".kun.nl" should therefore be changed into 
".ru.nl". Please update your address book and links.



More information about the fieldtrip mailing list