<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
 namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="PersonName"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
h1
        {margin-top:12.0pt;
        margin-right:0in;
        margin-bottom:3.0pt;
        margin-left:0in;
        page-break-after:avoid;
        font-size:12.0pt;
        font-family:"Times New Roman";
        font-weight:bold;}
h2
        {margin-top:12.0pt;
        margin-right:0in;
        margin-bottom:3.0pt;
        margin-left:0in;
        page-break-after:avoid;
        font-size:12.0pt;
        font-family:"Times New Roman";
        font-weight:bold;
        font-style:italic;}
h3
        {margin-top:12.0pt;
        margin-right:0in;
        margin-bottom:3.0pt;
        margin-left:0in;
        line-height:200%;
        page-break-after:avoid;
        font-size:12.0pt;
        font-family:"Times New Roman";
        font-weight:bold;}
p.MsoToc5, li.MsoToc5, div.MsoToc5
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Times New Roman";
        font-style:italic;}
p.MsoBodyText, li.MsoBodyText, div.MsoBodyText
        {margin-top:0in;
        margin-right:0in;
        margin-bottom:6.0pt;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
p
        {mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman";}
p.JMsstyle01, li.JMsstyle01, div.JMsstyle01
        {margin:0in;
        margin-bottom:.0001pt;
        line-height:200%;
        font-size:12.0pt;
        font-family:"Times New Roman";
        font-weight:bold;}
p.JMsstyle02, li.JMsstyle02, div.JMsstyle02
        {margin:0in;
        margin-bottom:.0001pt;
        line-height:200%;
        font-size:12.0pt;
        font-family:"Times New Roman";
        font-style:italic;}
p.JMsstyle03, li.JMsstyle03, div.JMsstyle03
        {margin:0in;
        margin-bottom:.0001pt;
        text-align:justify;
        line-height:200%;
        font-size:12.0pt;
        font-family:"Times New Roman";
        font-weight:bold;
        font-style:italic;}
span.EmailStyle23
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Dear Lorina,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>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):<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Cfg.method = ‘montecarlo’;<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Cfg.statistic = ‘diff’;<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Cfg.parameter = ‘powerspctrm’;
%these contain coherences in reality, right?<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Cfg.numrandomization = something;<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Cfg.design = dependent on your input data;<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Cfg.ivar = 1; %put condition in the first
row of your desing-matrix<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Cfg.uvar = 2; %put the subject-index on
the second row<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>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.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>For j = 1:length(dataBlabla.label)<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>  Cfg.neighbours{j}.label =
dataBlabla.label{j};<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>  Cfg.neighbours{j}.neighblabel = {};<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>End<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>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)<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>At least it should run through if you
call:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Stat = freqstatistics(cfg, dataS1C1,
dataS1C2, dataS2C1 etc)<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Yours,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Jan-Mathijs<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> <st1:PersonName
w:st="on">FieldTrip discussion list</st1:PersonName>
[mailto:FIELDTRIP@NIC.SURFNET.NL] <b><span style='font-weight:bold'>On Behalf Of
</span></b>Lorina Naci<br>
<b><span style='font-weight:bold'>Sent:</span></b> Friday, November 10, 2006
6:41 PM<br>
<b><span style='font-weight:bold'>To:</span></b> FIELDTRIP@NIC.SURFNET.NL<br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [FIELDTRIP]
Within-subject coherence statististics for virtual sources</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Hi Robert,<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>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:<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>"Could not determine type of input data" which leads me to
believe there is a problem with the converted data.<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><br>
I am also attaching my script for freqstatistics in case you need to see this
file.<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Very many thanks for your help,<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Lorina<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> <o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><br>
<st1:PersonName w:st="on"><b><i><span style='font-weight:bold;font-style:italic'>Robert
 Oostenveld</span></i></b></st1:PersonName><b><i><span style='font-weight:bold;
font-style:italic'> <r.oostenveld@FCDONDERS.RU.NL></span></i></b> wrote:<o:p></o:p></span></font></p>

</div>

<blockquote style='border:none;border-left:solid #1010FF 1.5pt;padding:0in 0in 0in 4.0pt;
margin-left:3.75pt;margin-top:5.0pt;margin-bottom:5.0pt'>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Hi Lorina<br>
<br>
On 8 Nov 2006, at 20:00, Lorina Naci wrote:<br>
> I tried to run the script as you suggested but it did not work. The <br>
> error message I get is to do with<br>
> [stat] = statistics_wrapper(cfg, varargin{:}). It just gives me an <br>
> error message pointing to this line,saying: error using <br>
> fieldtrip-20061003/private/statistics_wrapper, could not determine <br>
> the type of input data.<br>
<br>
Then it means that the data structure that you have obtained from <br>
besa2fieldtrip is not recognized. It is also not clear to me how your <br>
data looks like (i.e. as a Matlab structure). It is virtual channel <br>
data, time-frequency analyzed, and then single trial coherences <br>
computed?<br>
<br>
Could you show the output that you get on screen after<br>
<br>
dataA = besa2fieldtrip('filenameA.tfc') % i.e. without semicolon, <br>
to show the output on screen<br>
dataB = besa2fieldtrip('filenameB.tfc') % i.e. without semicolon, <br>
to show the output on screen<br>
<br>
> Also, the function 'cfg.numrandomization' requires a number, but I <br>
> am not sure what the choice of the number depends on? I've inputed <br>
> 500 as in the documentation example.<br>
<br>
That is the number of resamplings that is used to construct the <br>
reference distribution, 500 should be fine.<br>
<br>
> Finally, at risk making my ignorance of how Fieldtrip works <br>
> entirely transparent, I am not quite sure how the function you send <br>
> me 'statfun_diff.m' links with the 'freqstatistics.m,' and whether <br>
> I do need to use it?<br>
<br>
You just have to put it on your Matlab path somewhere, and you specify<br>
cfg.statistic ='diff'<br>
in freqstatistics. In general by specifying cfg.statistic='xxx', the <br>
function statfun_xxx will be called. Please look in the function <br>
statfun_diff.m to see how the statistic for each sample (=time- <br>
frequency-channel point) is computed.<br>
<br>
best regards,<br>
Robert<o:p></o:p></span></font></p>

</blockquote>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>

<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'> Send
instant messages to your online friends http://uk.messenger.yahoo.com <o:p></o:p></span></font></p>

</div>

</body>

</html>