Within-subject coherence statististics for virtual sources

Lorina Naci lorina_naci at YAHOO.CO.UK
Mon Nov 20 19:32:50 CET 2006

Dear Jan-Mathijs, thanks so much for your message. I am sorry I did not respond any earlier – the message ended up misclassified in my mailbox and I did not notice it.

  Thank you for sending me the modified script. I’ve defined the cfg.neighbours{j}.label by entering one of my data structures. Also, I’ve loaded all my subjects’ data structures which are saved in the file ‘allsubjects.m’

  I ran it but again it crashes, giving the same error pointing to the statistics_wrapper, saying that the input data could not be determined. I am attaching here my scrip and ‘allsubjects.m’
  Sorry to keep bothering you with this.

  Many thanks for your help,

Jan Mathijs Schoffelen <Jan.Schoffelen at FCDONDERS.RU.NL> wrote:         v\:* {behavior:url(#default#VML);}  o\:* {behavior:url(#default#VML);}  w\:* {behavior:url(#default#VML);}  .shape {behavior:url(#default#VML);}        st1\:*{behavior:url(#default#ieooui) }                Dear Lorina,

  Even though my name is not Robert, I hope that is OK. I do not really understand why you use freqstatistics_test function the way you do, but this is the way I get it going in your case (so not using the function you sent along: and I think what went wrong is how you configured your input-data):

  Cfg.method = ‘montecarlo’;
  Cfg.statistic = ‘diff’;
  Cfg.parameter = ‘powerspctrm’; %these contain coherences in reality, right?
  Cfg.numrandomization = something;
  Cfg.design = dependent on your input data;
  Cfg.ivar = 1; %put condition in the first row of your desing-matrix
  Cfg.uvar = 2; %put the subject-index on the second row

  And now comes the trick, and I guess that’s why you tried it the way you did, at least so that you would not run into problems with neighbourselection anymore.

  For j = 1:length(dataBlabla.label)
    Cfg.neighbours{j}.label = dataBlabla.label{j};
    Cfg.neighbours{j}.neighblabel = {};

  You have virtual channel data, so the neighbourhood-structure is irrelevant for clustering (you don’t want to cluster in space, but only in time and frequency perhaps)

  At least it should run through if you call:

  Stat = freqstatistics(cfg, dataS1C1, dataS1C2, dataS2C1 etc)




  From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Lorina Naci
Sent: Friday, November 10, 2006 6:41 PM
Subject: Re: [FIELDTRIP] Within-subject coherence statististics for virtual sources

    Hi Robert,

    Thank you very much for your help, I was wondering whether I could trouble you with a couple more questions. I converted my besa data to fieldtrip format and this seemed to work fine. I got no error messages and the data structures look like they contain all my data in them (I am attaching an example mat file with the output structures from a few subjects). However, I am still having problems with running freqstatistics. The cfg options are defined OK but the matlab script crushes when it comes to calling statistics_wrapper. The error message I get is as follows:

    "Could not determine type of input data" which leads me to believe there is a problem with the converted data.

I am also attaching my script for freqstatistics in case you need to see this file.

    Very many thanks for your help,


Robert Oostenveld <r.oostenveld at FCDONDERS.RU.NL> wrote:

    Hi Lorina

On 8 Nov 2006, at 20:00, Lorina Naci wrote:
> I tried to run the script as you suggested but it did not work. The
> error message I get is to do with
> [stat] = statistics_wrapper(cfg, varargin{:}). It just gives me an
> error message pointing to this line,saying: error using
> fieldtrip-20061003/private/statistics_wrapper, could not determine
> the type of input data.

Then it means that the data structure that you have obtained from
besa2fieldtrip is not recognized. It is also not clear to me how your
data looks like (i.e. as a Matlab structure). It is virtual channel
data, time-frequency analyzed, and then single trial coherences

Could you show the output that you get on screen after

dataA = besa2fieldtrip('filenameA.tfc') % i.e. without semicolon,
to show the output on screen
dataB = besa2fieldtrip('filenameB.tfc') % i.e. without semicolon,
to show the output on screen

> Also, the function 'cfg.numrandomization' requires a number, but I
> am not sure what the choice of the number depends on? I've inputed
> 500 as in the documentation example.

That is the number of resamplings that is used to construct the
reference distribution, 500 should be fine.

> Finally, at risk making my ignorance of how Fieldtrip works
> entirely transparent, I am not quite sure how the function you send
> me 'statfun_diff.m' links with the 'freqstatistics.m,' and whether
> I do need to use it?

You just have to put it on your Matlab path somewhere, and you specify
cfg.statistic ='diff'
in freqstatistics. In general by specifying cfg.statistic='xxx', the
function statfun_xxx will be called. Please look in the function
statfun_diff.m to see how the statistic for each sample (=time-
frequency-channel point) is computed.

best regards,

   Send instant messages to your online friends http://uk.messenger.yahoo.com

 Inbox full of spam? Get leading spam protection and 1GB storage with All New Yahoo! Mail.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20061120/ac6faadb/attachment-0002.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: allsubjects.mat
Type: application/octet-stream
Size: 769060 bytes
Desc: 2990736193-allsubjects.mat
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20061120/ac6faadb/attachment-0004.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freqstatistics_test.m
Type: application/octet-stream
Size: 3928 bytes
Desc: 669505844-freqstatistics_test.m
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20061120/ac6faadb/attachment-0005.obj>

More information about the fieldtrip mailing list