[FieldTrip] way to subset data in cfg structure?

Tim Meehan timeehan at gmail.com
Tue Feb 7 19:34:52 CET 2017


Hi Stephen,

I was able to find the solution, which is to specify the trl field in the
ft_preprocessing cfg. I'll put it here for posterity.

cfg = [];
cfg.dataset = 'full_recording_session.edf';
cfg.trl = [blockbeg blockend 0]; % The 0 indicates there are no triggers
associated with the trial
cfg.continuous = 'yes';

datp = ft_preprocessing(cfg);

Found in this thread:
https://mailman.science.ru.nl/pipermail/fieldtrip/2016-January/009960.html

Cheers,
Tim

On Tue, Feb 7, 2017 at 10:52 AM, Tim Meehan <timeehan at gmail.com> wrote:

> Hi Stephen,
>
> Aha, this looks like what I'm looking for. However, I've tried it and I'm
> not sure what the effect is. For example, if I run:
>
> nchan = 1;
> blockbeg = 4197000;
> blockend = 5782000;
>
> for n = 1:nchan
>
>   cfgp = [];
>   cfgp.dataset = 'full_recording_session.edf';
>   cfgp.channel = n;
>   cfgp.latency = [blockbeg blockend];
>
>   datp{n} = ft_preprocessing(cfgp);
>
> end
>
> >> datp{1}
>
> ans =
>
>            hdr: [1x1 struct]
>          label: {'SEEG F11'}
>           time: {[1x9002826 double]}
>          trial: {[1x9002826 double]}
>        fsample: 2000
>     sampleinfo: [1 9002826]
>            cfg: [1x1 struct]
>
> >> datp{1}.cfg.latency
>
> ans =
>
>      4197000     5782000
>
>
> So, the beginning and end points are being stored in the cfg.latency
> field, but it seems they are not being used to subset the data since
> datp.time and datp.trial contain the full session.
>
> Is there a way to achieve the actual subsetting? Otherwise I will run out
> of memory when looping through all the channels, even if I downsample each
> channel at each iteration.
>
> Thanks!
> Tim
>
> On Tue, Feb 7, 2017 at 9:15 AM, Stephen Whitmarsh <
> stephen.whitmarsh at gmail.com> wrote:
>
>> Hi Tim,
>>
>> In ft_selectdata, check cfg.latency. And maybe ft_redefinetrials,
>> depending on where you are in your pipeline, i.e. after or before
>> timelocking/epoching.
>>
>> Cheers,
>> Stephen
>>
>> On 6 February 2017 at 23:53, Tim Meehan <timeehan at gmail.com> wrote:
>>
>>> Hi Stephen,
>>>
>>> Thanks, I checked out ft_selectdata, but what I really want is a way to
>>> subselect the time dimension, not the channel dimension. I don't see this
>>> as an option in ft_selectdata. I can do this subselection manually by going
>>> into the trials and time fields but it's a little bit clunky and was hoping
>>> there might be a more elegant way...
>>>
>>> Thanks,
>>> Tim
>>>
>>> On Sat, Feb 4, 2017 at 9:35 AM, Stephen Whitmarsh <
>>> stephen.whitmarsh at gmail.com> wrote:
>>>
>>>> Hi Tim,
>>>>
>>>> You might want to check out the cfg.channel setting in
>>>> ft_preprocessing, or use cfg.channel and cfg.trials in ft_selectdata. You
>>>> can use ft_appenddata to recombine data over trials or channels at a later
>>>> point.
>>>>
>>>> Hope this helps,
>>>> Stephen
>>>>
>>>>
>>>> On 3 February 2017 at 23:23, Tim Meehan <timeehan at gmail.com> wrote:
>>>>
>>>>> Hello everyone,
>>>>>
>>>>> I'm trying to preprocess a block of continuous data, but the block is
>>>>> too long such that I can't hold all the channels in memory together, even
>>>>> after downsampling. Is there perhaps a setting in ft_preprocessing through
>>>>> which you can specify a subset of data from a larger block? This would
>>>>> solve my problem, I think.
>>>>>
>>>>> Thanks!
>>>>> Tim
>>>>>
>>>>> _______________________________________________
>>>>> 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/20170207/211d8792/attachment.html>


More information about the fieldtrip mailing list