[FieldTrip] Fwd: Getting data from a database instead of files
Schoffelen, J.M. (Jan Mathijs)
jan.schoffelen at donders.ru.nl
Mon Jun 3 17:07:27 CEST 2019
Hi Thomas,
Thanks for your informative e-mail :).
Here's what I did:
1- Get the data for a subset of my choosing (I tried everything with a small 4-channel, 55-trials subset)
2- Put that data into a structure built as follows, adding fields that FieldTrip required:
fsample: 1017 (I know this is weird but we're stuck with it)
channels: [1 17 25 29] Added to keep track of in-house bookkeeping
label: {'Ch:1 idElectrodeSite:181' 'Ch:17 idElectrodeSite:183' 'Ch:25 idElectrodeSite:184'
'Ch:29 idElectrodeSite:185'} Not the right structure, but I don't have header files to get them from
trial: {55×1 cell} One cell per trial, with each being [chan x time]
time: {55×1 cell} One cell per trial, each going from -750ms to 750ms (around target onset) This includes a 250ms pad on each side.
trl: [55×3 double] Built from scratch as if the trials were continuous. (Inspired by the FT function that does this)
dimord: 'chan_time' Added by hand, can't get Fieldtrip to recognize it
sampleinfo: [55×2 double] The first two columns of trl
You may need to get rid of the following fields: ’trl’ ‘dimord’ and ‘channels’. Once this is done, I think you are ready to go, without warnings and errors.
3- Try to use ft_freqanalysis using the following cfg (also attached)
cfg = [];
cfg.method= 'tfr';
cfg.pad = 'nextpow2';
cfg.width = 7;
cfg.gwidth = 3;
cfg.foi = [15:1:60];
cfg.toi = 'all';
I first get the message:
the input is raw data with 4 channels and 55 trial
This would be encouraging, but then, I get the following warnings:
Warning: could not determine dimord of "trial" in: (structure shown above)
Warning: could not determine dimord of "trl" in: (structure shown above)
...but four pairs of them.
Looking through the debugger, I found out they're given when ft_freqanalysis, calls ft_checkdata and ft_selectdata.
Are these warnings something I should be worried about, or can everything work well the way it is?
Also, how is it that FT 'could not determine dimord' when I give it one in the data structure, and it seems to understand the way it works given the message it sends at the beginning?
After the warnings, I get this:
the call to "ft_selectdata" took 16 seconds
processing trials
trial 2, frequency 32 (46.18 Hz)
Array dimensions must match for binary array op.
Error in ft_freqanalysis (line 679)
trlcnt(1, ifoi, :) = trlcnt(1, ifoi, :) + shiftdim(double(acttboi(:)'),-1);
...which I simply don't know how to solve.
So in summary:
1- Is it possible to make FT work without using original files to get the data?
Yes!
2- If it is, what have I done wrong, and how could I make it work?
See above.
3- Are the warnings worrisome or is it just a natural consequence of trying to jerry-rig data in FT?
Not worrisome, they should go away if you do exactly as I told :).
4- Any idea on how to solve the error message I get is appreciated, but a secondary objective.
Probably it goes away.
Keep up the good work and with best wishes,
Jan-Mathijs
I attached the function I made to build the data structure in case it could help.
Thank you very much for reading this long-winded message!
Regards
Thomas Lusignan, B. Sc.
Paul Cisek's Lab
Université de Montréal
<GetFTLFP.m>_______________________________________________
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/20190603/baabd496/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