[FieldTrip] 'ft_redefinetrial' returning only one trial

Nakyung Lee rleese12 at berkeley.edu
Thu Jul 28 18:01:57 CEST 2016


Hi Rui,

In the code, the time (data.time{1,1}) is simply (1:NTime) (so it just
increments by 1).
Would it still matter?
Thank you for your reply.

Best,
Rachel

On Thu, Jul 28, 2016 at 12:58 AM, Rui Li <ruil3 at student.unimelb.edu.au>
wrote:

> Hi, Rachel
>
> Probably because cfg.begsample and cfg.endsample should be sample points
> of the begin and the end of the trails instead of the time;
>
> I am not sure;
>
> Regards,
> Rui.
>
> On Thu, Jul 28, 2016 at 3:43 PM, Nakyung Lee <rleese12 at berkeley.edu>
> wrote:
>
>> Dear FieldTrip community,
>>
>> I've been having a problem calling 'ft_redefinetrial'.
>> Basically with my raw data with one trial (simply 'data' here), I've
>> been trying to segment that one trial into smaller trials (so I can get rid
>> of 'bad_times') by using the following code:
>>
>> time = data.time{1,1};
>> bad_times = globals.bad_times_sorted; % a N*2 sorted double
>>
>> cfg.begsample = [time(1); bad_times(:,2) + 1];
>> cfg.endsample = [bad_times(:,1) - 1; time(end)];
>>
>> data_good = ft_redefinetrial(cfg, data);
>>
>> However the code returns a data with only one trial.
>> (i.e. the resulting data_good consists of only one trial which correspond
>> to the time (time(1) : bad_times(1,1).)
>> The code is very simple and I didn't really expect it to behave this way.
>> Does anyone see why this is happening?
>> Any type of help would be appreciated.
>>
>> Best regards,
>> Rachel Lee
>>
>>
>> _______________________________________________
>> fieldtrip mailing list
>> fieldtrip at donders.ru.nl
>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>>
>
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20160728/0d9bea57/attachment-0002.html>


More information about the fieldtrip mailing list