[FieldTrip] way to subset data in cfg structure?

Tim Meehan timeehan at gmail.com
Tue Feb 7 16:52:41 CET 2017


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/de7ccbe5/attachment.html>


More information about the fieldtrip mailing list