<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Dear Tony,<br>
<br>
I had a quick look at your code, and I think it is fine. However,
I would define neighbours purely based on the target sensor, not
on the reference, e.g. when computing cortico-muscular coherence
on channel level, you are interested in spatial clusters near the
cortex and not in cluster on the arm where the reference sensor
is. <br>
Also check out this:<br>
<pre class="bz_comment_text" id="comment_text_0">data = ft_checkdata(data, 'cmbrepresentation', 'full');</pre>
This will turn chancmb (Nx1) into chan X chan (RxS, where R*S = N).<br>
<br>
Best,<br>
Jörn<br>
<br>
On 5/8/2013 11:17 PM, Antony Passaro wrote:<br>
</div>
<blockquote
cite="mid:CAB8wAYQXFAY51_aK+5jRP58xC=9F6zik_qmpLKH-2fZJv=hovw@mail.gmail.com"
type="cite">
<div class="gmail_quote">
<div>Hi Fieldtrippers,</div>
<div> </div>
<div>I am trying to perform a group-level comparison of 2
conditions across 10 subjects based on the DTF connectivity.
For the time being, we are looking at the DTF for a subset of
frequencies (alpha) and choosing the avgoverfreq option which
gives us a 4096 x 1 matrix since we are looking at 64 x 64
channels. Using ft_freqstatistics, I noticed that it will
throw an error explaining that there is not yet an
implementation for data with channelcmb for a cluster analysis
so I took it upon myself to identify channel pairs which
should be considered neighbors and build a new neighbor
structure prior to running ft_freqstatistics. To do that, I
took the basic neighbor structure for 64 channels and then
created a new neighbor structure of 4096 channel pairs based
on the code below:</div>
<div> </div>
<div><span
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;DISPLAY:inline!important;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;FLOAT:none;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">for
i=1:4096</span><br
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">
<span
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;DISPLAY:inline!important;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;FLOAT:none;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">
label{i,1} = [dtf.</span><span
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;DISPLAY:inline!important;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;FLOAT:none;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">labelcmb{i,1},'_',</span><span
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;DISPLAY:inline!important;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;FLOAT:none;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">dtf.labelcmb{i,2}];</span><br
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">
<span
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;DISPLAY:inline!important;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;FLOAT:none;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">end</span><br
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">
</div>
<div> </div>
<div>labelcmb = dtf.labelcmb;</div>
<div><br style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">
<span
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;DISPLAY:inline!important;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;FLOAT:none;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">chans=64;</span><br
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">
</div>
<div> </div>
<div>%Identify the channel pairs which are neighbors with the
target channel<br
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">
<span
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;DISPLAY:inline!important;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;FLOAT:none;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">NBtarget
= {};</span><br
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">
<span
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;DISPLAY:inline!important;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;FLOAT:none;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">for
ch=1:chans^2</span><br
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">
<span
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;DISPLAY:inline!important;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;FLOAT:none;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">
NBtarget(ch).label = label{ch};<span> </span></span><br
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">
<span
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;DISPLAY:inline!important;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;FLOAT:none;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">
target = find(cellfun(@(x) strcmp(labelcmb{ch,1},x),{</span><span
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;DISPLAY:inline!important;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;FLOAT:none;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">neighbours(:).label})
==1) ;</span><br
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">
<span
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;DISPLAY:inline!important;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;FLOAT:none;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">
tempnb = cellfun(@(x) strcat(x,['_'
labelcmb{ch,2}]),{neighbours(</span><span
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;DISPLAY:inline!important;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;FLOAT:none;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">1,target).neighblabel},'</span><span
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;DISPLAY:inline!important;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;FLOAT:none;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">UniformOutput',0);</span><br
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">
<span
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;DISPLAY:inline!important;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;FLOAT:none;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">
NBtarget(ch).neighblabel = tempnb{:};</span><br
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">
<span
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;DISPLAY:inline!important;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;FLOAT:none;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">end</span><br
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">
</div>
<div><br style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">
%Identify the channel pairs which are neighbors with the
reference channel<br
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">
<span
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;DISPLAY:inline!important;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;FLOAT:none;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">NBref
= {};</span><br
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">
<span
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;DISPLAY:inline!important;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;FLOAT:none;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">for
ch=1:chans^2</span><br
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">
<span
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;DISPLAY:inline!important;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;FLOAT:none;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">
NBref(ch).label = label{ch};<span> </span></span><br
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">
<span
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;DISPLAY:inline!important;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;FLOAT:none;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">
target = find(cellfun(@(x) strcmp(labelcmb{ch,2},x),{</span><span
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;DISPLAY:inline!important;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;FLOAT:none;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">neighbours(:).label})
==1) ;</span><br
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">
<span
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;DISPLAY:inline!important;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;FLOAT:none;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">
tempnb = cellfun(@(x) strcat([labelcmb{ch,1}
'_'],x),{neighbours(1,target).</span><span
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;DISPLAY:inline!important;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;FLOAT:none;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">neighblabel},'UniformOutput',</span><span
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;DISPLAY:inline!important;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;FLOAT:none;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">0);</span><br
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">
<span
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;DISPLAY:inline!important;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;FLOAT:none;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">
NBref(ch).neighblabel = tempnb{:};</span><br
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">
<span
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;DISPLAY:inline!important;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;FLOAT:none;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">end</span><br
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">
<br style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">
<br style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">
%Append both sets of neighbors (ref and target)</div>
<div><span
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;DISPLAY:inline!important;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;FLOAT:none;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">NBboth=
{};</span><br
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">
<span
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;DISPLAY:inline!important;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;FLOAT:none;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">for
ch=1:chans^2</span><br
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">
<span
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;DISPLAY:inline!important;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;FLOAT:none;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">
NBboth(ch).label = label{ch};<span> </span></span><br
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">
<span
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;DISPLAY:inline!important;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;FLOAT:none;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">
NBboth(ch).neighblabel = [NBref(ch).neighblabel;
NBtarget(ch).neighblabel];</span><br
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">
<span
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;DISPLAY:inline!important;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;FLOAT:none;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">end</span></div>
<div><span
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;DISPLAY:inline!important;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;FLOAT:none;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px"></span> </div>
<div><span
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;DISPLAY:inline!important;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;FLOAT:none;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px"></span> </div>
<div><span
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;DISPLAY:inline!important;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;FLOAT:none;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">This
seems to work and the clustering method proceeds without
error. My question is the following: is this the proper way
to utilize the clustering method using ft_freqstatistics on
connectivity data or am I missing something?</span></div>
<div><span
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;DISPLAY:inline!important;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;FLOAT:none;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px"></span> </div>
<div><span
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;DISPLAY:inline!important;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;FLOAT:none;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">Thanks,</span></div>
<div><span
style="TEXT-TRANSFORM:none;TEXT-INDENT:0px;DISPLAY:inline!important;FONT:12px
arial,sans-serif;WHITE-SPACE:normal;FLOAT:none;LETTER-SPACING:normal;COLOR:rgb(34,34,34);WORD-SPACING:0px">-Tony</span></div>
</div>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
fieldtrip mailing list
<a class="moz-txt-link-abbreviated" href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a>
<a class="moz-txt-link-freetext" href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a></pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Jörn M. Horschig
PhD Student
Donders Institute for Brain, Cognition and Behaviour
Centre for Cognitive Neuroimaging
Radboud University Nijmegen
Neuronal Oscillations Group
FieldTrip Development Team
P.O. Box 9101
NL-6500 HB Nijmegen
The Netherlands
Contact:
E-Mail: <a class="moz-txt-link-abbreviated" href="mailto:jm.horschig@donders.ru.nl">jm.horschig@donders.ru.nl</a>
Tel: +31-(0)24-36-68493
Web: <a class="moz-txt-link-freetext" href="http://www.ru.nl/donders">http://www.ru.nl/donders</a>
Visiting address:
Trigon, room 2.30
Kapittelweg 29
NL-6525 EN Nijmegen
The Netherlands</pre>
</body>
</html>