[FieldTrip] concatenating data to a single trial data set

Nathan Weisz nathanweisz at mac.com
Mon Jun 20 17:15:50 CEST 2011


hi andreas,

perhaps i misunderstood something. but your RAM worries concern the ICA computation?

then after running your ICA & getting the components, why don't you just read the raw data again with the option as continuous data (cfg.continuous i think). then apply the components to the single-trial raw data and finally reject the bad components. less efficient than elkes solution, rather the lazy one :-)

cheers,
n

On 20.06.2011, at 15:35, Eelke Spaak wrote:

> Dear Andreas,
> 
> The way I concatenate data is just 'manually', so without the
> intervention of FieldTrip. To do this, you will have to concatenate
> the arrays in both the data.trial and the data.time cell array.
> 
> In pseudocode:
> 
> initialize matrix data_concat of size channels X total time points
> initialize matrix time_concat of size 1 X total time points
> 
> loop over data.trial and data.time (have the same size)
>  data_concat(:,appropriate time indices) = data.trial{k}(:,:);
>  time_concat(1,appropriate time indices) = data.time{k}(:);
> end loop
> 
> data.trial = data_concat;
> data.time = time_concat;
> 
> That should do the trick. I would have provided actual code, were it
> not that I am doing something slightly different from what you are
> asking.
> 
> I hope this helps!
> 
> Best,
> Eelke
> 
> 2011/6/20 Andreas Wollbrink <a.wollbrink at uni-muenster.de>:
>> Dear all,
>> 
>> in order not to run into a RAM memory overload when performing an ICA on MEG
>> data I subdivided the raw data into several equally long segments (chops)
>> using ft_preprocessing with varying cfg.trl settings.
>> After applying ft_componentanalysis to each of these chops I removed some
>> (bad) components and backprojected the data to seperate data matrices using
>> the following code:
>> 
>> cfg = [];
>> cfg.component = badCompVec; % to be removed component(s)
>> dataCorr = ft_rejectcomponent(cfg, compData);
>> 
>> 
>> Finally I like to concatenate these data to a continuous (single trial) data
>> matrix in order to compare it with the original raw data set and perform the
>> further timelock analysis on it.
>> 
>> I tried using ft_appenddata for this issue. Doing so one gets a multi trial
>> data matrix which I could not convert to single trial continuous data matrix
>> using e.g. ft_redefinetrial.
>> 
>> I would appreciate any help in how to solve this problem.
>> 
>> Thanks in advance.
>> 
>> Andreas Wollbrink
>> --
>> 
>> 
>> ======================================================================
>> 
>>  Andreas Wollbrink, Biomedical Engineer
>> 
>>  Institute for Biomagnetism and Biosignalanalysis
>>  Muenster University Hospital
>> 
>>  Malmedyweg 15         phone:   +49-(0)251-83-52546
>>  D-48149 Muenster      mobil:   +49-(0)160-98527553
>>  Germany               fax:     +49-(0)251-83-56874
>>                        e-Mail: a.wollbrink at uni-muenster.de
>> 
>> ======================================================================
>> _______________________________________________
>> fieldtrip mailing list
>> fieldtrip at donders.ru.nl
>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>> 
> 
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip




More information about the fieldtrip mailing list