<div dir="ltr">Hi everyone,<div><br></div><div>I posted a comment on the error 3058 <a href="http://bugzilla.fieldtriptoolbox.org/show_bug.cgi?id=3058" target="_blank" style="font-size:12.8px">http://bugzilla.fieldtriptoolbox.org/show_bug.cgi?id=3058</a> about the cross correlation tutorial on spike data</div><div><br></div><div>But I copy and paste what I did also here, maybe someone could be intrested as well</div><div><br></div><div><div>(In reply to Danial Arabali from comment #0)</div><div>Hi Danial,</div><div><br></div><div>I'm stuck exactly at your point with the same error.</div><div><br></div><div>Today I tried to do some detective work because I think the first error is at the line 138:</div><div><br></div><div><i>chansel    = unique(cmbindx(:)); % get the unique channels</i></div><div><br></div><div><br></div><div>because it takes also the value 0 as index for channels.</div><div><br></div><div>So i corrected like:</div><div><br></div><div><i>chansel    = unique(cmbindx(:)); % get the unique channels</i></div><div><i>chansel    = chansel(chansel~=0); % remove zeros</i></div><div><br></div><div>and the script works fine to the end, but the output is different: infact I don't get the instruction at line 133</div><div><br></div><div><i>for k=1:size(cfg.channelcmb,1)</i></div><div><i>  cmbindx(k,1) = strmatch(cfg.channelcmb(k,1), spike.label, 'exact');</i></div><div><i>  cmbindx(k,2) = strmatch(cfg.channelcmb(k,2), spike.label, 'exact');</i></div><div><i>end</i></div><div><br></div><div>Why does it is set to search for only two channels if we specified 4 channels? (<i>cfg.spikechannel = {'sig001U_wf', 'sig002U_wf', 'sig003U_wf', 'sig004U_wf'}; % select only the MUA</i>)</div><div><br></div><div>Maybe the instruction at this point should be something like this </div><div><br></div><div><i>for k=1:size(cfg.channelcmb,1)</i></div><div><i>        for c=1:length(spike.label)</i></div><div><i>         cmbindx(k,c) = strmatch(cfg.channelcmb(k,c), spike.label, 'exact');</i></div><div><i>        end</i></div><div><i>end</i></div><div><br></div><div><br></div><div>Anyway, I tried this solution and the output is of the right size now (xcorr: [4x4x400 double] instead of xcorr: [2x2x400 double]), but I don't think the content is right.</div><div><br></div><div>The last test I did was to select only the channels 3 and 4</div><div><br></div><div><i>cfg.spikechannel = { 'sig003U_wf', 'sig004U_wf'}; % select only the MUA</i></div><div><br></div><div>and run the original script with only the first modified instruction</div><div><br></div><div><i>chansel    = unique(cmbindx(:)); % get the unique channels</i></div><div><i>chansel    = chansel(chansel~=0); % remove zeros</i></div><div><br></div><div>Then I followed the second part of the tutorial </div><div><br></div><div><i>% compute the shuffled correlogram</i></div><div><i>cfg.method      = 'shiftpredictor'; % compute the shift predictor</i></div><div><i>Xshuff = ft_spike_xcorr(cfg,spikeTrials);</i></div><div><i><br></i></div><div><i>iCmb = 3;</i></div><div><i>jCmb = 4;</i></div><div><i>figure</i></div><div><i>xcSmoothed = conv(squeeze(Xc.xcorr(iCmb,jCmb,:)),ones(1,5)./5,'same'); % do some smoothing</i></div><div><i>hd = plot(Xc.time(3:end-2),xcSmoothed(3:end-2),'k'); % leave out borders (because of smoothing)</i></div><div><i>hold on</i></div><div><i>xcSmoothed = conv(squeeze(Xshuff.shiftpredictor(iCmb,jCmb,:)),ones(1,5)./5,'same');    </i></div><div><i>plot(Xc.time(3:end-2),xcSmoothed(3:end-2),'r')</i></div><div><i>hold on</i></div><div><i>xlabel('delay')</i></div><div><i>ylabel('proportion of coincidences')        </i></div><div><i>title([Xc.label{iCmb} Xc.label{jCmb}])</i></div><div><i>axis tight</i></div><div><br></div><div><br></div><div><br></div><div>And I just changed </div><div><i>iCmb = 3;</i></div><div><i>jCmb = 4;</i></div><div>in </div><div><i>iCmb = 1;</i></div><div><i>jCmb = 2;</i></div><div><br></div><div>And I got exactly the same figure output of the tutorial.</div><div><br></div><div>I hope this can be a little help for the work</div><div><br></div><div><br></div><div>Valentina</div></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-02-20 12:49 GMT+01:00 Schoffelen, J.M. (Jan Mathijs) <span dir="ltr"><<a href="mailto:jan.schoffelen@donders.ru.nl" target="_blank">jan.schoffelen@donders.ru.nl</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div style="word-wrap:break-word">
Hi Valentina,
<div><br>
</div>
<div>Danial Arabali (in BCC) has also encountered this, and filed a bug on <a href="http://bugzilla.fieldtriptoolbox.org" target="_blank">
bugzilla.fieldtriptoolbox.org</a>, as bug 3058. Perhaps you could create yourself an account, add yourself on the CC-list of this bug, and team up with Danial to do some extra detective work. You seem to be on the right track, with respect to your debugging
 attempt. I suspect it’s probably relatively easy to solve. Note that the error relating to the issue in ft_checkconfig has been fixed in the current version of the code, that can be easily obtained from
<a href="http://github.com/fieldtrip" target="_blank">github.com/fieldtrip</a></div>
<div><br>
</div>
<div>The ft_checkconfig bug is referenced here:</div>
<div><br>
</div>
<div><a href="http://bugzilla.fieldtriptoolbox.org/show_bug.cgi?id=3062" target="_blank">http://bugzilla.fieldtriptoolbox.org/show_bug.cgi?id=3062</a></div>
<div><br>
</div>
<div>The current issue is referenced here:</div>
<div><br>
</div>
<div><a href="http://bugzilla.fieldtriptoolbox.org/show_bug.cgi?id=3058" target="_blank">http://bugzilla.fieldtriptoolbox.org/show_bug.cgi?id=3058</a></div>
<div><br>
</div>
<div>Best,</div>
<div>Jan-Mathijs</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
<div><div><div class="h5">
<div>On Feb 19, 2016, at 6:17 PM, Valentina Mione <<a href="mailto:valentina.mione@uniroma1.it" target="_blank">valentina.mione@uniroma1.it</a>> wrote:</div>
<br>
</div></div><blockquote type="cite"><div><div class="h5">
<div dir="ltr">Hi everyone,
<div><br>
</div>
<div>I am Valentina and I am a fresh new FieldTrip user.</div>
<div><br>
</div>
<div>I was following the tutorial <a href="http://www.fieldtriptoolbox.org/tutorial/spike" target="_blank">http://www.fieldtriptoolbox.org/tutorial/spike</a>, in particular the cross correlation part with the example data <a href="ftp://ftp.fieldtriptoolbox.org/pub/fieldtrip/tutorial/spike/p029_sort_final_01.nex" target="_blank">ftp://ftp.fieldtriptoolbox.org/pub/fieldtrip/tutorial/spike/p029_sort_final_01.nex</a>,
 but I'm stuck with a MatLab error.</div>
<div><br>
</div>
<div>I loaded the data exactly how it's explained and I defined the channels and the trials (just copying the matlab instructions) and all worked fine.</div>
<div><br>
</div>
<div>Then I followed this part of the tutorial:</div>
<div><br>
</div>
<div> <span style="font-family:Calibri,Geneva,Arial,Verdana,sans-serif;font-size:15px;line-height:22.5px;text-align:justify"><i>and then compute the cross-correlogram (and the shift-predictor cross-correlogram) by</i></span></div>
<div>
<pre style="padding:0.5em;margin-top:0px;margin-bottom:1em;font-size:12px;border:1px dashed rgb(204,204,204);overflow:hidden;font-family:Consolas,'Andale Mono',Menlo,Monaco,monospace;white-space:pre-wrap;width:640px;text-align:justify;background-color:rgb(247,249,250)">cfg             = <span style="padding:0px;margin:0px;color:rgb(102,204,102)">[</span><span style="padding:0px;margin:0px;color:rgb(102,204,102)">]</span>;
cfg.<span style="padding:0px;margin:0px;color:rgb(0,102,0)">maxlag</span>      = <span style="padding:0px;margin:0px;color:rgb(204,102,204)">0.2</span>; <span style="padding:0px;margin:0px;color:rgb(128,128,128);font-style:italic">% maximum 200 ms</span>
cfg.<span style="padding:0px;margin:0px;color:rgb(0,102,0)">binsize</span>     = <span style="padding:0px;margin:0px;color:rgb(204,102,204)">0.001</span>; <span style="padding:0px;margin:0px;color:rgb(128,128,128);font-style:italic">% bins of 1 ms</span>
cfg.<span style="padding:0px;margin:0px;color:rgb(0,102,0)">outputunit</span>  = <span style="padding:0px;margin:0px;color:rgb(128,128,128);font-style:italic">'proportion'</span>; <span style="padding:0px;margin:0px;color:rgb(128,128,128);font-style:italic">% make unit area</span>
cfg.<span style="padding:0px;margin:0px;color:rgb(0,102,0)">latency</span>     = <span style="padding:0px;margin:0px;color:rgb(102,204,102)">[</span>-<span style="padding:0px;margin:0px;color:rgb(204,102,204)">2.5</span> <span style="padding:0px;margin:0px;color:rgb(204,102,204)">0</span><span style="padding:0px;margin:0px;color:rgb(102,204,102)">]</span>;
cfg.<span style="padding:0px;margin:0px;color:rgb(0,102,0)">vartriallen</span> = <span style="padding:0px;margin:0px;color:rgb(128,128,128);font-style:italic">'no'</span>; <span style="padding:0px;margin:0px;color:rgb(128,128,128);font-style:italic">% do not allow variable trial lengths</span>
cfg.<span style="padding:0px;margin:0px;color:rgb(0,102,0)">method</span>      = <span style="padding:0px;margin:0px;color:rgb(128,128,128);font-style:italic">'xcorr'</span>; <span style="padding:0px;margin:0px;color:rgb(128,128,128);font-style:italic">% compute the normal cross-correlogram</span>
Xc = ft_spike_xcorr<span style="padding:0px;margin:0px;color:rgb(102,204,102)">(</span>cfg,spikeTrials<span style="padding:0px;margin:0px;color:rgb(102,204,102)">)</span>;  
<br></pre>
<p style="padding:0px;margin:0px 0px 1em;font-size:15px;line-height:22.5px;font-family:Calibri,Geneva,Arial,Verdana,sans-serif;text-align:justify">
But after processing all the 600 trials the ft_spike_xcorr function interrupts working with the error:</p>
<p style="padding:0px;margin:0px 0px 1em;text-align:justify"><span style="font-family:Calibri,Geneva,Arial,Verdana,sans-serif;font-size:15px;line-height:22.5px">"</span><b><font face="Calibri, Geneva, Arial, Verdana, sans-serif"><span style="font-size:15px;line-height:22.5px">???
 Subscript indices must either be real positive integers or </span></font><span style="font-size:15px;line-height:22.5px;font-family:Calibri,Geneva,Arial,Verdana,sans-serif">logicals.</span></b></p>
<p style="padding:0px;margin:0px 0px 1em;text-align:justify"><b><span style="font-size:15px;line-height:22.5px;font-family:Calibri,Geneva,Arial,Verdana,sans-serif">Error in ==> ft_spike_xcorr at 350</span><br>
</b></p>
<p style="padding:0px;margin:0px 0px 1em;text-align:justify"><font face="Calibri, Geneva, Arial, Verdana, sans-serif"><span style="font-size:15px;line-height:22.5px"><b>stat.label       = spike.label(chansel);</b>"</span></font></p>
<p style="padding:0px;margin:0px 0px 1em;text-align:justify">Trying to understand the error I set I breakpoint on the 350 line of the script and I got  another error in ft_checkconfig.m</p>
<p style="padding:0px;margin:0px 0px 1em;text-align:justify">"<b>??? Error using ==> ft_checkconfig at 208</b></p>
<p style="padding:0px;margin:0px 0px 1em;text-align:justify"><b>The field cfg.progress is not allowed</b></p>
<p style="padding:0px;margin:0px 0px 1em;text-align:justify"><b>Error in ==> ft_spike_xcorr at 126</b></p>
<p style="padding:0px;margin:0px 0px 1em;text-align:justify"><b>cfg = ft_checkconfig(cfg, 'allowed', {'latency', 'trials',</b></p>
<p style="padding:0px;margin:0px 0px 1em;text-align:justify"><b>'keeptrials', 'method', 'channelcmb', 'vartriallen', 'debias',</b></p>
<p style="padding:0px;margin:0px 0px 1em;text-align:justify"><b>'maxlag', 'binsize', 'outputunit'});</b>"</p>
<p style="padding:0px;margin:0px 0px 1em;text-align:justify"><br>
</p>
<p style="padding:0px;margin:0px 0px 1em;text-align:justify">I hope someone can help me because I really can't understand what's wrong (I feel there is a problem with the selection of the channels maybe) and I just followed the instructions.</p>
<p style="padding:0px;margin:0px 0px 1em;text-align:justify"><br>
</p>
<p style="padding:0px;margin:0px 0px 1em;text-align:justify">Best,</p>
<p style="padding:0px;margin:0px 0px 1em;text-align:justify"><br>
</p>
<p style="padding:0px;margin:0px 0px 1em;text-align:justify">Valentina</p>
</div>
</div></div></div>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl" target="_blank">fieldtrip@donders.ru.nl</a><br>
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a></blockquote>
</div>
<br>
</div>
</div>

<br>_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br></blockquote></div><br></div>