<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="">
Maria,
<div class=""><br class="">
</div>
<div class="">Can I reiterate my suggestion to look into the problem at the level of ft_appendspike (as per the text copied in below), or additionally look into this information:
<a href="http://www.fieldtriptoolbox.org/faq/how_can_i_import_my_own_dataformat/" class="">
http://www.fieldtriptoolbox.org/faq/how_can_i_import_my_own_dataformat/</a></div>
<div class=""><br class="">
</div>
<div class="">Your ‘vicious’ circle is caused by the fact that you try to create a ’trl’-matrix using an underdefined data format, so I don’t think that this is going to work. </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="">
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++</div>
</div>
</div>
</div>
</div>
<div class=""><br class="">
</div>
<div 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>
<blockquote type="cite" class="">
<div class="">On 19 Feb 2019, at 14:47, 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="">Yes, I've been going through that discussion trying to repeat what Rachel did but is not working, maybe my problem is somewhere else.
<div class="">I want to use the ft_appendspike function in order to do a spike-field coherence test. So, to do that the FT tutorial says I need to process the raw spike data such the resulting spike structure has the "same trial definition" as the lfp structure. </div>
<div class="">Al lthe time in the tutorial is asking me for a trl function but the only way to create a trl matrix is using the ft_definitiontria, and to use the ft_definitiontrial I need to read the header. </div>
<div class="">Is a vicious circle and I can't find the way out</div>
</div>
<br class="">
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">El mar., 19 feb. 2019 a las 14:29, Martin Rosenfelder (<<a href="mailto:martin.rosenfelder@uni-ulm.de" class="">martin.rosenfelder@uni-ulm.de</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">
Dear Alex,<br class="">
<br class="">
I suppose that Fieldtrip throws that particular error, since the data is already present in MATLAB structure. Actually, I think there is no need to define the trial using ft_definetrial. Maybe ft_redifinetrial accepts the MATLAB structure of your data. Does
 reading the data as 'continuous' work using ft_preprocessing?<br class="">
See also the following link to a similar problem which had been discussed in the Fieldtrip community three years ago:<br class="">
<a href="https://mailman.science.ru.nl/pipermail/fieldtrip/2016-July/010699.html" rel="noreferrer" target="_blank" class="">https://mailman.science.ru.nl/pipermail/fieldtrip/2016-July/010699.html</a><br class="">
<br class="">
Best,<br class="">
Martin <br class="">
<br class="">
<br class="">
-- <br class="">
M.Sc.-Psych. Martin Rosenfelder<br class="">
Wissenschaftlicher Mitarbeiter<br class="">
Klinische und Biologische Psychologie<br class="">
Universität Ulm<br class="">
Raum 47.2.259<br class="">
+49 731-50 26592<br class="">
<a href="mailto:martin.rosenfelder@uni-ulm.de" target="_blank" class="">martin.rosenfelder@uni-ulm.de</a>
<br class="">
<br class="">
Am Dienstag, 19. Februar 2019 12:52 CET, María Alejandra Korovaichuk <<a href="mailto:alejandra.korovaichuk@ctb.upm.es" target="_blank" class="">alejandra.korovaichuk@ctb.upm.es</a>> schrieb:
<br class="">
<br class="">
> Thanks Martin, but I tried this many times before and is still the same<br class="">
> issue.<br class="">
> FT is not recognizing mydata (is a matlab file with 3 variables: time (in<br class="">
> milliseconds), lfp data (in mV), and sampling freq<br class="">
> <br class="">
> The message is always the same:<br class="">
> evaluating trialfunction 'ft_trialfun_general'<br class="">
> reading the header from 'mydata.mat'<br class="">
> Error using ft_read_header (line 2581)<br class="">
> unsupported header format "matlab"<br class="">
> <br class="">
> <br class="">
> <br class="">
> El mar., 19 feb. 2019 a las 11:44, Martin Rosenfelder (<<br class="">
> <a href="mailto:martin.rosenfelder@uni-ulm.de" target="_blank" class="">martin.rosenfelder@uni-ulm.de</a>>) escribió:<br class="">
> <br class="">
> > Hi Alex,<br class="">
> ><br class="">
> > You can use the ft_definetrial function in order to define your data<br class="">
> > containing continuous data. In order to achieve this, you can specify the<br class="">
> > cfg like this:<br class="">
> > cfg = []<br class="">
> > cfg.trialdef = (your 1x3 matrix)<br class="">
> > data_new = ft_definetrial(data)<br class="">
> ><br class="">
> > The new variable should now contain your continuous data as one trial.<br class="">
> > In the new data matrix you can then check the .trl field if it really<br class="">
> > consists of just one trial from beginning to end of your timeline.<br class="">
> ><br class="">
> > Maybe this works.<br class="">
> ><br class="">
> > Best,<br class="">
> > Martin<br class="">
> ><br class="">
> ><br class="">
> ><br class="">
> ><br class="">
> > --<br class="">
> > M.Sc.-Psych. Martin Rosenfelder<br class="">
> > Wissenschaftlicher Mitarbeiter<br class="">
> > Klinische und Biologische Psychologie<br class="">
> > Universität Ulm<br class="">
> > Raum 47.2.259<br class="">
> > +49 731-50 26592<br class="">
> > <a href="mailto:martin.rosenfelder@uni-ulm.de" target="_blank" class="">martin.rosenfelder@uni-ulm.de</a><br class="">
> ><br class="">
> > Am Dienstag, 19. Februar 2019 10:19 CET, María Alejandra Korovaichuk <<br class="">
> > <a href="mailto:alejandra.korovaichuk@ctb.upm.es" target="_blank" class="">alejandra.korovaichuk@ctb.upm.es</a>> schrieb:<br class="">
> ><br class="">
> > > Hi!<br class="">
> > ><br class="">
> > > Is still impossible to use the appendspike function in my data :( That is<br class="">
> > > way  now I am trying to use the ft_definetrial to create my own set.<br class="">
> > > My question is how can I create a trialfun for continuos data (that<br class="">
> > means I<br class="">
> > > don't want to split my data into segments or events or epochs), I want to<br class="">
> > > define a long and continuos set of data (the LFP), in order to append the<br class="">
> > > spike data afterwards.<br class="">
> > ><br class="">
> > > Thanks!<br class="">
> > ><br class="">
> > > Best,<br class="">
> > ><br class="">
> > > Alex<br class="">
> ><br class="">
> ><br class="">
> ><br class="">
> ><br class="">
> > _______________________________________________<br class="">
> > fieldtrip mailing list<br class="">
> > <a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank" class="">
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="">
> > <a href="https://doi.org/10.1371/journal.pcbi.1002202" rel="noreferrer" target="_blank" class="">
https://doi.org/10.1371/journal.pcbi.1002202</a><br class="">
> ><br class="">
<br class="">
<br class="">
<br class="">
<br class="">
_______________________________________________<br class="">
fieldtrip mailing list<br class="">
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="">
<a href="https://doi.org/10.1371/journal.pcbi.1002202" rel="noreferrer" target="_blank" class="">https://doi.org/10.1371/journal.pcbi.1002202</a><br class="">
</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>