[FieldTrip] Function is asking for raw data as input

Snijders, T.M. (Tineke) tineke.snijders at donders.ru.nl
Wed May 11 09:23:47 CEST 2016


Hi Soujata,

So then you have to correct your script, so that you specify cfg.channel= {'Cz';'M1';'M2'}; instead of cfg.channels.

I guess you could have worked that one out yourself... If you type 'help ft_timelockanalysis' you see it takes cfg.channel and not cfg.channels.


Cheers,
Tineke

________________________________
From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Soujata Borbaruah [s.borbaruah at student.utwente.nl]
Sent: Tuesday, May 10, 2016 6:20 PM
To: FieldTrip discussion list
Subject: Re: [FieldTrip] Function is asking for raw data as input

Dear Tineke,

Many many thanks for the suggestion. It works now, however, instead of averaging trials in the three channels that is listed in cfg.channel, the script is performing the averaging in all 64 channels. Is it possible to correct it?

After the script is executed, cfg contains a cell called channels with 6x1 cell and another cell called channel with 64x1 cell. I think the script is taking the data from channel.

Regards,
Soujata



Sent with MailTrack<https://mailtrack.io/install?source=signature&lang=en&referral=s.borbaruah@student.utwente.nl&idSignature=22>


On Tue, May 10, 2016 at 11:27 AM, Soujata Borbaruah <s.borbaruah at student.utwente.nl<mailto:s.borbaruah at student.utwente.nl>> wrote:
Dear Tineke,

I have created a function that performs timelock analysis on trials present in Dat which is obtained from Data of a subject.

Script Average calls the function:

Sub                         = 'Subject1'; % Need to perform for all the subjects
load(['MTT_EP_data_',Sub,'.mat']);

[ep] = Actual_Timelockanalysis_MTT_EP(Data)


function [EP] = Actual_Timelockanalysis_MTT_EP(Data)

cfg = [];
cfg.channels = {'Cz';'M1';'M2'};

for i = 1; % Only for NOP=1
    S = unique(Data(i).Stimuli); % To find the unique stimuli
          for j = 1:length(S)
                  Indices = find(Data(i).Stimuli == S(j)); % comparison
                  Idx{1} = 1:length(Indices); % Trials per amplitude, both perceived and not perceived
                  for k = 1;
                    Dat(i,j,k).Stimuli = S(j); % Corresponding unique stimuli
                    Dat(i,j,k).Trial = Data(i).Trials(Indices(Idx{k})); % Extract the trials from Data(1).Trials and place in the new Dat structure
                    Dat(i,j,k).Time = repmat({Data(i).TrialTime}, [1 length(Idx{k})]); %represents 1 trial as a whole (9th trial took that much of time)
                    Dat(i,j,k).fsample = Data(i).fsample;
                    Dat(i,j,k).Label = Data(i).EEGlabels; % Contains all the 64 channels and the selection of the channels can be done using cfg.channels

                    if ~isempty(Idx{1})
                        EP{i,j}.All = ft_timelockanalysis(cfg,Dat(i,j));
                    else
                        EP{i,j} = [];

                    end
                    end
                end
          end

Dat is supposed to be a 1x10 (because there are 10 unique stimuli) structure with 5 fields which are:
1. Type of stimuli
2. Number of trials for the respective stimuli (64x4000 double for each trial)
3. Time of the trials (1x4000 double which is the same for every trial)
4. fsample (1000)
5. Labels of the EEG (64 channels).

The Dat structure is created, however when the data in it is called for timelockanalysis, it fails and the warning says it is not raw data.

Sent with MailTrack<https://mailtrack.io/install?source=signature&lang=en&referral=s.borbaruah@student.utwente.nl&idSignature=22>

On Tue, May 10, 2016 at 10:34 AM, Snijders, T.M. (Tineke) <tineke.snijders at donders.ru.nl<mailto:tineke.snijders at donders.ru.nl>> wrote:
Dear Soujata,

Have you checked what data is in Dat(i,j,k)? The data input of ft_timelockanalysis should be organised in a structure as obtained from ft_preprocessing, with trial-based data.

Best,
Tineke



________________________________
From: fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl> [fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl>] on behalf of Soujata Borbaruah [s.borbaruah at student.utwente.nl<mailto:s.borbaruah at student.utwente.nl>]
Sent: Tuesday, May 10, 2016 10:00 AM
To: fieldtrip, donders
Subject: [FieldTrip] Function is asking for raw data as input

Hello, I am working on statistical analysis of EEG data from subjects. I am trying to perform time lock analysis on the data available but while executing the script these are the following errors I get:

Error using ft_checkdata (line 464)
This function requires raw+comp or raw data as input.

Error in ft_timelockanalysis (line 106)
data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'yes', 'hassampleinfo', 'yes');

Error in Actual_Timelockanalysis_MTT_EP (line 20)
                        EP{i,j,k}.All = ft_timelockanalysis(cfg,Dat(i,j,k));

Error in Noise_MTT_EP (line 8)
[ep] = Actual_Timelockanalysis_MTT_EP(Data)

Please let me know if you require any more information.



Sent with MailTrack<https://mailtrack.io/install?source=signature&lang=en&referral=s.borbaruah@student.utwente.nl&idSignature=22>


_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
http://mailman.science.ru.nl/mailman/listinfo/fieldtrip


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20160511/2387e85d/attachment-0002.html>


More information about the fieldtrip mailing list