reformat processed data

Robert Oostenveld r.oostenveld at FCDONDERS.RU.NL
Fri Nov 18 09:28:21 CET 2005


Dear Christopher,

The tutorial data that you refer to contains a structure. In general
all data in fieldtrip is represented as a structure. A structure is a
collection of variables that belong together, and the "freq"
structure, i.e. the structure that results from the freqanalysis
function contains all elements (but not more) that are required to
fully describe the data. The file gravgerfcporig.mat contains a grand
average Event Related Field (ERF) structure, which is the result of
the timelockgrandaverage function:

 >> clear all
 >> load gravgerfcporig
 >> whos
   gravg_erf_cp_FC        1x1                  11352992  struct array
   gravg_erf_cp_FIC       1x1                  11352992  struct array
 >> gravg_erf_cp_FC
          label: {152x1 cell}
           time: [1x900 double]
         dimord: 'repl_chan_time'
           grad: [1x1 struct]
     individual: [10x152x900 double]

(hmmm, the average itself seems to be missing, I was expecting that
it also would contain an avg-field of 152x900 double. Maybe Eric
deleted it. Also the cfg field is missing, so it seems like it was
hand-made and not using timelockgrandaverage.)

But that is not the data that you are interested in. Have a look in
the file containing the time-frequency representation of the data

 >> load TFRorig
 >> whos
   TFRFC        1x1                  20540072  struct array
   TFRFIC       1x1                  20775680  struct array
 >> TFRFC
         label: {151x1 cell}
        dimord: 'rpt_sgncmb_frq_tim'
     powspctrm: [4-D double]
           foi: [5 10 20 40 80]
           toi: [1x39 double]
          grad: [1x1 struct]
           cfg: [1x1 struct]

There you see that there is a structure TFRFC, which contains a
powspctrm field, with the order of dimensions (dimord) repetitions-
channels-frequency-time. There is a vector describing the values
along the time-axis (toi) and a frequency axis (foi) and a cell-array
with the channel labels (label). Furthermore, there is a "grad"
structure which contains the position of the MEG gradiometers.

If you want to copy your data from excel into fieldtrip, you should
create a similar structure in which all sub-elements correspond with
the data, since that is what clusterrandanalysis expects (that is the
"bookkeeping" that Eric referred to). You currently only have a data
matrix of <160x30 double>, but clusterrandanalysis does not know
whether it has 160 channels or 30, and whether it contains the power
at a single frequency that was estimated at multiple timepoints, or
the power at many frequencies that was estimated at a single
timepoint, or what the frequencies actually are. You also have to
tell (through the elec structure) what the locations of your
electrodes are, since clusterrandanalysis needs to know which
electrodes are neighbours.

Although converting the data from excel to a fieldtrip-compatible
structure is possible, I think that it will be easier to do your
complete analysis in fieldtrip. Fieldtrip can read Brainvision files,
and you can follow all steps in the clusterrandanalysis tutorial, but
then instead of doing a time-frequency analysis (mtmconvol) only
doing a frequency analysis (mtmfft).

best regards,
Robert


On 17-nov-2005, at 16:48, Christopher Miller wrote:

> Dear Robert,
>
> I have a question about reformating (pre)processed data:
>
> I performed a frequency analysis with Brain Vision Analyzer and
> exported the data into Excel. These data are multidimensional (27
> channels X 5 frequencybands) and thus consist of 27 X 5 numbers for
> each of the 16 subjects. Each number represents the power of every
> channel-frequency combination. Since this was a within design, I
> have two sets of 27 X 5 for each subject. I want to compare these
> two sets with a Cluster-level Randomization Test for a Within
> Subjects experiment, just like the test which is performed in the
> tutorial on Cluster-level Randomization Tests, page 16-17. In the
> tutorial this can be done after "load gravgerfcporig;". When this
> command is executed, two files appear in the workspace:
> "gravg_erf_cp_FC" and "gravg_erf_cp_FIC", both with the format:
> "<1x1 struct> struct". However, when I import my data with the
> import wizard there appears only one file in the workspace,
> named :"data" with the format: "<160x30 double> double". The
> numbers 160 and 30 represent the data as needed for analyzing them
> in SPSS: 160 rows (16 subjects, with 5 frequencybands in 2
> conditions). The number 30 represents 30 columns (27 channels and 3
> channels to label: (1) the subject(1-16), (2) the frequencybands
> (1-5) and (3) the condition(1-2).
> I know that just saving my imported file as a .mat file doesn't
> change the structure of the file, since I tried this. My question
> is, how can I reformat these data in such a way that I can perform
> a Cluster-level Randomization Test for a Within Subjects experiment?
>
> Thanks in advance,
>
>
> Christopher Miller, MSc
> Unit for Clinical Psychopharmacology and Neuropsychiatry
> Department of Psychiatry 974
> Radboud University Nijmegen Medical Centre
> PO Box 9101
> 6500 HB  Nijmegen
> The Netherlands
> Tel.: + 31 24 3613204
> Email: CAFJ.Miller at psy.umcn.nl
>

=======================================================
Robert Oostenveld, PhD
F.C. Donders Centre for Cognitive Neuroimaging
Radboud University Nijmegen
phone: +31-24-3619695
http://www.ru.nl/fcdonders/



More information about the fieldtrip mailing list