another help request for *.tfc files

Andrew Smart andrew.smart at NYU.EDU
Thu Apr 19 00:28:27 CEST 2007


I have been trying to do group analysis on source coherence files in
fieldtrip, and fieldtrip doesn't seem to like the output of besa2fieldtrip
when the *.tfc files have coherence. 

The problem seems to be that fieldtrip is looking for the 'label' field in
the output structure, which when the *.tfc file has coherence becomes
'labelcmb'.

I debugged through fieldtrip and changed prepare_timefreq_data (there is
FIXME about this in freqstatistics but it is in Dutch, but I believe it says
to replace data.label with data.labelcmb(:,2), however it doesn't specify in
which function to do this)

In prepare_timefreq_data I changed:

output.label  = input.label;

to

output.label  = input.labelcmb;

To accomodate the labelcmb field in the fieldtrip structure. This gets me by
the errors about the field 'label' not existing.

But then I get the following errors
(for 10 subjects)

reading time-frequency representation using BESA toolbox
reading coherence between 4 channel pairs
renaming parameter 'cohspctrm' into 'powspctrm'
selected 1 channels
selected 41 time bins
selected 24 frequency bins
using "statistics_montecarlo" for the statistical testing
??? Error using ==> fieldtrip-20070320\private\statistics_wrapper
the size of the design matrix does not match the number of observations in
the data

Error in ==> freqstatistics at 87
[stat] = statistics_wrapper(cfg, varargin{:});

Error in ==> coherence_test at 82
Prepstat = freqstatistics(cfg, Prepgram{:},Prepungram{i});




This is the code I have used which generates the above error, which I cannot
figure out:

clear all; close all; pack;
filename_Prepgram = {
  'LP_ELAN_05_M100_Fried_prep_gram.tfc'
  'LP_ELAN_06_M100_Fried_prep_gram.tfc'
  'LP_ELAN_07_M100_Fried_prep_gram.tfc'
  'LP_ELAN_08_M100_Fried_prep_gram.tfc'
  'LP_ELAN_10_M100_Fried_prep_gram.tfc'
  'LP_ELAN_11_M100_Fried_prep_gram.tfc'
  'LP_ELAN_12_M100_Fried_prep_gram.tfc'
  'LP_ELAN_13_M100_Fried_prep_gram.tfc'
  'LP_ELAN_14_M100_Fried_prep_gram.tfc'
  'LP_ELAN_16_M100_Fried_prep_gram.tfc'
  };
 
% this is the list of BESA datafiles in the other condition
filename_Prepungram = {
  'LP_ELAN_05_M100_Fried_prep_ungram.tfc'
  'LP_ELAN_06_M100_Fried_prep_ungram.tfc'
  'LP_ELAN_07_M100_Fried_prep_ungram.tfc'
  'LP_ELAN_08_M100_Fried_prep_ungram.tfc'
  'LP_ELAN_10_M100_Fried_prep_ungram.tfc'
  'LP_ELAN_11_M100_Fried_prep_ungram.tfc'
  'LP_ELAN_12_M100_Fried_prep_ungram.tfc'
  'LP_ELAN_13_M100_Fried_prep_ungram.tfc'
  'LP_ELAN_14_M100_Fried_prep_ungram.tfc'
  'LP_ELAN_16_M100_Fried_prep_ungram.tfc'
  };
 
nsubj = length(filename_Prepgram);

%read in BESA
for i=1:nsubj
  Prepgram{i} = besa2fieldtrip(filename_Prepgram{i});
  Prepungram{i} = besa2fieldtrip(filename_Prepungram{i});
end

cfg = [];
cfg.keepindividual = 'yes';
cfg.cohrefchannel= 'M100';
cfg.channel = 'Fried_RH_elan_FL';
cfg.parameter = 'cohspctrm';
cfg.method = 'montecarlo';
cfg.neighbours    = [];
cfg.time          = 'all';
cfg.freq        = 'all';
cfg.avgovertime      = 'no';
cfg.avgoverfreq      = 'no';
cfg.avgoverchan      = 'no';
cfg.statistic        = 'depsamplesT';
cfg.correctm         = 'max';
cfg.numrandomization = 200;
 cfg.design           = [
    1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10                  % subject 
    1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 ];               % condition number
 cfg.uvar = 1;                                   % "subject"  
 cfg.ivar = 2;                                   % "condition" 

Prepstat = freqstatistics(cfg, Prepgram{:},Prepungram{i});
%     

any help would be greatly appreciated, thanks!
andy



More information about the fieldtrip mailing list