[FieldTrip] reading .mat in fieldtrip

Arjen Stolk a.stolk8 at gmail.com
Thu Aug 11 23:25:13 CEST 2016


Bahareh, according to
http://www.fieldtriptoolbox.org/reference/ft_redefinetrial (or 'help
ft_redefinetrial') cfg.trl should be

cfg.trl       = Nx3 matrix with the trial definition,

For example, according to the page mentioned earlier (I suggest you
actually read it this time:
http://www.fieldtriptoolbox.org/faq/how_can_i_import_my_own_dataformat)

cfg.trl = [1    100 -10;
           101  200 -10;
           201  300 -10];


In contrast, you specified
data.trial{1,1} = eeg.eeg_data;
cfg.trl = data.trial{1,1};

It's my guess that eeg.eeg_data is that 8x10350000 matrix you imported,
meaning your cfg.trl specification is off (it should be Nx3).



2016-08-11 12:23 GMT-07:00 Bahareh Elahian (belahian) <belahian at memphis.edu>
:

> I did something and it works but it is not correct .
>
> I specified cfg.trl = data.trial{1,1}
>
>
> cfg = [];
> cfg.bpfilter = 'yes';
> cfg.demean = 'yes';
> data.trial{1,1} = eeg.eeg_data;
> cfg.trl = data.trial{1,1};
> data.time{1,1} = 1:size(eeg.eeg_data,2);
> data.label{1,1} = 'chan 1';
> data.label{2,1} =  'chan 2';
> data.label{3,1} = 'chan 3';
> data.label{4,1} =  'chan 4';
> data.label{5,1} = 'chan 5';
> data.label{6,1} =  'chan 6';
> data.label{7,1} = 'chan 7';
> data.label{8,1} =  'chan 8';
> data.fsample = eeg.samp_rate;
> newdata = ft_redefinetrial(cfg,data);
>
> the newdata.time and newdata.trial are  <1*8 cell > . some of the cells
> are empty and one is NAN.
>
>
> ------------------------------
> *From:* fieldtrip-bounces at science.ru.nl <fieldtrip-bounces at science.ru.nl>
> on behalf of Bahareh Elahian (belahian) <belahian at memphis.edu>
> *Sent:* Thursday, August 11, 2016 2:00:52 PM
>
> *To:* FieldTrip discussion list
> *Subject:* Re: [FieldTrip] reading .mat in fieldtrip
>
>
> Thanks but none of the options works.
>
> The error is :
>
> you should specify at least one configuration option.
>
>
> Even cfg.demean = 'yes'; is not enough.
>
>
> ------------------------------
> *From:* fieldtrip-bounces at science.ru.nl <fieldtrip-bounces at science.ru.nl>
> on behalf of Antonio Rodriguez <toni.rbaena at gmail.com>
> *Sent:* Thursday, August 11, 2016 1:47:18 PM
> *To:* FieldTrip discussion list
> *Subject:* Re: [FieldTrip] reading .mat in fieldtrip
>
>
> Hi.
>
> You can create an empty cfg structure, and fill with data :
>
> cfg =[];
> newdata = ft_redefinetrial(cfg,data);
>
> El 11 ago. 2016 7:11 p. m., "Bahareh Elahian (belahian)" <
> belahian at memphis.edu> escribió:
>
>> Thanks for the answer,
>>
>> I have had a look on this page before and I tried to follow the steps.
>> The problem is ;I do not have any cfg to define cfg.trl and use newdata
>> = ft_redefinetrial(cfg,data);
>>
>> Any other idea?
>>
>>
>>
>> On Aug 11, 2016, at 11:36 AM, Arjen Stolk <a.stolk8 at gmail.com> wrote:
>>
>> Hi Bahareh,
>>
>> To get you started, see this page:
>> http://www.fieldtriptoolbox.org/faq/how_can_i_import_my_own_dataformat
>>
>> It describes what fieldtrip expects your raw data to look like.
>>
>> Arjen
>>
>> 2016-08-11 8:42 GMT-07:00 Bahareh Elahian (belahian) <
>> belahian at memphis.edu>:
>>
>>> Hi All,
>>>
>>>
>>>
>>> I have a “.mat” file which contais: <8x10350000 double> and sampling
>>> rate.
>>>
>>> How should I import this data to field trip? By using   [data] =
>>> ft_preprocessing( cfg);
>>>
>>>   I am getting an error that the data should be in the format of raw or
>>> raw + comp.
>>>
>>>
>>>
>>> Any idea?
>>>
>>>
>>>
>>> Thanks!
>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> 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/20160811/5267af17/attachment-0002.html>


More information about the fieldtrip mailing list