[FieldTrip] 'ft_redefinetrial' returning only one trial

Nakyung Lee rleese12 at berkeley.edu
Sat Jul 30 00:37:57 CEST 2016


Hi Rui,

Again thank you for your reply.
They are samples as well.
Hence the elements of the first row of bad_times, which is 141000, 146000,
each represents the 141000th and 146000th indices of time and trial.
And since time is simply and array of consecutive integers (so it acts just
like indices) time(end) behaves just like a sample as well.

Best,
Rachel

On Thu, Jul 28, 2016 at 9:19 PM, Rui Li <ruil3 at student.unimelb.edu.au>
wrote:

> hi,
>
> cfg.begsample = [time(1); bad_times(:,2) + 1];
> cfg.endsample = [bad_times(:,1) - 1; time(end)];
>
> How about the rest three time samples: bad_times(:,2)+1, bad_times(:,1)-1
> and time(end)?
>
> Are they samples or the time?
>
> Regards,
> Rui.
>
> On Fri, Jul 29, 2016 at 2:01 AM, Nakyung Lee <rleese12 at berkeley.edu>
> wrote:
>
>> 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
>>>
>>
>>
>> _______________________________________________
>> 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/20160729/ecb9985a/attachment-0002.html>


More information about the fieldtrip mailing list