[FieldTrip] Error ussingg ft_appendspike

Schoffelen, J.M. (Jan Mathijs) jan.schoffelen at donders.ru.nl
Thu Feb 14 14:26:20 CET 2019


Hi Maria,

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.

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.

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);

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.

Best wishes
Jan-Mathijs


J.M.Schoffelen, MD PhD
Senior Researcher, VIDI-fellow - PI, language in interaction
Telephone: +31-24-3614793
Physical location: room 00.028
Donders Centre for Cognitive Neuroimaging, Nijmegen, The Netherlands





On 14 Feb 2019, at 13:57, María Alejandra Korovaichuk <alejandra.korovaichuk at ctb.upm.es<mailto:alejandra.korovaichuk at ctb.upm.es>> wrote:

Hi again,
This is my question (I hope now would be much clear):
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.
However I found some issues with my own data.
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.
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.

The step I am following are:
1) Read the LFP and spikes files with FT. No problem so far except for the header in the LFP file
2) Define trial and preprocessing of both files separately
3) read and select the spike
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):

load(fullfile(data_dir,'lfp.mat'));
        cfg = [];
        cfg.continuous  = 'yes';
        cfg.channel=lfp_FT.label;
        cfg.padding   = 10;
        cfg.dftfreq   = [50-1*(1/10):(1/10):50+1*(1/10) ]; % filter out 50 hz line noise
        cfg.bsfilter = 'yes';

data_lfp  = ft_preprocessing(cfg, lfp_FT); % read in the LFP

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
Error using ft_appendspike (line 112): could not find the trial information in the continuous data"

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.

Thanks for your help,

Maria

El jue., 14 feb. 2019 a las 11:29, María Alejandra Korovaichuk (<alejandra.korovaichuk at ctb.upm.es<mailto:alejandra.korovaichuk at ctb.upm.es>>) escribió:
Hi,
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.
I tried many options but I always have the same error (Error using ft_appendspike (line 112)
could not find the trial information in the continuous data)
I add all the requiered info manually in order to read it but there is something missing I can't find.
Any help is welcome, thanks!
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190214/d7835dbe/attachment-0002.html>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202


More information about the fieldtrip mailing list