Print

Print


Dear Duncan,

I think you should address your question to the Fieldtrip list. Once
the data is out of SPM and assuming that it looks OK in Fieldtrip
(which you can check), we cannot be responsible for it any more :-) I
think it would help if you give more details about what you mean by
giberish. Perhaps try to create surrogate data of the same dimensions
that doesn't come from SPM and run it through the same pipeline and
then you will see if the problem has anything to do with SPM or not.

Best,

Vladimir

On Wed, Sep 12, 2012 at 12:32 PM, Duncan Astle
<[log in to unmask]> wrote:
> Dear learned SPMers,
>
> I have some nice ERP data that is all processed in SPM8 and averaged, such
> that I have individual subject files, each with 6 averages (these are my
> conditions).
>
> I am keen to put the data into fieldtrip such that I can use the fieldtrip
> statistic functions. So I split the files up (so that I have individual
> averages for each condition) and put them into fieldtrip using the
> spm2fieldtrip function. Then I group averaged using the
> ft_timelockgrandaverage function. Then I tried to use ft_timelockstatistics
> to compare two conditions. It runs, and seems reasonably happy with it, but
> when I examine the stats structure at the end it is full of giberish. What
> am I doing wrong!?!?!? It seems obvious but I can't quite get it right.
>
> Any help gratefully received. The script that I used is below.
>
> Best,
> Duncan
>
> D1 = spm_eeg_load('U:\eeg\Load3Hard\wmeffMMspm8_raw_0011');
> D2 = spm_eeg_load('U:\eeg\Load3Hard\wmeffMMspm8_raw_0012');
> D3 = spm_eeg_load('U:\eeg\Load3Hard\wmeffMMspm8_raw_0013');
> D4 = spm_eeg_load('U:\eeg\Load3Hard\wmeffMMspm8_raw_0014');
> D5 = spm_eeg_load('U:\eeg\Load3Hard\wmeffMMspm8_raw_0015');
> D6 = spm_eeg_load('U:\eeg\Load3Hard\wmeffMMspm8_raw_0016');
> D7 = spm_eeg_load('U:\eeg\Load3Hard\wmeffMMspm8_raw_0017');
> D8 = spm_eeg_load('U:\eeg\Load3Hard\wmeffMMspm8_raw_0018');
> D9 = spm_eeg_load('U:\eeg\Load3Hard\wmeffMMspm8_raw_0019');
> D10 = spm_eeg_load('U:\eeg\Load3Hard\wmeffMMspm8_raw_0020');
> D11 = spm_eeg_load('U:\eeg\Load3Hard\wmeffMMspm8_raw_0021');
>
> l3e1=spm2fieldtrip(D1);
> l3e2=spm2fieldtrip(D2);
> l3e3=spm2fieldtrip(D3);
> l3e4=spm2fieldtrip(D4);
> l3e5=spm2fieldtrip(D5);
> l3e6=spm2fieldtrip(D6);
> l3e7=spm2fieldtrip(D7);
> l3e8=spm2fieldtrip(D8);
> l3e9=spm2fieldtrip(D9);
> l3e10=spm2fieldtrip(D10);
> l3e11=spm2fieldtrip(D11);
>
> D1 = spm_eeg_load('U:\eeg\Load3Hard\wmeffMMspm8_raw_0011');
> D2 = spm_eeg_load('U:\eeg\Load3Hard\wmeffMMspm8_raw_0012');
> D3 = spm_eeg_load('U:\eeg\Load3Hard\wmeffMMspm8_raw_0013');
> D4 = spm_eeg_load('U:\eeg\Load3Hard\wmeffMMspm8_raw_0014');
> D5 = spm_eeg_load('U:\eeg\Load3Hard\wmeffMMspm8_raw_0015');
> D6 = spm_eeg_load('U:\eeg\Load3Hard\wmeffMMspm8_raw_0016');
> D7 = spm_eeg_load('U:\eeg\Load3Hard\wmeffMMspm8_raw_0017');
> D8 = spm_eeg_load('U:\eeg\Load3Hard\wmeffMMspm8_raw_0018');
> D9 = spm_eeg_load('U:\eeg\Load3Hard\wmeffMMspm8_raw_0019');
> D10 = spm_eeg_load('U:\eeg\Load3Hard\wmeffMMspm8_raw_0020');
> D11 = spm_eeg_load('U:\eeg\Load3Hard\wmeffMMspm8_raw_0021');
>
> l3h1=spm2fieldtrip(D1);
> l3h2=spm2fieldtrip(D2);
> l3h3=spm2fieldtrip(D3);
> l3h4=spm2fieldtrip(D4);
> l3h5=spm2fieldtrip(D5);
> l3h6=spm2fieldtrip(D6);
> l3h7=spm2fieldtrip(D7);
> l3h8=spm2fieldtrip(D8);
> l3h9=spm2fieldtrip(D9);
> l3h10=spm2fieldtrip(D10);
> l3h11=spm2fieldtrip(D11);
>
>     cfg=[];
>     cfg.keepindividual = 'yes';
>     cfg.channel = {'all', '-Fp1', '-Fp2','-F10', '-F9','-TP10', '-TP9',
> '-EOG'};
>
> Load3Easy = ft_timelockgrandaverage(cfg, l3e1, l3e2, l3e3, l3e4, l3e5, l3e6,
> l3e7, l3e8, l3e9, l3e10, l3e11);
> Load3Hard = ft_timelockgrandaverage(cfg, l3h1, l3h2, l3h3, l3h4, l3h5, l3h6,
> l3h7, l3h8, l3h9, l3h10, l3h11);
>
>     cfg = [];
>     cfg.channel     = 'EEG';
>     cfg.latency     = [0.3 0.7];
>     cfg.avgovertime = 'yes';
>     cfg.parameter   = 'individual';
>     cfg.method      = 'montecarlo';
>     cfg.statistic   = 'depsamplesT'
>     cfg.alpha       = 0.05;
>     cfg.correctm    = 'no';
>     cfg.correcttail = 'prob';
>     cfg.numrandomization = 1000;
>
>     Nsub = 11;
>     cfg.design(1,1:2*Nsub)  = [ones(1,Nsub) 2*ones(1,Nsub)];
>     cfg.design(2,1:2*Nsub)  = [1:Nsub 1:Nsub];
>     cfg.ivar                = 1; % the 1st row in cfg.design contains the
> independent variable
>     cfg.uvar                = 2; % the 2nd row in cfg.design contains the
> subject number
>
>
> [stat] = ft_timelockstatistics(cfg, Load3Easy, Load3Hard)
>
>
>