Back to the main page.
Bug 946 - ft_appenddata reportedly fails to concatenate trialinfo and sampleinfo (even when that is possible)
Status | CLOSED WORKSFORME |
Reported | 2011-09-10 08:35:00 +0200 |
Modified | 2011-10-19 15:21:25 +0200 |
Product: | FieldTrip |
Component: | core |
Version: | unspecified |
Hardware: | PC |
Operating System: | Mac OS |
Importance: | P1 normal |
Assigned to: | Eelke Spaak |
URL: | |
Tags: | |
Depends on: | |
Blocks: | |
See also: |
Jan-Mathijs Schoffelen - 2011-09-10 08:35:22 +0200
reported by Marianne Severens, and likely by Leo Zizlsperger: Hi Leo, Jan-Mathijs I also have the same problem. When appending data from 2 datasets the trialinfo and sampleinfo only contains info from the first dataset. And I need the information to know which trials belong to each condition. I fixed it for my data by concatenating the trialinfo and sampleinfo field myself. You just need to make sure that the funtions you use afterwards do not depend on the sampleinfo field, because this is not correct any more as Jan-Mathijs explained. I'm not sure if this is the best thing to do, but it works for me! Best, Marianne ________________________________________ From: fieldtrip-bounces@donders.ru.nl [fieldtrip-bounces@donders.ru.nl] On Behalf Of jan-mathijs schoffelen [jan.schoffelen@donders.ru.nl] Sent: Thursday, September 08, 2011 9:19 PM To: Email discussion list for the FieldTrip project Subject: Re: [FieldTrip] ft_appenddata Hi Leo, With 'trl', are you referring to data.cfg.previous. ... .trl? I assume that data.trial (which contains the actual data) has the correct dimensionality of 1x605? In the past, fieldtrip also concatenated the trl-matrices, but we feel that this is not appropriate. The reason for this is, that the first 2 columns of these matrices represent the sample numbers that define the epochs of interest, with respect to the first sample in the recording. If the concatenated data are derived from two different datasets, these numbers become meaningless, because they cannot be interpreted unequivocally anymore. Yet, and I hope that this was motivating your question, the trl-matrix was also used (by some) to store trial-specific information, which of course still is meaningful even if the data comes from different recordings. If this indeed relates to your question, please have a look at: http://fieldtrip.fcdonders.nl/faq/i_used_to_work_with_trl-matrices_that_have_more_than_3_columns._why_is_this_not_supported_anymore If your actual question is of a different nature, could you please explain a bit more what is the problem? Thanks, Jan-Mathijs On Sep 8, 2011, at 6:09 PM, Leopold Zizlsperger wrote: Hello thanks in advance for your assistance. I'd like to merge 2 datasets after preprocessing using ft_appendata. Even though it works on first view, "trl" does not add up but keeps the structure of the last dataset (304 in the example): XY_merge=ft_appenddata(cfg, x1, x2); input dataset 1, 29 channels, 301 trials input dataset 2, 29 channels, 304 trials Warning: input data comes from different datafiles In ft_appenddata at 182 concatenating the trials over all datasets removing sampleinfo field from output output dataset, 29 channels, 605 trials Do I miss the point ? Thanks Best regards Leopold I suggest to write a simple test script to validate this and fix it if necessary.