<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Hi Maria,
<div class=""><br class="">
</div>
<div class="">I am not using combined spike/lfp data myself, but I suggest that you look into the code of ft_appendspike in a little more detail. This will give you some idea about why the error occurs.</div>
<div class=""><br class="">
</div>
<div class="">My initial thought is that ft_appendspike hasn’t matured (in terms of backward compatibility) along with the fieldtrip code base (and more strict internal data representation). Any improvements in the code will therefore be most welcome. I suspect
 that the current issue results from the fact that the code tries to look into data.cfg. … .trl to extract information about the original sampling. Since your data is coming from somewhere else, this information is not present. Also, current data organization
 standards actually prohibit to look into data.cfg.previous. … trl, and require this information be represented in a field called .sampleinfo.</div>
<div class=""><br class="">
</div>
<div class="">I suggest that you search in the documentation for ‘sampleinfo’ to get an impression how this information is used throughout the code, and how it is generated if it doesn’t exist (hint: use ft_checkdata(data,'hassampleinfo’, true); </div>
<div class=""><br class="">
</div>
<div class="">Please also, if you have fixed your version of ft_appendspike, do submit a Pull Request on github so that we can incorporate your fixes into the codebase.</div>
<div class=""><br class="">
</div>
<div class="">Best wishes </div>
<div class="">Jan-Mathijs</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">
<div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
J.M.Schoffelen, MD PhD<br class="">
Senior Researcher, VIDI-fellow - PI, language in interaction<br class="">
Telephone: +31-24-3614793</div>
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Physical location: room 00.028</div>
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Donders Centre for Cognitive Neuroimaging, Nijmegen, The Netherlands<br class="">
<br class="">
<br class="">
</div>
</div>
</div>
</div>
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
<div>
<blockquote type="cite" class="">
<div class="">On 14 Feb 2019, at 13:57, María Alejandra Korovaichuk <<a href="mailto:alejandra.korovaichuk@ctb.upm.es" class="">alejandra.korovaichuk@ctb.upm.es</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">
<div dir="ltr" class="">
<div dir="ltr" class="">Hi again,
<div class="">This is my question (I hope now would be much clear):</div>
<div class="">I am trying to do a "preprocessing and analysis of spike+local field potential data". I followed the tutorial and everything was nice and clear with your data.</div>
<div class="">However I found some issues with my own data.</div>
<div class="">My LFP data is a .mat file and I tranformed it into a  FT data structure. The only thing I don't have is the header (hdr), because the original recording came from a .dat file from Inomed recordings. Anyway, even without the header I am able to
 plot the data and to see it. </div>
<div class="">The spikes were sorted with wave_clus so here I don't have any issue, FT open it and I can work with them perfectly.</div>
<div class=""><br class="">
</div>
<div class="">The step I am following are:</div>
<div class="">1) Read the LFP and spikes files with FT. No problem so far except for the header in the LFP file</div>
<div class="">2) Define trial and preprocessing of both files separately </div>
<div class="">3) read and select the spike</div>
<div class="">4)The first problem is here in: construct a cfg.trl matrix to preprocess the LFP. I can preprocess like a continuous data (1 column of voltages and the sampling freq):</div>
<div class="">
<div class=""><br class="">
</div>
<div class="">load(fullfile(data_dir,'lfp.mat')); </div>
<div class="">        cfg = [];</div>
<div class="">        cfg.continuous  = 'yes';</div>
<div class="">        cfg.channel=lfp_FT.label;</div>
<div class="">        cfg.padding   = 10; </div>
<div class="">        cfg.dftfreq   = [50-1*(1/10):(1/10):50+1*(1/10) ]; % filter out 50 hz line noise</div>
<div class="">        cfg.bsfilter = 'yes';</div>
<div class="">      </div>
<div class="">data_lfp  = ft_preprocessing(cfg, lfp_FT); % read in the LFP</div>
</div>
<div class=""><br class="">
</div>
<div class="">I tried many ways following the different tutorials and nothing works properly because even when FT let me ADD THE TRIAL INFORMATION "artificially" into my data_lfp, later on it would show me the </div>
<div class="">Error using ft_appendspike (line 112): <span style="color:rgb(34,139,34);font-family:"Courier New";font-size:13.3333px" class="">could not find the trial information in the continuous data"</span><br class="">
</div>
<div class=""> </div>
<div class="">I plot both files and the spikes match perfectly with the lfp data, so Matlab is reading them well, but I am doing something  wrong when I try to create the lfp FT structure.  </div>
<div class=""><br class="">
</div>
<div class="">Thanks for your help,</div>
<div class=""><br class="">
</div>
<div class="">Maria</div>
</div>
</div>
</div>
<br class="">
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">El jue., 14 feb. 2019 a las 11:29, María Alejandra Korovaichuk (<<a href="mailto:alejandra.korovaichuk@ctb.upm.es" class="">alejandra.korovaichuk@ctb.upm.es</a>>) escribió:<br class="">
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr" class="">
<div style="margin: 0cm 0cm 0.0001pt; line-height: normal; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:forestgreen" class="">Hi,</span></div>
<div style="margin: 0cm 0cm 0.0001pt; line-height: normal; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:forestgreen" class="">I am trying to append LFP data (from a continous matlab file), with a spike data (from wave_clus), into one large file to do some analysis.</span></div>
<div style="margin: 0cm 0cm 0.0001pt; line-height: normal; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:forestgreen" class="">I tried many options but I always have the same error (Error using ft_appendspike (line 112)</span></div>
<div style="margin: 0cm 0cm 0.0001pt; line-height: normal; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:forestgreen" class="">could not find the trial information in the continuous data)</span></div>
<div style="margin: 0cm 0cm 0.0001pt; line-height: normal; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:forestgreen" class="">I add all the requiered info manually in order to read it but there is something missing I can't find.</span></div>
<div style="margin: 0cm 0cm 0.0001pt; line-height: normal; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:forestgreen" class="">Any help is welcome, thanks!</span></div>
</div>
</blockquote>
</div>
_______________________________________________<br class="">
fieldtrip mailing list<br class="">
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="">
https://doi.org/10.1371/journal.pcbi.1002202<br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
<br class="">
<br class="">
</body>
</html>