<html>
  <head>

  </head>
  <body style="font-variant: normal; margin-right: 4px; line-height: normal; margin-left: 4px; margin-top: 4px; margin-bottom: 1px" text="#000000" bgcolor="#FFFFFF">
    <p style="margin-bottom: 0; margin-top: 0">
      <font face="Dialog" size="2">Hi Jörn,</font>    </p>
<br>      
    <p style="margin-bottom: 0; margin-top: 0">
      <font face="Dialog" size="2">thanks a lot for your response. I meanwhile checked some possible reasons for the different clusterings and I am coming closer. </font>    </p>
    <p style="margin-bottom: 0; margin-top: 0">
      <font face="Dialog" size="2">I could reproduce the described error with two different datasets (62 channel and 29 channel EEG), on two different computers and with two different versions of fieldtrip (2011 versions).  First of all, I checked the neighbourhood structures. They are identical in my two analyses - same number of electrodes, same order, same neighbours. I checked that before and after entering neighbours into the analyses (by comparing the stat.cfg.neighbours) - they are the same.</font>    </p>
    <p style="margin-bottom: 0; margin-top: 0">
      <font face="Dialog" size="2">I then searched through the code and found the channeighbstructmat that is constructed during the call of "clusterstat.m". I saved these matrices during the call of ft_freqstatistics and found that, with the same neighbourhood structures, the channeighbstructmat looked  completely different in the old and new version. I then changed the code of the new FT "clusterstat.m" so that it reads in the channeighbstructmat obtained with the old FT version - then everything works perfect.</font>    </p>
<br>      
    <p style="margin-bottom: 0; margin-top: 0">
      <font face="Dialog" size="2">Thus, the problem is most likely an incorrect channeighbstructmat. I figured out that in my case, FT calls an SPM8 function spm_bwlabeln during construction of the channeighbstructmat, which older version do not do. However, if I understood the code correctly, the SPM function should only be called for source data?! Could it be that, because my data is a 4D grand-average structure ( dimord: 'subj_chan_freq_time'), FT assumes source data?</font>    </p>
<br>      
    <p style="margin-bottom: 0; margin-top: 0">
      <font face="Dialog" size="2">Thanks again for your help,</font>    </p>
    <p style="margin-bottom: 0; margin-top: 0">
      <font face="Dialog" size="2">Gregor</font>    </p>
<br>      
    <p style="margin-bottom: 0; margin-top: 0">
      <font face="Dialog" size="2"> </font><br><br><font face="Dialog" STYLE="font-size: 10pt"><br>--  <BR>Dr. rer. nat. Gregor Volberg <gregor.volberg@psychologie.uni-regensburg.de> ( mailto:gregor.volberg@psychologie.uni-regensburg.de ) <BR>University of Regensburg <BR>Institute for Experimental Psychology <BR>93040 Regensburg, Germany <BR>Tel: +49 941 943 3862  <BR>Fax: +49 941 943 3233 <BR><a href="http://www.psychologie.uni-regensburg.de/Greenlee/team/volberg/volberg.html ">http://www.psychologie.uni-regensburg.de/Greenlee/team/volberg/volberg.html </a><BR><br><br></font>>>> "Jörn M. Horschig"<jm.horschig@donders.ru.nl> 11/9/2011 4:00 PM >>><br>Hi Gregor,<br><br>did you check your neighbourselection? Maybe something is going wrong there, given that a lot in this code has changed since 2010. Could you check that using ft_neighbourplot? This would be the most logical explanation why the results differ. It does not really make sense that these three sensors form one cluster, because they should not be neighbours of each other. So i would suppose that something is going wrong there.<br><br>Best,<br>Jörn<br><br><br>On 11/3/2011 4:57 PM, Michael Wibral wrote:    </p>
    <blockquote type="cite" cite="mid:362958968.59435.1320335856835.JavaMail.fmail@mwmweb078">
      <p style="margin-bottom: 0; margin-top: 0">
        Hi Gregor,<br><br>in principle the first level statistics that determine cluster membership (and thereby cluster shapes etc.)  can also vary from one set of permutations to the next, esp. on the borders of a cluster (this is why it is typically said that the localization of a cluster is not as trustworthy as its existence). Other resaons for differences are differing number of permutations - did you set everything the same?<br><br>This said there might well be another problem - I hope the cluster people can have a look into it.<br><br>Best ,<br>Michael<br><br><br>      </p>
      <blockquote style="margin-left: 5px; padding-left: 5px; border-left: 2px solid blue; padding-top: 5px">
        <p style="margin-bottom: 0; margin-top: 0">
          <hr>
          <b>Von:</b> "Gregor Volberg" <a class="moz-txt-link-rfc2396E" href="mailto:Gregor.Volberg@psychologie.uni-regensburg.de"><Gregor.Volberg@psychologie.uni-regensburg.de></a><br><b>Gesendet:</b> Nov 2, 2011 6:34:43 PM<br><b>An:</b> <a class="moz-txt-link-abbreviated" href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br><b>Betreff:</b> [FieldTrip] Wrong clustering of electrodes in newer FT versions?<br><br>        </p>
        <div style="font-variant: normal; margin-right: 4px; line-height: normal; margin-left: 4px; margin-top: 4px; margin-bottom: 1px">
          <p style="margin-bottom: 0; margin-top: 0">
            <font face="Dialog" size="2">Dear fieldtrip community,</font>          </p>
          <p style="margin-bottom: 0; margin-top: 0">
            <br>
                      </p>
          <p style="margin-bottom: 0; margin-top: 0">
            <font face="Dialog" size="2">I just encountered an unexpected behavior of FT that I would like to share with the list. It is that the cluster permutation test formed incorrect clusters from a given set of significant electrodes in newer FT versions (ft-20111012; I also tried with ft-20111028). </font>          </p>
          <p style="margin-bottom: 0; margin-top: 0">
            <br>
                      </p>
          <p style="margin-bottom: 0; margin-top: 0">
            <font face="Dialog" size="2">For example, when using an old ft version (ft-20100810)  and freqstatistics I get a negative cluster with 17 contiguous electrodes. With the newer ft version, using the same data and the same cfg, three significant  electrodes that are spatially contiguous to the other significant electrodes are not included in the cluster. Also, three electrodes that are spatially seperated and are actually part of the first cluster are grouped into a separate cluster.  I attached a picture with the respective clusterplots where differences are marked with red arrows.</font>          </p>
          <p style="margin-bottom: 0; margin-top: 0">
            <font face="Dialog" size="2"> </font>          </p>
          <p style="margin-bottom: 0; margin-top: 0">
            <font face="Dialog" size="2">I am aware that the permutation p-value for a given cluster can be different in two separate analyses, but the grouping of significant electrodes into clusters should always be the same, am i right? I double-checked the cfg.neighbours, after conversion to new 'struct' style, and they were identical in the "old ft" and "new ft"  analysis. Also, the stat.stat field and the stat.cfg.clustercritval were the same for both analyses. Thus, the same neighbourhood relations and the same significant electrodes should be used for grouping. Yet I get different results... </font>          </p>
          <p style="margin-bottom: 0; margin-top: 0">
            <br>
                      </p>
          <p style="margin-bottom: 0; margin-top: 0">
            <font face="Dialog" size="2">I am almost sure that this is trivial, but I could not yet replicate my old results with new FT and this makes me nervous. Has someone made a similar experience? Or do newer versions of ft use some further information besides cfg.neighbours for clustering, somewhere in the *cfg.previuous perhaps, that I am not aware of? Any comments are highly welcome.</font>          </p>
          <p style="margin-bottom: 0; margin-top: 0">
            <br>
                      </p>
          <p style="margin-bottom: 0; margin-top: 0">
            <font face="Dialog" size="2">Best regards,</font>          </p>
          <p style="margin-bottom: 0; margin-top: 0">
            <font face="Dialog" size="2">Gregor</font>          </p>
          <p style="margin-bottom: 0; margin-top: 0">
            <br>
                      </p>
          <p style="margin-bottom: 0; margin-top: 0">
            <font face="Dialog" size="2">cfg = [];</font>          </p>
          <p style="margin-bottom: 0; margin-top: 0">
            <font face="Dialog" size="2">cfg.neighbours    = neighbours;</font>          </p>
          <p style="margin-bottom: 0; margin-top: 0">
            <font face="Dialog" size="2">cfg.minnbchan=1;</font>          </p>
          <p style="margin-bottom: 0; margin-top: 0">
            <font face="Dialog" size="2">cfg.avgoverfreq   = 'yes';</font>          </p>
          <p style="margin-bottom: 0; margin-top: 0">
            <font face="Dialog" size="2">cfg.avgovertime   = 'yes';</font>          </p>
          <p style="margin-bottom: 0; margin-top: 0">
            <font face="Dialog" size="2">cfg.method        = 'montecarlo';</font>          </p>
          <p style="margin-bottom: 0; margin-top: 0">
            <font face="Dialog" size="2">cfg.correctm       = 'cluster';</font>          </p>
          <p style="margin-bottom: 0; margin-top: 0">
            <font face="Dialog" size="2">cfg.statistic     = 'depsamplesT';</font>          </p>
          <p style="margin-bottom: 0; margin-top: 0">
            <font face="Dialog" size="2">cfg.tail          = 0;</font>          </p>
          <p style="margin-bottom: 0; margin-top: 0">
            <font face="Dialog" size="2">cfg.alpha         = 0.05;</font>          </p>
          <p style="margin-bottom: 0; margin-top: 0">
            <font face="Dialog" size="2">cfg.clusteralpha = 0.05;</font>          </p>
          <p style="margin-bottom: 0; margin-top: 0">
            <font face="Dialog" size="2">cfg.numrandomization = 1000;</font>          </p>
          <p style="margin-bottom: 0; margin-top: 0">
            <font face="Dialog" size="2">cfg.design = [[1:14 1:14]; [zeros(1,14)+1 zeros(1,14)+2]];</font>          </p>
          <p style="margin-bottom: 0; margin-top: 0">
            <font face="Dialog" size="2">cfg.uvar          = 1;</font>          </p>
          <p style="margin-bottom: 0; margin-top: 0">
            <font face="Dialog" size="2">cfg.ivar          = 2;</font>          </p>
          <p style="margin-bottom: 0; margin-top: 0">
            <font face="Dialog" size="2">cfg.latency       = [2.24 2.53];</font>          </p>
          <p style="margin-bottom: 0; margin-top: 0">
            <font face="Dialog" size="2">cfg.frequency     = [17 21];%</font>          </p>
          <p style="margin-bottom: 0; margin-top: 0">
            <font face="Dialog" size="2">stat = ft_freqstatistics(cfg, DC, TC);</font>          </p>
          <p style="margin-bottom: 0; margin-top: 0">
            <br>
            <SPAN STYLE='style="font-size: 10pt" FONT-FAMILY:"Dialog" ;FONT-SIZE:"10pt"'>--<br style="font-size: 10pt; font-family: Dialog">Dr. rer. nat. Gregor Volberg <a class="moz-txt-link-rfc2396E" href="mailto:gregor.volberg@psychologie.uni-regensburg.de"><gregor.volberg@psychologie.uni-regensburg.de></a> ( <a class="moz-txt-link-freetext" href="mailto:gregor.volberg@psychologie.uni-regensburg.de">mailto:gregor.volberg@psychologie.uni-regensburg.de</a> )<br style="font-size: 10pt; font-family: Dialog">University of Regensburg<br style="font-size: 10pt; font-family: Dialog">Institute for Experimental Psychology<br style="font-size: 10pt; font-family: Dialog">93040 Regensburg, Germany<br style="font-size: 10pt; font-family: Dialog">Tel: +49 941 943 3862<br style="font-size: 10pt; font-family: Dialog">Fax: +49 941 943 3233<br style="font-size: 10pt; font-family: Dialog"><a moz-do-not-send="true" href="http://www.psychologie.uni-regensburg.de/Greenlee/team/volberg/volberg.html%0A">http://www.psychologie.uni-regensburg.de/Greenlee/team/volberg/volberg.html </a></SPAN><br><br>           </p>
        </div>
      </blockquote>
      <p style="margin-bottom: 0; margin-top: 0">
        <br>
        <fieldset class="mimeAttachmentHeader">
        </fieldset>
        <br>
              </p>
      <pre wrap=""><p style="white-space: pre; margin-bottom: 0; margin-top: 0" wrap="">
_______________________________________________</p>
    <p style="white-space: pre; margin-bottom: 0; margin-top: 0">
fieldtrip mailing list</p>
  <p style="white-space: pre; margin-bottom: 0; margin-top: 0">
<a class="moz-txt-link-abbreviated" href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a></p>
<p style="white-space: pre; margin-bottom: 0; margin-top: 0">
<a class="moz-txt-link-freetext" href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a></p>
</pre>
</blockquote>
<p style="margin-bottom: 0; margin-top: 0">
<br>
<br>
</p>
<pre class="moz-signature" cols="72"><p style="white-space: pre; margin-top: 0; margin-bottom: 0" class="moz-signature" cols="72">
-- </p>
<p style="white-space: pre; margin-bottom: 0; margin-top: 0">
Jörn M. Horschig</p>
<p style="white-space: pre; margin-bottom: 0; margin-top: 0">
PhD Student</p>
<p style="white-space: pre; margin-bottom: 0; margin-top: 0">
Donders Institute for Brain, Cognition and Behaviour </p>
<p style="white-space: pre; margin-bottom: 0; margin-top: 0">
Centre for Cognitive Neuroimaging</p>
<p style="white-space: pre; margin-bottom: 0; margin-top: 0">
Radboud University Nijmegen </p>
<p style="white-space: pre; margin-bottom: 0; margin-top: 0">
Neuronal Oscillations Group</p>
<br>
<p style="white-space: pre; margin-bottom: 0; margin-top: 0">
P.O. Box 9101</p>
<p style="white-space: pre; margin-bottom: 0; margin-top: 0">
NL-6500 HB Nijmegen</p>
<p style="white-space: pre; margin-bottom: 0; margin-top: 0">
The Netherlands</p>
<br>
<p style="white-space: pre; margin-bottom: 0; margin-top: 0">
Contact:</p>
<p style="white-space: pre; margin-bottom: 0; margin-top: 0">
E-Mail: <a class="moz-txt-link-abbreviated" href="mailto:jm.horschig@donders.ru.nl">jm.horschig@donders.ru.nl</a></p>
<p style="white-space: pre; margin-bottom: 0; margin-top: 0">
Tel:    +31-(0)24-36-68493</p>
<p style="white-space: pre; margin-bottom: 0; margin-top: 0">
Web: <a class="moz-txt-link-freetext" href="http://www.ru.nl/donders">http://www.ru.nl/donders</a></p>
<br>
<p style="white-space: pre; margin-bottom: 0; margin-top: 0">
Visiting address:</p>
<p style="white-space: pre; margin-bottom: 0; margin-top: 0">
Trigon, room 2.30</p>
<p style="white-space: pre; margin-bottom: 0; margin-top: 0">
Kapittelweg 29</p>
<p style="white-space: pre; margin-bottom: 0; margin-top: 0">
NL-6525 EN Nijmegen</p>
<p style="white-space: pre; margin-bottom: 0; margin-top: 0">
The Netherlands</p>
</pre>
</body>
</html>