[FieldTrip] 'ft_redefinetrial' returning only one trial

Rui Li ruil3 at student.unimelb.edu.au
Thu Jul 28 09:58:07 CEST 2016


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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20160728/a1304ab0/attachment-0001.html>


More information about the fieldtrip mailing list