<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Dear Julian,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Many thanks for getting back to me.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Sorry to bother you again but can I humbly request you to please have a look at the script below as I am unable to run this script. The script that is provided on the link defines 'data' as a simulation I believe, but I am trying out with one preprocessed real
 rat EEG data file (x.set) (I have little knowledge of programming), not sure how to define data and trials (can it take the number of trials from the file or do I need to mention):</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 10px; background-color: rgb(255, 255, 255); display: inline !important">cfg</span><span class="Apple-converted-space" style="margin: 0px; font-family: Helvetica; font-size: 10px; caret-color: rgb(0, 0, 0)"> 
      <span class="Apple-converted-space"> </span></span><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 10px; background-color: rgb(255, 255, 255); display: inline !important">= [];</span><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica; color: #a020f0">
<span style="color: #000000">load </span>data<span style="color: #000000"> </span>
=<span style="color: #000000"> </span>'x.set'<span style="color: #000000">;</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica; color: #a020f0">
<span style="color: #000000">filename = </span>'x.set'<span style="color: #000000">;</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica; color: #3c763d">
%cfg.numtrl = 100</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica; color: #3c763d">
%data <span class="Apple-converted-space">      </span>= ft_freqsimulation(cfg.data); % simulate some data</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica">dat = ft_read_data(filename,
<span style="color: #0000ff">...</span><span style="color: #3c763d">);</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica; color: #3c763d; min-height: 12.0px">
<span class="Apple-converted-space"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica">cfg<span class="Apple-converted-space">       
</span>= [];</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica">cfg.method = <span style="color: #a020f0">
'wavelet'</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica">cfg.toi<span class="Apple-converted-space">   
</span>= [-0.1 0.3];</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica">cfg.foi<span class="Apple-converted-space">   
</span>= [1 100];</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica">cfg.output = <span style="color: #a020f0">
'fourier'</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica">freq <span class="Apple-converted-space">
      </span>= ft_freqanalysis(cfg, data);</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica; min-height: 12.0px">
<span class="Apple-converted-space"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica; color: #3c763d">
% make a new FieldTrip-style data structure containing the ITC</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica; color: #3c763d">
% copy the descriptive fields over from the frequency decomposition</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica; color: #3c763d; min-height: 12.0px">
<span class="Apple-converted-space"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica">itc <span class="Apple-converted-space">
          </span>= [];</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica">itc.label <span class="Apple-converted-space">
    </span>= freq.label;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica">itc.freq<span class="Apple-converted-space">     
</span>= freq.freq;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica">itc.time<span class="Apple-converted-space">     
</span>= freq.time;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica">itc.dimord<span class="Apple-converted-space">   
</span>= <span style="color: #a020f0">'chan_freq_time'</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica; min-height: 12.0px">
<span class="Apple-converted-space"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica; min-height: 12.0px">
<span class="Apple-converted-space"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica; color: #3c763d">
<span style="color: #000000">F = freq.fourierspctrm; <span class="Apple-converted-space">
  </span></span>% copy the Fourier spectrum</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica">N = size(F,1);
<span class="Apple-converted-space">          </span><span style="color: #3c763d">% number of trials</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica; color: #3c763d; min-height: 12.0px">
<span class="Apple-converted-space"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica; color: #3c763d">
% compute inter-trial phase coherence (itpc)</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica">itc.itpc<span class="Apple-converted-space">     
</span>= F./abs(F); <span class="Apple-converted-space">        </span><span style="color: #3c763d">% divide by amplitude</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica">itc.itpc<span class="Apple-converted-space">     
</span>= sum(itc.itpc,1); <span class="Apple-converted-space">  </span><span style="color: #3c763d">% sum angles</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica; color: #3c763d">
<span style="color: #000000">itc.itpc<span class="Apple-converted-space">      </span>
= abs(itc.itpc)/N; <span class="Apple-converted-space">  </span></span>% take the absolute value and normalize</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica; color: #3c763d">
<span style="color: #000000">itc.itpc<span class="Apple-converted-space">      </span>
= squeeze(itc.itpc); </span>% remove the first singleton dimension</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica; color: #3c763d; min-height: 12.0px">
<span class="Apple-converted-space"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica; color: #3c763d">
% compute inter-trial linear coherence (itlc)</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica">itc.itlc<span class="Apple-converted-space">     
</span>= sum(F) ./ (sqrt(N*sum(abs(F).^2)));</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica; color: #3c763d">
<span style="color: #000000">itc.itlc<span class="Apple-converted-space">      </span>
= abs(itc.itlc); <span class="Apple-converted-space">    </span></span>% take the absolute value, i.e. ignore phase</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica; color: #3c763d">
<span style="color: #000000">itc.itlc<span class="Apple-converted-space">      </span>
= squeeze(itc.itlc); </span>% remove the first singleton dimension</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica; color: #3c763d; min-height: 12.0px">
<span class="Apple-converted-space"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica">figure</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica">subplot(2, 1, 1);</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica">imagesc(itc.time, itc.freq, squeeze(itc.itpc(1,:,:)));</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica">axis <span style="color: #a020f0">
xy</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica; color: #a020f0">
<span style="color: #000000">title(</span>'inter-trial phase coherence'<span style="color: #000000">);</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica">subplot(2, 1, 2);</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica">imagesc(itc.time, itc.freq, squeeze(itc.itlc(1,:,:)));</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica">axis <span style="color: #a020f0">
xy</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica; color: #a020f0">
<span style="color: #000000">title(</span>'inter-trial linear coherence'<span style="color: #000000">);</span></p>
<br class="Apple-interchange-newline">
Once again sorry to bother you,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thanks,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Jaishree</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> fieldtrip <fieldtrip-bounces@science.ru.nl> on behalf of Julian Keil <julian.keil@gmail.com><br>
<b>Sent:</b> Wednesday, 12 August 2020 5:28 PM<br>
<b>To:</b> FieldTrip discussion list <fieldtrip@science.ru.nl><br>
<b>Subject:</b> Re: [FieldTrip] ITC</font>
<div> </div>
</div>
<div class="" style="word-wrap:break-word; line-break:after-white-space">Dear Jaishree,
<div class=""><br class="">
</div>
<div class="">you can find information on how to compute ITC in FieldTrip here: <a href="http://www.fieldtriptoolbox.org/faq/itc/" class="">http://www.fieldtriptoolbox.org/faq/itc/</a></div>
<div class="">You should be able to read in the .set files using ft_read_data: <a href="http://www.fieldtriptoolbox.org/faq/dataformat/" class="">http://www.fieldtriptoolbox.org/faq/dataformat/</a></div>
<div class=""><br class="">
</div>
<div class="">Hope this helps,</div>
<div class=""><br class="">
</div>
<div class="">Julian</div>
<div class=""><br class="">
</div>
<div class="">
<div class="">
<div style="color:rgb(0,0,0); font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px">
________________<br class="">
Prof. Dr. Julian Keil<br class="">
<br class="">
Biological Psychology<br class="">
Olshausenstrasse 62 - R. 306<br class="">
24118 Kiel, Germany<br class="">
<br class="">
+49 - 0431 - 880 - 4872<br class="">
<a href="http://www.biopsych.uni-kiel.de/en" class="">http://www.biopsych.uni-kiel.de/en</a><br class="">
<br class="">
</div>
</div>
<div>
<blockquote type="cite" class="">
<div class="">Am 12.08.2020 um 04:56 schrieb Jaishree Jalewa <<a href="mailto:Jaishree.Jalewa@uon.edu.au" class="">Jaishree.Jalewa@uon.edu.au</a>>:</div>
<br class="x_Apple-interchange-newline">
<div class="">
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
Hi, Can I please request some help with performing ITC using Fieldtrip as I have no experience with it.<span class="x_Apple-converted-space"> </span><br class="">
I am willing to use preprocessed rat EEG data with multiple groups and conditions involved.  Can anyone please let me know how to load the .set files in order to run the Fieldtrip script.<br class="">
<br class="">
Any help will be much appreciated.<br class="">
Thanks,<br class="">
Jaishree<br class="">
</div>
<span class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">_______________________________________________</span><br class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<span class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">fieldtrip
 mailing list</span><br class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<a href="https://doi.org/10.1371/journal.pcbi.1002202" class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px">https://doi.org/10.1371/journal.pcbi.1002202</a></div>
</blockquote>
</div>
<br class="">
</div>
</div>
</body>
</html>