From elene.beitia at alumni.mondragon.edu  Sat Jun  1 10:35:21 2019
From: elene.beitia at alumni.mondragon.edu (Elene Beitia Loinaz)
Date: Sat, 1 Jun 2019 10:35:21 +0200
Subject: [FieldTrip] Problem with Multiplot_TFR
In-Reply-To: <B28AD569-1C1D-43A4-A35C-C24E2E1EBC76@donders.ru.nl>
References: <CAAo3uSXrgxgMGhjyr0174reD9+2bLskjpBXwJE2pSyEFp9C4WQ@mail.gmail.com>
 <B28AD569-1C1D-43A4-A35C-C24E2E1EBC76@donders.ru.nl>
Message-ID: <CAAo3uSUOeiezjGQ8+ShJpTkr=G7ygxVhC3J1xq1eMZcqNg3MMA@mail.gmail.com>

Hi,

And is there some way of creating a layout from the *.label field?

Thank you in advance

Elene.

Hau idatzi du Schoffelen, J.M. (Jan Mathijs) (jan.schoffelen at donders.ru.nl)
erabiltzaileak (2019 mai. 30, og. (11:49)):

> Hi Elene,
>
> Please check the names of the electrode labels in the layout file, and
> compare them with the ones in your *.label field.
> Only the exactly matching tokens will be shown in the figure.
>
> Jan-Mathijs
>
> > On 30 May 2019, at 10:35, Elene Beitia Loinaz <
> elene.beitia at alumni.mondragon.edu> wrote:
> >
> > Hi Fieldtripers,
> >
> > I want to plot all the channels powerspectrum using ft_multiplotTFR.
> >
> > I have the next configuration in the ft_freq analiysis:
> >
> >                       cfg              = [];
> >                       cfg.continuous   = 'yes';
> >                       cfg.output       = 'pow';
> >                       cfg.method       = 'mtmconvol';
> >                       cfg.taper        = 'hanning';
> >                       cfg.toi          = [0:0.0039063:1];%[0: 0.0039063
> : 479.9961];
> >                       cfg.foi          = 8:12;
> >                       cfg.t_ftimwin    = ones(length(cfg.foi),1)./10;
> >                       cfg.feedback     = 'no';
> >                       cfg.hassampleinfo= 'yes';
> >
> >                      data_Fourier_TFR1 = ft_freqanalysis(cfg, data);
> >
> > and this is the  data_Fourier_TFR1  structure that I obtained:
> >                        label: {128×1 cell}
> >                        dimord: 'chan_freq_time'
> >                        freq: [8 9 10 11 12]
> >                        time: [1×256 double]
> >                        powspctrm: [128×5×256 double]
> >                       elec: [1×1 struct]
> >                       cfg: [1×1 struct]
> >
> > I yse the next configuration in multiplot_TFR:
> >                       cfg = [];
> >                       cfg.parameter = 'powspctrm';
> >                       cfg.layout = 'bioSemi128.lay';
> >                       cfg.zlim = [-20 20];
> >                       cfg.colorbar='yes';
> >                       cfg.baselinetype = 'absolute';
> >
> >                       ft_multiplotTFR(cfg, data_Fourier_TFR1)
> >
> > It does not give me any error but I do not obtained to plot all the
> channels. The image that I obtained is the following one:
> >
> > <image.png>
> >
> > Does someone how to solve this?
> > Thanks,
> >
> > Elene.
> > _______________________________________________
> > fieldtrip mailing list
> > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> > https://doi.org/10.1371/journal.pcbi.1002202
>
>
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190601/39a8eb87/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From elene.beitia at alumni.mondragon.edu  Sat Jun  1 10:35:21 2019
From: elene.beitia at alumni.mondragon.edu (Elene Beitia Loinaz)
Date: Sat, 1 Jun 2019 10:35:21 +0200
Subject: [FieldTrip] Problem with Multiplot_TFR
In-Reply-To: <B28AD569-1C1D-43A4-A35C-C24E2E1EBC76@donders.ru.nl>
References: <CAAo3uSXrgxgMGhjyr0174reD9+2bLskjpBXwJE2pSyEFp9C4WQ@mail.gmail.com>
 <B28AD569-1C1D-43A4-A35C-C24E2E1EBC76@donders.ru.nl>
Message-ID: <CAAo3uSUOeiezjGQ8+ShJpTkr=G7ygxVhC3J1xq1eMZcqNg3MMA@mail.gmail.com>

Hi,

And is there some way of creating a layout from the *.label field?

Thank you in advance

Elene.

Hau idatzi du Schoffelen, J.M. (Jan Mathijs) (jan.schoffelen at donders.ru.nl)
erabiltzaileak (2019 mai. 30, og. (11:49)):

> Hi Elene,
>
> Please check the names of the electrode labels in the layout file, and
> compare them with the ones in your *.label field.
> Only the exactly matching tokens will be shown in the figure.
>
> Jan-Mathijs
>
> > On 30 May 2019, at 10:35, Elene Beitia Loinaz <
> elene.beitia at alumni.mondragon.edu> wrote:
> >
> > Hi Fieldtripers,
> >
> > I want to plot all the channels powerspectrum using ft_multiplotTFR.
> >
> > I have the next configuration in the ft_freq analiysis:
> >
> >                       cfg              = [];
> >                       cfg.continuous   = 'yes';
> >                       cfg.output       = 'pow';
> >                       cfg.method       = 'mtmconvol';
> >                       cfg.taper        = 'hanning';
> >                       cfg.toi          = [0:0.0039063:1];%[0: 0.0039063
> : 479.9961];
> >                       cfg.foi          = 8:12;
> >                       cfg.t_ftimwin    = ones(length(cfg.foi),1)./10;
> >                       cfg.feedback     = 'no';
> >                       cfg.hassampleinfo= 'yes';
> >
> >                      data_Fourier_TFR1 = ft_freqanalysis(cfg, data);
> >
> > and this is the  data_Fourier_TFR1  structure that I obtained:
> >                        label: {128×1 cell}
> >                        dimord: 'chan_freq_time'
> >                        freq: [8 9 10 11 12]
> >                        time: [1×256 double]
> >                        powspctrm: [128×5×256 double]
> >                       elec: [1×1 struct]
> >                       cfg: [1×1 struct]
> >
> > I yse the next configuration in multiplot_TFR:
> >                       cfg = [];
> >                       cfg.parameter = 'powspctrm';
> >                       cfg.layout = 'bioSemi128.lay';
> >                       cfg.zlim = [-20 20];
> >                       cfg.colorbar='yes';
> >                       cfg.baselinetype = 'absolute';
> >
> >                       ft_multiplotTFR(cfg, data_Fourier_TFR1)
> >
> > It does not give me any error but I do not obtained to plot all the
> channels. The image that I obtained is the following one:
> >
> > <image.png>
> >
> > Does someone how to solve this?
> > Thanks,
> >
> > Elene.
> > _______________________________________________
> > fieldtrip mailing list
> > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> > https://doi.org/10.1371/journal.pcbi.1002202
>
>
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190601/39a8eb87/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From daniel.strahnen at uni-ulm.de  Sun Jun  2 16:28:08 2019
From: daniel.strahnen at uni-ulm.de (daniel.strahnen at uni-ulm.de)
Date: Sun, 2 Jun 2019 16:28:08 +0200
Subject: [FieldTrip] Load already preprocessed data to fieldtrip functions
Message-ID: <000401d5194f$66ece690$34c6b3b0$@uni-ulm.de>

Is it possible to use the fieldtrip functions for already preprocessed data
that is organized in a .mat file. 

The data is stored in a matrix organized as follows: Channels x samples

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190602/37bb8ec8/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From daniel.strahnen at uni-ulm.de  Sun Jun  2 16:28:08 2019
From: daniel.strahnen at uni-ulm.de (daniel.strahnen at uni-ulm.de)
Date: Sun, 2 Jun 2019 16:28:08 +0200
Subject: [FieldTrip] Load already preprocessed data to fieldtrip functions
Message-ID: <000401d5194f$66ece690$34c6b3b0$@uni-ulm.de>

Is it possible to use the fieldtrip functions for already preprocessed data
that is organized in a .mat file. 

The data is stored in a matrix organized as follows: Channels x samples

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190602/37bb8ec8/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jan.schoffelen at donders.ru.nl  Mon Jun  3 16:34:21 2019
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Mon, 3 Jun 2019 14:34:21 +0000
Subject: [FieldTrip] Load already preprocessed data to fieldtrip
 functions
In-Reply-To: <000401d5194f$66ece690$34c6b3b0$@uni-ulm.de>
References: <000401d5194f$66ece690$34c6b3b0$@uni-ulm.de>
Message-ID: <C7C832DB-855E-4E65-9792-1A1A648C69FA@donders.ru.nl>

Hi Daniel,
Yes, that’s possible. Please refer to: http://www.fieldtriptoolbox.org/faq/how_can_i_import_my_own_dataformat/ for more information.
Best wishes,
Jan-Mathijs


On 2 Jun 2019, at 16:28, daniel.strahnen at uni-ulm.de<mailto:daniel.strahnen at uni-ulm.de> wrote:

Is it possible to use the fieldtrip functions for already preprocessed data that is organized in a .mat file.
The data is stored in a matrix organized as follows: Channels x samples
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190603/0d66e13f/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jan.schoffelen at donders.ru.nl  Mon Jun  3 16:34:21 2019
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Mon, 3 Jun 2019 14:34:21 +0000
Subject: [FieldTrip] Load already preprocessed data to fieldtrip
 functions
In-Reply-To: <000401d5194f$66ece690$34c6b3b0$@uni-ulm.de>
References: <000401d5194f$66ece690$34c6b3b0$@uni-ulm.de>
Message-ID: <C7C832DB-855E-4E65-9792-1A1A648C69FA@donders.ru.nl>

Hi Daniel,
Yes, that’s possible. Please refer to: http://www.fieldtriptoolbox.org/faq/how_can_i_import_my_own_dataformat/ for more information.
Best wishes,
Jan-Mathijs


On 2 Jun 2019, at 16:28, daniel.strahnen at uni-ulm.de<mailto:daniel.strahnen at uni-ulm.de> wrote:

Is it possible to use the fieldtrip functions for already preprocessed data that is organized in a .mat file.
The data is stored in a matrix organized as follows: Channels x samples
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190603/0d66e13f/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jan.schoffelen at donders.ru.nl  Mon Jun  3 16:43:07 2019
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Mon, 3 Jun 2019 14:43:07 +0000
Subject: [FieldTrip] ft_freqanalysis error
In-Reply-To: <62F4B8F1-3BF6-4AAB-9B20-01B5958C60C0@cardiff.ac.uk>
References: <62F4B8F1-3BF6-4AAB-9B20-01B5958C60C0@cardiff.ac.uk>
Message-ID: <DD76F3C5-CD61-457E-8AA7-8BD391C65620@donders.ru.nl>

Dear Sarah,

Hmm, hard to tell. Have you checked whether any of the cells in the variable ‘groups’ is empty? Does it happen for each of the ‘groupi’ iterations? Are the elements in groups of type numeric?

Best wishes,
Jan-Mathijs


On 31 May 2019, at 11:53, Sarah Gerson <GersonS at cardiff.ac.uk<mailto:GersonS at cardiff.ac.uk>> wrote:

Hi everyone,

I’m trying to revive an old processing script for TFRs on a new computer and am running into an error I can’t seem to track down.
I want to run ft_freqanalysis and am trying to use a data file that is the output of a preprocessing script that worked fine. As far as I can tell from the fieldtrip guidance/forum, the data structure should be fine, but I am receiving an error stating that it needs to be a cell array (among other errors).

Any help or guidance is greatly appreciated!

For reference, I’ll copy and paste the code that’s creating the error, the errors received, and the data file structure (since this seems to be a source of the error):

Code:
 for groupi = 1:3
    windowsize = 0.5;

      disp('----');       disp('----');
        disp(['loading data from subject ', num2str(subjects), ' || ', 'groups ', num2str(groupi)]);
        disp('----');       disp('----');

        cfg = [];
        cfg.trials         = groups{groupi}%(((length(groups{groupi})/2)+1):end);
        cfg.output         = 'pow';
        cfg.method         = 'mtmconvol'; %'mtmfft';
        cfg.channel         = {'all'}; %mtmfft
        cfg.taper          = 'hanning'; %'dpss';
        cfg.tapsmofrq      = 3;
        cfg.foi            = 1:50;
        cfg.t_ftimwin      =  ones(1, length(cfg.foi))*windowsize; % ones(length(cfg.foi),1).*0.5;
        cfg.toi            = [reref_datam{subject}.time{1}(1) + windowsize/2 : windowsize/5 : reref_datam{subjects}.time{1}(end) - windowsize/2] %0:0.1:2;
        TFR_cond{subjects, groupi}               = ft_freqanalysis(cfg, reref_datam{subjects});
        TFR_cond{subjects, groupi}.cfg = [];
    end;

Errors:

Error using sort
Input argument must be a cell array of character vectors.

Error in ft_selectdata>getselection_rpt (line 1128)
  rptindx = unique(sort(rptindx));

Error in ft_selectdata (line 302)
    [selrpt{i}, dum, rptdim{i}, selrpttap{i}] = getselection_rpt(cfg, varargin{i}, dimord{j});

Error in ft_freqanalysis (line 234)
data = ft_selectdata(tmpcfg, data);

Structure of data:
reref_datam{subjects}

ans =

  struct with fields:

           hdr: [1×1 struct]
       fsample: 500
    sampleinfo: [95×2 double]
     trialinfo: [95×1 double]
         trial: {1×95 cell}
          time: {1×95 cell}
         label: {31×1 cell}
           cfg: [1×1 struct]


—
Sarah A Gerson, PhD
Lecturer
School of Psychology
College of Biomedical & Life Sciences
Cardiff University
70 Park Place
Cardiff
CF10 3AT
Tel: +44 (0)29 2087 0480
Email: GersonS at cardiff.ac.uk<mailto:GersonS at cardiff.ac.uk>
http://psych.cf.ac.uk/contactsandpeople/gersons.php
The University welcomes correspondence in Welsh or English.

Sarah A Gerson, PhD
Darlithydd
Yr Ysgol Seicoleg
Coleg y Gwyddorau Biofeddygol a Bywyd
Prifysgol Caerdydd
70 Plas-y-Parc
Caerdydd
CF10 3AT
Ffôn : +44 (0)29 2087 0480
E-bost: GersonS at cardiff.ac.uk<mailto:GersonS at cardiff.ac.uk>
http://psych.cf.ac.uk/contactsandpeople/gersons.php
Mae'r Brifysgol yn croesawu gohebiaeth yn Gymraeg neu'n Saesneg.



_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190603/24c0708a/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jan.schoffelen at donders.ru.nl  Mon Jun  3 16:43:07 2019
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Mon, 3 Jun 2019 14:43:07 +0000
Subject: [FieldTrip] ft_freqanalysis error
In-Reply-To: <62F4B8F1-3BF6-4AAB-9B20-01B5958C60C0@cardiff.ac.uk>
References: <62F4B8F1-3BF6-4AAB-9B20-01B5958C60C0@cardiff.ac.uk>
Message-ID: <DD76F3C5-CD61-457E-8AA7-8BD391C65620@donders.ru.nl>

Dear Sarah,

Hmm, hard to tell. Have you checked whether any of the cells in the variable ‘groups’ is empty? Does it happen for each of the ‘groupi’ iterations? Are the elements in groups of type numeric?

Best wishes,
Jan-Mathijs


On 31 May 2019, at 11:53, Sarah Gerson <GersonS at cardiff.ac.uk<mailto:GersonS at cardiff.ac.uk>> wrote:

Hi everyone,

I’m trying to revive an old processing script for TFRs on a new computer and am running into an error I can’t seem to track down.
I want to run ft_freqanalysis and am trying to use a data file that is the output of a preprocessing script that worked fine. As far as I can tell from the fieldtrip guidance/forum, the data structure should be fine, but I am receiving an error stating that it needs to be a cell array (among other errors).

Any help or guidance is greatly appreciated!

For reference, I’ll copy and paste the code that’s creating the error, the errors received, and the data file structure (since this seems to be a source of the error):

Code:
 for groupi = 1:3
    windowsize = 0.5;

      disp('----');       disp('----');
        disp(['loading data from subject ', num2str(subjects), ' || ', 'groups ', num2str(groupi)]);
        disp('----');       disp('----');

        cfg = [];
        cfg.trials         = groups{groupi}%(((length(groups{groupi})/2)+1):end);
        cfg.output         = 'pow';
        cfg.method         = 'mtmconvol'; %'mtmfft';
        cfg.channel         = {'all'}; %mtmfft
        cfg.taper          = 'hanning'; %'dpss';
        cfg.tapsmofrq      = 3;
        cfg.foi            = 1:50;
        cfg.t_ftimwin      =  ones(1, length(cfg.foi))*windowsize; % ones(length(cfg.foi),1).*0.5;
        cfg.toi            = [reref_datam{subject}.time{1}(1) + windowsize/2 : windowsize/5 : reref_datam{subjects}.time{1}(end) - windowsize/2] %0:0.1:2;
        TFR_cond{subjects, groupi}               = ft_freqanalysis(cfg, reref_datam{subjects});
        TFR_cond{subjects, groupi}.cfg = [];
    end;

Errors:

Error using sort
Input argument must be a cell array of character vectors.

Error in ft_selectdata>getselection_rpt (line 1128)
  rptindx = unique(sort(rptindx));

Error in ft_selectdata (line 302)
    [selrpt{i}, dum, rptdim{i}, selrpttap{i}] = getselection_rpt(cfg, varargin{i}, dimord{j});

Error in ft_freqanalysis (line 234)
data = ft_selectdata(tmpcfg, data);

Structure of data:
reref_datam{subjects}

ans =

  struct with fields:

           hdr: [1×1 struct]
       fsample: 500
    sampleinfo: [95×2 double]
     trialinfo: [95×1 double]
         trial: {1×95 cell}
          time: {1×95 cell}
         label: {31×1 cell}
           cfg: [1×1 struct]


—
Sarah A Gerson, PhD
Lecturer
School of Psychology
College of Biomedical & Life Sciences
Cardiff University
70 Park Place
Cardiff
CF10 3AT
Tel: +44 (0)29 2087 0480
Email: GersonS at cardiff.ac.uk<mailto:GersonS at cardiff.ac.uk>
http://psych.cf.ac.uk/contactsandpeople/gersons.php
The University welcomes correspondence in Welsh or English.

Sarah A Gerson, PhD
Darlithydd
Yr Ysgol Seicoleg
Coleg y Gwyddorau Biofeddygol a Bywyd
Prifysgol Caerdydd
70 Plas-y-Parc
Caerdydd
CF10 3AT
Ffôn : +44 (0)29 2087 0480
E-bost: GersonS at cardiff.ac.uk<mailto:GersonS at cardiff.ac.uk>
http://psych.cf.ac.uk/contactsandpeople/gersons.php
Mae'r Brifysgol yn croesawu gohebiaeth yn Gymraeg neu'n Saesneg.



_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190603/24c0708a/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jan.schoffelen at donders.ru.nl  Mon Jun  3 16:46:14 2019
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Mon, 3 Jun 2019 14:46:14 +0000
Subject: [FieldTrip] Error related to ft_postamble_provenance
In-Reply-To: <6CB19FB7-B4CF-4847-AAB3-92E996225250@rockefeller.edu>
References: <6CB19FB7-B4CF-4847-AAB3-92E996225250@rockefeller.edu>
Message-ID: <0EBD133A-F213-4719-8B66-90FC6C583352@donders.ru.nl>

Hi Yuriria,

Are you sure that the quoted line  'freqall = ft_appendfreq(cfg, freqall.freq);’ is correct? Reading this, I would assume that the input argument freqall is a structure, and that freqall.freq is a vector, which is an incorrect input to ft_appendfreq to begin with.

Best wishes,
Jan-Mathijs

On 30 May 2019, at 17:13, Yuriria Vazquez Zuniga <yvazquez at mail.rockefeller.edu<mailto:yvazquez at mail.rockefeller.edu>> wrote:

Hello,

I keep having the following error when I try to run several of the fieldtrip functions like:
 ft_freqgrandaverage, ft_redefinetrial, ft_appendfreq, etc….

The error is related to the software not been able to find the function or variable 'ftohDiW7th_FuncMem’.

Text Error is the following:
Undefined function or variable 'ftohDiW7th_FuncMem'.

Error in ft_postamble_provenance (line 56)
cfg.callinfo.procmem  = memtoc(ftohDiW7th_FuncMem);

Error in ft_postamble (line 55)
  evalin('caller', ['ft_postamble_' cmd]);

Error in ft_selectdata (line 454)
ft_postamble provenance         % this records the time and memory at the end of the function, prints
them on screen and adds this information together with the function name and MATLAB version etc. to
the output cfg

Error in ft_appendfreq (line 176)
    [varargin{:}]    = ft_selectdata(tmpcfg, varargin{:});

Error in CollapseSessionsPerDay_n_Average_CaseRest (line 149)
    freqall = ft_appendfreq(cfg, freqall.freq);

I checked for my startup Mfile, and I configured as  indicated in:
http://www.fieldtriptoolbox.org/faq/should_i_add_fieldtrip_with_all_subdirectories_to_my_matlab_path/

Do you guys have any suggestion on how to debug this?
All the best,

Yuriria
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190603/ecce8eb8/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jan.schoffelen at donders.ru.nl  Mon Jun  3 16:46:14 2019
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Mon, 3 Jun 2019 14:46:14 +0000
Subject: [FieldTrip] Error related to ft_postamble_provenance
In-Reply-To: <6CB19FB7-B4CF-4847-AAB3-92E996225250@rockefeller.edu>
References: <6CB19FB7-B4CF-4847-AAB3-92E996225250@rockefeller.edu>
Message-ID: <0EBD133A-F213-4719-8B66-90FC6C583352@donders.ru.nl>

Hi Yuriria,

Are you sure that the quoted line  'freqall = ft_appendfreq(cfg, freqall.freq);’ is correct? Reading this, I would assume that the input argument freqall is a structure, and that freqall.freq is a vector, which is an incorrect input to ft_appendfreq to begin with.

Best wishes,
Jan-Mathijs

On 30 May 2019, at 17:13, Yuriria Vazquez Zuniga <yvazquez at mail.rockefeller.edu<mailto:yvazquez at mail.rockefeller.edu>> wrote:

Hello,

I keep having the following error when I try to run several of the fieldtrip functions like:
 ft_freqgrandaverage, ft_redefinetrial, ft_appendfreq, etc….

The error is related to the software not been able to find the function or variable 'ftohDiW7th_FuncMem’.

Text Error is the following:
Undefined function or variable 'ftohDiW7th_FuncMem'.

Error in ft_postamble_provenance (line 56)
cfg.callinfo.procmem  = memtoc(ftohDiW7th_FuncMem);

Error in ft_postamble (line 55)
  evalin('caller', ['ft_postamble_' cmd]);

Error in ft_selectdata (line 454)
ft_postamble provenance         % this records the time and memory at the end of the function, prints
them on screen and adds this information together with the function name and MATLAB version etc. to
the output cfg

Error in ft_appendfreq (line 176)
    [varargin{:}]    = ft_selectdata(tmpcfg, varargin{:});

Error in CollapseSessionsPerDay_n_Average_CaseRest (line 149)
    freqall = ft_appendfreq(cfg, freqall.freq);

I checked for my startup Mfile, and I configured as  indicated in:
http://www.fieldtriptoolbox.org/faq/should_i_add_fieldtrip_with_all_subdirectories_to_my_matlab_path/

Do you guys have any suggestion on how to debug this?
All the best,

Yuriria
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190603/ecce8eb8/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jan.schoffelen at donders.ru.nl  Mon Jun  3 16:40:19 2019
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Mon, 3 Jun 2019 14:40:19 +0000
Subject: [FieldTrip] Assigning Channels - Error channel layout
In-Reply-To: <CABoLA=1B_Oy8rTU9X8MqUjo-iS1EUpUL1xANgpXhA8FL96UdYA@mail.gmail.com>
References: <CABoLA=1B_Oy8rTU9X8MqUjo-iS1EUpUL1xANgpXhA8FL96UdYA@mail.gmail.com>
Message-ID: <FFBA441F-C55B-47BB-BF96-B92D2709B04B@donders.ru.nl>

Hi Danielle,

You need to have a close look at what you define to be cfg.channel. This should be a list of channel names: {’somechannel’;’someotherchannel’;’yetanotherchannel’}, or simply ‘all’, rather than a layout structure that you currently provide.

Best wishes,
Jan-Mathijs


On 31 May 2019, at 18:46, Taylor, Danielle <danielle.taylor at okstate.edu<mailto:danielle.taylor at okstate.edu>> wrote:

Hello Fieldtrippers,

My name is Danielle Taylor, and I have been developing a script that reads in data which have been preprocessed using EEGlab, in order to run a frequency analysis.

I've been successful at compiling an ERP thus far in FieldTrip. However, when I attempted to run a frequency analysis on a particular channel (Oz), it turned out that I could not select this channel, as channels had never been assigned when loading my EEGlab file.

Therefore, I am reformatting my Fieldtrip preprocessing script, but have run into an error. I can't seem to find any record of others running into this error in the discussion either, so I'm not quite sure how to move forward. My guess is that because the file is no longer a bdf (biosemi file), but instead a .set (from eeglab), that there might be problems assigning channels, but that is purely a guess.

The error I get is:
Error using load
Unknown text on line number 1 of ASCII file C:\Users\danie\fieldtrip\template\layout\biosemi32.lay
"Fp1".

Here is the script I have so far:

path_ft = 'C:/Users/danie/fieldtrip';
path_data = 'C:/Users/danie/OneDrive - Oklahoma A and M System/LEAP/ALE/EEG/SSVEP/';

addpath(path_ft);
ft_defaults;

subjects = {'001' '002' '003' '004' '005' '006' '007' '008' '009' '010'...
            '012' '013' '014' '015' '016' '017' '018' '021' '022' '023'...
            '025' '026' '027' '029' '031' '032' '033' '035' '036' '037'...
            '038' '040' '041' '043' '044' '045' '047' '049' '050' '051'...
            '052' '053' '054' '055' '056' '057' '058' '059' '060' '061'...
            '062' '063' '064' '065' '066' '067' '068' '069' '070' '071'...
            '072' '073' '074' '075' '076'};

 load (fullfile(path_ft,'template','layout','biosemi32.lay'));
 biosemi32_layout = ft_prepare_layout(cfg);

for i=1:length(subjects)

    ftype = 'eeglab_set';
    datapath = strcat(path_data, subjects{i});
    dataset = fullfile(datapath, strcat(subjects{i},'.set'));

    cfg           = [];
    cfg.dataset = dataset;
    cfg.headerfile = dataset;
    cfg.dataformat = ftype;
    cfg.headerformat = ftype;

    cfg           = [];
    cfg.dataset = dataset;
    cfg.trialfun  = 'ft_trialfun_general';
    cfg.trialdef.eventtype = 'trigger';
    cfg.trialdef.eventvalue = 'B3(5)';
    cfg.trialdef.prestim    = .2;
    cfg.trialdef.poststim   = 3;
    cfg = ft_definetrial(cfg);
    trl           = cfg.trl;

    cfg.dataset = dataset;
    cfg.channel = biosemi32_layout;
    cfg.outputfile = fullfile(datapath,  'dataPNU');
    ft_preprocessing(cfg);
end

Any assistance would be greatly appreciated!
Thank you all,

Danielle Taylor, M.S.
Doctoral Candidate,
Clinical Psychology
Oklahoma State University

Breach of Confidentiality or Accidental Breach of Confidentiality: This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed.  If you have received this email in error please notify the sender. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute, or copy this email. Please notify the sender immediately by email if you have received this email by mistake and delete this email from your system. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited.
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190603/1d84a4e1/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jan.schoffelen at donders.ru.nl  Mon Jun  3 16:40:19 2019
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Mon, 3 Jun 2019 14:40:19 +0000
Subject: [FieldTrip] Assigning Channels - Error channel layout
In-Reply-To: <CABoLA=1B_Oy8rTU9X8MqUjo-iS1EUpUL1xANgpXhA8FL96UdYA@mail.gmail.com>
References: <CABoLA=1B_Oy8rTU9X8MqUjo-iS1EUpUL1xANgpXhA8FL96UdYA@mail.gmail.com>
Message-ID: <FFBA441F-C55B-47BB-BF96-B92D2709B04B@donders.ru.nl>

Hi Danielle,

You need to have a close look at what you define to be cfg.channel. This should be a list of channel names: {’somechannel’;’someotherchannel’;’yetanotherchannel’}, or simply ‘all’, rather than a layout structure that you currently provide.

Best wishes,
Jan-Mathijs


On 31 May 2019, at 18:46, Taylor, Danielle <danielle.taylor at okstate.edu<mailto:danielle.taylor at okstate.edu>> wrote:

Hello Fieldtrippers,

My name is Danielle Taylor, and I have been developing a script that reads in data which have been preprocessed using EEGlab, in order to run a frequency analysis.

I've been successful at compiling an ERP thus far in FieldTrip. However, when I attempted to run a frequency analysis on a particular channel (Oz), it turned out that I could not select this channel, as channels had never been assigned when loading my EEGlab file.

Therefore, I am reformatting my Fieldtrip preprocessing script, but have run into an error. I can't seem to find any record of others running into this error in the discussion either, so I'm not quite sure how to move forward. My guess is that because the file is no longer a bdf (biosemi file), but instead a .set (from eeglab), that there might be problems assigning channels, but that is purely a guess.

The error I get is:
Error using load
Unknown text on line number 1 of ASCII file C:\Users\danie\fieldtrip\template\layout\biosemi32.lay
"Fp1".

Here is the script I have so far:

path_ft = 'C:/Users/danie/fieldtrip';
path_data = 'C:/Users/danie/OneDrive - Oklahoma A and M System/LEAP/ALE/EEG/SSVEP/';

addpath(path_ft);
ft_defaults;

subjects = {'001' '002' '003' '004' '005' '006' '007' '008' '009' '010'...
            '012' '013' '014' '015' '016' '017' '018' '021' '022' '023'...
            '025' '026' '027' '029' '031' '032' '033' '035' '036' '037'...
            '038' '040' '041' '043' '044' '045' '047' '049' '050' '051'...
            '052' '053' '054' '055' '056' '057' '058' '059' '060' '061'...
            '062' '063' '064' '065' '066' '067' '068' '069' '070' '071'...
            '072' '073' '074' '075' '076'};

 load (fullfile(path_ft,'template','layout','biosemi32.lay'));
 biosemi32_layout = ft_prepare_layout(cfg);

for i=1:length(subjects)

    ftype = 'eeglab_set';
    datapath = strcat(path_data, subjects{i});
    dataset = fullfile(datapath, strcat(subjects{i},'.set'));

    cfg           = [];
    cfg.dataset = dataset;
    cfg.headerfile = dataset;
    cfg.dataformat = ftype;
    cfg.headerformat = ftype;

    cfg           = [];
    cfg.dataset = dataset;
    cfg.trialfun  = 'ft_trialfun_general';
    cfg.trialdef.eventtype = 'trigger';
    cfg.trialdef.eventvalue = 'B3(5)';
    cfg.trialdef.prestim    = .2;
    cfg.trialdef.poststim   = 3;
    cfg = ft_definetrial(cfg);
    trl           = cfg.trl;

    cfg.dataset = dataset;
    cfg.channel = biosemi32_layout;
    cfg.outputfile = fullfile(datapath,  'dataPNU');
    ft_preprocessing(cfg);
end

Any assistance would be greatly appreciated!
Thank you all,

Danielle Taylor, M.S.
Doctoral Candidate,
Clinical Psychology
Oklahoma State University

Breach of Confidentiality or Accidental Breach of Confidentiality: This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed.  If you have received this email in error please notify the sender. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute, or copy this email. Please notify the sender immediately by email if you have received this email by mistake and delete this email from your system. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited.
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190603/1d84a4e1/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jan.schoffelen at donders.ru.nl  Mon Jun  3 17:00:55 2019
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Mon, 3 Jun 2019 15:00:55 +0000
Subject: [FieldTrip] Infinite recursion tutorial problem
In-Reply-To: <43d0-5ce28a80-f3-d71c800@3416461>
References: <43d0-5ce28a80-f3-d71c800@3416461>
Message-ID: <58F91E70-D38D-4469-AE6C-43B34D55DA80@donders.ru.nl>

Hi Grégoire,
It is not clear why you are having this problem. We miss the full error stack in your message, so it’s not clear in which fieldtrip function the error is thrown.
Also, have you checked (and ensured) that the triplet of ‘vhdr’,’eeg’,’mrk’ are in the same folder?

Best wishes,
Jan-Mathijs


On 20 May 2019, at 13:08, VERGOTTE Gregoire <Gregoire.VERGOTTE at isae-supaero.fr<mailto:Gregoire.VERGOTTE at isae-supaero.fr>> wrote:

Dear community,

I encounter a problem when I want to follow the tutorial"Preprocessing - reading continuous EEG and MEG data" from the first step.

cfg = [];
cfg.dataset     = 'subj2.vhdr';
data_eeg        = ft_preprocessing(cfg)

Return the following error:

Out of memory. The likely cause is an infinite recursion within the program.

Error in fileparts (line 40)
elseif ~isrow(file)

Do you know why I'm having this problem? (I use Matlab 2019a and I downloaded SubjectEEG and Subject01 files).

Regards,
--
---
Grégoire Vergotte
Post-Doctorant
gregoire.vergotte at isae-supaero.fr<mailto:gregoire.vergotte at isae-supaero.fr>

https://www.isae-supaero.fr<https://www.isae-supaero.fr/>
Institut Supérieur de l'Aéronautique et de l'Espace
10, avenue Edouard Belin - BP 54032
31055 Toulouse Cedex 4
France



Suivez l'ISAE-SUPAERO sur les réseaux sociaux / Follow the ISAE-SUPAERO on the social media
Facebook<https://fr-fr.facebook.com/isae.supaero> Twitter<https://twitter.com/isae_officiel> LinkedIn<https://www.linkedin.com/school/isae/> Youtube<https://www.youtube.com/user/ISAEcom> Instagram<https://www.instagram.com/isae_supaero/>

_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190603/edfbac18/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jan.schoffelen at donders.ru.nl  Mon Jun  3 17:00:55 2019
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Mon, 3 Jun 2019 15:00:55 +0000
Subject: [FieldTrip] Infinite recursion tutorial problem
In-Reply-To: <43d0-5ce28a80-f3-d71c800@3416461>
References: <43d0-5ce28a80-f3-d71c800@3416461>
Message-ID: <58F91E70-D38D-4469-AE6C-43B34D55DA80@donders.ru.nl>

Hi Grégoire,
It is not clear why you are having this problem. We miss the full error stack in your message, so it’s not clear in which fieldtrip function the error is thrown.
Also, have you checked (and ensured) that the triplet of ‘vhdr’,’eeg’,’mrk’ are in the same folder?

Best wishes,
Jan-Mathijs


On 20 May 2019, at 13:08, VERGOTTE Gregoire <Gregoire.VERGOTTE at isae-supaero.fr<mailto:Gregoire.VERGOTTE at isae-supaero.fr>> wrote:

Dear community,

I encounter a problem when I want to follow the tutorial"Preprocessing - reading continuous EEG and MEG data" from the first step.

cfg = [];
cfg.dataset     = 'subj2.vhdr';
data_eeg        = ft_preprocessing(cfg)

Return the following error:

Out of memory. The likely cause is an infinite recursion within the program.

Error in fileparts (line 40)
elseif ~isrow(file)

Do you know why I'm having this problem? (I use Matlab 2019a and I downloaded SubjectEEG and Subject01 files).

Regards,
--
---
Grégoire Vergotte
Post-Doctorant
gregoire.vergotte at isae-supaero.fr<mailto:gregoire.vergotte at isae-supaero.fr>

https://www.isae-supaero.fr<https://www.isae-supaero.fr/>
Institut Supérieur de l'Aéronautique et de l'Espace
10, avenue Edouard Belin - BP 54032
31055 Toulouse Cedex 4
France



Suivez l'ISAE-SUPAERO sur les réseaux sociaux / Follow the ISAE-SUPAERO on the social media
Facebook<https://fr-fr.facebook.com/isae.supaero> Twitter<https://twitter.com/isae_officiel> LinkedIn<https://www.linkedin.com/school/isae/> Youtube<https://www.youtube.com/user/ISAEcom> Instagram<https://www.instagram.com/isae_supaero/>

_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190603/edfbac18/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From thomas.lusignan at gmail.com  Mon Jun  3 17:00:42 2019
From: thomas.lusignan at gmail.com (Thomas Lusignan)
Date: Mon, 3 Jun 2019 11:00:42 -0400
Subject: [FieldTrip] Fwd: Getting data from a database instead of files
In-Reply-To: <CA+P_HzdoSsdv=t+TDc9aTJJfiagnOPgyBy+hxtXFnXe_5-FKvg@mail.gmail.com>
References: <CA+P_HzdRM_myzfe27DYYkahi0wTqn-+rseWg9zWTj6kJpKb65Q@mail.gmail.com>
 <CA+P_HzdoSsdv=t+TDc9aTJJfiagnOPgyBy+hxtXFnXe_5-FKvg@mail.gmail.com>
Message-ID: <CA+P_Hzdn93ebZxFmLBxEVBoQapdyrgFUAh6hdhp+opzCggOHmA@mail.gmail.com>

Hi everyone,

I'm Thomas, a Master's student in Paul Cisek's lab at Université de
Montréal, Canada, and also a FieldTrip newbie. My project is to analyse LFP
data from chronically implanted electrodes
<https://www.graymatter-research.com/32-channel-microdrive-system-sc32/> in
monkeys during a decision-making task. FieldTrip seems to be the best, most
complete tool for this job. However.

Since we have years worth of data, we have everything stored and organized
(with extensive bookkeeping) in an SQL database and have an in-house
toolbox to get it into MATLAB. This means using the original files created
every day is counter-productive in my situation. Therefore, I have tried to
create a data structure that would work with FT functions by getting data
from our database, however FieldTrip seems to *really* want to get its data
from files.

Has using self-made data structures ever been done? *Can* it be done?

In time, I would like to use as many FieldTrip functions as is applicable,
but I tried to start by using ft_freqanalysis to get time-frequency
representations. Here's


Here's what I did:




*1- Get the data for a subset of my choosing (I tried everything with a
small 4-channel, 55-trials subset)*
*2- Put that data into a structure built as follows, adding fields that
FieldTrip required:*

    fsample: 1017           (I know this is weird but we're stuck with it)
   channels: [1 17 25 29]   Added to keep track of in-house bookkeeping
      label: {'Ch:1 idElectrodeSite:181'  'Ch:17 idElectrodeSite:183'
'Ch:25 idElectrodeSite:184'
              'Ch:29 idElectrodeSite:185'}  Not the right structure, but I
don't have header files to get them from
      trial: {55×1 cell}    One cell per trial, with each being [chan x
time]
       time: {55×1 cell}    One cell per trial, each going from -750ms to
750ms (around target onset) This includes a 250ms pad on each side.
        trl: [55×3 double]  Built from scratch as if the trials were
continuous. (Inspired by the FT function that does this)
     dimord: 'chan_time'    Added by hand, can't get Fieldtrip to recognize
it
 sampleinfo: [55×2 double]  The first two columns of trl



*3- Try to use ft_freqanalysis using the following cfg (also attached)*
cfg = [];
cfg.method= 'tfr';
cfg.pad = 'nextpow2';
cfg.width = 7;
cfg.gwidth = 3;
cfg.foi = [15:1:60];
cfg.toi = 'all';

I first get the message:
the input is raw data with 4 channels and 55 trial
This would be encouraging, but then, I get the following warnings:

Warning: could not determine dimord of "trial" in: (structure shown above)
Warning: could not determine dimord of "trl" in:   (structure shown above)
...but four pairs of them.

Looking through the debugger, I found out they're given when ft_freqanalysis,
calls ft_checkdata and ft_selectdata.
*Are these warnings something I should be worried about, or can everything
work well the way it is?*
Also, how is it that FT 'could not determine dimord' when I give it one in
the data structure, and it seems to understand the way it works given the
message it sends at the beginning?

After the warnings, I get this:

the call to "ft_selectdata" took 16 seconds
processing trials
trial 2, frequency 32 (46.18 Hz)
Array dimensions must match for binary array op.

Error in ft_freqanalysis (line 679)
            trlcnt(1, ifoi, :) = trlcnt(1, ifoi, :) +
shiftdim(double(acttboi(:)'),-1);

...which I simply don't know how to solve.


*So in summary:*

1- Is it possible to make FT work without using original files to get the
data?
2- If it is, what have I done wrong, and how could I make it work?
3- Are the warnings worrisome or is it just a natural consequence of trying
to jerry-rig data in FT?
4- Any idea on how to solve the error message I get is appreciated, but a
secondary objective.

I attached the function I made to build the data structure in case it could
help.


Thank you very much for reading this long-winded message!

Regards

Thomas Lusignan, B. Sc.
Paul Cisek's Lab
Université de Montréal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190603/a5c8b42e/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GetFTLFP.m
Type: text/x-objcsrc
Size: 3745 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190603/a5c8b42e/attachment.bin>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From thomas.lusignan at gmail.com  Mon Jun  3 17:00:42 2019
From: thomas.lusignan at gmail.com (Thomas Lusignan)
Date: Mon, 3 Jun 2019 11:00:42 -0400
Subject: [FieldTrip] Fwd: Getting data from a database instead of files
In-Reply-To: <CA+P_HzdoSsdv=t+TDc9aTJJfiagnOPgyBy+hxtXFnXe_5-FKvg@mail.gmail.com>
References: <CA+P_HzdRM_myzfe27DYYkahi0wTqn-+rseWg9zWTj6kJpKb65Q@mail.gmail.com>
 <CA+P_HzdoSsdv=t+TDc9aTJJfiagnOPgyBy+hxtXFnXe_5-FKvg@mail.gmail.com>
Message-ID: <CA+P_Hzdn93ebZxFmLBxEVBoQapdyrgFUAh6hdhp+opzCggOHmA@mail.gmail.com>

Hi everyone,

I'm Thomas, a Master's student in Paul Cisek's lab at Université de
Montréal, Canada, and also a FieldTrip newbie. My project is to analyse LFP
data from chronically implanted electrodes
<https://www.graymatter-research.com/32-channel-microdrive-system-sc32/> in
monkeys during a decision-making task. FieldTrip seems to be the best, most
complete tool for this job. However.

Since we have years worth of data, we have everything stored and organized
(with extensive bookkeeping) in an SQL database and have an in-house
toolbox to get it into MATLAB. This means using the original files created
every day is counter-productive in my situation. Therefore, I have tried to
create a data structure that would work with FT functions by getting data
from our database, however FieldTrip seems to *really* want to get its data
from files.

Has using self-made data structures ever been done? *Can* it be done?

In time, I would like to use as many FieldTrip functions as is applicable,
but I tried to start by using ft_freqanalysis to get time-frequency
representations. Here's


Here's what I did:




*1- Get the data for a subset of my choosing (I tried everything with a
small 4-channel, 55-trials subset)*
*2- Put that data into a structure built as follows, adding fields that
FieldTrip required:*

    fsample: 1017           (I know this is weird but we're stuck with it)
   channels: [1 17 25 29]   Added to keep track of in-house bookkeeping
      label: {'Ch:1 idElectrodeSite:181'  'Ch:17 idElectrodeSite:183'
'Ch:25 idElectrodeSite:184'
              'Ch:29 idElectrodeSite:185'}  Not the right structure, but I
don't have header files to get them from
      trial: {55×1 cell}    One cell per trial, with each being [chan x
time]
       time: {55×1 cell}    One cell per trial, each going from -750ms to
750ms (around target onset) This includes a 250ms pad on each side.
        trl: [55×3 double]  Built from scratch as if the trials were
continuous. (Inspired by the FT function that does this)
     dimord: 'chan_time'    Added by hand, can't get Fieldtrip to recognize
it
 sampleinfo: [55×2 double]  The first two columns of trl



*3- Try to use ft_freqanalysis using the following cfg (also attached)*
cfg = [];
cfg.method= 'tfr';
cfg.pad = 'nextpow2';
cfg.width = 7;
cfg.gwidth = 3;
cfg.foi = [15:1:60];
cfg.toi = 'all';

I first get the message:
the input is raw data with 4 channels and 55 trial
This would be encouraging, but then, I get the following warnings:

Warning: could not determine dimord of "trial" in: (structure shown above)
Warning: could not determine dimord of "trl" in:   (structure shown above)
...but four pairs of them.

Looking through the debugger, I found out they're given when ft_freqanalysis,
calls ft_checkdata and ft_selectdata.
*Are these warnings something I should be worried about, or can everything
work well the way it is?*
Also, how is it that FT 'could not determine dimord' when I give it one in
the data structure, and it seems to understand the way it works given the
message it sends at the beginning?

After the warnings, I get this:

the call to "ft_selectdata" took 16 seconds
processing trials
trial 2, frequency 32 (46.18 Hz)
Array dimensions must match for binary array op.

Error in ft_freqanalysis (line 679)
            trlcnt(1, ifoi, :) = trlcnt(1, ifoi, :) +
shiftdim(double(acttboi(:)'),-1);

...which I simply don't know how to solve.


*So in summary:*

1- Is it possible to make FT work without using original files to get the
data?
2- If it is, what have I done wrong, and how could I make it work?
3- Are the warnings worrisome or is it just a natural consequence of trying
to jerry-rig data in FT?
4- Any idea on how to solve the error message I get is appreciated, but a
secondary objective.

I attached the function I made to build the data structure in case it could
help.


Thank you very much for reading this long-winded message!

Regards

Thomas Lusignan, B. Sc.
Paul Cisek's Lab
Université de Montréal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190603/a5c8b42e/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GetFTLFP.m
Type: text/x-objcsrc
Size: 3745 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190603/a5c8b42e/attachment-0001.bin>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jan.schoffelen at donders.ru.nl  Mon Jun  3 16:58:52 2019
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Mon, 3 Jun 2019 14:58:52 +0000
Subject: [FieldTrip] Creating a BEM volume conduction model of the head
 for source-reconstruction of EEG data related question
In-Reply-To: <CAHb-gxmdC=8z1Mf9dDh3+yLMqU9F_aJ6ng0WLuR5M9q8A4D-zQ@mail.gmail.com>
References: <CAHb-gxmdC=8z1Mf9dDh3+yLMqU9F_aJ6ng0WLuR5M9q8A4D-zQ@mail.gmail.com>
Message-ID: <6CAF2D59-B907-4B43-86B7-54B41524C5C9@donders.ru.nl>

Hi Anik,


On 29 May 2019, at 20:36, Anik Das <anik.nicks at gmail.com<mailto:anik.nicks at gmail.com>> wrote:

I was working with "Creating a BEM volume conduction model of the head for source-reconstruction of EEG data" founded from: http://www.fieldtriptoolbox.org/tutorial/headmodel_eeg_bem/ .I've some questions regarding this
1. Is the head-model(only for vol.bnd(3) coordinates) origin in figure is (0,0,0) ?

Well, the origin by definition is (0,0,0), that’s why it’s called ‘origin’ :). This is independent of the object.

2. if so, does the x, y axis for origin (0,0,0) intersect the points  ‘Nz’, ‘LPA’ and ‘RPA’ like ctf coordinate system(http://www.fieldtriptoolbox.org/faq/how_are_the_different_head_and_mri_coordinate_systems_defined/)?
<image.png>

I don’t know. You can evaluate this yourself, using the ft_determine_coordsys function. To me, it looks as if the coordinate system is acpc-based RAS. But I could be wrong.

Best wishes,
Jan-Mathijs



_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190603/c59b02e1/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jan.schoffelen at donders.ru.nl  Mon Jun  3 16:58:52 2019
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Mon, 3 Jun 2019 14:58:52 +0000
Subject: [FieldTrip] Creating a BEM volume conduction model of the head
 for source-reconstruction of EEG data related question
In-Reply-To: <CAHb-gxmdC=8z1Mf9dDh3+yLMqU9F_aJ6ng0WLuR5M9q8A4D-zQ@mail.gmail.com>
References: <CAHb-gxmdC=8z1Mf9dDh3+yLMqU9F_aJ6ng0WLuR5M9q8A4D-zQ@mail.gmail.com>
Message-ID: <6CAF2D59-B907-4B43-86B7-54B41524C5C9@donders.ru.nl>

Hi Anik,


On 29 May 2019, at 20:36, Anik Das <anik.nicks at gmail.com<mailto:anik.nicks at gmail.com>> wrote:

I was working with "Creating a BEM volume conduction model of the head for source-reconstruction of EEG data" founded from: http://www.fieldtriptoolbox.org/tutorial/headmodel_eeg_bem/ .I've some questions regarding this
1. Is the head-model(only for vol.bnd(3) coordinates) origin in figure is (0,0,0) ?

Well, the origin by definition is (0,0,0), that’s why it’s called ‘origin’ :). This is independent of the object.

2. if so, does the x, y axis for origin (0,0,0) intersect the points  ‘Nz’, ‘LPA’ and ‘RPA’ like ctf coordinate system(http://www.fieldtriptoolbox.org/faq/how_are_the_different_head_and_mri_coordinate_systems_defined/)?
<image.png>

I don’t know. You can evaluate this yourself, using the ft_determine_coordsys function. To me, it looks as if the coordinate system is acpc-based RAS. But I could be wrong.

Best wishes,
Jan-Mathijs



_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190603/c59b02e1/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jan.schoffelen at donders.ru.nl  Mon Jun  3 17:07:27 2019
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Mon, 3 Jun 2019 15:07:27 +0000
Subject: [FieldTrip] Fwd: Getting data from a database instead of files
In-Reply-To: <CA+P_Hzdn93ebZxFmLBxEVBoQapdyrgFUAh6hdhp+opzCggOHmA@mail.gmail.com>
References: <CA+P_HzdRM_myzfe27DYYkahi0wTqn-+rseWg9zWTj6kJpKb65Q@mail.gmail.com>
 <CA+P_HzdoSsdv=t+TDc9aTJJfiagnOPgyBy+hxtXFnXe_5-FKvg@mail.gmail.com>
 <CA+P_Hzdn93ebZxFmLBxEVBoQapdyrgFUAh6hdhp+opzCggOHmA@mail.gmail.com>
Message-ID: <511490D9-FFFD-4516-ADE4-537F68647B2F@donders.ru.nl>

Hi Thomas,

Thanks for your informative e-mail :).

Here's what I did:


1- Get the data for a subset of my choosing (I tried everything with a small 4-channel, 55-trials subset)

2- Put that data into a structure built as follows, adding fields that FieldTrip required:

    fsample: 1017           (I know this is weird but we're stuck with it)
   channels: [1 17 25 29]   Added to keep track of in-house bookkeeping
      label: {'Ch:1 idElectrodeSite:181'  'Ch:17 idElectrodeSite:183'  'Ch:25 idElectrodeSite:184'
              'Ch:29 idElectrodeSite:185'}  Not the right structure, but I don't have header files to get them from
      trial: {55×1 cell}    One cell per trial, with each being [chan x time]
       time: {55×1 cell}    One cell per trial, each going from -750ms to 750ms (around target onset) This includes a 250ms pad on each side.
        trl: [55×3 double]  Built from scratch as if the trials were continuous. (Inspired by the FT function that does this)
     dimord: 'chan_time'    Added by hand, can't get Fieldtrip to recognize it
 sampleinfo: [55×2 double]  The first two columns of trl


You may need to get rid of the following fields: ’trl’ ‘dimord’ and ‘channels’. Once this is done, I think you are ready to go, without warnings and errors.


3- Try to use ft_freqanalysis using the following cfg (also attached)

cfg = [];
cfg.method= 'tfr';
cfg.pad = 'nextpow2';
cfg.width = 7;
cfg.gwidth = 3;
cfg.foi = [15:1:60];
cfg.toi = 'all';

I first get the message:
the input is raw data with 4 channels and 55 trial
This would be encouraging, but then, I get the following warnings:

Warning: could not determine dimord of "trial" in: (structure shown above)
Warning: could not determine dimord of "trl" in:   (structure shown above)
...but four pairs of them.

Looking through the debugger, I found out they're given when ft_freqanalysis, calls ft_checkdata and ft_selectdata.
Are these warnings something I should be worried about, or can everything work well the way it is?
Also, how is it that FT 'could not determine dimord' when I give it one in the data structure, and it seems to understand the way it works given the message it sends at the beginning?

After the warnings, I get this:

the call to "ft_selectdata" took 16 seconds
processing trials
trial 2, frequency 32 (46.18 Hz)
Array dimensions must match for binary array op.

Error in ft_freqanalysis (line 679)
            trlcnt(1, ifoi, :) = trlcnt(1, ifoi, :) + shiftdim(double(acttboi(:)'),-1);

...which I simply don't know how to solve.


So in summary:

1- Is it possible to make FT work without using original files to get the data?


Yes!

2- If it is, what have I done wrong, and how could I make it work?

See above.


3- Are the warnings worrisome or is it just a natural consequence of trying to jerry-rig data in FT?

Not worrisome, they should go away if you do exactly as I told :).

4- Any idea on how to solve the error message I get is appreciated, but a secondary objective.

Probably it goes away.

Keep up the good work and with best wishes,
Jan-Mathijs



I attached the function I made to build the data structure in case it could help.


Thank you very much for reading this long-winded message!

Regards

Thomas Lusignan, B. Sc.
Paul Cisek's Lab
Université de Montréal
<GetFTLFP.m>_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190603/baabd496/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jan.schoffelen at donders.ru.nl  Mon Jun  3 17:07:27 2019
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Mon, 3 Jun 2019 15:07:27 +0000
Subject: [FieldTrip] Fwd: Getting data from a database instead of files
In-Reply-To: <CA+P_Hzdn93ebZxFmLBxEVBoQapdyrgFUAh6hdhp+opzCggOHmA@mail.gmail.com>
References: <CA+P_HzdRM_myzfe27DYYkahi0wTqn-+rseWg9zWTj6kJpKb65Q@mail.gmail.com>
 <CA+P_HzdoSsdv=t+TDc9aTJJfiagnOPgyBy+hxtXFnXe_5-FKvg@mail.gmail.com>
 <CA+P_Hzdn93ebZxFmLBxEVBoQapdyrgFUAh6hdhp+opzCggOHmA@mail.gmail.com>
Message-ID: <511490D9-FFFD-4516-ADE4-537F68647B2F@donders.ru.nl>

Hi Thomas,

Thanks for your informative e-mail :).

Here's what I did:


1- Get the data for a subset of my choosing (I tried everything with a small 4-channel, 55-trials subset)

2- Put that data into a structure built as follows, adding fields that FieldTrip required:

    fsample: 1017           (I know this is weird but we're stuck with it)
   channels: [1 17 25 29]   Added to keep track of in-house bookkeeping
      label: {'Ch:1 idElectrodeSite:181'  'Ch:17 idElectrodeSite:183'  'Ch:25 idElectrodeSite:184'
              'Ch:29 idElectrodeSite:185'}  Not the right structure, but I don't have header files to get them from
      trial: {55×1 cell}    One cell per trial, with each being [chan x time]
       time: {55×1 cell}    One cell per trial, each going from -750ms to 750ms (around target onset) This includes a 250ms pad on each side.
        trl: [55×3 double]  Built from scratch as if the trials were continuous. (Inspired by the FT function that does this)
     dimord: 'chan_time'    Added by hand, can't get Fieldtrip to recognize it
 sampleinfo: [55×2 double]  The first two columns of trl


You may need to get rid of the following fields: ’trl’ ‘dimord’ and ‘channels’. Once this is done, I think you are ready to go, without warnings and errors.


3- Try to use ft_freqanalysis using the following cfg (also attached)

cfg = [];
cfg.method= 'tfr';
cfg.pad = 'nextpow2';
cfg.width = 7;
cfg.gwidth = 3;
cfg.foi = [15:1:60];
cfg.toi = 'all';

I first get the message:
the input is raw data with 4 channels and 55 trial
This would be encouraging, but then, I get the following warnings:

Warning: could not determine dimord of "trial" in: (structure shown above)
Warning: could not determine dimord of "trl" in:   (structure shown above)
...but four pairs of them.

Looking through the debugger, I found out they're given when ft_freqanalysis, calls ft_checkdata and ft_selectdata.
Are these warnings something I should be worried about, or can everything work well the way it is?
Also, how is it that FT 'could not determine dimord' when I give it one in the data structure, and it seems to understand the way it works given the message it sends at the beginning?

After the warnings, I get this:

the call to "ft_selectdata" took 16 seconds
processing trials
trial 2, frequency 32 (46.18 Hz)
Array dimensions must match for binary array op.

Error in ft_freqanalysis (line 679)
            trlcnt(1, ifoi, :) = trlcnt(1, ifoi, :) + shiftdim(double(acttboi(:)'),-1);

...which I simply don't know how to solve.


So in summary:

1- Is it possible to make FT work without using original files to get the data?


Yes!

2- If it is, what have I done wrong, and how could I make it work?

See above.


3- Are the warnings worrisome or is it just a natural consequence of trying to jerry-rig data in FT?

Not worrisome, they should go away if you do exactly as I told :).

4- Any idea on how to solve the error message I get is appreciated, but a secondary objective.

Probably it goes away.

Keep up the good work and with best wishes,
Jan-Mathijs



I attached the function I made to build the data structure in case it could help.


Thank you very much for reading this long-winded message!

Regards

Thomas Lusignan, B. Sc.
Paul Cisek's Lab
Université de Montréal
<GetFTLFP.m>_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190603/baabd496/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jan.schoffelen at donders.ru.nl  Mon Jun  3 16:55:34 2019
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Mon, 3 Jun 2019 14:55:34 +0000
Subject: [FieldTrip] Problem with Multiplot_TFR
In-Reply-To: <CAAo3uSUOeiezjGQ8+ShJpTkr=G7ygxVhC3J1xq1eMZcqNg3MMA@mail.gmail.com>
References: <CAAo3uSXrgxgMGhjyr0174reD9+2bLskjpBXwJE2pSyEFp9C4WQ@mail.gmail.com>
 <B28AD569-1C1D-43A4-A35C-C24E2E1EBC76@donders.ru.nl>
 <CAAo3uSUOeiezjGQ8+ShJpTkr=G7ygxVhC3J1xq1eMZcqNg3MMA@mail.gmail.com>
Message-ID: <2EFA701D-81D5-4CBE-A9DF-0390B4F05DD7@donders.ru.nl>

Hi Elene,

This is not possible from the label field alone. If anything, you also need a specification of corresponding positions (either in 3D space, or as a 2D projection).
Please refer to http://www.fieldtriptoolbox.org/tutorial/layout/ for more information. If there is, as I suspect in your case, a mismatch between the exact label names, and the names of the labels in one of the existing layout files (e.g. biosemi128.lay), you can consider making your local copy of that file, and adjust the names of the labels according to your needs (e.g. change ‘Fp1' into 'Fp 1’ or so).

Good luck,

Jan-Mathijs



On 1 Jun 2019, at 10:35, Elene Beitia Loinaz <elene.beitia at alumni.mondragon.edu<mailto:elene.beitia at alumni.mondragon.edu>> wrote:

Hi,

And is there some way of creating a layout from the *.label field?

Thank you in advance

Elene.

Hau idatzi du Schoffelen, J.M. (Jan Mathijs) (jan.schoffelen at donders.ru.nl<mailto:jan.schoffelen at donders.ru.nl>) erabiltzaileak (2019 mai. 30, og. (11:49)):
Hi Elene,

Please check the names of the electrode labels in the layout file, and compare them with the ones in your *.label field.
Only the exactly matching tokens will be shown in the figure.

Jan-Mathijs

> On 30 May 2019, at 10:35, Elene Beitia Loinaz <elene.beitia at alumni.mondragon.edu<mailto:elene.beitia at alumni.mondragon.edu>> wrote:
>
> Hi Fieldtripers,
>
> I want to plot all the channels powerspectrum using ft_multiplotTFR.
>
> I have the next configuration in the ft_freq analiysis:
>
>                       cfg              = [];
>                       cfg.continuous   = 'yes';
>                       cfg.output       = 'pow';
>                       cfg.method       = 'mtmconvol';
>                       cfg.taper        = 'hanning';
>                       cfg.toi          = [0:0.0039063:1];%[0: 0.0039063 : 479.9961];
>                       cfg.foi          = 8:12;
>                       cfg.t_ftimwin    = ones(length(cfg.foi),1)./10;
>                       cfg.feedback     = 'no';
>                       cfg.hassampleinfo= 'yes';
>
>                      data_Fourier_TFR1 = ft_freqanalysis(cfg, data);
>
> and this is the  data_Fourier_TFR1  structure that I obtained:
>                        label: {128×1 cell}
>                        dimord: 'chan_freq_time'
>                        freq: [8 9 10 11 12]
>                        time: [1×256 double]
>                        powspctrm: [128×5×256 double]
>                       elec: [1×1 struct]
>                       cfg: [1×1 struct]
>
> I yse the next configuration in multiplot_TFR:
>                       cfg = [];
>                       cfg.parameter = 'powspctrm';
>                       cfg.layout = 'bioSemi128.lay';
>                       cfg.zlim = [-20 20];
>                       cfg.colorbar='yes';
>                       cfg.baselinetype = 'absolute';
>
>                       ft_multiplotTFR(cfg, data_Fourier_TFR1)
>
> It does not give me any error but I do not obtained to plot all the channels. The image that I obtained is the following one:
>
> <image.png>
>
> Does someone how to solve this?
> Thanks,
>
> Elene.
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202


_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190603/6d63efeb/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jan.schoffelen at donders.ru.nl  Mon Jun  3 16:55:34 2019
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Mon, 3 Jun 2019 14:55:34 +0000
Subject: [FieldTrip] Problem with Multiplot_TFR
In-Reply-To: <CAAo3uSUOeiezjGQ8+ShJpTkr=G7ygxVhC3J1xq1eMZcqNg3MMA@mail.gmail.com>
References: <CAAo3uSXrgxgMGhjyr0174reD9+2bLskjpBXwJE2pSyEFp9C4WQ@mail.gmail.com>
 <B28AD569-1C1D-43A4-A35C-C24E2E1EBC76@donders.ru.nl>
 <CAAo3uSUOeiezjGQ8+ShJpTkr=G7ygxVhC3J1xq1eMZcqNg3MMA@mail.gmail.com>
Message-ID: <2EFA701D-81D5-4CBE-A9DF-0390B4F05DD7@donders.ru.nl>

Hi Elene,

This is not possible from the label field alone. If anything, you also need a specification of corresponding positions (either in 3D space, or as a 2D projection).
Please refer to http://www.fieldtriptoolbox.org/tutorial/layout/ for more information. If there is, as I suspect in your case, a mismatch between the exact label names, and the names of the labels in one of the existing layout files (e.g. biosemi128.lay), you can consider making your local copy of that file, and adjust the names of the labels according to your needs (e.g. change ‘Fp1' into 'Fp 1’ or so).

Good luck,

Jan-Mathijs



On 1 Jun 2019, at 10:35, Elene Beitia Loinaz <elene.beitia at alumni.mondragon.edu<mailto:elene.beitia at alumni.mondragon.edu>> wrote:

Hi,

And is there some way of creating a layout from the *.label field?

Thank you in advance

Elene.

Hau idatzi du Schoffelen, J.M. (Jan Mathijs) (jan.schoffelen at donders.ru.nl<mailto:jan.schoffelen at donders.ru.nl>) erabiltzaileak (2019 mai. 30, og. (11:49)):
Hi Elene,

Please check the names of the electrode labels in the layout file, and compare them with the ones in your *.label field.
Only the exactly matching tokens will be shown in the figure.

Jan-Mathijs

> On 30 May 2019, at 10:35, Elene Beitia Loinaz <elene.beitia at alumni.mondragon.edu<mailto:elene.beitia at alumni.mondragon.edu>> wrote:
>
> Hi Fieldtripers,
>
> I want to plot all the channels powerspectrum using ft_multiplotTFR.
>
> I have the next configuration in the ft_freq analiysis:
>
>                       cfg              = [];
>                       cfg.continuous   = 'yes';
>                       cfg.output       = 'pow';
>                       cfg.method       = 'mtmconvol';
>                       cfg.taper        = 'hanning';
>                       cfg.toi          = [0:0.0039063:1];%[0: 0.0039063 : 479.9961];
>                       cfg.foi          = 8:12;
>                       cfg.t_ftimwin    = ones(length(cfg.foi),1)./10;
>                       cfg.feedback     = 'no';
>                       cfg.hassampleinfo= 'yes';
>
>                      data_Fourier_TFR1 = ft_freqanalysis(cfg, data);
>
> and this is the  data_Fourier_TFR1  structure that I obtained:
>                        label: {128×1 cell}
>                        dimord: 'chan_freq_time'
>                        freq: [8 9 10 11 12]
>                        time: [1×256 double]
>                        powspctrm: [128×5×256 double]
>                       elec: [1×1 struct]
>                       cfg: [1×1 struct]
>
> I yse the next configuration in multiplot_TFR:
>                       cfg = [];
>                       cfg.parameter = 'powspctrm';
>                       cfg.layout = 'bioSemi128.lay';
>                       cfg.zlim = [-20 20];
>                       cfg.colorbar='yes';
>                       cfg.baselinetype = 'absolute';
>
>                       ft_multiplotTFR(cfg, data_Fourier_TFR1)
>
> It does not give me any error but I do not obtained to plot all the channels. The image that I obtained is the following one:
>
> <image.png>
>
> Does someone how to solve this?
> Thanks,
>
> Elene.
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202


_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190603/6d63efeb/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jan.schoffelen at donders.ru.nl  Mon Jun  3 16:51:11 2019
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Mon, 3 Jun 2019 14:51:11 +0000
Subject: [FieldTrip] spectral_Granger_causality
In-Reply-To: <E8AD81E2-5ED7-46FA-88F8-2B48E9ADA11C@donders.ru.nl>
References: <CAKN_vchboLfNZF5mDx-09REJeNbcoCqabSaJhy1397TKbRDQtg@mail.gmail.com>
 <E8AD81E2-5ED7-46FA-88F8-2B48E9ADA11C@donders.ru.nl>
Message-ID: <3E8A4986-203A-4115-9956-06B0142D2DE0@donders.ru.nl>

Hi Edoardo,

Begin forwarded message:

From: Edoardo Pinzuti <edoardo.pinzuti at gmail.com<mailto:edoardo.pinzuti at gmail.com>>
Subject: spectral_Granger_causality
Date: 30 May 2019 at 12:16:08 CEST
To: j.schoffelen at donders.ru.nl<mailto:j.schoffelen at donders.ru.nl>

Dear M.J Schoffelen,

I am a phd student of the Brain Imaging Center of Frankfurt am Main. I usually take your work on spectral Granger Causality, as  reference.
I have few short questions on nonparametric GC that I hope you can answer.

1) The nonparamteric GC needs the full spectrum decomposition 0 Hz up to Nyquist frequency, is what you usually do ?


Yes.


2) I set the Fieldtrip function to granger.conditional='yes'  , the output is source-->target conditional on all other sources of the network?

I wouldn’t use this functionality, unless you really understand what you are doing. The code is poorly documented, and in general behaves poorly (numerically).

3) I saw that you do the spectral analysis on channels and then project them to source space (multiply with spatial filter) does it make a difference to do the spectral analysis directly on virtual channel data?

I don’t know where you saw this, but indeed the order of doing linear transformations of data in general should not make a difference for the result. So: doing a spatial filtering step, followed by an FFT should yield the same result as doing an FFT followed by a spatial filtering step (provided the same spatial filter is used in both situations).


4) Padding. Would you suggest to pad the data? I have 0.250 ms task length, now I pad the data to 0.400 ms with a spectral resolution of 2.5 Hz and being interested on beta frequencies I use Hanning taper.

For the non-parametric spectral factorization to behave well, you need to have sufficiently smooth spectra (as well as a sufficiently high number of frequency bins). I would recommend using somewhat longer time windows (if possible), use zero padding (cfg.pad in ft_freqanalysis, e.g. of 4), and use the ‘dpss’ + ’tapsmofrq’.

Good luck,
Jan-Mathijs



thanks a lot for your help
Best,
Edoardo



_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190603/c48061cf/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jan.schoffelen at donders.ru.nl  Mon Jun  3 16:51:11 2019
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Mon, 3 Jun 2019 14:51:11 +0000
Subject: [FieldTrip] spectral_Granger_causality
In-Reply-To: <E8AD81E2-5ED7-46FA-88F8-2B48E9ADA11C@donders.ru.nl>
References: <CAKN_vchboLfNZF5mDx-09REJeNbcoCqabSaJhy1397TKbRDQtg@mail.gmail.com>
 <E8AD81E2-5ED7-46FA-88F8-2B48E9ADA11C@donders.ru.nl>
Message-ID: <3E8A4986-203A-4115-9956-06B0142D2DE0@donders.ru.nl>

Hi Edoardo,

Begin forwarded message:

From: Edoardo Pinzuti <edoardo.pinzuti at gmail.com<mailto:edoardo.pinzuti at gmail.com>>
Subject: spectral_Granger_causality
Date: 30 May 2019 at 12:16:08 CEST
To: j.schoffelen at donders.ru.nl<mailto:j.schoffelen at donders.ru.nl>

Dear M.J Schoffelen,

I am a phd student of the Brain Imaging Center of Frankfurt am Main. I usually take your work on spectral Granger Causality, as  reference.
I have few short questions on nonparametric GC that I hope you can answer.

1) The nonparamteric GC needs the full spectrum decomposition 0 Hz up to Nyquist frequency, is what you usually do ?


Yes.


2) I set the Fieldtrip function to granger.conditional='yes'  , the output is source-->target conditional on all other sources of the network?

I wouldn’t use this functionality, unless you really understand what you are doing. The code is poorly documented, and in general behaves poorly (numerically).

3) I saw that you do the spectral analysis on channels and then project them to source space (multiply with spatial filter) does it make a difference to do the spectral analysis directly on virtual channel data?

I don’t know where you saw this, but indeed the order of doing linear transformations of data in general should not make a difference for the result. So: doing a spatial filtering step, followed by an FFT should yield the same result as doing an FFT followed by a spatial filtering step (provided the same spatial filter is used in both situations).


4) Padding. Would you suggest to pad the data? I have 0.250 ms task length, now I pad the data to 0.400 ms with a spectral resolution of 2.5 Hz and being interested on beta frequencies I use Hanning taper.

For the non-parametric spectral factorization to behave well, you need to have sufficiently smooth spectra (as well as a sufficiently high number of frequency bins). I would recommend using somewhat longer time windows (if possible), use zero padding (cfg.pad in ft_freqanalysis, e.g. of 4), and use the ‘dpss’ + ’tapsmofrq’.

Good luck,
Jan-Mathijs



thanks a lot for your help
Best,
Edoardo



_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190603/c48061cf/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From politzerahless at gmail.com  Mon Jun  3 17:39:35 2019
From: politzerahless at gmail.com (Stephen Politzer-Ahles)
Date: Mon, 3 Jun 2019 23:39:35 +0800
Subject: [FieldTrip] Load already preprocessed data to fieldtrip
 functions
In-Reply-To: <mailman.5.1559556002.28155.fieldtrip@science.ru.nl>
References: <mailman.5.1559556002.28155.fieldtrip@science.ru.nl>
Message-ID: <CAJT2k_9oANdcRqnOB-BtCCGE-Uqx2sciQHwgEabJ8iOMWgGKCA@mail.gmail.com>

An easy way to hack it is to preprocess some other data using the Fieldtrip
pipeline, grab the structure that's created, and then manually replace the
appropriate fields (like .trial, .average, .time, etc.) with the fields
from your own data. You may also have to replace some other fields, like
.dimord, if they don't match yours; but this is pretty straightforward to
do once you get familiar with the Fieldtrip data structure. This is what
I've done in the past when I have data I processed in some other software
or toolbox but then I want to use Fieldtrip's functions for cluster-based
permutation tests or whatnot. There may be more proper or more efficient
ways to do it, but this hack has worked fine for me so far.

---
Stephen Politzer-Ahles
The Hong Kong Polytechnic University
Department of Chinese and Bilingual Studies
http://www.mypolyuweb.hk/~sjpolit/
<http://www.nyu.edu/projects/politzer-ahles/>




> Message: 1
> Date: Sun, 2 Jun 2019 16:28:08 +0200
> From: <daniel.strahnen at uni-ulm.de>
> To: <fieldtrip at science.ru.nl>
> Subject: [FieldTrip] Load already preprocessed data to fieldtrip
>         functions
> Message-ID: <000401d5194f$66ece690$34c6b3b0$@uni-ulm.de>
> Content-Type: text/plain; charset="utf-8"
>
> Is it possible to use the fieldtrip functions for already preprocessed data
> that is organized in a .mat file.
>
> The data is stored in a matrix organized as follows: Channels x samples
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190602/37bb8ec8/attachment.html
> >
>
> ------------------------------
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190603/f3904fcc/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From politzerahless at gmail.com  Mon Jun  3 17:39:35 2019
From: politzerahless at gmail.com (Stephen Politzer-Ahles)
Date: Mon, 3 Jun 2019 23:39:35 +0800
Subject: [FieldTrip] Load already preprocessed data to fieldtrip
 functions
In-Reply-To: <mailman.5.1559556002.28155.fieldtrip@science.ru.nl>
References: <mailman.5.1559556002.28155.fieldtrip@science.ru.nl>
Message-ID: <CAJT2k_9oANdcRqnOB-BtCCGE-Uqx2sciQHwgEabJ8iOMWgGKCA@mail.gmail.com>

An easy way to hack it is to preprocess some other data using the Fieldtrip
pipeline, grab the structure that's created, and then manually replace the
appropriate fields (like .trial, .average, .time, etc.) with the fields
from your own data. You may also have to replace some other fields, like
.dimord, if they don't match yours; but this is pretty straightforward to
do once you get familiar with the Fieldtrip data structure. This is what
I've done in the past when I have data I processed in some other software
or toolbox but then I want to use Fieldtrip's functions for cluster-based
permutation tests or whatnot. There may be more proper or more efficient
ways to do it, but this hack has worked fine for me so far.

---
Stephen Politzer-Ahles
The Hong Kong Polytechnic University
Department of Chinese and Bilingual Studies
http://www.mypolyuweb.hk/~sjpolit/
<http://www.nyu.edu/projects/politzer-ahles/>




> Message: 1
> Date: Sun, 2 Jun 2019 16:28:08 +0200
> From: <daniel.strahnen at uni-ulm.de>
> To: <fieldtrip at science.ru.nl>
> Subject: [FieldTrip] Load already preprocessed data to fieldtrip
>         functions
> Message-ID: <000401d5194f$66ece690$34c6b3b0$@uni-ulm.de>
> Content-Type: text/plain; charset="utf-8"
>
> Is it possible to use the fieldtrip functions for already preprocessed data
> that is organized in a .mat file.
>
> The data is stored in a matrix organized as follows: Channels x samples
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190602/37bb8ec8/attachment.html
> >
>
> ------------------------------
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190603/f3904fcc/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jaimegus at gmail.com  Mon Jun  3 17:51:04 2019
From: jaimegus at gmail.com (=?UTF-8?Q?Jaime_Ib=C3=A1nez_Pereda?=)
Date: Mon, 3 Jun 2019 16:51:04 +0100
Subject: [FieldTrip] Channels to be highlighted after a cluster-based
 permutation test
Message-ID: <CAHK=WN94x9Yw8HXbC7L_-vQGSTYmUM3GYQVDGDPjqLFsKrYPfA@mail.gmail.com>

Hello everyone,

I am currently running a cluster-based permutation test on my TMS-EEG data
and I saw something in the fieldtrip tutorial that I'm not sure how to
interpret: according to the lines of code on the fieldtrip's website (
http://www.fieldtriptoolbox.org/tutorial/cluster_permutation_timelock/), to
decide which channels are to be highlighted in your topoplots aimed to
characterize the region of a significant cluster you can use the 'all'
command, thus implying that you consider a channel pertaining to the
significant cluster if it is always active during the whole time window
that you are looking at. Would anyone please let me know why 'all' is being
used in this case instead of some alternative line of code simply
highlighting channels that are part of the cluster and significantly
changing at any given time during the analyzed interval?

I other words, in the referred link, the following code is used (e.g., in
the "Within-subjects experiments" example, when the scalp maps are plotted):

*   pos_int(i1) = all(pos(i2, m(k):m(k+1)), 2);*

However, in this case, I would have thought that something like this would
be more appropriate:
  * pos_int(i1) = sum(pos(i2, m(k):m(k+1)), 2)>0;*

I wonder whether previous articles published using these tools have used
the 'all' command to establish the channels considered to be part in a
certain cluster?

Thanks in advance,
Jaime
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190603/2254bb7f/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jaimegus at gmail.com  Mon Jun  3 17:51:04 2019
From: jaimegus at gmail.com (=?UTF-8?Q?Jaime_Ib=C3=A1nez_Pereda?=)
Date: Mon, 3 Jun 2019 16:51:04 +0100
Subject: [FieldTrip] Channels to be highlighted after a cluster-based
 permutation test
Message-ID: <CAHK=WN94x9Yw8HXbC7L_-vQGSTYmUM3GYQVDGDPjqLFsKrYPfA@mail.gmail.com>

Hello everyone,

I am currently running a cluster-based permutation test on my TMS-EEG data
and I saw something in the fieldtrip tutorial that I'm not sure how to
interpret: according to the lines of code on the fieldtrip's website (
http://www.fieldtriptoolbox.org/tutorial/cluster_permutation_timelock/), to
decide which channels are to be highlighted in your topoplots aimed to
characterize the region of a significant cluster you can use the 'all'
command, thus implying that you consider a channel pertaining to the
significant cluster if it is always active during the whole time window
that you are looking at. Would anyone please let me know why 'all' is being
used in this case instead of some alternative line of code simply
highlighting channels that are part of the cluster and significantly
changing at any given time during the analyzed interval?

I other words, in the referred link, the following code is used (e.g., in
the "Within-subjects experiments" example, when the scalp maps are plotted):

*   pos_int(i1) = all(pos(i2, m(k):m(k+1)), 2);*

However, in this case, I would have thought that something like this would
be more appropriate:
  * pos_int(i1) = sum(pos(i2, m(k):m(k+1)), 2)>0;*

I wonder whether previous articles published using these tools have used
the 'all' command to establish the channels considered to be part in a
certain cluster?

Thanks in advance,
Jaime
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190603/2254bb7f/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From GersonS at cardiff.ac.uk  Mon Jun  3 18:05:33 2019
From: GersonS at cardiff.ac.uk (Sarah Gerson)
Date: Mon, 3 Jun 2019 16:05:33 +0000
Subject: [FieldTrip] ft_freqanalysis error
In-Reply-To: <DD76F3C5-CD61-457E-8AA7-8BD391C65620@donders.ru.nl>
References: <62F4B8F1-3BF6-4AAB-9B20-01B5958C60C0@cardiff.ac.uk>
 <DD76F3C5-CD61-457E-8AA7-8BD391C65620@donders.ru.nl>
Message-ID: <F46167C8-756C-4E8B-B3AE-94FF76121071@cardiff.ac.uk>

Dear Jan-Mathijs,

Good questions I checked and they all have at least some cells:

groups =

  1×3 cell array

    {7×1 cell}    {7×1 cell}    {4×1 cell}

I also tried starting with groupi = 2 to ensure it’s not just a problem with the first array, but I received the same error.

Best,
Sarah
—
Sarah A Gerson, PhD
Lecturer
School of Psychology
College of Biomedical & Life Sciences
Cardiff University
70 Park Place
Cardiff
CF10 3AT
Tel: +44 (0)29 2087 0480
Email: GersonS at cardiff.ac.uk<mailto:GersonS at cardiff.ac.uk>
http://psych.cf.ac.uk/contactsandpeople/gersons.php
The University welcomes correspondence in Welsh or English.
Sarah A Gerson, PhD
Darlithydd
Yr Ysgol Seicoleg
Coleg y Gwyddorau Biofeddygol a Bywyd
Prifysgol Caerdydd
70 Plas-y-Parc
Caerdydd
CF10 3AT
Ffôn : +44 (0)29 2087 0480
E-bost: GersonS at cardiff.ac.uk<mailto:GersonS at cardiff.ac.uk>
http://psych.cf.ac.uk/contactsandpeople/gersons.php
Mae'r Brifysgol yn croesawu gohebiaeth yn Gymraeg neu'n Saesneg.


On 3 Jun 2019, at 15:43, Schoffelen, J.M. (Jan Mathijs) <jan.schoffelen at donders.ru.nl<mailto:jan.schoffelen at donders.ru.nl>> wrote:

Dear Sarah,

Hmm, hard to tell. Have you checked whether any of the cells in the variable ‘groups’ is empty? Does it happen for each of the ‘groupi’ iterations? Are the elements in groups of type numeric?

Best wishes,
Jan-Mathijs


On 31 May 2019, at 11:53, Sarah Gerson <GersonS at cardiff.ac.uk<mailto:GersonS at cardiff.ac.uk>> wrote:

Hi everyone,

I’m trying to revive an old processing script for TFRs on a new computer and am running into an error I can’t seem to track down.
I want to run ft_freqanalysis and am trying to use a data file that is the output of a preprocessing script that worked fine. As far as I can tell from the fieldtrip guidance/forum, the data structure should be fine, but I am receiving an error stating that it needs to be a cell array (among other errors).

Any help or guidance is greatly appreciated!

For reference, I’ll copy and paste the code that’s creating the error, the errors received, and the data file structure (since this seems to be a source of the error):

Code:
 for groupi = 1:3
    windowsize = 0.5;

      disp('----');       disp('----');
        disp(['loading data from subject ', num2str(subjects), ' || ', 'groups ', num2str(groupi)]);
        disp('----');       disp('----');

        cfg = [];
        cfg.trials         = groups{groupi}%(((length(groups{groupi})/2)+1):end);
        cfg.output         = 'pow';
        cfg.method         = 'mtmconvol'; %'mtmfft';
        cfg.channel         = {'all'}; %mtmfft
        cfg.taper          = 'hanning'; %'dpss';
        cfg.tapsmofrq      = 3;
        cfg.foi            = 1:50;
        cfg.t_ftimwin      =  ones(1, length(cfg.foi))*windowsize; % ones(length(cfg.foi),1).*0.5;
        cfg.toi            = [reref_datam{subject}.time{1}(1) + windowsize/2 : windowsize/5 : reref_datam{subjects}.time{1}(end) - windowsize/2] %0:0.1:2;
        TFR_cond{subjects, groupi}               = ft_freqanalysis(cfg, reref_datam{subjects});
        TFR_cond{subjects, groupi}.cfg = [];
    end;

Errors:

Error using sort
Input argument must be a cell array of character vectors.

Error in ft_selectdata>getselection_rpt (line 1128)
  rptindx = unique(sort(rptindx));

Error in ft_selectdata (line 302)
    [selrpt{i}, dum, rptdim{i}, selrpttap{i}] = getselection_rpt(cfg, varargin{i}, dimord{j});

Error in ft_freqanalysis (line 234)
data = ft_selectdata(tmpcfg, data);

Structure of data:
reref_datam{subjects}

ans =

  struct with fields:

           hdr: [1×1 struct]
       fsample: 500
    sampleinfo: [95×2 double]
     trialinfo: [95×1 double]
         trial: {1×95 cell}
          time: {1×95 cell}
         label: {31×1 cell}
           cfg: [1×1 struct]


—
Sarah A Gerson, PhD
Lecturer
School of Psychology
College of Biomedical & Life Sciences
Cardiff University
70 Park Place
Cardiff
CF10 3AT
Tel: +44 (0)29 2087 0480
Email: GersonS at cardiff.ac.uk<mailto:GersonS at cardiff.ac.uk>
http://psych.cf.ac.uk/contactsandpeople/gersons.php
The University welcomes correspondence in Welsh or English.
Sarah A Gerson, PhD
Darlithydd
Yr Ysgol Seicoleg
Coleg y Gwyddorau Biofeddygol a Bywyd
Prifysgol Caerdydd
70 Plas-y-Parc
Caerdydd
CF10 3AT
Ffôn : +44 (0)29 2087 0480
E-bost: GersonS at cardiff.ac.uk<mailto:GersonS at cardiff.ac.uk>
http://psych.cf.ac.uk/contactsandpeople/gersons.php
Mae'r Brifysgol yn croesawu gohebiaeth yn Gymraeg neu'n Saesneg.


_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=01%7C01%7CGersonS%40cardiff.ac.uk%7C0c9a29b5139f4b0787df08d6e836a673%7Cbdb74b3095684856bdbf06759778fcbc%7C1&sdata=a5tf8BebnDHiY70mJj%2BBqE91FkYv10gGckqOD%2Bpyn6A%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202

_______________________________________________
fieldtrip mailing list
https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&amp;data=01%7C01%7CGersonS%40cardiff.ac.uk%7C0c9a29b5139f4b0787df08d6e836a673%7Cbdb74b3095684856bdbf06759778fcbc%7C1&amp;sdata=a5tf8BebnDHiY70mJj%2BBqE91FkYv10gGckqOD%2Bpyn6A%3D&amp;reserved=0
https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&amp;data=01%7C01%7CGersonS%40cardiff.ac.uk%7C0c9a29b5139f4b0787df08d6e836a673%7Cbdb74b3095684856bdbf06759778fcbc%7C1&amp;sdata=PqlI0Im4FjTsdvOl3vXTOwRq1Vytd6%2FdF%2B%2F6zMS98Rk%3D&amp;reserved=0

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190603/dda33e99/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From GersonS at cardiff.ac.uk  Mon Jun  3 18:05:33 2019
From: GersonS at cardiff.ac.uk (Sarah Gerson)
Date: Mon, 3 Jun 2019 16:05:33 +0000
Subject: [FieldTrip] ft_freqanalysis error
In-Reply-To: <DD76F3C5-CD61-457E-8AA7-8BD391C65620@donders.ru.nl>
References: <62F4B8F1-3BF6-4AAB-9B20-01B5958C60C0@cardiff.ac.uk>
 <DD76F3C5-CD61-457E-8AA7-8BD391C65620@donders.ru.nl>
Message-ID: <F46167C8-756C-4E8B-B3AE-94FF76121071@cardiff.ac.uk>

Dear Jan-Mathijs,

Good questions I checked and they all have at least some cells:

groups =

  1×3 cell array

    {7×1 cell}    {7×1 cell}    {4×1 cell}

I also tried starting with groupi = 2 to ensure it’s not just a problem with the first array, but I received the same error.

Best,
Sarah
—
Sarah A Gerson, PhD
Lecturer
School of Psychology
College of Biomedical & Life Sciences
Cardiff University
70 Park Place
Cardiff
CF10 3AT
Tel: +44 (0)29 2087 0480
Email: GersonS at cardiff.ac.uk<mailto:GersonS at cardiff.ac.uk>
http://psych.cf.ac.uk/contactsandpeople/gersons.php
The University welcomes correspondence in Welsh or English.
Sarah A Gerson, PhD
Darlithydd
Yr Ysgol Seicoleg
Coleg y Gwyddorau Biofeddygol a Bywyd
Prifysgol Caerdydd
70 Plas-y-Parc
Caerdydd
CF10 3AT
Ffôn : +44 (0)29 2087 0480
E-bost: GersonS at cardiff.ac.uk<mailto:GersonS at cardiff.ac.uk>
http://psych.cf.ac.uk/contactsandpeople/gersons.php
Mae'r Brifysgol yn croesawu gohebiaeth yn Gymraeg neu'n Saesneg.


On 3 Jun 2019, at 15:43, Schoffelen, J.M. (Jan Mathijs) <jan.schoffelen at donders.ru.nl<mailto:jan.schoffelen at donders.ru.nl>> wrote:

Dear Sarah,

Hmm, hard to tell. Have you checked whether any of the cells in the variable ‘groups’ is empty? Does it happen for each of the ‘groupi’ iterations? Are the elements in groups of type numeric?

Best wishes,
Jan-Mathijs


On 31 May 2019, at 11:53, Sarah Gerson <GersonS at cardiff.ac.uk<mailto:GersonS at cardiff.ac.uk>> wrote:

Hi everyone,

I’m trying to revive an old processing script for TFRs on a new computer and am running into an error I can’t seem to track down.
I want to run ft_freqanalysis and am trying to use a data file that is the output of a preprocessing script that worked fine. As far as I can tell from the fieldtrip guidance/forum, the data structure should be fine, but I am receiving an error stating that it needs to be a cell array (among other errors).

Any help or guidance is greatly appreciated!

For reference, I’ll copy and paste the code that’s creating the error, the errors received, and the data file structure (since this seems to be a source of the error):

Code:
 for groupi = 1:3
    windowsize = 0.5;

      disp('----');       disp('----');
        disp(['loading data from subject ', num2str(subjects), ' || ', 'groups ', num2str(groupi)]);
        disp('----');       disp('----');

        cfg = [];
        cfg.trials         = groups{groupi}%(((length(groups{groupi})/2)+1):end);
        cfg.output         = 'pow';
        cfg.method         = 'mtmconvol'; %'mtmfft';
        cfg.channel         = {'all'}; %mtmfft
        cfg.taper          = 'hanning'; %'dpss';
        cfg.tapsmofrq      = 3;
        cfg.foi            = 1:50;
        cfg.t_ftimwin      =  ones(1, length(cfg.foi))*windowsize; % ones(length(cfg.foi),1).*0.5;
        cfg.toi            = [reref_datam{subject}.time{1}(1) + windowsize/2 : windowsize/5 : reref_datam{subjects}.time{1}(end) - windowsize/2] %0:0.1:2;
        TFR_cond{subjects, groupi}               = ft_freqanalysis(cfg, reref_datam{subjects});
        TFR_cond{subjects, groupi}.cfg = [];
    end;

Errors:

Error using sort
Input argument must be a cell array of character vectors.

Error in ft_selectdata>getselection_rpt (line 1128)
  rptindx = unique(sort(rptindx));

Error in ft_selectdata (line 302)
    [selrpt{i}, dum, rptdim{i}, selrpttap{i}] = getselection_rpt(cfg, varargin{i}, dimord{j});

Error in ft_freqanalysis (line 234)
data = ft_selectdata(tmpcfg, data);

Structure of data:
reref_datam{subjects}

ans =

  struct with fields:

           hdr: [1×1 struct]
       fsample: 500
    sampleinfo: [95×2 double]
     trialinfo: [95×1 double]
         trial: {1×95 cell}
          time: {1×95 cell}
         label: {31×1 cell}
           cfg: [1×1 struct]


—
Sarah A Gerson, PhD
Lecturer
School of Psychology
College of Biomedical & Life Sciences
Cardiff University
70 Park Place
Cardiff
CF10 3AT
Tel: +44 (0)29 2087 0480
Email: GersonS at cardiff.ac.uk<mailto:GersonS at cardiff.ac.uk>
http://psych.cf.ac.uk/contactsandpeople/gersons.php
The University welcomes correspondence in Welsh or English.
Sarah A Gerson, PhD
Darlithydd
Yr Ysgol Seicoleg
Coleg y Gwyddorau Biofeddygol a Bywyd
Prifysgol Caerdydd
70 Plas-y-Parc
Caerdydd
CF10 3AT
Ffôn : +44 (0)29 2087 0480
E-bost: GersonS at cardiff.ac.uk<mailto:GersonS at cardiff.ac.uk>
http://psych.cf.ac.uk/contactsandpeople/gersons.php
Mae'r Brifysgol yn croesawu gohebiaeth yn Gymraeg neu'n Saesneg.


_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=01%7C01%7CGersonS%40cardiff.ac.uk%7C0c9a29b5139f4b0787df08d6e836a673%7Cbdb74b3095684856bdbf06759778fcbc%7C1&sdata=a5tf8BebnDHiY70mJj%2BBqE91FkYv10gGckqOD%2Bpyn6A%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202

_______________________________________________
fieldtrip mailing list
https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&amp;data=01%7C01%7CGersonS%40cardiff.ac.uk%7C0c9a29b5139f4b0787df08d6e836a673%7Cbdb74b3095684856bdbf06759778fcbc%7C1&amp;sdata=a5tf8BebnDHiY70mJj%2BBqE91FkYv10gGckqOD%2Bpyn6A%3D&amp;reserved=0
https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&amp;data=01%7C01%7CGersonS%40cardiff.ac.uk%7C0c9a29b5139f4b0787df08d6e836a673%7Cbdb74b3095684856bdbf06759778fcbc%7C1&amp;sdata=PqlI0Im4FjTsdvOl3vXTOwRq1Vytd6%2FdF%2B%2F6zMS98Rk%3D&amp;reserved=0

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190603/dda33e99/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From yvazquez at mail.rockefeller.edu  Mon Jun  3 18:52:53 2019
From: yvazquez at mail.rockefeller.edu (Yuriria Vazquez Zuniga)
Date: Mon, 3 Jun 2019 16:52:53 +0000
Subject: [FieldTrip] Error related to ft_postamble_provenance
In-Reply-To: <0EBD133A-F213-4719-8B66-90FC6C583352@donders.ru.nl>
References: <6CB19FB7-B4CF-4847-AAB3-92E996225250@rockefeller.edu>
 <0EBD133A-F213-4719-8B66-90FC6C583352@donders.ru.nl>
Message-ID: <77DAABC9-1548-4873-8ED6-12022E1C7A55@rockefeller.edu>

Hi Jan,

It got solved, in a super strange manner. I uninstalled and re-installed fieldtrip, and the error went away.
My assumption is that something got messed up with the path/private dir.
Thanks so much.
All the best,
Yuriria

On Jun 3, 2019, at 10:46 AM, Schoffelen, J.M. (Jan Mathijs) <jan.schoffelen at donders.ru.nl<mailto:jan.schoffelen at donders.ru.nl>> wrote:

Hi Yuriria,

Are you sure that the quoted line  'freqall = ft_appendfreq(cfg, freqall.freq);’ is correct? Reading this, I would assume that the input argument freqall is a structure, and that freqall.freq is a vector, which is an incorrect input to ft_appendfreq to begin with.

Best wishes,
Jan-Mathijs

On 30 May 2019, at 17:13, Yuriria Vazquez Zuniga <yvazquez at mail.rockefeller.edu<mailto:yvazquez at mail.rockefeller.edu>> wrote:

Hello,

I keep having the following error when I try to run several of the fieldtrip functions like:
 ft_freqgrandaverage, ft_redefinetrial, ft_appendfreq, etc….

The error is related to the software not been able to find the function or variable 'ftohDiW7th_FuncMem’.

Text Error is the following:
Undefined function or variable 'ftohDiW7th_FuncMem'.

Error in ft_postamble_provenance (line 56)
cfg.callinfo.procmem  = memtoc(ftohDiW7th_FuncMem);

Error in ft_postamble (line 55)
  evalin('caller', ['ft_postamble_' cmd]);

Error in ft_selectdata (line 454)
ft_postamble provenance         % this records the time and memory at the end of the function, prints
them on screen and adds this information together with the function name and MATLAB version etc. to
the output cfg

Error in ft_appendfreq (line 176)
    [varargin{:}]    = ft_selectdata(tmpcfg, varargin{:});

Error in CollapseSessionsPerDay_n_Average_CaseRest (line 149)
    freqall = ft_appendfreq(cfg, freqall.freq);

I checked for my startup Mfile, and I configured as  indicated in:
http://www.fieldtriptoolbox.org/faq/should_i_add_fieldtrip_with_all_subdirectories_to_my_matlab_path/<https://urldefense.proofpoint.com/v2/url?u=http-3A__www.fieldtriptoolbox.org_faq_should-5Fi-5Fadd-5Ffieldtrip-5Fwith-5Fall-5Fsubdirectories-5Fto-5Fmy-5Fmatlab-5Fpath_&d=DwMGaQ&c=JeTkUgVztGMmhKYjxsy2rfoWYibK1YmxXez1G3oNStg&r=l7EKSVBzD6QfabzuzHb5D3YKdLdJIwSYGtXuakqdE80&m=YUEWu58O3NCeNJs0jRFaAGZSzG29y2fjpGe_6KfNYf4&s=51Mhze-M9xYdstXmsFnnx5Csza8WJ03qmhCNutrtglA&e=>

Do you guys have any suggestion on how to debug this?
All the best,

Yuriria
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://urldefense.proofpoint.com/v2/url?u=https-3A__mailman.science.ru.nl_mailman_listinfo_fieldtrip&d=DwMGaQ&c=JeTkUgVztGMmhKYjxsy2rfoWYibK1YmxXez1G3oNStg&r=l7EKSVBzD6QfabzuzHb5D3YKdLdJIwSYGtXuakqdE80&m=YUEWu58O3NCeNJs0jRFaAGZSzG29y2fjpGe_6KfNYf4&s=s9JPITKyfRSdnh-Q1sHQGjwt6bj0F_kQx8DAPspPFQA&e=>
https://doi.org/10.1371/journal.pcbi.1002202

_______________________________________________
fieldtrip mailing list
https://urldefense.proofpoint.com/v2/url?u=https-3A__mailman.science.ru.nl_mailman_listinfo_fieldtrip&d=DwIGaQ&c=JeTkUgVztGMmhKYjxsy2rfoWYibK1YmxXez1G3oNStg&r=l7EKSVBzD6QfabzuzHb5D3YKdLdJIwSYGtXuakqdE80&m=YUEWu58O3NCeNJs0jRFaAGZSzG29y2fjpGe_6KfNYf4&s=s9JPITKyfRSdnh-Q1sHQGjwt6bj0F_kQx8DAPspPFQA&e=
https://urldefense.proofpoint.com/v2/url?u=https-3A__doi.org_10.1371_journal.pcbi.1002202&d=DwIGaQ&c=JeTkUgVztGMmhKYjxsy2rfoWYibK1YmxXez1G3oNStg&r=l7EKSVBzD6QfabzuzHb5D3YKdLdJIwSYGtXuakqdE80&m=YUEWu58O3NCeNJs0jRFaAGZSzG29y2fjpGe_6KfNYf4&s=COh4CJm0QD1aojtR6BoGb0SP56C4wIE19wqXKR1jdHw&e=

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190603/03a63667/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From yvazquez at mail.rockefeller.edu  Mon Jun  3 18:52:53 2019
From: yvazquez at mail.rockefeller.edu (Yuriria Vazquez Zuniga)
Date: Mon, 3 Jun 2019 16:52:53 +0000
Subject: [FieldTrip] Error related to ft_postamble_provenance
In-Reply-To: <0EBD133A-F213-4719-8B66-90FC6C583352@donders.ru.nl>
References: <6CB19FB7-B4CF-4847-AAB3-92E996225250@rockefeller.edu>
 <0EBD133A-F213-4719-8B66-90FC6C583352@donders.ru.nl>
Message-ID: <77DAABC9-1548-4873-8ED6-12022E1C7A55@rockefeller.edu>

Hi Jan,

It got solved, in a super strange manner. I uninstalled and re-installed fieldtrip, and the error went away.
My assumption is that something got messed up with the path/private dir.
Thanks so much.
All the best,
Yuriria

On Jun 3, 2019, at 10:46 AM, Schoffelen, J.M. (Jan Mathijs) <jan.schoffelen at donders.ru.nl<mailto:jan.schoffelen at donders.ru.nl>> wrote:

Hi Yuriria,

Are you sure that the quoted line  'freqall = ft_appendfreq(cfg, freqall.freq);’ is correct? Reading this, I would assume that the input argument freqall is a structure, and that freqall.freq is a vector, which is an incorrect input to ft_appendfreq to begin with.

Best wishes,
Jan-Mathijs

On 30 May 2019, at 17:13, Yuriria Vazquez Zuniga <yvazquez at mail.rockefeller.edu<mailto:yvazquez at mail.rockefeller.edu>> wrote:

Hello,

I keep having the following error when I try to run several of the fieldtrip functions like:
 ft_freqgrandaverage, ft_redefinetrial, ft_appendfreq, etc….

The error is related to the software not been able to find the function or variable 'ftohDiW7th_FuncMem’.

Text Error is the following:
Undefined function or variable 'ftohDiW7th_FuncMem'.

Error in ft_postamble_provenance (line 56)
cfg.callinfo.procmem  = memtoc(ftohDiW7th_FuncMem);

Error in ft_postamble (line 55)
  evalin('caller', ['ft_postamble_' cmd]);

Error in ft_selectdata (line 454)
ft_postamble provenance         % this records the time and memory at the end of the function, prints
them on screen and adds this information together with the function name and MATLAB version etc. to
the output cfg

Error in ft_appendfreq (line 176)
    [varargin{:}]    = ft_selectdata(tmpcfg, varargin{:});

Error in CollapseSessionsPerDay_n_Average_CaseRest (line 149)
    freqall = ft_appendfreq(cfg, freqall.freq);

I checked for my startup Mfile, and I configured as  indicated in:
http://www.fieldtriptoolbox.org/faq/should_i_add_fieldtrip_with_all_subdirectories_to_my_matlab_path/<https://urldefense.proofpoint.com/v2/url?u=http-3A__www.fieldtriptoolbox.org_faq_should-5Fi-5Fadd-5Ffieldtrip-5Fwith-5Fall-5Fsubdirectories-5Fto-5Fmy-5Fmatlab-5Fpath_&d=DwMGaQ&c=JeTkUgVztGMmhKYjxsy2rfoWYibK1YmxXez1G3oNStg&r=l7EKSVBzD6QfabzuzHb5D3YKdLdJIwSYGtXuakqdE80&m=YUEWu58O3NCeNJs0jRFaAGZSzG29y2fjpGe_6KfNYf4&s=51Mhze-M9xYdstXmsFnnx5Csza8WJ03qmhCNutrtglA&e=>

Do you guys have any suggestion on how to debug this?
All the best,

Yuriria
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://urldefense.proofpoint.com/v2/url?u=https-3A__mailman.science.ru.nl_mailman_listinfo_fieldtrip&d=DwMGaQ&c=JeTkUgVztGMmhKYjxsy2rfoWYibK1YmxXez1G3oNStg&r=l7EKSVBzD6QfabzuzHb5D3YKdLdJIwSYGtXuakqdE80&m=YUEWu58O3NCeNJs0jRFaAGZSzG29y2fjpGe_6KfNYf4&s=s9JPITKyfRSdnh-Q1sHQGjwt6bj0F_kQx8DAPspPFQA&e=>
https://doi.org/10.1371/journal.pcbi.1002202

_______________________________________________
fieldtrip mailing list
https://urldefense.proofpoint.com/v2/url?u=https-3A__mailman.science.ru.nl_mailman_listinfo_fieldtrip&d=DwIGaQ&c=JeTkUgVztGMmhKYjxsy2rfoWYibK1YmxXez1G3oNStg&r=l7EKSVBzD6QfabzuzHb5D3YKdLdJIwSYGtXuakqdE80&m=YUEWu58O3NCeNJs0jRFaAGZSzG29y2fjpGe_6KfNYf4&s=s9JPITKyfRSdnh-Q1sHQGjwt6bj0F_kQx8DAPspPFQA&e=
https://urldefense.proofpoint.com/v2/url?u=https-3A__doi.org_10.1371_journal.pcbi.1002202&d=DwIGaQ&c=JeTkUgVztGMmhKYjxsy2rfoWYibK1YmxXez1G3oNStg&r=l7EKSVBzD6QfabzuzHb5D3YKdLdJIwSYGtXuakqdE80&m=YUEWu58O3NCeNJs0jRFaAGZSzG29y2fjpGe_6KfNYf4&s=COh4CJm0QD1aojtR6BoGb0SP56C4wIE19wqXKR1jdHw&e=

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190603/03a63667/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jan.schoffelen at donders.ru.nl  Tue Jun  4 08:58:40 2019
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Tue, 4 Jun 2019 06:58:40 +0000
Subject: [FieldTrip] ft_freqanalysis error
In-Reply-To: <F46167C8-756C-4E8B-B3AE-94FF76121071@cardiff.ac.uk>
References: <62F4B8F1-3BF6-4AAB-9B20-01B5958C60C0@cardiff.ac.uk>
 <DD76F3C5-CD61-457E-8AA7-8BD391C65620@donders.ru.nl>
 <F46167C8-756C-4E8B-B3AE-94FF76121071@cardiff.ac.uk>
Message-ID: <352500F3-4CB1-4073-BE01-C2354214B9F8@donders.ru.nl>

Hi Sarah,

cfg.trials should be a numeric array, not a cell-array: in your case, when you use cfg.trials = groups{igroup} it will not work.
JAn-Mathijs


On 3 Jun 2019, at 18:05, Sarah Gerson <GersonS at cardiff.ac.uk<mailto:GersonS at cardiff.ac.uk>> wrote:

Dear Jan-Mathijs,

Good questions I checked and they all have at least some cells:

groups =

  1×3 cell array

    {7×1 cell}    {7×1 cell}    {4×1 cell}

I also tried starting with groupi = 2 to ensure it’s not just a problem with the first array, but I received the same error.

Best,
Sarah
—
Sarah A Gerson, PhD
Lecturer
School of Psychology
College of Biomedical & Life Sciences
Cardiff University
70 Park Place
Cardiff
CF10 3AT
Tel: +44 (0)29 2087 0480
Email: GersonS at cardiff.ac.uk<mailto:GersonS at cardiff.ac.uk>
http://psych.cf.ac.uk/contactsandpeople/gersons.php
The University welcomes correspondence in Welsh or English.

Sarah A Gerson, PhD
Darlithydd
Yr Ysgol Seicoleg
Coleg y Gwyddorau Biofeddygol a Bywyd
Prifysgol Caerdydd
70 Plas-y-Parc
Caerdydd
CF10 3AT
Ffôn : +44 (0)29 2087 0480
E-bost: GersonS at cardiff.ac.uk<mailto:GersonS at cardiff.ac.uk>
http://psych.cf.ac.uk/contactsandpeople/gersons.php
Mae'r Brifysgol yn croesawu gohebiaeth yn Gymraeg neu'n Saesneg.



On 3 Jun 2019, at 15:43, Schoffelen, J.M. (Jan Mathijs) <jan.schoffelen at donders.ru.nl<mailto:jan.schoffelen at donders.ru.nl>> wrote:

Dear Sarah,

Hmm, hard to tell. Have you checked whether any of the cells in the variable ‘groups’ is empty? Does it happen for each of the ‘groupi’ iterations? Are the elements in groups of type numeric?

Best wishes,
Jan-Mathijs


On 31 May 2019, at 11:53, Sarah Gerson <GersonS at cardiff.ac.uk<mailto:GersonS at cardiff.ac.uk>> wrote:

Hi everyone,

I’m trying to revive an old processing script for TFRs on a new computer and am running into an error I can’t seem to track down.
I want to run ft_freqanalysis and am trying to use a data file that is the output of a preprocessing script that worked fine. As far as I can tell from the fieldtrip guidance/forum, the data structure should be fine, but I am receiving an error stating that it needs to be a cell array (among other errors).

Any help or guidance is greatly appreciated!

For reference, I’ll copy and paste the code that’s creating the error, the errors received, and the data file structure (since this seems to be a source of the error):

Code:
 for groupi = 1:3
    windowsize = 0.5;

      disp('----');       disp('----');
        disp(['loading data from subject ', num2str(subjects), ' || ', 'groups ', num2str(groupi)]);
        disp('----');       disp('----');

        cfg = [];
        cfg.trials         = groups{groupi}%(((length(groups{groupi})/2)+1):end);
        cfg.output         = 'pow';
        cfg.method         = 'mtmconvol'; %'mtmfft';
        cfg.channel         = {'all'}; %mtmfft
        cfg.taper          = 'hanning'; %'dpss';
        cfg.tapsmofrq      = 3;
        cfg.foi            = 1:50;
        cfg.t_ftimwin      =  ones(1, length(cfg.foi))*windowsize; % ones(length(cfg.foi),1).*0.5;
        cfg.toi            = [reref_datam{subject}.time{1}(1) + windowsize/2 : windowsize/5 : reref_datam{subjects}.time{1}(end) - windowsize/2] %0:0.1:2;
        TFR_cond{subjects, groupi}               = ft_freqanalysis(cfg, reref_datam{subjects});
        TFR_cond{subjects, groupi}.cfg = [];
    end;

Errors:

Error using sort
Input argument must be a cell array of character vectors.

Error in ft_selectdata>getselection_rpt (line 1128)
  rptindx = unique(sort(rptindx));

Error in ft_selectdata (line 302)
    [selrpt{i}, dum, rptdim{i}, selrpttap{i}] = getselection_rpt(cfg, varargin{i}, dimord{j});

Error in ft_freqanalysis (line 234)
data = ft_selectdata(tmpcfg, data);

Structure of data:
reref_datam{subjects}

ans =

  struct with fields:

           hdr: [1×1 struct]
       fsample: 500
    sampleinfo: [95×2 double]
     trialinfo: [95×1 double]
         trial: {1×95 cell}
          time: {1×95 cell}
         label: {31×1 cell}
           cfg: [1×1 struct]


—
Sarah A Gerson, PhD
Lecturer
School of Psychology
College of Biomedical & Life Sciences
Cardiff University
70 Park Place
Cardiff
CF10 3AT
Tel: +44 (0)29 2087 0480
Email: GersonS at cardiff.ac.uk<mailto:GersonS at cardiff.ac.uk>
http://psych.cf.ac.uk/contactsandpeople/gersons.php
The University welcomes correspondence in Welsh or English.

Sarah A Gerson, PhD
Darlithydd
Yr Ysgol Seicoleg
Coleg y Gwyddorau Biofeddygol a Bywyd
Prifysgol Caerdydd
70 Plas-y-Parc
Caerdydd
CF10 3AT
Ffôn : +44 (0)29 2087 0480
E-bost: GersonS at cardiff.ac.uk<mailto:GersonS at cardiff.ac.uk>
http://psych.cf.ac.uk/contactsandpeople/gersons.php
Mae'r Brifysgol yn croesawu gohebiaeth yn Gymraeg neu'n Saesneg.



_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=01%7C01%7CGersonS%40cardiff.ac.uk%7C0c9a29b5139f4b0787df08d6e836a673%7Cbdb74b3095684856bdbf06759778fcbc%7C1&sdata=a5tf8BebnDHiY70mJj%2BBqE91FkYv10gGckqOD%2Bpyn6A%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202

_______________________________________________
fieldtrip mailing list
https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&amp;data=01%7C01%7CGersonS%40cardiff.ac.uk%7C0c9a29b5139f4b0787df08d6e836a673%7Cbdb74b3095684856bdbf06759778fcbc%7C1&amp;sdata=a5tf8BebnDHiY70mJj%2BBqE91FkYv10gGckqOD%2Bpyn6A%3D&amp;reserved=0
https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&amp;data=01%7C01%7CGersonS%40cardiff.ac.uk%7C0c9a29b5139f4b0787df08d6e836a673%7Cbdb74b3095684856bdbf06759778fcbc%7C1&amp;sdata=PqlI0Im4FjTsdvOl3vXTOwRq1Vytd6%2FdF%2B%2F6zMS98Rk%3D&amp;reserved=0

_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190604/a630fc50/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jan.schoffelen at donders.ru.nl  Tue Jun  4 08:58:40 2019
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Tue, 4 Jun 2019 06:58:40 +0000
Subject: [FieldTrip] ft_freqanalysis error
In-Reply-To: <F46167C8-756C-4E8B-B3AE-94FF76121071@cardiff.ac.uk>
References: <62F4B8F1-3BF6-4AAB-9B20-01B5958C60C0@cardiff.ac.uk>
 <DD76F3C5-CD61-457E-8AA7-8BD391C65620@donders.ru.nl>
 <F46167C8-756C-4E8B-B3AE-94FF76121071@cardiff.ac.uk>
Message-ID: <352500F3-4CB1-4073-BE01-C2354214B9F8@donders.ru.nl>

Hi Sarah,

cfg.trials should be a numeric array, not a cell-array: in your case, when you use cfg.trials = groups{igroup} it will not work.
JAn-Mathijs


On 3 Jun 2019, at 18:05, Sarah Gerson <GersonS at cardiff.ac.uk<mailto:GersonS at cardiff.ac.uk>> wrote:

Dear Jan-Mathijs,

Good questions I checked and they all have at least some cells:

groups =

  1×3 cell array

    {7×1 cell}    {7×1 cell}    {4×1 cell}

I also tried starting with groupi = 2 to ensure it’s not just a problem with the first array, but I received the same error.

Best,
Sarah
—
Sarah A Gerson, PhD
Lecturer
School of Psychology
College of Biomedical & Life Sciences
Cardiff University
70 Park Place
Cardiff
CF10 3AT
Tel: +44 (0)29 2087 0480
Email: GersonS at cardiff.ac.uk<mailto:GersonS at cardiff.ac.uk>
http://psych.cf.ac.uk/contactsandpeople/gersons.php
The University welcomes correspondence in Welsh or English.

Sarah A Gerson, PhD
Darlithydd
Yr Ysgol Seicoleg
Coleg y Gwyddorau Biofeddygol a Bywyd
Prifysgol Caerdydd
70 Plas-y-Parc
Caerdydd
CF10 3AT
Ffôn : +44 (0)29 2087 0480
E-bost: GersonS at cardiff.ac.uk<mailto:GersonS at cardiff.ac.uk>
http://psych.cf.ac.uk/contactsandpeople/gersons.php
Mae'r Brifysgol yn croesawu gohebiaeth yn Gymraeg neu'n Saesneg.



On 3 Jun 2019, at 15:43, Schoffelen, J.M. (Jan Mathijs) <jan.schoffelen at donders.ru.nl<mailto:jan.schoffelen at donders.ru.nl>> wrote:

Dear Sarah,

Hmm, hard to tell. Have you checked whether any of the cells in the variable ‘groups’ is empty? Does it happen for each of the ‘groupi’ iterations? Are the elements in groups of type numeric?

Best wishes,
Jan-Mathijs


On 31 May 2019, at 11:53, Sarah Gerson <GersonS at cardiff.ac.uk<mailto:GersonS at cardiff.ac.uk>> wrote:

Hi everyone,

I’m trying to revive an old processing script for TFRs on a new computer and am running into an error I can’t seem to track down.
I want to run ft_freqanalysis and am trying to use a data file that is the output of a preprocessing script that worked fine. As far as I can tell from the fieldtrip guidance/forum, the data structure should be fine, but I am receiving an error stating that it needs to be a cell array (among other errors).

Any help or guidance is greatly appreciated!

For reference, I’ll copy and paste the code that’s creating the error, the errors received, and the data file structure (since this seems to be a source of the error):

Code:
 for groupi = 1:3
    windowsize = 0.5;

      disp('----');       disp('----');
        disp(['loading data from subject ', num2str(subjects), ' || ', 'groups ', num2str(groupi)]);
        disp('----');       disp('----');

        cfg = [];
        cfg.trials         = groups{groupi}%(((length(groups{groupi})/2)+1):end);
        cfg.output         = 'pow';
        cfg.method         = 'mtmconvol'; %'mtmfft';
        cfg.channel         = {'all'}; %mtmfft
        cfg.taper          = 'hanning'; %'dpss';
        cfg.tapsmofrq      = 3;
        cfg.foi            = 1:50;
        cfg.t_ftimwin      =  ones(1, length(cfg.foi))*windowsize; % ones(length(cfg.foi),1).*0.5;
        cfg.toi            = [reref_datam{subject}.time{1}(1) + windowsize/2 : windowsize/5 : reref_datam{subjects}.time{1}(end) - windowsize/2] %0:0.1:2;
        TFR_cond{subjects, groupi}               = ft_freqanalysis(cfg, reref_datam{subjects});
        TFR_cond{subjects, groupi}.cfg = [];
    end;

Errors:

Error using sort
Input argument must be a cell array of character vectors.

Error in ft_selectdata>getselection_rpt (line 1128)
  rptindx = unique(sort(rptindx));

Error in ft_selectdata (line 302)
    [selrpt{i}, dum, rptdim{i}, selrpttap{i}] = getselection_rpt(cfg, varargin{i}, dimord{j});

Error in ft_freqanalysis (line 234)
data = ft_selectdata(tmpcfg, data);

Structure of data:
reref_datam{subjects}

ans =

  struct with fields:

           hdr: [1×1 struct]
       fsample: 500
    sampleinfo: [95×2 double]
     trialinfo: [95×1 double]
         trial: {1×95 cell}
          time: {1×95 cell}
         label: {31×1 cell}
           cfg: [1×1 struct]


—
Sarah A Gerson, PhD
Lecturer
School of Psychology
College of Biomedical & Life Sciences
Cardiff University
70 Park Place
Cardiff
CF10 3AT
Tel: +44 (0)29 2087 0480
Email: GersonS at cardiff.ac.uk<mailto:GersonS at cardiff.ac.uk>
http://psych.cf.ac.uk/contactsandpeople/gersons.php
The University welcomes correspondence in Welsh or English.

Sarah A Gerson, PhD
Darlithydd
Yr Ysgol Seicoleg
Coleg y Gwyddorau Biofeddygol a Bywyd
Prifysgol Caerdydd
70 Plas-y-Parc
Caerdydd
CF10 3AT
Ffôn : +44 (0)29 2087 0480
E-bost: GersonS at cardiff.ac.uk<mailto:GersonS at cardiff.ac.uk>
http://psych.cf.ac.uk/contactsandpeople/gersons.php
Mae'r Brifysgol yn croesawu gohebiaeth yn Gymraeg neu'n Saesneg.



_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=01%7C01%7CGersonS%40cardiff.ac.uk%7C0c9a29b5139f4b0787df08d6e836a673%7Cbdb74b3095684856bdbf06759778fcbc%7C1&sdata=a5tf8BebnDHiY70mJj%2BBqE91FkYv10gGckqOD%2Bpyn6A%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202

_______________________________________________
fieldtrip mailing list
https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&amp;data=01%7C01%7CGersonS%40cardiff.ac.uk%7C0c9a29b5139f4b0787df08d6e836a673%7Cbdb74b3095684856bdbf06759778fcbc%7C1&amp;sdata=a5tf8BebnDHiY70mJj%2BBqE91FkYv10gGckqOD%2Bpyn6A%3D&amp;reserved=0
https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&amp;data=01%7C01%7CGersonS%40cardiff.ac.uk%7C0c9a29b5139f4b0787df08d6e836a673%7Cbdb74b3095684856bdbf06759778fcbc%7C1&amp;sdata=PqlI0Im4FjTsdvOl3vXTOwRq1Vytd6%2FdF%2B%2F6zMS98Rk%3D&amp;reserved=0

_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190604/a630fc50/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From GersonS at cardiff.ac.uk  Tue Jun  4 14:09:35 2019
From: GersonS at cardiff.ac.uk (Sarah Gerson)
Date: Tue, 4 Jun 2019 12:09:35 +0000
Subject: [FieldTrip] ft_freqanalysis error
In-Reply-To: <352500F3-4CB1-4073-BE01-C2354214B9F8@donders.ru.nl>
References: <62F4B8F1-3BF6-4AAB-9B20-01B5958C60C0@cardiff.ac.uk>
 <DD76F3C5-CD61-457E-8AA7-8BD391C65620@donders.ru.nl>
 <F46167C8-756C-4E8B-B3AE-94FF76121071@cardiff.ac.uk>
 <352500F3-4CB1-4073-BE01-C2354214B9F8@donders.ru.nl>
Message-ID: <6B387847-47DA-4EEE-8654-C1D624E8589B@cardiff.ac.uk>

Thanks so much Jan-Mathijs! This has been really helpful. I managed to convert the data from strings to numerics and now it all works perfectly.
For anyone else searching this later, I think (though I’m not sure) part of the problem was that I had to adapt the ft_trialfun_general script to include trials marked with an E (instead of S or R). But now that I’ve converted my groups to numerics via sprintf/sscanf, all is well.
Thanks again!
—


On 4 Jun 2019, at 07:58, Schoffelen, J.M. (Jan Mathijs) <jan.schoffelen at donders.ru.nl<mailto:jan.schoffelen at donders.ru.nl>> wrote:

Hi Sarah,

cfg.trials should be a numeric array, not a cell-array: in your case, when you use cfg.trials = groups{igroup} it will not work.
JAn-Mathijs


On 3 Jun 2019, at 18:05, Sarah Gerson <GersonS at cardiff.ac.uk<mailto:GersonS at cardiff.ac.uk>> wrote:

Dear Jan-Mathijs,

Good questions I checked and they all have at least some cells:

groups =

  1×3 cell array

    {7×1 cell}    {7×1 cell}    {4×1 cell}

I also tried starting with groupi = 2 to ensure it’s not just a problem with the first array, but I received the same error.

Best,
Sarah
—
Sarah A Gerson, PhD
Lecturer
School of Psychology
College of Biomedical & Life Sciences
Cardiff University
70 Park Place
Cardiff
CF10 3AT
Tel: +44 (0)29 2087 0480
Email: GersonS at cardiff.ac.uk<mailto:GersonS at cardiff.ac.uk>
http://psych.cf.ac.uk/contactsandpeople/gersons.php
The University welcomes correspondence in Welsh or English.
Sarah A Gerson, PhD
Darlithydd
Yr Ysgol Seicoleg
Coleg y Gwyddorau Biofeddygol a Bywyd
Prifysgol Caerdydd
70 Plas-y-Parc
Caerdydd
CF10 3AT
Ffôn : +44 (0)29 2087 0480
E-bost: GersonS at cardiff.ac.uk<mailto:GersonS at cardiff.ac.uk>
http://psych.cf.ac.uk/contactsandpeople/gersons.php
Mae'r Brifysgol yn croesawu gohebiaeth yn Gymraeg neu'n Saesneg.


On 3 Jun 2019, at 15:43, Schoffelen, J.M. (Jan Mathijs) <jan.schoffelen at donders.ru.nl<mailto:jan.schoffelen at donders.ru.nl>> wrote:

Dear Sarah,

Hmm, hard to tell. Have you checked whether any of the cells in the variable ‘groups’ is empty? Does it happen for each of the ‘groupi’ iterations? Are the elements in groups of type numeric?

Best wishes,
Jan-Mathijs


On 31 May 2019, at 11:53, Sarah Gerson <GersonS at cardiff.ac.uk<mailto:GersonS at cardiff.ac.uk>> wrote:

Hi everyone,

I’m trying to revive an old processing script for TFRs on a new computer and am running into an error I can’t seem to track down.
I want to run ft_freqanalysis and am trying to use a data file that is the output of a preprocessing script that worked fine. As far as I can tell from the fieldtrip guidance/forum, the data structure should be fine, but I am receiving an error stating that it needs to be a cell array (among other errors).

Any help or guidance is greatly appreciated!

For reference, I’ll copy and paste the code that’s creating the error, the errors received, and the data file structure (since this seems to be a source of the error):

Code:
 for groupi = 1:3
    windowsize = 0.5;

      disp('----');       disp('----');
        disp(['loading data from subject ', num2str(subjects), ' || ', 'groups ', num2str(groupi)]);
        disp('----');       disp('----');

        cfg = [];
        cfg.trials         = groups{groupi}%(((length(groups{groupi})/2)+1):end);
        cfg.output         = 'pow';
        cfg.method         = 'mtmconvol'; %'mtmfft';
        cfg.channel         = {'all'}; %mtmfft
        cfg.taper          = 'hanning'; %'dpss';
        cfg.tapsmofrq      = 3;
        cfg.foi            = 1:50;
        cfg.t_ftimwin      =  ones(1, length(cfg.foi))*windowsize; % ones(length(cfg.foi),1).*0.5;
        cfg.toi            = [reref_datam{subject}.time{1}(1) + windowsize/2 : windowsize/5 : reref_datam{subjects}.time{1}(end) - windowsize/2] %0:0.1:2;
        TFR_cond{subjects, groupi}               = ft_freqanalysis(cfg, reref_datam{subjects});
        TFR_cond{subjects, groupi}.cfg = [];
    end;

Errors:

Error using sort
Input argument must be a cell array of character vectors.

Error in ft_selectdata>getselection_rpt (line 1128)
  rptindx = unique(sort(rptindx));

Error in ft_selectdata (line 302)
    [selrpt{i}, dum, rptdim{i}, selrpttap{i}] = getselection_rpt(cfg, varargin{i}, dimord{j});

Error in ft_freqanalysis (line 234)
data = ft_selectdata(tmpcfg, data);

Structure of data:
reref_datam{subjects}

ans =

  struct with fields:

           hdr: [1×1 struct]
       fsample: 500
    sampleinfo: [95×2 double]
     trialinfo: [95×1 double]
         trial: {1×95 cell}
          time: {1×95 cell}
         label: {31×1 cell}
           cfg: [1×1 struct]


—
Sarah A Gerson, PhD
Lecturer
School of Psychology
College of Biomedical & Life Sciences
Cardiff University
70 Park Place
Cardiff
CF10 3AT
Tel: +44 (0)29 2087 0480
Email: GersonS at cardiff.ac.uk<mailto:GersonS at cardiff.ac.uk>
http://psych.cf.ac.uk/contactsandpeople/gersons.php
The University welcomes correspondence in Welsh or English.
Sarah A Gerson, PhD
Darlithydd
Yr Ysgol Seicoleg
Coleg y Gwyddorau Biofeddygol a Bywyd
Prifysgol Caerdydd
70 Plas-y-Parc
Caerdydd
CF10 3AT
Ffôn : +44 (0)29 2087 0480
E-bost: GersonS at cardiff.ac.uk<mailto:GersonS at cardiff.ac.uk>
http://psych.cf.ac.uk/contactsandpeople/gersons.php
Mae'r Brifysgol yn croesawu gohebiaeth yn Gymraeg neu'n Saesneg.


_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=01%7C01%7CGersonS%40cardiff.ac.uk%7Ccc322942c03e41e7e20708d6e8be5332%7Cbdb74b3095684856bdbf06759778fcbc%7C1&sdata=xmuFrGDJL1hUvIvVlU%2BgBDoGtra5jJWMOkntFfcjYuc%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=01%7C01%7CGersonS%40cardiff.ac.uk%7Ccc322942c03e41e7e20708d6e8be5332%7Cbdb74b3095684856bdbf06759778fcbc%7C1&sdata=e8owkPm9RewSnTY2YKpQ9eKMNfDjXaqMeJkJ5ZOiqys%3D&reserved=0>

_______________________________________________
fieldtrip mailing list
https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&amp;data=01%7C01%7CGersonS%40cardiff.ac.uk%7C0c9a29b5139f4b0787df08d6e836a673%7Cbdb74b3095684856bdbf06759778fcbc%7C1&amp;sdata=a5tf8BebnDHiY70mJj%2BBqE91FkYv10gGckqOD%2Bpyn6A%3D&amp;reserved=0<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=01%7C01%7CGersonS%40cardiff.ac.uk%7Ccc322942c03e41e7e20708d6e8be5332%7Cbdb74b3095684856bdbf06759778fcbc%7C1&sdata=xmuFrGDJL1hUvIvVlU%2BgBDoGtra5jJWMOkntFfcjYuc%3D&reserved=0>
https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&amp;data=01%7C01%7CGersonS%40cardiff.ac.uk%7C0c9a29b5139f4b0787df08d6e836a673%7Cbdb74b3095684856bdbf06759778fcbc%7C1&amp;sdata=PqlI0Im4FjTsdvOl3vXTOwRq1Vytd6%2FdF%2B%2F6zMS98Rk%3D&amp;reserved=0<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=01%7C01%7CGersonS%40cardiff.ac.uk%7Ccc322942c03e41e7e20708d6e8be5332%7Cbdb74b3095684856bdbf06759778fcbc%7C1&sdata=e8owkPm9RewSnTY2YKpQ9eKMNfDjXaqMeJkJ5ZOiqys%3D&reserved=0>

_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=01%7C01%7CGersonS%40cardiff.ac.uk%7Ccc322942c03e41e7e20708d6e8be5332%7Cbdb74b3095684856bdbf06759778fcbc%7C1&sdata=xmuFrGDJL1hUvIvVlU%2BgBDoGtra5jJWMOkntFfcjYuc%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202

_______________________________________________
fieldtrip mailing list
https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&amp;data=01%7C01%7CGersonS%40cardiff.ac.uk%7Ccc322942c03e41e7e20708d6e8be5332%7Cbdb74b3095684856bdbf06759778fcbc%7C1&amp;sdata=xmuFrGDJL1hUvIvVlU%2BgBDoGtra5jJWMOkntFfcjYuc%3D&amp;reserved=0
https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&amp;data=01%7C01%7CGersonS%40cardiff.ac.uk%7Ccc322942c03e41e7e20708d6e8be5332%7Cbdb74b3095684856bdbf06759778fcbc%7C1&amp;sdata=e8owkPm9RewSnTY2YKpQ9eKMNfDjXaqMeJkJ5ZOiqys%3D&amp;reserved=0

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190604/471c11df/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From GersonS at cardiff.ac.uk  Tue Jun  4 14:09:35 2019
From: GersonS at cardiff.ac.uk (Sarah Gerson)
Date: Tue, 4 Jun 2019 12:09:35 +0000
Subject: [FieldTrip] ft_freqanalysis error
In-Reply-To: <352500F3-4CB1-4073-BE01-C2354214B9F8@donders.ru.nl>
References: <62F4B8F1-3BF6-4AAB-9B20-01B5958C60C0@cardiff.ac.uk>
 <DD76F3C5-CD61-457E-8AA7-8BD391C65620@donders.ru.nl>
 <F46167C8-756C-4E8B-B3AE-94FF76121071@cardiff.ac.uk>
 <352500F3-4CB1-4073-BE01-C2354214B9F8@donders.ru.nl>
Message-ID: <6B387847-47DA-4EEE-8654-C1D624E8589B@cardiff.ac.uk>

Thanks so much Jan-Mathijs! This has been really helpful. I managed to convert the data from strings to numerics and now it all works perfectly.
For anyone else searching this later, I think (though I’m not sure) part of the problem was that I had to adapt the ft_trialfun_general script to include trials marked with an E (instead of S or R). But now that I’ve converted my groups to numerics via sprintf/sscanf, all is well.
Thanks again!
—


On 4 Jun 2019, at 07:58, Schoffelen, J.M. (Jan Mathijs) <jan.schoffelen at donders.ru.nl<mailto:jan.schoffelen at donders.ru.nl>> wrote:

Hi Sarah,

cfg.trials should be a numeric array, not a cell-array: in your case, when you use cfg.trials = groups{igroup} it will not work.
JAn-Mathijs


On 3 Jun 2019, at 18:05, Sarah Gerson <GersonS at cardiff.ac.uk<mailto:GersonS at cardiff.ac.uk>> wrote:

Dear Jan-Mathijs,

Good questions I checked and they all have at least some cells:

groups =

  1×3 cell array

    {7×1 cell}    {7×1 cell}    {4×1 cell}

I also tried starting with groupi = 2 to ensure it’s not just a problem with the first array, but I received the same error.

Best,
Sarah
—
Sarah A Gerson, PhD
Lecturer
School of Psychology
College of Biomedical & Life Sciences
Cardiff University
70 Park Place
Cardiff
CF10 3AT
Tel: +44 (0)29 2087 0480
Email: GersonS at cardiff.ac.uk<mailto:GersonS at cardiff.ac.uk>
http://psych.cf.ac.uk/contactsandpeople/gersons.php
The University welcomes correspondence in Welsh or English.
Sarah A Gerson, PhD
Darlithydd
Yr Ysgol Seicoleg
Coleg y Gwyddorau Biofeddygol a Bywyd
Prifysgol Caerdydd
70 Plas-y-Parc
Caerdydd
CF10 3AT
Ffôn : +44 (0)29 2087 0480
E-bost: GersonS at cardiff.ac.uk<mailto:GersonS at cardiff.ac.uk>
http://psych.cf.ac.uk/contactsandpeople/gersons.php
Mae'r Brifysgol yn croesawu gohebiaeth yn Gymraeg neu'n Saesneg.


On 3 Jun 2019, at 15:43, Schoffelen, J.M. (Jan Mathijs) <jan.schoffelen at donders.ru.nl<mailto:jan.schoffelen at donders.ru.nl>> wrote:

Dear Sarah,

Hmm, hard to tell. Have you checked whether any of the cells in the variable ‘groups’ is empty? Does it happen for each of the ‘groupi’ iterations? Are the elements in groups of type numeric?

Best wishes,
Jan-Mathijs


On 31 May 2019, at 11:53, Sarah Gerson <GersonS at cardiff.ac.uk<mailto:GersonS at cardiff.ac.uk>> wrote:

Hi everyone,

I’m trying to revive an old processing script for TFRs on a new computer and am running into an error I can’t seem to track down.
I want to run ft_freqanalysis and am trying to use a data file that is the output of a preprocessing script that worked fine. As far as I can tell from the fieldtrip guidance/forum, the data structure should be fine, but I am receiving an error stating that it needs to be a cell array (among other errors).

Any help or guidance is greatly appreciated!

For reference, I’ll copy and paste the code that’s creating the error, the errors received, and the data file structure (since this seems to be a source of the error):

Code:
 for groupi = 1:3
    windowsize = 0.5;

      disp('----');       disp('----');
        disp(['loading data from subject ', num2str(subjects), ' || ', 'groups ', num2str(groupi)]);
        disp('----');       disp('----');

        cfg = [];
        cfg.trials         = groups{groupi}%(((length(groups{groupi})/2)+1):end);
        cfg.output         = 'pow';
        cfg.method         = 'mtmconvol'; %'mtmfft';
        cfg.channel         = {'all'}; %mtmfft
        cfg.taper          = 'hanning'; %'dpss';
        cfg.tapsmofrq      = 3;
        cfg.foi            = 1:50;
        cfg.t_ftimwin      =  ones(1, length(cfg.foi))*windowsize; % ones(length(cfg.foi),1).*0.5;
        cfg.toi            = [reref_datam{subject}.time{1}(1) + windowsize/2 : windowsize/5 : reref_datam{subjects}.time{1}(end) - windowsize/2] %0:0.1:2;
        TFR_cond{subjects, groupi}               = ft_freqanalysis(cfg, reref_datam{subjects});
        TFR_cond{subjects, groupi}.cfg = [];
    end;

Errors:

Error using sort
Input argument must be a cell array of character vectors.

Error in ft_selectdata>getselection_rpt (line 1128)
  rptindx = unique(sort(rptindx));

Error in ft_selectdata (line 302)
    [selrpt{i}, dum, rptdim{i}, selrpttap{i}] = getselection_rpt(cfg, varargin{i}, dimord{j});

Error in ft_freqanalysis (line 234)
data = ft_selectdata(tmpcfg, data);

Structure of data:
reref_datam{subjects}

ans =

  struct with fields:

           hdr: [1×1 struct]
       fsample: 500
    sampleinfo: [95×2 double]
     trialinfo: [95×1 double]
         trial: {1×95 cell}
          time: {1×95 cell}
         label: {31×1 cell}
           cfg: [1×1 struct]


—
Sarah A Gerson, PhD
Lecturer
School of Psychology
College of Biomedical & Life Sciences
Cardiff University
70 Park Place
Cardiff
CF10 3AT
Tel: +44 (0)29 2087 0480
Email: GersonS at cardiff.ac.uk<mailto:GersonS at cardiff.ac.uk>
http://psych.cf.ac.uk/contactsandpeople/gersons.php
The University welcomes correspondence in Welsh or English.
Sarah A Gerson, PhD
Darlithydd
Yr Ysgol Seicoleg
Coleg y Gwyddorau Biofeddygol a Bywyd
Prifysgol Caerdydd
70 Plas-y-Parc
Caerdydd
CF10 3AT
Ffôn : +44 (0)29 2087 0480
E-bost: GersonS at cardiff.ac.uk<mailto:GersonS at cardiff.ac.uk>
http://psych.cf.ac.uk/contactsandpeople/gersons.php
Mae'r Brifysgol yn croesawu gohebiaeth yn Gymraeg neu'n Saesneg.


_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=01%7C01%7CGersonS%40cardiff.ac.uk%7Ccc322942c03e41e7e20708d6e8be5332%7Cbdb74b3095684856bdbf06759778fcbc%7C1&sdata=xmuFrGDJL1hUvIvVlU%2BgBDoGtra5jJWMOkntFfcjYuc%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=01%7C01%7CGersonS%40cardiff.ac.uk%7Ccc322942c03e41e7e20708d6e8be5332%7Cbdb74b3095684856bdbf06759778fcbc%7C1&sdata=e8owkPm9RewSnTY2YKpQ9eKMNfDjXaqMeJkJ5ZOiqys%3D&reserved=0>

_______________________________________________
fieldtrip mailing list
https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&amp;data=01%7C01%7CGersonS%40cardiff.ac.uk%7C0c9a29b5139f4b0787df08d6e836a673%7Cbdb74b3095684856bdbf06759778fcbc%7C1&amp;sdata=a5tf8BebnDHiY70mJj%2BBqE91FkYv10gGckqOD%2Bpyn6A%3D&amp;reserved=0<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=01%7C01%7CGersonS%40cardiff.ac.uk%7Ccc322942c03e41e7e20708d6e8be5332%7Cbdb74b3095684856bdbf06759778fcbc%7C1&sdata=xmuFrGDJL1hUvIvVlU%2BgBDoGtra5jJWMOkntFfcjYuc%3D&reserved=0>
https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&amp;data=01%7C01%7CGersonS%40cardiff.ac.uk%7C0c9a29b5139f4b0787df08d6e836a673%7Cbdb74b3095684856bdbf06759778fcbc%7C1&amp;sdata=PqlI0Im4FjTsdvOl3vXTOwRq1Vytd6%2FdF%2B%2F6zMS98Rk%3D&amp;reserved=0<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=01%7C01%7CGersonS%40cardiff.ac.uk%7Ccc322942c03e41e7e20708d6e8be5332%7Cbdb74b3095684856bdbf06759778fcbc%7C1&sdata=e8owkPm9RewSnTY2YKpQ9eKMNfDjXaqMeJkJ5ZOiqys%3D&reserved=0>

_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=01%7C01%7CGersonS%40cardiff.ac.uk%7Ccc322942c03e41e7e20708d6e8be5332%7Cbdb74b3095684856bdbf06759778fcbc%7C1&sdata=xmuFrGDJL1hUvIvVlU%2BgBDoGtra5jJWMOkntFfcjYuc%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202

_______________________________________________
fieldtrip mailing list
https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&amp;data=01%7C01%7CGersonS%40cardiff.ac.uk%7Ccc322942c03e41e7e20708d6e8be5332%7Cbdb74b3095684856bdbf06759778fcbc%7C1&amp;sdata=xmuFrGDJL1hUvIvVlU%2BgBDoGtra5jJWMOkntFfcjYuc%3D&amp;reserved=0
https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&amp;data=01%7C01%7CGersonS%40cardiff.ac.uk%7Ccc322942c03e41e7e20708d6e8be5332%7Cbdb74b3095684856bdbf06759778fcbc%7C1&amp;sdata=e8owkPm9RewSnTY2YKpQ9eKMNfDjXaqMeJkJ5ZOiqys%3D&amp;reserved=0

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190604/471c11df/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From eli.kinneylang at ucalgary.ca  Tue Jun  4 16:47:03 2019
From: eli.kinneylang at ucalgary.ca (Eli Kinney- Lang)
Date: Tue, 4 Jun 2019 14:47:03 +0000
Subject: [FieldTrip] Using Fieldtrip with LabStreamingLayer for online BCI
 Processing
Message-ID: <YTBPR01MB3021315EE5F9B2A5A77AA5DA94150@YTBPR01MB3021.CANPRD01.PROD.OUTLOOK.COM>

Hi all,


  I have been using Fieldtrip for the past few years for my offline EEG analysis, with good success. Recently, I have switched to helping build and design some online brain-computer interface systems and was looking toward Fieldtrip to handle the signal processing aspect in real-time. However, I am having some trouble with getting the online EEG processing to work as I'd like. I was wondering if any of you could provide some guidance on getting started (and potentially optimization areas) for the online EEG analysis from Fieldtrip, based on our setup below.


Details:

We are using the LabStreamingLayer (LSL) synchronization system to read in raw EEG data from a g.tec USB amplifier. I know that Fieldtrip has its own online buffer, but for various reasons we'd prefer to use the LSL system to link together our EEG recording, Matlab processing, stimulus input/output.

Data from the amplifier is brought in to Matlab through LSL, providing raw Chan X Sample data. We are establishing the header for Fieldtrip ourselves, inputting the required points to use the ft_datatype_raw format. We have to use the raw datatype as the header information output is not in Fieldtrip's standard format.  This allows us to run ft_preprocessing after defining a cfg of our choice.


However, just doing this processes takes around 1.5-1.8 seconds for Matlab to processes each EEG data chunk. We haven't even yet included any of the ft_analysis schemes for feature extraction, and are concerned the processing time might be too delayed through this route for real-time BCI. Does anyone have any experience with online BCI processing through Fieldtrip, or recommendations on expediting this process?


Thank you in advance for your help!


-Eli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190604/6dccaf2c/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From eli.kinneylang at ucalgary.ca  Tue Jun  4 16:47:03 2019
From: eli.kinneylang at ucalgary.ca (Eli Kinney- Lang)
Date: Tue, 4 Jun 2019 14:47:03 +0000
Subject: [FieldTrip] Using Fieldtrip with LabStreamingLayer for online BCI
 Processing
Message-ID: <YTBPR01MB3021315EE5F9B2A5A77AA5DA94150@YTBPR01MB3021.CANPRD01.PROD.OUTLOOK.COM>

Hi all,


  I have been using Fieldtrip for the past few years for my offline EEG analysis, with good success. Recently, I have switched to helping build and design some online brain-computer interface systems and was looking toward Fieldtrip to handle the signal processing aspect in real-time. However, I am having some trouble with getting the online EEG processing to work as I'd like. I was wondering if any of you could provide some guidance on getting started (and potentially optimization areas) for the online EEG analysis from Fieldtrip, based on our setup below.


Details:

We are using the LabStreamingLayer (LSL) synchronization system to read in raw EEG data from a g.tec USB amplifier. I know that Fieldtrip has its own online buffer, but for various reasons we'd prefer to use the LSL system to link together our EEG recording, Matlab processing, stimulus input/output.

Data from the amplifier is brought in to Matlab through LSL, providing raw Chan X Sample data. We are establishing the header for Fieldtrip ourselves, inputting the required points to use the ft_datatype_raw format. We have to use the raw datatype as the header information output is not in Fieldtrip's standard format.  This allows us to run ft_preprocessing after defining a cfg of our choice.


However, just doing this processes takes around 1.5-1.8 seconds for Matlab to processes each EEG data chunk. We haven't even yet included any of the ft_analysis schemes for feature extraction, and are concerned the processing time might be too delayed through this route for real-time BCI. Does anyone have any experience with online BCI processing through Fieldtrip, or recommendations on expediting this process?


Thank you in advance for your help!


-Eli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190604/6dccaf2c/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From daniel.strahnen at uni-ulm.de  Tue Jun  4 17:00:50 2019
From: daniel.strahnen at uni-ulm.de (daniel.strahnen at uni-ulm.de)
Date: Tue, 4 Jun 2019 17:00:50 +0200
Subject: [FieldTrip] Load already preprocessed data to fieldtrip
 functions
In-Reply-To: <CAJT2k_9oANdcRqnOB-BtCCGE-Uqx2sciQHwgEabJ8iOMWgGKCA@mail.gmail.com>
References: <mailman.5.1559556002.28155.fieldtrip@science.ru.nl>
 <CAJT2k_9oANdcRqnOB-BtCCGE-Uqx2sciQHwgEabJ8iOMWgGKCA@mail.gmail.com>
Message-ID: <000001d51ae6$4fad5ee0$ef081ca0$@uni-ulm.de>

Thanks for the advice! Would it be possible for you to send me just the structure the you mentioned since I don’t have any data here that is compatible to the Fieldtrip pipeline?

 

Von: fieldtrip <fieldtrip-bounces at science.ru.nl> Im Auftrag von Stephen Politzer-Ahles
Gesendet: Montag, 3. Juni 2019 17:40
An: fieldtrip at science.ru.nl
Betreff: Re: [FieldTrip] Load already preprocessed data to fieldtrip functions

 

An easy way to hack it is to preprocess some other data using the Fieldtrip pipeline, grab the structure that's created, and then manually replace the appropriate fields (like .trial, .average, .time, etc.) with the fields from your own data. You may also have to replace some other fields, like .dimord, if they don't match yours; but this is pretty straightforward to do once you get familiar with the Fieldtrip data structure. This is what I've done in the past when I have data I processed in some other software or toolbox but then I want to use Fieldtrip's functions for cluster-based permutation tests or whatnot. There may be more proper or more efficient ways to do it, but this hack has worked fine for me so far.


 

---

Stephen Politzer-Ahles
The Hong Kong Polytechnic University
Department of Chinese and Bilingual Studies
http://www.mypolyuweb.hk/~sjpolit/

 

 

 

Message: 1
Date: Sun, 2 Jun 2019 16:28:08 +0200
From: <daniel.strahnen at uni-ulm.de <mailto:daniel.strahnen at uni-ulm.de> >
To: <fieldtrip at science.ru.nl <mailto:fieldtrip at science.ru.nl> >
Subject: [FieldTrip] Load already preprocessed data to fieldtrip
        functions
Message-ID: <000401d5194f$66ece690$34c6b3b0$@uni-ulm.de <http://uni-ulm.de> >
Content-Type: text/plain; charset="utf-8"

Is it possible to use the fieldtrip functions for already preprocessed data
that is organized in a .mat file. 

The data is stored in a matrix organized as follows: Channels x samples

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190602/37bb8ec8/attachment.html>

------------------------------

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190604/501601d8/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From daniel.strahnen at uni-ulm.de  Tue Jun  4 17:00:50 2019
From: daniel.strahnen at uni-ulm.de (daniel.strahnen at uni-ulm.de)
Date: Tue, 4 Jun 2019 17:00:50 +0200
Subject: [FieldTrip] Load already preprocessed data to fieldtrip
 functions
In-Reply-To: <CAJT2k_9oANdcRqnOB-BtCCGE-Uqx2sciQHwgEabJ8iOMWgGKCA@mail.gmail.com>
References: <mailman.5.1559556002.28155.fieldtrip@science.ru.nl>
 <CAJT2k_9oANdcRqnOB-BtCCGE-Uqx2sciQHwgEabJ8iOMWgGKCA@mail.gmail.com>
Message-ID: <000001d51ae6$4fad5ee0$ef081ca0$@uni-ulm.de>

Thanks for the advice! Would it be possible for you to send me just the structure the you mentioned since I don’t have any data here that is compatible to the Fieldtrip pipeline?

 

Von: fieldtrip <fieldtrip-bounces at science.ru.nl> Im Auftrag von Stephen Politzer-Ahles
Gesendet: Montag, 3. Juni 2019 17:40
An: fieldtrip at science.ru.nl
Betreff: Re: [FieldTrip] Load already preprocessed data to fieldtrip functions

 

An easy way to hack it is to preprocess some other data using the Fieldtrip pipeline, grab the structure that's created, and then manually replace the appropriate fields (like .trial, .average, .time, etc.) with the fields from your own data. You may also have to replace some other fields, like .dimord, if they don't match yours; but this is pretty straightforward to do once you get familiar with the Fieldtrip data structure. This is what I've done in the past when I have data I processed in some other software or toolbox but then I want to use Fieldtrip's functions for cluster-based permutation tests or whatnot. There may be more proper or more efficient ways to do it, but this hack has worked fine for me so far.


 

---

Stephen Politzer-Ahles
The Hong Kong Polytechnic University
Department of Chinese and Bilingual Studies
http://www.mypolyuweb.hk/~sjpolit/

 

 

 

Message: 1
Date: Sun, 2 Jun 2019 16:28:08 +0200
From: <daniel.strahnen at uni-ulm.de <mailto:daniel.strahnen at uni-ulm.de> >
To: <fieldtrip at science.ru.nl <mailto:fieldtrip at science.ru.nl> >
Subject: [FieldTrip] Load already preprocessed data to fieldtrip
        functions
Message-ID: <000401d5194f$66ece690$34c6b3b0$@uni-ulm.de <http://uni-ulm.de> >
Content-Type: text/plain; charset="utf-8"

Is it possible to use the fieldtrip functions for already preprocessed data
that is organized in a .mat file. 

The data is stored in a matrix organized as follows: Channels x samples

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190602/37bb8ec8/attachment.html>

------------------------------

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190604/501601d8/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From a.stolk8 at gmail.com  Tue Jun  4 19:04:40 2019
From: a.stolk8 at gmail.com (Arjen Stolk)
Date: Tue, 4 Jun 2019 10:04:40 -0700
Subject: [FieldTrip] Postdoc and PhD Position 'Communication in Context'
 (1.0 FTE)
In-Reply-To: <d49ed4f3446e4896b7f34d73030aaa5e@EXPRD05.hosting.ru.nl>
References: <d49ed4f3446e4896b7f34d73030aaa5e@EXPRD05.hosting.ru.nl>
Message-ID: <CAAiwptSFcYG5S_e7tgR6QL4yCODSLbwkbV2QooAJd8WEP_ujWQ@mail.gmail.com>

Always been interested in our ability to interact, brainstorm, and even
make list posts like these? If you're considering doing Postdoc- or
PhD-level neuroscientific research on this deep-seated yet elusive human
social ability, take a look at this Communication in Context
<https://www.languageininteraction.nl/Synergy1a.html> project.

The preferred start date is September 1. Both positions are for 4 years and
will be held at the Donders Centre for Cognitive Neuroimaging (where
FieldTrip is also housed). The application period closes on June 23.

Best,
Arjen



On Mon, May 27, 2019 at 4:00 AM Verhoef, J.P. (Julia) <
J.Verhoef at donders.ru.nl> wrote:

> Postdoc and PhD Position 'Communication in Context' (1.0 FTE) Vacancy
> number: 30.07.19
> Application deadline: 23 June 2019, 23:59 Amsterdam Time Zone
>
> *Responsibilities*
> We are looking for highly motivated candidates to enrich a unique
> consortium of researchers that aims to unravel the neurocognitive
> mechanisms of language at multiple levels. The goal is to understand both
> the universality and variability of the human language faculty from genes
> to behaviour.
>
> Currently, our consortium advertises one Postdoctoral Researcher position
> and one PhD position <https://www.languageininteraction.nl/Synergy1a.html>.
> These positions provide the opportunity for conducting world-class research
> as a member of an interdisciplinary team.
>
> *Work environment*
> These positions will be held at the Donders Insititute, Centre for
> Cognitive Neuroimaging, Radboud University, Nijmegen, The Netherlands.
>
> The Netherlands has an outstanding track record in the language sciences.
> The ‘Language in Interaction’ research consortium, sponsored by a large
> grant from the Netherlands Organization for Scientific Research (NWO),
> brings together many of the excellent research groups in the Netherlands
> with a research programme on the foundations of language. In addition to
> excellence in the domain of language and related relevant fields of
> cognition, our consortium provides state-of-the-art research facilities and
> a research team with ample experience in the complex research methods that
> will be invoked to address the scientific questions at the highest level of
> methodological sophistication. These include methods from genetics,
> neuroimaging, computational modelling, and patient-related research. This
> consortium realizes both quality and critical mass for studying human
> language at a scale not easily found anywhere else.
>
> We have identified five Big Questions (BQ) that are central to our
> understanding of the human language faculty. These questions are
> interrelated at multiple levels. Teams of researchers will collaborate to
> collectively address these key questions of our field.
>
> Our five Big Questions are:
> BQ1: The nature of the mental lexicon: How to bridge neurobiology and
> psycholinguistic theory by computational modelling?
> BQ2: What are the characteristics and consequences of internal brain
> organisation for language?
> BQ3: Creating a shared cognitive space: How is language grounded in and
> shaped by communicative settings of interacting people?
> BQ4: Variability in language processing and in language learning: Why does
> the ability to learn language change with age? How can we characterise and
> map individual language skills in relation to the population distribution?
> BQ5: How are other cognitive systems shaped by the presence of a language
> system in humans?
>
> You will become member of our Synergy team which in turn will be embedded
> in our Big Questions framework. The research is conducted in an
> international setting at all participating institutions. English is the
> lingua franca.
>
> *What we expect from you*
> Each position has its own requirements and profile
> <https://www.languageininteraction.nl/Synergy1a.html>.
>
> General requirements for all positions are:
>
>    - an integrative mindset;
>    - a theory-driven approach
>    - good communication/collaboration skills;
>    - strong motivation;
>    - excellent proficiency in written and spoken English.
>
> Applications from excellent candidates with a less than ideal profile will
> also be considered.
>
> *What we have to offer*
>
>    - employment: 1.0 FTE;
>    - terms of employment depend on the position applied for;
>    - Dutch universities and the institute involved have a number of
>    regulations in place that enable employees to create a good work-life
>    balance;
>    - you will be able to make use of our Dual Career Service
>    <http://www.ru.nl/dualcareerservice> where our Dual Career Officer
>    will assist with family related support, such as child care, and help your
>    partner prepare for the local labour market and with finding an occupation.
>
> *Other Information*
> The institute involved is an equal opportunity employer, committed to
> building a culturally diverse intellectual community, and as such
> encourages applications from women and minorities.
>
> *Would you like to know more?*
> Further information on our Big Questions
> <https://www.languageininteraction.nl/Bigquestions.html>
> Further information on: the different positions
> <https://www.languageininteraction.nl/Synergy1a.html>, including terms of
> employment
>
> Additional information can be obtained from
> Dr. Arjen Stolk <astolk at berkeley.edu>
> Dr. Jana Bašnáková <jana.basnakova at gmail.com>
>
> *Are you interested?*
> You should upload your application (attn. of Prof. dr. P. Hagoort) using '*Apply
> directly <http://www.ru.nl/applyonline?tk=uk&recid=602020>*'. Your
> application should include (and be limited to) the following attachments:
>
>    - a cover letter *quoting at the top* the position you apply for,
>    - your curriculum vitae, including a list of publications and the
>    names of at least two persons who can provide references.
>
> Please apply before 23 June 2019, 23:59 Amsterdam Time Zone.
>
> For more information on your application: +31 24 3611173.
>
> *No commercial propositions please.*
>
> © Language In Interaction, 2019
>
>
>
>
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190604/8ad27d50/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From a.stolk8 at gmail.com  Tue Jun  4 19:04:40 2019
From: a.stolk8 at gmail.com (Arjen Stolk)
Date: Tue, 4 Jun 2019 10:04:40 -0700
Subject: [FieldTrip] Postdoc and PhD Position 'Communication in Context'
 (1.0 FTE)
In-Reply-To: <d49ed4f3446e4896b7f34d73030aaa5e@EXPRD05.hosting.ru.nl>
References: <d49ed4f3446e4896b7f34d73030aaa5e@EXPRD05.hosting.ru.nl>
Message-ID: <CAAiwptSFcYG5S_e7tgR6QL4yCODSLbwkbV2QooAJd8WEP_ujWQ@mail.gmail.com>

Always been interested in our ability to interact, brainstorm, and even
make list posts like these? If you're considering doing Postdoc- or
PhD-level neuroscientific research on this deep-seated yet elusive human
social ability, take a look at this Communication in Context
<https://www.languageininteraction.nl/Synergy1a.html> project.

The preferred start date is September 1. Both positions are for 4 years and
will be held at the Donders Centre for Cognitive Neuroimaging (where
FieldTrip is also housed). The application period closes on June 23.

Best,
Arjen



On Mon, May 27, 2019 at 4:00 AM Verhoef, J.P. (Julia) <
J.Verhoef at donders.ru.nl> wrote:

> Postdoc and PhD Position 'Communication in Context' (1.0 FTE) Vacancy
> number: 30.07.19
> Application deadline: 23 June 2019, 23:59 Amsterdam Time Zone
>
> *Responsibilities*
> We are looking for highly motivated candidates to enrich a unique
> consortium of researchers that aims to unravel the neurocognitive
> mechanisms of language at multiple levels. The goal is to understand both
> the universality and variability of the human language faculty from genes
> to behaviour.
>
> Currently, our consortium advertises one Postdoctoral Researcher position
> and one PhD position <https://www.languageininteraction.nl/Synergy1a.html>.
> These positions provide the opportunity for conducting world-class research
> as a member of an interdisciplinary team.
>
> *Work environment*
> These positions will be held at the Donders Insititute, Centre for
> Cognitive Neuroimaging, Radboud University, Nijmegen, The Netherlands.
>
> The Netherlands has an outstanding track record in the language sciences.
> The ‘Language in Interaction’ research consortium, sponsored by a large
> grant from the Netherlands Organization for Scientific Research (NWO),
> brings together many of the excellent research groups in the Netherlands
> with a research programme on the foundations of language. In addition to
> excellence in the domain of language and related relevant fields of
> cognition, our consortium provides state-of-the-art research facilities and
> a research team with ample experience in the complex research methods that
> will be invoked to address the scientific questions at the highest level of
> methodological sophistication. These include methods from genetics,
> neuroimaging, computational modelling, and patient-related research. This
> consortium realizes both quality and critical mass for studying human
> language at a scale not easily found anywhere else.
>
> We have identified five Big Questions (BQ) that are central to our
> understanding of the human language faculty. These questions are
> interrelated at multiple levels. Teams of researchers will collaborate to
> collectively address these key questions of our field.
>
> Our five Big Questions are:
> BQ1: The nature of the mental lexicon: How to bridge neurobiology and
> psycholinguistic theory by computational modelling?
> BQ2: What are the characteristics and consequences of internal brain
> organisation for language?
> BQ3: Creating a shared cognitive space: How is language grounded in and
> shaped by communicative settings of interacting people?
> BQ4: Variability in language processing and in language learning: Why does
> the ability to learn language change with age? How can we characterise and
> map individual language skills in relation to the population distribution?
> BQ5: How are other cognitive systems shaped by the presence of a language
> system in humans?
>
> You will become member of our Synergy team which in turn will be embedded
> in our Big Questions framework. The research is conducted in an
> international setting at all participating institutions. English is the
> lingua franca.
>
> *What we expect from you*
> Each position has its own requirements and profile
> <https://www.languageininteraction.nl/Synergy1a.html>.
>
> General requirements for all positions are:
>
>    - an integrative mindset;
>    - a theory-driven approach
>    - good communication/collaboration skills;
>    - strong motivation;
>    - excellent proficiency in written and spoken English.
>
> Applications from excellent candidates with a less than ideal profile will
> also be considered.
>
> *What we have to offer*
>
>    - employment: 1.0 FTE;
>    - terms of employment depend on the position applied for;
>    - Dutch universities and the institute involved have a number of
>    regulations in place that enable employees to create a good work-life
>    balance;
>    - you will be able to make use of our Dual Career Service
>    <http://www.ru.nl/dualcareerservice> where our Dual Career Officer
>    will assist with family related support, such as child care, and help your
>    partner prepare for the local labour market and with finding an occupation.
>
> *Other Information*
> The institute involved is an equal opportunity employer, committed to
> building a culturally diverse intellectual community, and as such
> encourages applications from women and minorities.
>
> *Would you like to know more?*
> Further information on our Big Questions
> <https://www.languageininteraction.nl/Bigquestions.html>
> Further information on: the different positions
> <https://www.languageininteraction.nl/Synergy1a.html>, including terms of
> employment
>
> Additional information can be obtained from
> Dr. Arjen Stolk <astolk at berkeley.edu>
> Dr. Jana Bašnáková <jana.basnakova at gmail.com>
>
> *Are you interested?*
> You should upload your application (attn. of Prof. dr. P. Hagoort) using '*Apply
> directly <http://www.ru.nl/applyonline?tk=uk&recid=602020>*'. Your
> application should include (and be limited to) the following attachments:
>
>    - a cover letter *quoting at the top* the position you apply for,
>    - your curriculum vitae, including a list of publications and the
>    names of at least two persons who can provide references.
>
> Please apply before 23 June 2019, 23:59 Amsterdam Time Zone.
>
> For more information on your application: +31 24 3611173.
>
> *No commercial propositions please.*
>
> © Language In Interaction, 2019
>
>
>
>
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190604/8ad27d50/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jan.schoffelen at donders.ru.nl  Wed Jun  5 08:51:53 2019
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Wed, 5 Jun 2019 06:51:53 +0000
Subject: [FieldTrip] Using Fieldtrip with LabStreamingLayer for online
 BCI Processing
In-Reply-To: <YTBPR01MB3021315EE5F9B2A5A77AA5DA94150@YTBPR01MB3021.CANPRD01.PROD.OUTLOOK.COM>
References: <YTBPR01MB3021315EE5F9B2A5A77AA5DA94150@YTBPR01MB3021.CANPRD01.PROD.OUTLOOK.COM>
Message-ID: <45A2FCA8-2DDC-4D71-A239-5A656DD63BBC@donders.ru.nl>

Hi Eli,

The high level FieldTrip functions spend a lot of time bookkeeping the data. If you know what you’re doing, and speed is what you’re after, I’d recommend tapping into the functionality one level down. For instance, for time domain signal processing you could directly tap into the functions that are located in the ‘preproc’ folder. These have a well defined API, so using them is quite straightforward.

Best wishes,
Jan-Mathijs


On 4 Jun 2019, at 16:47, Eli Kinney- Lang <eli.kinneylang at ucalgary.ca<mailto:eli.kinneylang at ucalgary.ca>> wrote:

Hi all,

  I have been using Fieldtrip for the past few years for my offline EEG analysis, with good success. Recently, I have switched to helping build and design some online brain-computer interface systems and was looking toward Fieldtrip to handle the signal processing aspect in real-time. However, I am having some trouble with getting the online EEG processing to work as I'd like. I was wondering if any of you could provide some guidance on getting started (and potentially optimization areas) for the online EEG analysis from Fieldtrip, based on our setup below.

Details:
We are using the LabStreamingLayer (LSL) synchronization system to read in raw EEG data from a g.tec USB amplifier. I know that Fieldtrip has its own online buffer, but for various reasons we'd prefer to use the LSL system to link together our EEG recording, Matlab processing, stimulus input/output.
Data from the amplifier is brought in to Matlab through LSL, providing raw Chan X Sample data. We are establishing the header for Fieldtrip ourselves, inputting the required points to use the ft_datatype_raw format. We have to use the raw datatype as the header information output is not in Fieldtrip's standard format.  This allows us to run ft_preprocessing after defining a cfg of our choice.

However, just doing this processes takes around 1.5-1.8 seconds for Matlab to processes each EEG data chunk. We haven't even yet included any of the ft_analysis schemes for feature extraction, and are concerned the processing time might be too delayed through this route for real-time BCI. Does anyone have any experience with online BCI processing through Fieldtrip, or recommendations on expediting this process?

Thank you in advance for your help!

-Eli
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190605/7044ddca/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jan.schoffelen at donders.ru.nl  Wed Jun  5 08:51:53 2019
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Wed, 5 Jun 2019 06:51:53 +0000
Subject: [FieldTrip] Using Fieldtrip with LabStreamingLayer for online
 BCI Processing
In-Reply-To: <YTBPR01MB3021315EE5F9B2A5A77AA5DA94150@YTBPR01MB3021.CANPRD01.PROD.OUTLOOK.COM>
References: <YTBPR01MB3021315EE5F9B2A5A77AA5DA94150@YTBPR01MB3021.CANPRD01.PROD.OUTLOOK.COM>
Message-ID: <45A2FCA8-2DDC-4D71-A239-5A656DD63BBC@donders.ru.nl>

Hi Eli,

The high level FieldTrip functions spend a lot of time bookkeeping the data. If you know what you’re doing, and speed is what you’re after, I’d recommend tapping into the functionality one level down. For instance, for time domain signal processing you could directly tap into the functions that are located in the ‘preproc’ folder. These have a well defined API, so using them is quite straightforward.

Best wishes,
Jan-Mathijs


On 4 Jun 2019, at 16:47, Eli Kinney- Lang <eli.kinneylang at ucalgary.ca<mailto:eli.kinneylang at ucalgary.ca>> wrote:

Hi all,

  I have been using Fieldtrip for the past few years for my offline EEG analysis, with good success. Recently, I have switched to helping build and design some online brain-computer interface systems and was looking toward Fieldtrip to handle the signal processing aspect in real-time. However, I am having some trouble with getting the online EEG processing to work as I'd like. I was wondering if any of you could provide some guidance on getting started (and potentially optimization areas) for the online EEG analysis from Fieldtrip, based on our setup below.

Details:
We are using the LabStreamingLayer (LSL) synchronization system to read in raw EEG data from a g.tec USB amplifier. I know that Fieldtrip has its own online buffer, but for various reasons we'd prefer to use the LSL system to link together our EEG recording, Matlab processing, stimulus input/output.
Data from the amplifier is brought in to Matlab through LSL, providing raw Chan X Sample data. We are establishing the header for Fieldtrip ourselves, inputting the required points to use the ft_datatype_raw format. We have to use the raw datatype as the header information output is not in Fieldtrip's standard format.  This allows us to run ft_preprocessing after defining a cfg of our choice.

However, just doing this processes takes around 1.5-1.8 seconds for Matlab to processes each EEG data chunk. We haven't even yet included any of the ft_analysis schemes for feature extraction, and are concerned the processing time might be too delayed through this route for real-time BCI. Does anyone have any experience with online BCI processing through Fieldtrip, or recommendations on expediting this process?

Thank you in advance for your help!

-Eli
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190605/7044ddca/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From martin.georg.bleichner at uni-oldenburg.de  Wed Jun  5 11:10:07 2019
From: martin.georg.bleichner at uni-oldenburg.de (Dr. Martin Georg Bleichner)
Date: Wed, 5 Jun 2019 09:10:07 +0000
Subject: [FieldTrip] PhD Position on mobile ear EEG in Oldenburg
Message-ID: <47e6963675ea40baafc8c6b3f6d7d806@uni-oldenburg.de>


The Emmy Noether Research Group "Neurophysiology of Everyday Life" in the Department of Psychology, School of Medicine and Health Sciences, University of Oldenburg,  is seeking to fill a position as
Doctoral researcher (wissenschaftliche/r Mitarbeiter/in)
(E 13 TV-L 65% for 3 years, starting as soon as possible).
The position will be part of the project: Transparent EEG for Monitoring Noise Perception in Everyday life (TEMPEL). In this project, we will study noise perception and why noise annoys us using mobile ear-centered electroencephalography (EEG). One part of the project is the advancement of technological and methodological foundations of beyond the lab EEG acquisition.
As PhD candidate, you will work on a project regarding the signal quality of long-term mobile ear-EEG recordings. You will investigate how artifacts affect the signal quality of everyday life recordings. Your task will be to acquire long term EEG in everyday situations. You will develop methods to predict, prevent and reduce artifacts. You will work closely together with other PhD students that work on related projects.
We are seeking a highly motivated candidate with an academic university degree (master or equivalent) in the field of psychology, biology, (cognitive) neuroscience, computer science, biomedical engineering or related disciplines. A prerequisite is a proven strong interest in bio-signal processing (e.g. as part of your master thesis or as research assistant). Experience in EEG recordings (especially using mobile EEG) are a plus. Fluency in oral and written English is necessary.
The University of Oldenburg offers cutting-edge infrastructure for neuroscience research, and an international, friendly environment with researchers and students with diverse backgrounds. The research group is tightly integrated in the Department of Psychology and associated with the Cluster of Excellence Hearing4all.
The University of Oldenburg is dedicated to increase the percentage of female employees in the field of science. Therefore, female candidates are strongly encouraged to apply. In accordance to § 21 Section 3 NHG, female candidates with equal qualifications will be preferentially considered. Handicapped applicants will be given preference in case of equal qualification. Full-time positions can be also turned into part-time ones.
Please send your application including cover letter, CV, a list of publications (if applicable) and copies of academic certificates in one pdf file to Dr. Martin Bleichner  (martin.bleichner at uol.de<mailto:martin.bleichner at uol.de>). Dr. Bleichner can be contacted for further questions regarding the position. The application deadline is June 23nd. For an indication of the salary please refer to https://oeffentlicher-dienst.info/tv-l/allg/.


--
Dr. Martin G. Bleichner
Neurophysiology of Everyday Life
Department of Psychology
University of Oldenburg
D-26111 Oldenburg
Germany

martin.bleichner at uni-oldenburg.de
Tel.: +49 (0)441 - 798-2940
https://uol.de/psychologie/neurophysiologie-des-alltags-emmy-noether-gruppe/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190605/fa60c479/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PhDPosition_Oldenburg_Bleichner.pdf
Type: application/pdf
Size: 353796 bytes
Desc: PhDPosition_Oldenburg_Bleichner.pdf
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190605/fa60c479/attachment.pdf>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From martin.georg.bleichner at uni-oldenburg.de  Wed Jun  5 11:10:07 2019
From: martin.georg.bleichner at uni-oldenburg.de (Dr. Martin Georg Bleichner)
Date: Wed, 5 Jun 2019 09:10:07 +0000
Subject: [FieldTrip] PhD Position on mobile ear EEG in Oldenburg
Message-ID: <47e6963675ea40baafc8c6b3f6d7d806@uni-oldenburg.de>


The Emmy Noether Research Group "Neurophysiology of Everyday Life" in the Department of Psychology, School of Medicine and Health Sciences, University of Oldenburg,  is seeking to fill a position as
Doctoral researcher (wissenschaftliche/r Mitarbeiter/in)
(E 13 TV-L 65% for 3 years, starting as soon as possible).
The position will be part of the project: Transparent EEG for Monitoring Noise Perception in Everyday life (TEMPEL). In this project, we will study noise perception and why noise annoys us using mobile ear-centered electroencephalography (EEG). One part of the project is the advancement of technological and methodological foundations of beyond the lab EEG acquisition.
As PhD candidate, you will work on a project regarding the signal quality of long-term mobile ear-EEG recordings. You will investigate how artifacts affect the signal quality of everyday life recordings. Your task will be to acquire long term EEG in everyday situations. You will develop methods to predict, prevent and reduce artifacts. You will work closely together with other PhD students that work on related projects.
We are seeking a highly motivated candidate with an academic university degree (master or equivalent) in the field of psychology, biology, (cognitive) neuroscience, computer science, biomedical engineering or related disciplines. A prerequisite is a proven strong interest in bio-signal processing (e.g. as part of your master thesis or as research assistant). Experience in EEG recordings (especially using mobile EEG) are a plus. Fluency in oral and written English is necessary.
The University of Oldenburg offers cutting-edge infrastructure for neuroscience research, and an international, friendly environment with researchers and students with diverse backgrounds. The research group is tightly integrated in the Department of Psychology and associated with the Cluster of Excellence Hearing4all.
The University of Oldenburg is dedicated to increase the percentage of female employees in the field of science. Therefore, female candidates are strongly encouraged to apply. In accordance to § 21 Section 3 NHG, female candidates with equal qualifications will be preferentially considered. Handicapped applicants will be given preference in case of equal qualification. Full-time positions can be also turned into part-time ones.
Please send your application including cover letter, CV, a list of publications (if applicable) and copies of academic certificates in one pdf file to Dr. Martin Bleichner  (martin.bleichner at uol.de<mailto:martin.bleichner at uol.de>). Dr. Bleichner can be contacted for further questions regarding the position. The application deadline is June 23nd. For an indication of the salary please refer to https://oeffentlicher-dienst.info/tv-l/allg/.


--
Dr. Martin G. Bleichner
Neurophysiology of Everyday Life
Department of Psychology
University of Oldenburg
D-26111 Oldenburg
Germany

martin.bleichner at uni-oldenburg.de
Tel.: +49 (0)441 - 798-2940
https://uol.de/psychologie/neurophysiologie-des-alltags-emmy-noether-gruppe/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190605/fa60c479/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PhDPosition_Oldenburg_Bleichner.pdf
Type: application/pdf
Size: 353796 bytes
Desc: PhDPosition_Oldenburg_Bleichner.pdf
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190605/fa60c479/attachment-0001.pdf>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jan.schoffelen at donders.ru.nl  Thu Jun  6 09:33:48 2019
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Thu, 6 Jun 2019 07:33:48 +0000
Subject: [FieldTrip] [ext] Re: Load already preprocessed data to
 fieldtrip functions
In-Reply-To: <000301d51c38$4f7c7340$ee7559c0$@uni-ulm.de>
References: <mailman.5.1559556002.28155.fieldtrip@science.ru.nl>
 <CAJT2k_9oANdcRqnOB-BtCCGE-Uqx2sciQHwgEabJ8iOMWgGKCA@mail.gmail.com>
 <000001d51ae6$4fad5ee0$ef081ca0$@uni-ulm.de>
 <855fd9af-3b47-2f34-f41f-387721222290@charite.de>
 <000301d51c38$4f7c7340$ee7559c0$@uni-ulm.de>
Message-ID: <CCA91CB8-97A4-4C72-BEF6-FE045032507F@donders.ru.nl>

Hi Daniel,

The data needs to be internally consistent:

npoint = size(data.trial{1},2);
fsample = 1000;

data.time{1} = (1:npoint)./fsample;
data.fsample = 1000;

Good luck,
Jan-Mathijs

> On 6 Jun 2019, at 09:20, daniel.strahnen at uni-ulm.de wrote:
> 
> Hi all,
> 
> sorry for bothering you again, but importing already preprocessed LFP data to fieldtrip is still giving me trouble.
> I now try to create the following data structure:
> 
> data.label		 = 	{'CH1'; 'CH2'; 'CH3'; 'CH4'; 'CH5'; 'CH6'; 'CH7'};
> data.time{1} 		 = 	1:1800; % time is 30 minutes, so 1800 seconds
> data.trial{1}		= 	Output_data'; % Output_data' is a matrix: Channels x timepoints
>                             			            % timepoints = 1800000 (1800 seconds  x 1000
>                              			            % samples per second
> data.fsample 		= 	1000; % Sampling rate of 1kHz
> 
> The error I get: Error using ft_datatype_raw (line 83)
> inconsistent number of samples in trial 1
> As I can see this is because I use 1800 for time, but the amount of samples are 1800000 (multiplied with the sampling rate), but when I change the time to 1800000 other errors occur within the analysis functions.
> I only have one long trial with 7 channels  of 30 minutes that I want to analyse using ft_freqanalysis and the connectivity functions.
> 
> Thank you very much in advance and best regards
> 
> Daniel
> 
> -----Ursprüngliche Nachricht-----
> Von: Mathis Kaiser <mathis.kaiser at charite.de> 
> Gesendet: Dienstag, 4. Juni 2019 18:26
> An: daniel.strahnen at uni-ulm.de
> Betreff: Re: [ext] Re: [FieldTrip] Load already preprocessed data to fieldtrip functions
> 
> Hi Daniel,
> 
> also see
> http://www.fieldtriptoolbox.org/faq/how_are_the_various_data_structures_defined/
> and e.g. http://www.fieldtriptoolbox.org/reference/ft_datatype_timelock/
> for info on required fields of your data structure.
> 
> Here's a Matlab code snippet that creates a minimal working timelock
> structure:
> 
> %%%
> 
> prePost = [-1 1]; % time around stimulus onset sampleFreq = 500; timeVec = prePost(1):1/sampleFreq:prePost(2);
> 
> nChan = 32;
> nSamples = length(timeVec);
> 
> data.avg = randn(nChan,nSamples); % just some random data data.dimord = 'chan_time'; data.label = compose('e%02i', 1:nChan); data.time = timeVec;
> 
> figure;
> ft_singleplotER([],data)
> 
> %%%
> 
> Best,
> Mathis
> 
> 
> On 04.06.19 17:00, daniel.strahnen at uni-ulm.de wrote:
>> Thanks for the advice! Would it be possible for you to send me just 
>> the structure the you mentioned since I don’t have any data here that 
>> is compatible to the Fieldtrip pipeline?
>> 
>> 
>> 
>> *Von:* fieldtrip <fieldtrip-bounces at science.ru.nl> *Im Auftrag von 
>> *Stephen Politzer-Ahles
>> *Gesendet:* Montag, 3. Juni 2019 17:40
>> *An:* fieldtrip at science.ru.nl
>> *Betreff:* Re: [FieldTrip] Load already preprocessed data to fieldtrip 
>> functions
>> 
>> 
>> 
>> An easy way to hack it is to preprocess some other data using the 
>> Fieldtrip pipeline, grab the structure that's created, and then 
>> manually replace the appropriate fields (like .trial, .average, .time, 
>> etc.) with the fields from your own data. You may also have to replace 
>> some other fields, like .dimord, if they don't match yours; but this 
>> is pretty straightforward to do once you get familiar with the 
>> Fieldtrip data structure. This is what I've done in the past when I 
>> have data I processed in some other software or toolbox but then I 
>> want to use Fieldtrip's functions for cluster-based permutation tests or whatnot.
>> There may be more proper or more efficient ways to do it, but this 
>> hack has worked fine for me so far.
>> 
>> 
>> 
>> ---
>> 
>> Stephen Politzer-Ahles
>> The Hong Kong Polytechnic University
>> Department of Chinese and Bilingual Studies 
>> http://www.mypolyuweb.hk/~sjpolit/
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>>    Message: 1
>>    Date: Sun, 2 Jun 2019 16:28:08 +0200
>>    From: <daniel.strahnen at uni-ulm.de <mailto:daniel.strahnen at uni-ulm.de>>
>>    To: <fieldtrip at science.ru.nl <mailto:fieldtrip at science.ru.nl>>
>>    Subject: [FieldTrip] Load already preprocessed data to fieldtrip
>>            functions
>>    Message-ID: <000401d5194f$66ece690$34c6b3b0$@uni-ulm.de
>>    <http://uni-ulm.de>>
>>    Content-Type: text/plain; charset="utf-8"
>> 
>>    Is it possible to use the fieldtrip functions for already
>>    preprocessed data
>>    that is organized in a .mat file.
>> 
>>    The data is stored in a matrix organized as follows: Channels x 
>> samples
>> 
>>    -------------- next part --------------
>>    An HTML attachment was scrubbed...
>>    URL:
>> 
>> <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190602
>> /37bb8ec8/attachment.html>
>> 
>>    ------------------------------
>> 
>> 
>> _______________________________________________
>> fieldtrip mailing list
>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>> https://doi.org/10.1371/journal.pcbi.1002202
>> 
> 
> 
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202


_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jan.schoffelen at donders.ru.nl  Thu Jun  6 09:33:48 2019
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Thu, 6 Jun 2019 07:33:48 +0000
Subject: [FieldTrip] [ext] Re: Load already preprocessed data to
 fieldtrip functions
In-Reply-To: <000301d51c38$4f7c7340$ee7559c0$@uni-ulm.de>
References: <mailman.5.1559556002.28155.fieldtrip@science.ru.nl>
 <CAJT2k_9oANdcRqnOB-BtCCGE-Uqx2sciQHwgEabJ8iOMWgGKCA@mail.gmail.com>
 <000001d51ae6$4fad5ee0$ef081ca0$@uni-ulm.de>
 <855fd9af-3b47-2f34-f41f-387721222290@charite.de>
 <000301d51c38$4f7c7340$ee7559c0$@uni-ulm.de>
Message-ID: <CCA91CB8-97A4-4C72-BEF6-FE045032507F@donders.ru.nl>

Hi Daniel,

The data needs to be internally consistent:

npoint = size(data.trial{1},2);
fsample = 1000;

data.time{1} = (1:npoint)./fsample;
data.fsample = 1000;

Good luck,
Jan-Mathijs

> On 6 Jun 2019, at 09:20, daniel.strahnen at uni-ulm.de wrote:
> 
> Hi all,
> 
> sorry for bothering you again, but importing already preprocessed LFP data to fieldtrip is still giving me trouble.
> I now try to create the following data structure:
> 
> data.label		 = 	{'CH1'; 'CH2'; 'CH3'; 'CH4'; 'CH5'; 'CH6'; 'CH7'};
> data.time{1} 		 = 	1:1800; % time is 30 minutes, so 1800 seconds
> data.trial{1}		= 	Output_data'; % Output_data' is a matrix: Channels x timepoints
>                             			            % timepoints = 1800000 (1800 seconds  x 1000
>                              			            % samples per second
> data.fsample 		= 	1000; % Sampling rate of 1kHz
> 
> The error I get: Error using ft_datatype_raw (line 83)
> inconsistent number of samples in trial 1
> As I can see this is because I use 1800 for time, but the amount of samples are 1800000 (multiplied with the sampling rate), but when I change the time to 1800000 other errors occur within the analysis functions.
> I only have one long trial with 7 channels  of 30 minutes that I want to analyse using ft_freqanalysis and the connectivity functions.
> 
> Thank you very much in advance and best regards
> 
> Daniel
> 
> -----Ursprüngliche Nachricht-----
> Von: Mathis Kaiser <mathis.kaiser at charite.de> 
> Gesendet: Dienstag, 4. Juni 2019 18:26
> An: daniel.strahnen at uni-ulm.de
> Betreff: Re: [ext] Re: [FieldTrip] Load already preprocessed data to fieldtrip functions
> 
> Hi Daniel,
> 
> also see
> http://www.fieldtriptoolbox.org/faq/how_are_the_various_data_structures_defined/
> and e.g. http://www.fieldtriptoolbox.org/reference/ft_datatype_timelock/
> for info on required fields of your data structure.
> 
> Here's a Matlab code snippet that creates a minimal working timelock
> structure:
> 
> %%%
> 
> prePost = [-1 1]; % time around stimulus onset sampleFreq = 500; timeVec = prePost(1):1/sampleFreq:prePost(2);
> 
> nChan = 32;
> nSamples = length(timeVec);
> 
> data.avg = randn(nChan,nSamples); % just some random data data.dimord = 'chan_time'; data.label = compose('e%02i', 1:nChan); data.time = timeVec;
> 
> figure;
> ft_singleplotER([],data)
> 
> %%%
> 
> Best,
> Mathis
> 
> 
> On 04.06.19 17:00, daniel.strahnen at uni-ulm.de wrote:
>> Thanks for the advice! Would it be possible for you to send me just 
>> the structure the you mentioned since I don’t have any data here that 
>> is compatible to the Fieldtrip pipeline?
>> 
>> 
>> 
>> *Von:* fieldtrip <fieldtrip-bounces at science.ru.nl> *Im Auftrag von 
>> *Stephen Politzer-Ahles
>> *Gesendet:* Montag, 3. Juni 2019 17:40
>> *An:* fieldtrip at science.ru.nl
>> *Betreff:* Re: [FieldTrip] Load already preprocessed data to fieldtrip 
>> functions
>> 
>> 
>> 
>> An easy way to hack it is to preprocess some other data using the 
>> Fieldtrip pipeline, grab the structure that's created, and then 
>> manually replace the appropriate fields (like .trial, .average, .time, 
>> etc.) with the fields from your own data. You may also have to replace 
>> some other fields, like .dimord, if they don't match yours; but this 
>> is pretty straightforward to do once you get familiar with the 
>> Fieldtrip data structure. This is what I've done in the past when I 
>> have data I processed in some other software or toolbox but then I 
>> want to use Fieldtrip's functions for cluster-based permutation tests or whatnot.
>> There may be more proper or more efficient ways to do it, but this 
>> hack has worked fine for me so far.
>> 
>> 
>> 
>> ---
>> 
>> Stephen Politzer-Ahles
>> The Hong Kong Polytechnic University
>> Department of Chinese and Bilingual Studies 
>> http://www.mypolyuweb.hk/~sjpolit/
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>>    Message: 1
>>    Date: Sun, 2 Jun 2019 16:28:08 +0200
>>    From: <daniel.strahnen at uni-ulm.de <mailto:daniel.strahnen at uni-ulm.de>>
>>    To: <fieldtrip at science.ru.nl <mailto:fieldtrip at science.ru.nl>>
>>    Subject: [FieldTrip] Load already preprocessed data to fieldtrip
>>            functions
>>    Message-ID: <000401d5194f$66ece690$34c6b3b0$@uni-ulm.de
>>    <http://uni-ulm.de>>
>>    Content-Type: text/plain; charset="utf-8"
>> 
>>    Is it possible to use the fieldtrip functions for already
>>    preprocessed data
>>    that is organized in a .mat file.
>> 
>>    The data is stored in a matrix organized as follows: Channels x 
>> samples
>> 
>>    -------------- next part --------------
>>    An HTML attachment was scrubbed...
>>    URL:
>> 
>> <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190602
>> /37bb8ec8/attachment.html>
>> 
>>    ------------------------------
>> 
>> 
>> _______________________________________________
>> fieldtrip mailing list
>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>> https://doi.org/10.1371/journal.pcbi.1002202
>> 
> 
> 
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202


_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From daniel.strahnen at uni-ulm.de  Thu Jun  6 09:20:18 2019
From: daniel.strahnen at uni-ulm.de (daniel.strahnen at uni-ulm.de)
Date: Thu, 6 Jun 2019 09:20:18 +0200
Subject: [FieldTrip] [ext] Re: Load already preprocessed data to
 fieldtrip functions
In-Reply-To: <855fd9af-3b47-2f34-f41f-387721222290@charite.de>
References: <mailman.5.1559556002.28155.fieldtrip@science.ru.nl>
 <CAJT2k_9oANdcRqnOB-BtCCGE-Uqx2sciQHwgEabJ8iOMWgGKCA@mail.gmail.com>
 <000001d51ae6$4fad5ee0$ef081ca0$@uni-ulm.de>
 <855fd9af-3b47-2f34-f41f-387721222290@charite.de>
Message-ID: <000301d51c38$4f7c7340$ee7559c0$@uni-ulm.de>

Hi all,

sorry for bothering you again, but importing already preprocessed LFP data to fieldtrip is still giving me trouble.
I now try to create the following data structure:

data.label		 = 	{'CH1'; 'CH2'; 'CH3'; 'CH4'; 'CH5'; 'CH6'; 'CH7'};
data.time{1} 		 = 	1:1800; % time is 30 minutes, so 1800 seconds
data.trial{1}		= 	Output_data'; % Output_data' is a matrix: Channels x timepoints
                             			            % timepoints = 1800000 (1800 seconds  x 1000
                              			            % samples per second
data.fsample 		= 	1000; % Sampling rate of 1kHz

The error I get: Error using ft_datatype_raw (line 83)
inconsistent number of samples in trial 1
As I can see this is because I use 1800 for time, but the amount of samples are 1800000 (multiplied with the sampling rate), but when I change the time to 1800000 other errors occur within the analysis functions.
I only have one long trial with 7 channels  of 30 minutes that I want to analyse using ft_freqanalysis and the connectivity functions.

Thank you very much in advance and best regards

Daniel

-----Ursprüngliche Nachricht-----
Von: Mathis Kaiser <mathis.kaiser at charite.de> 
Gesendet: Dienstag, 4. Juni 2019 18:26
An: daniel.strahnen at uni-ulm.de
Betreff: Re: [ext] Re: [FieldTrip] Load already preprocessed data to fieldtrip functions

Hi Daniel,

also see
http://www.fieldtriptoolbox.org/faq/how_are_the_various_data_structures_defined/
and e.g. http://www.fieldtriptoolbox.org/reference/ft_datatype_timelock/
for info on required fields of your data structure.

Here's a Matlab code snippet that creates a minimal working timelock
structure:

%%%

prePost = [-1 1]; % time around stimulus onset sampleFreq = 500; timeVec = prePost(1):1/sampleFreq:prePost(2);

nChan = 32;
nSamples = length(timeVec);

data.avg = randn(nChan,nSamples); % just some random data data.dimord = 'chan_time'; data.label = compose('e%02i', 1:nChan); data.time = timeVec;

figure;
ft_singleplotER([],data)

%%%

Best,
Mathis


On 04.06.19 17:00, daniel.strahnen at uni-ulm.de wrote:
> Thanks for the advice! Would it be possible for you to send me just 
> the structure the you mentioned since I don’t have any data here that 
> is compatible to the Fieldtrip pipeline?
> 
>  
> 
> *Von:* fieldtrip <fieldtrip-bounces at science.ru.nl> *Im Auftrag von 
> *Stephen Politzer-Ahles
> *Gesendet:* Montag, 3. Juni 2019 17:40
> *An:* fieldtrip at science.ru.nl
> *Betreff:* Re: [FieldTrip] Load already preprocessed data to fieldtrip 
> functions
> 
>  
> 
> An easy way to hack it is to preprocess some other data using the 
> Fieldtrip pipeline, grab the structure that's created, and then 
> manually replace the appropriate fields (like .trial, .average, .time, 
> etc.) with the fields from your own data. You may also have to replace 
> some other fields, like .dimord, if they don't match yours; but this 
> is pretty straightforward to do once you get familiar with the 
> Fieldtrip data structure. This is what I've done in the past when I 
> have data I processed in some other software or toolbox but then I 
> want to use Fieldtrip's functions for cluster-based permutation tests or whatnot.
> There may be more proper or more efficient ways to do it, but this 
> hack has worked fine for me so far.
> 
>  
> 
> ---
> 
> Stephen Politzer-Ahles
> The Hong Kong Polytechnic University
> Department of Chinese and Bilingual Studies 
> http://www.mypolyuweb.hk/~sjpolit/
> 
>  
> 
>  
> 
>  
> 
>     Message: 1
>     Date: Sun, 2 Jun 2019 16:28:08 +0200
>     From: <daniel.strahnen at uni-ulm.de <mailto:daniel.strahnen at uni-ulm.de>>
>     To: <fieldtrip at science.ru.nl <mailto:fieldtrip at science.ru.nl>>
>     Subject: [FieldTrip] Load already preprocessed data to fieldtrip
>             functions
>     Message-ID: <000401d5194f$66ece690$34c6b3b0$@uni-ulm.de
>     <http://uni-ulm.de>>
>     Content-Type: text/plain; charset="utf-8"
> 
>     Is it possible to use the fieldtrip functions for already
>     preprocessed data
>     that is organized in a .mat file.
> 
>     The data is stored in a matrix organized as follows: Channels x 
> samples
> 
>     -------------- next part --------------
>     An HTML attachment was scrubbed...
>     URL:
>     
> <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190602
> /37bb8ec8/attachment.html>
> 
>     ------------------------------
> 
> 
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202
> 


_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From daniel.strahnen at uni-ulm.de  Thu Jun  6 09:20:18 2019
From: daniel.strahnen at uni-ulm.de (daniel.strahnen at uni-ulm.de)
Date: Thu, 6 Jun 2019 09:20:18 +0200
Subject: [FieldTrip] [ext] Re: Load already preprocessed data to
 fieldtrip functions
In-Reply-To: <855fd9af-3b47-2f34-f41f-387721222290@charite.de>
References: <mailman.5.1559556002.28155.fieldtrip@science.ru.nl>
 <CAJT2k_9oANdcRqnOB-BtCCGE-Uqx2sciQHwgEabJ8iOMWgGKCA@mail.gmail.com>
 <000001d51ae6$4fad5ee0$ef081ca0$@uni-ulm.de>
 <855fd9af-3b47-2f34-f41f-387721222290@charite.de>
Message-ID: <000301d51c38$4f7c7340$ee7559c0$@uni-ulm.de>

Hi all,

sorry for bothering you again, but importing already preprocessed LFP data to fieldtrip is still giving me trouble.
I now try to create the following data structure:

data.label		 = 	{'CH1'; 'CH2'; 'CH3'; 'CH4'; 'CH5'; 'CH6'; 'CH7'};
data.time{1} 		 = 	1:1800; % time is 30 minutes, so 1800 seconds
data.trial{1}		= 	Output_data'; % Output_data' is a matrix: Channels x timepoints
                             			            % timepoints = 1800000 (1800 seconds  x 1000
                              			            % samples per second
data.fsample 		= 	1000; % Sampling rate of 1kHz

The error I get: Error using ft_datatype_raw (line 83)
inconsistent number of samples in trial 1
As I can see this is because I use 1800 for time, but the amount of samples are 1800000 (multiplied with the sampling rate), but when I change the time to 1800000 other errors occur within the analysis functions.
I only have one long trial with 7 channels  of 30 minutes that I want to analyse using ft_freqanalysis and the connectivity functions.

Thank you very much in advance and best regards

Daniel

-----Ursprüngliche Nachricht-----
Von: Mathis Kaiser <mathis.kaiser at charite.de> 
Gesendet: Dienstag, 4. Juni 2019 18:26
An: daniel.strahnen at uni-ulm.de
Betreff: Re: [ext] Re: [FieldTrip] Load already preprocessed data to fieldtrip functions

Hi Daniel,

also see
http://www.fieldtriptoolbox.org/faq/how_are_the_various_data_structures_defined/
and e.g. http://www.fieldtriptoolbox.org/reference/ft_datatype_timelock/
for info on required fields of your data structure.

Here's a Matlab code snippet that creates a minimal working timelock
structure:

%%%

prePost = [-1 1]; % time around stimulus onset sampleFreq = 500; timeVec = prePost(1):1/sampleFreq:prePost(2);

nChan = 32;
nSamples = length(timeVec);

data.avg = randn(nChan,nSamples); % just some random data data.dimord = 'chan_time'; data.label = compose('e%02i', 1:nChan); data.time = timeVec;

figure;
ft_singleplotER([],data)

%%%

Best,
Mathis


On 04.06.19 17:00, daniel.strahnen at uni-ulm.de wrote:
> Thanks for the advice! Would it be possible for you to send me just 
> the structure the you mentioned since I don’t have any data here that 
> is compatible to the Fieldtrip pipeline?
> 
>  
> 
> *Von:* fieldtrip <fieldtrip-bounces at science.ru.nl> *Im Auftrag von 
> *Stephen Politzer-Ahles
> *Gesendet:* Montag, 3. Juni 2019 17:40
> *An:* fieldtrip at science.ru.nl
> *Betreff:* Re: [FieldTrip] Load already preprocessed data to fieldtrip 
> functions
> 
>  
> 
> An easy way to hack it is to preprocess some other data using the 
> Fieldtrip pipeline, grab the structure that's created, and then 
> manually replace the appropriate fields (like .trial, .average, .time, 
> etc.) with the fields from your own data. You may also have to replace 
> some other fields, like .dimord, if they don't match yours; but this 
> is pretty straightforward to do once you get familiar with the 
> Fieldtrip data structure. This is what I've done in the past when I 
> have data I processed in some other software or toolbox but then I 
> want to use Fieldtrip's functions for cluster-based permutation tests or whatnot.
> There may be more proper or more efficient ways to do it, but this 
> hack has worked fine for me so far.
> 
>  
> 
> ---
> 
> Stephen Politzer-Ahles
> The Hong Kong Polytechnic University
> Department of Chinese and Bilingual Studies 
> http://www.mypolyuweb.hk/~sjpolit/
> 
>  
> 
>  
> 
>  
> 
>     Message: 1
>     Date: Sun, 2 Jun 2019 16:28:08 +0200
>     From: <daniel.strahnen at uni-ulm.de <mailto:daniel.strahnen at uni-ulm.de>>
>     To: <fieldtrip at science.ru.nl <mailto:fieldtrip at science.ru.nl>>
>     Subject: [FieldTrip] Load already preprocessed data to fieldtrip
>             functions
>     Message-ID: <000401d5194f$66ece690$34c6b3b0$@uni-ulm.de
>     <http://uni-ulm.de>>
>     Content-Type: text/plain; charset="utf-8"
> 
>     Is it possible to use the fieldtrip functions for already
>     preprocessed data
>     that is organized in a .mat file.
> 
>     The data is stored in a matrix organized as follows: Channels x 
> samples
> 
>     -------------- next part --------------
>     An HTML attachment was scrubbed...
>     URL:
>     
> <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190602
> /37bb8ec8/attachment.html>
> 
>     ------------------------------
> 
> 
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202
> 


_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From thomas.lusignan at gmail.com  Thu Jun  6 20:31:45 2019
From: thomas.lusignan at gmail.com (Thomas Lusignan)
Date: Thu, 6 Jun 2019 14:31:45 -0400
Subject: [FieldTrip] Fwd: Getting data from a database instead of files
In-Reply-To: <511490D9-FFFD-4516-ADE4-537F68647B2F@donders.ru.nl>
References: <CA+P_HzdRM_myzfe27DYYkahi0wTqn-+rseWg9zWTj6kJpKb65Q@mail.gmail.com>
 <CA+P_HzdoSsdv=t+TDc9aTJJfiagnOPgyBy+hxtXFnXe_5-FKvg@mail.gmail.com>
 <CA+P_Hzdn93ebZxFmLBxEVBoQapdyrgFUAh6hdhp+opzCggOHmA@mail.gmail.com>
 <511490D9-FFFD-4516-ADE4-537F68647B2F@donders.ru.nl>
Message-ID: <CA+P_Hze1fn2Gsz++pTh0uZqQ9JGqeDuDZN+2bvmn_sEnb=j8ig@mail.gmail.com>

Hi  Jan-Mathijs,

Thank you so much for your swift and thorough answer!

Sadly, removing the .trl, .channels and .dimord fields did not solve my
problem. It did halve the number of warnings I get (from 8 to 4). A few
quick tests showed me this came down to removing the .trl field and not the
other ones.
I also get a warning about inconsistent sampleinfo, which I forgot to
mention in my original email.

Could it be a problem with my FT path? I had path-related errors with SPM
earlier, and I ended up solving them by adding ft_defaults in my startup.m
file.

Another thing I found out is that the error I get (Array dimensions must
match for binary array op.) doesn't always happen at the same time. The
processing counter goes up to trial 3, and then frequency somewhere between
1 and 24.  I'm not sure what this means, though.

Do you have any suggestions?

Thank you!

Thomas


Le lun. 3 juin 2019 à 11:35, Schoffelen, J.M. (Jan Mathijs) <
jan.schoffelen at donders.ru.nl> a écrit :

> Hi Thomas,
>
> Thanks for your informative e-mail :).
>
> Here's what I did:
>
>
>
>
> *1- Get the data for a subset of my choosing (I tried everything with a
> small 4-channel, 55-trials subset) *
> *2- Put that data into a structure built as follows, adding fields that
> FieldTrip required:*
>
>     fsample: 1017           (I know this is weird but we're stuck with it)
>    channels: [1 17 25 29]   Added to keep track of in-house bookkeeping
>       label: {'Ch:1 idElectrodeSite:181'  'Ch:17 idElectrodeSite:183'
> 'Ch:25 idElectrodeSite:184'
>               'Ch:29 idElectrodeSite:185'}  Not the right structure, but
> I don't have header files to get them from
>       trial: {55×1 cell}    One cell per trial, with each being [chan x
> time]
>        time: {55×1 cell}    One cell per trial, each going from -750ms to
> 750ms (around target onset) This includes a 250ms pad on each side.
>         trl: [55×3 double]  Built from scratch as if the trials were
> continuous. (Inspired by the FT function that does this)
>      dimord: 'chan_time'    Added by hand, can't get Fieldtrip to
> recognize it
>  sampleinfo: [55×2 double]  The first two columns of trl
>
>
> You may need to get rid of the following fields: ’trl’ ‘dimord’ and
> ‘channels’. Once this is done, I think you are ready to go, without
> warnings and errors.
>
>
>
>
> *3- Try to use ft_freqanalysis using the following cfg (also attached) *
> cfg = [];
> cfg.method= 'tfr';
> cfg.pad = 'nextpow2';
> cfg.width = 7;
> cfg.gwidth = 3;
> cfg.foi = [15:1:60];
> cfg.toi = 'all';
>
> I first get the message:
> the input is raw data with 4 channels and 55 trial
> This would be encouraging, but then, I get the following warnings:
>
> Warning: could not determine dimord of "trial" in: (structure shown above)
> Warning: could not determine dimord of "trl" in:   (structure shown above)
> ...but four pairs of them.
>
> Looking through the debugger, I found out they're given when ft_freqanalysis,
> calls ft_checkdata and ft_selectdata.
> *Are these warnings something I should be worried about, or can everything
> work well the way it is?*
> Also, how is it that FT 'could not determine dimord' when I give it one in
> the data structure, and it seems to understand the way it works given the
> message it sends at the beginning?
>
> After the warnings, I get this:
>
> the call to "ft_selectdata" took 16 seconds
> processing trials
> trial 2, frequency 32 (46.18 Hz)
> Array dimensions must match for binary array op.
>
> Error in ft_freqanalysis (line 679)
>             trlcnt(1, ifoi, :) = trlcnt(1, ifoi, :) +
> shiftdim(double(acttboi(:)'),-1);
>
> ...which I simply don't know how to solve.
>
>
> *So in summary:*
>
> 1- Is it possible to make FT work without using original files to get the
> data?
>
>
>
> Yes!
>
> 2- If it is, what have I done wrong, and how could I make it work?
>
>
> See above.
>
>
> 3- Are the warnings worrisome or is it just a natural consequence of
> trying to jerry-rig data in FT?
>
>
> Not worrisome, they should go away if you do exactly as I told :).
>
> 4- Any idea on how to solve the error message I get is appreciated, but a
> secondary objective.
>
>
> Probably it goes away.
>
> Keep up the good work and with best wishes,
> Jan-Mathijs
>
>
>
> I attached the function I made to build the data structure in case it
> could help.
>
>
> Thank you very much for reading this long-winded message!
>
> Regards
>
> Thomas Lusignan, B. Sc.
> Paul Cisek's Lab
> Université de Montréal
> <GetFTLFP.m>_______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202
>
>
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190606/e4acfccd/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From thomas.lusignan at gmail.com  Thu Jun  6 20:31:45 2019
From: thomas.lusignan at gmail.com (Thomas Lusignan)
Date: Thu, 6 Jun 2019 14:31:45 -0400
Subject: [FieldTrip] Fwd: Getting data from a database instead of files
In-Reply-To: <511490D9-FFFD-4516-ADE4-537F68647B2F@donders.ru.nl>
References: <CA+P_HzdRM_myzfe27DYYkahi0wTqn-+rseWg9zWTj6kJpKb65Q@mail.gmail.com>
 <CA+P_HzdoSsdv=t+TDc9aTJJfiagnOPgyBy+hxtXFnXe_5-FKvg@mail.gmail.com>
 <CA+P_Hzdn93ebZxFmLBxEVBoQapdyrgFUAh6hdhp+opzCggOHmA@mail.gmail.com>
 <511490D9-FFFD-4516-ADE4-537F68647B2F@donders.ru.nl>
Message-ID: <CA+P_Hze1fn2Gsz++pTh0uZqQ9JGqeDuDZN+2bvmn_sEnb=j8ig@mail.gmail.com>

Hi  Jan-Mathijs,

Thank you so much for your swift and thorough answer!

Sadly, removing the .trl, .channels and .dimord fields did not solve my
problem. It did halve the number of warnings I get (from 8 to 4). A few
quick tests showed me this came down to removing the .trl field and not the
other ones.
I also get a warning about inconsistent sampleinfo, which I forgot to
mention in my original email.

Could it be a problem with my FT path? I had path-related errors with SPM
earlier, and I ended up solving them by adding ft_defaults in my startup.m
file.

Another thing I found out is that the error I get (Array dimensions must
match for binary array op.) doesn't always happen at the same time. The
processing counter goes up to trial 3, and then frequency somewhere between
1 and 24.  I'm not sure what this means, though.

Do you have any suggestions?

Thank you!

Thomas


Le lun. 3 juin 2019 à 11:35, Schoffelen, J.M. (Jan Mathijs) <
jan.schoffelen at donders.ru.nl> a écrit :

> Hi Thomas,
>
> Thanks for your informative e-mail :).
>
> Here's what I did:
>
>
>
>
> *1- Get the data for a subset of my choosing (I tried everything with a
> small 4-channel, 55-trials subset) *
> *2- Put that data into a structure built as follows, adding fields that
> FieldTrip required:*
>
>     fsample: 1017           (I know this is weird but we're stuck with it)
>    channels: [1 17 25 29]   Added to keep track of in-house bookkeeping
>       label: {'Ch:1 idElectrodeSite:181'  'Ch:17 idElectrodeSite:183'
> 'Ch:25 idElectrodeSite:184'
>               'Ch:29 idElectrodeSite:185'}  Not the right structure, but
> I don't have header files to get them from
>       trial: {55×1 cell}    One cell per trial, with each being [chan x
> time]
>        time: {55×1 cell}    One cell per trial, each going from -750ms to
> 750ms (around target onset) This includes a 250ms pad on each side.
>         trl: [55×3 double]  Built from scratch as if the trials were
> continuous. (Inspired by the FT function that does this)
>      dimord: 'chan_time'    Added by hand, can't get Fieldtrip to
> recognize it
>  sampleinfo: [55×2 double]  The first two columns of trl
>
>
> You may need to get rid of the following fields: ’trl’ ‘dimord’ and
> ‘channels’. Once this is done, I think you are ready to go, without
> warnings and errors.
>
>
>
>
> *3- Try to use ft_freqanalysis using the following cfg (also attached) *
> cfg = [];
> cfg.method= 'tfr';
> cfg.pad = 'nextpow2';
> cfg.width = 7;
> cfg.gwidth = 3;
> cfg.foi = [15:1:60];
> cfg.toi = 'all';
>
> I first get the message:
> the input is raw data with 4 channels and 55 trial
> This would be encouraging, but then, I get the following warnings:
>
> Warning: could not determine dimord of "trial" in: (structure shown above)
> Warning: could not determine dimord of "trl" in:   (structure shown above)
> ...but four pairs of them.
>
> Looking through the debugger, I found out they're given when ft_freqanalysis,
> calls ft_checkdata and ft_selectdata.
> *Are these warnings something I should be worried about, or can everything
> work well the way it is?*
> Also, how is it that FT 'could not determine dimord' when I give it one in
> the data structure, and it seems to understand the way it works given the
> message it sends at the beginning?
>
> After the warnings, I get this:
>
> the call to "ft_selectdata" took 16 seconds
> processing trials
> trial 2, frequency 32 (46.18 Hz)
> Array dimensions must match for binary array op.
>
> Error in ft_freqanalysis (line 679)
>             trlcnt(1, ifoi, :) = trlcnt(1, ifoi, :) +
> shiftdim(double(acttboi(:)'),-1);
>
> ...which I simply don't know how to solve.
>
>
> *So in summary:*
>
> 1- Is it possible to make FT work without using original files to get the
> data?
>
>
>
> Yes!
>
> 2- If it is, what have I done wrong, and how could I make it work?
>
>
> See above.
>
>
> 3- Are the warnings worrisome or is it just a natural consequence of
> trying to jerry-rig data in FT?
>
>
> Not worrisome, they should go away if you do exactly as I told :).
>
> 4- Any idea on how to solve the error message I get is appreciated, but a
> secondary objective.
>
>
> Probably it goes away.
>
> Keep up the good work and with best wishes,
> Jan-Mathijs
>
>
>
> I attached the function I made to build the data structure in case it
> could help.
>
>
> Thank you very much for reading this long-winded message!
>
> Regards
>
> Thomas Lusignan, B. Sc.
> Paul Cisek's Lab
> Université de Montréal
> <GetFTLFP.m>_______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202
>
>
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190606/e4acfccd/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From keshav.b.kundassery at vanderbilt.edu  Tue Jun 11 18:18:16 2019
From: keshav.b.kundassery at vanderbilt.edu (Keshav Kundassery)
Date: Tue, 11 Jun 2019 11:18:16 -0500
Subject: [FieldTrip] Partial directed coherence
Message-ID: <CAMvULJYyw9n=HyRmf0xvihXY_NUUfOPGSqWwjfHauLBE3qWUDQ@mail.gmail.com>

Hi,

I am trying to calculate partial directed coherence using Fieldtrip using
ft_connectivity analysis with the method set to 'pdc'. In the output
matrix, does anyone know, is it the columns or the rows that are the
sources/destinations of the signal?

Thanks,
Keshav Kundassery
Undegraduate Research Assistant
Vanderbilt University BIEN Lab
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190611/2b5bb1c0/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From keshav.b.kundassery at vanderbilt.edu  Tue Jun 11 18:18:16 2019
From: keshav.b.kundassery at vanderbilt.edu (Keshav Kundassery)
Date: Tue, 11 Jun 2019 11:18:16 -0500
Subject: [FieldTrip] Partial directed coherence
Message-ID: <CAMvULJYyw9n=HyRmf0xvihXY_NUUfOPGSqWwjfHauLBE3qWUDQ@mail.gmail.com>

Hi,

I am trying to calculate partial directed coherence using Fieldtrip using
ft_connectivity analysis with the method set to 'pdc'. In the output
matrix, does anyone know, is it the columns or the rows that are the
sources/destinations of the signal?

Thanks,
Keshav Kundassery
Undegraduate Research Assistant
Vanderbilt University BIEN Lab
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190611/2b5bb1c0/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jan.schoffelen at donders.ru.nl  Tue Jun 11 23:10:00 2019
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Tue, 11 Jun 2019 21:10:00 +0000
Subject: [FieldTrip] Partial directed coherence
In-Reply-To: <CAMvULJYyw9n=HyRmf0xvihXY_NUUfOPGSqWwjfHauLBE3qWUDQ@mail.gmail.com>
References: <CAMvULJYyw9n=HyRmf0xvihXY_NUUfOPGSqWwjfHauLBE3qWUDQ@mail.gmail.com>
Message-ID: <94B3824F-1EC3-440B-AC4E-11740D147193@donders.ru.nl>

Hi Keshav,

Fieldtrip convention is that the row causes the column. As far as I remember, this is documented here, although admittedly a bit hidden: http://www.fieldtriptoolbox.org/faq/in_what_way_can_frequency_domain_data_be_represented_in_fieldtrip/

Best wishes,
Jan-Mathijs



On 11 Jun 2019, at 18:18, Keshav Kundassery <keshav.b.kundassery at vanderbilt.edu<mailto:keshav.b.kundassery at vanderbilt.edu>> wrote:

Hi,

I am trying to calculate partial directed coherence using Fieldtrip using ft_connectivity analysis with the method set to 'pdc'. In the output matrix, does anyone know, is it the columns or the rows that are the sources/destinations of the signal?

Thanks,
Keshav Kundassery
Undegraduate Research Assistant
Vanderbilt University BIEN Lab
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190611/560e6c95/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jan.schoffelen at donders.ru.nl  Tue Jun 11 23:10:00 2019
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Tue, 11 Jun 2019 21:10:00 +0000
Subject: [FieldTrip] Partial directed coherence
In-Reply-To: <CAMvULJYyw9n=HyRmf0xvihXY_NUUfOPGSqWwjfHauLBE3qWUDQ@mail.gmail.com>
References: <CAMvULJYyw9n=HyRmf0xvihXY_NUUfOPGSqWwjfHauLBE3qWUDQ@mail.gmail.com>
Message-ID: <94B3824F-1EC3-440B-AC4E-11740D147193@donders.ru.nl>

Hi Keshav,

Fieldtrip convention is that the row causes the column. As far as I remember, this is documented here, although admittedly a bit hidden: http://www.fieldtriptoolbox.org/faq/in_what_way_can_frequency_domain_data_be_represented_in_fieldtrip/

Best wishes,
Jan-Mathijs



On 11 Jun 2019, at 18:18, Keshav Kundassery <keshav.b.kundassery at vanderbilt.edu<mailto:keshav.b.kundassery at vanderbilt.edu>> wrote:

Hi,

I am trying to calculate partial directed coherence using Fieldtrip using ft_connectivity analysis with the method set to 'pdc'. In the output matrix, does anyone know, is it the columns or the rows that are the sources/destinations of the signal?

Thanks,
Keshav Kundassery
Undegraduate Research Assistant
Vanderbilt University BIEN Lab
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190611/560e6c95/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From keshav.b.kundassery at vanderbilt.edu  Wed Jun 12 17:42:39 2019
From: keshav.b.kundassery at vanderbilt.edu (Keshav Kundassery)
Date: Wed, 12 Jun 2019 10:42:39 -0500
Subject: [FieldTrip] Partial directed coherence
In-Reply-To: <94B3824F-1EC3-440B-AC4E-11740D147193@donders.ru.nl>
References: <CAMvULJYyw9n=HyRmf0xvihXY_NUUfOPGSqWwjfHauLBE3qWUDQ@mail.gmail.com>
 <94B3824F-1EC3-440B-AC4E-11740D147193@donders.ru.nl>
Message-ID: <CAMvULJbavX3n7ev_sC3AB0tZrJOXH_Sn6ZBw1cd33vZTt9aRvQ@mail.gmail.com>

Hi Jan-Mathijs,

Thank you so much for the help and reference.

Best,
Keshav

On Tue, Jun 11, 2019 at 4:12 PM Schoffelen, J.M. (Jan Mathijs) <
jan.schoffelen at donders.ru.nl> wrote:

> Hi Keshav,
>
> Fieldtrip convention is that the row causes the column. As far as I
> remember, this is documented here, although admittedly a bit hidden:
> http://www.fieldtriptoolbox.org/faq/in_what_way_can_frequency_domain_data_be_represented_in_fieldtrip/
> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.fieldtriptoolbox.org%2Ffaq%2Fin_what_way_can_frequency_domain_data_be_represented_in_fieldtrip%2F&data=02%7C01%7Ckeshav.b.kundassery%40mail-service-3-mx.vanderbilt.edu%7Cdd27bd2962eb40ee920c08d6eeb1882e%7Cba5a7f39e3be4ab3b45067fa80faecad%7C0%7C0%7C636958843610473665&sdata=PLB3y2u3tkRMH%2BJMlixL2YQaYg1lIIZPliCylsEGnaw%3D&reserved=0>
>
> Best wishes,
> Jan-Mathijs
>
>
>
> On 11 Jun 2019, at 18:18, Keshav Kundassery <
> keshav.b.kundassery at vanderbilt.edu> wrote:
>
> Hi,
>
> I am trying to calculate partial directed coherence using Fieldtrip using
> ft_connectivity analysis with the method set to 'pdc'. In the output
> matrix, does anyone know, is it the columns or the rows that are the
> sources/destinations of the signal?
>
> Thanks,
> Keshav Kundassery
> Undegraduate Research Assistant
> Vanderbilt University BIEN Lab
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=02%7C01%7Ckeshav.b.kundassery%40mail-service-3-mx.vanderbilt.edu%7Cdd27bd2962eb40ee920c08d6eeb1882e%7Cba5a7f39e3be4ab3b45067fa80faecad%7C0%7C0%7C636958843610473665&sdata=zTJNvYx45M5SdMG0cItrHu7O0ZRI5P3V929kqC1Bhdg%3D&reserved=0>
> https://doi.org/10.1371/journal.pcbi.1002202
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190612/e088f10a/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From keshav.b.kundassery at vanderbilt.edu  Wed Jun 12 17:42:39 2019
From: keshav.b.kundassery at vanderbilt.edu (Keshav Kundassery)
Date: Wed, 12 Jun 2019 10:42:39 -0500
Subject: [FieldTrip] Partial directed coherence
In-Reply-To: <94B3824F-1EC3-440B-AC4E-11740D147193@donders.ru.nl>
References: <CAMvULJYyw9n=HyRmf0xvihXY_NUUfOPGSqWwjfHauLBE3qWUDQ@mail.gmail.com>
 <94B3824F-1EC3-440B-AC4E-11740D147193@donders.ru.nl>
Message-ID: <CAMvULJbavX3n7ev_sC3AB0tZrJOXH_Sn6ZBw1cd33vZTt9aRvQ@mail.gmail.com>

Hi Jan-Mathijs,

Thank you so much for the help and reference.

Best,
Keshav

On Tue, Jun 11, 2019 at 4:12 PM Schoffelen, J.M. (Jan Mathijs) <
jan.schoffelen at donders.ru.nl> wrote:

> Hi Keshav,
>
> Fieldtrip convention is that the row causes the column. As far as I
> remember, this is documented here, although admittedly a bit hidden:
> http://www.fieldtriptoolbox.org/faq/in_what_way_can_frequency_domain_data_be_represented_in_fieldtrip/
> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.fieldtriptoolbox.org%2Ffaq%2Fin_what_way_can_frequency_domain_data_be_represented_in_fieldtrip%2F&data=02%7C01%7Ckeshav.b.kundassery%40mail-service-3-mx.vanderbilt.edu%7Cdd27bd2962eb40ee920c08d6eeb1882e%7Cba5a7f39e3be4ab3b45067fa80faecad%7C0%7C0%7C636958843610473665&sdata=PLB3y2u3tkRMH%2BJMlixL2YQaYg1lIIZPliCylsEGnaw%3D&reserved=0>
>
> Best wishes,
> Jan-Mathijs
>
>
>
> On 11 Jun 2019, at 18:18, Keshav Kundassery <
> keshav.b.kundassery at vanderbilt.edu> wrote:
>
> Hi,
>
> I am trying to calculate partial directed coherence using Fieldtrip using
> ft_connectivity analysis with the method set to 'pdc'. In the output
> matrix, does anyone know, is it the columns or the rows that are the
> sources/destinations of the signal?
>
> Thanks,
> Keshav Kundassery
> Undegraduate Research Assistant
> Vanderbilt University BIEN Lab
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=02%7C01%7Ckeshav.b.kundassery%40mail-service-3-mx.vanderbilt.edu%7Cdd27bd2962eb40ee920c08d6eeb1882e%7Cba5a7f39e3be4ab3b45067fa80faecad%7C0%7C0%7C636958843610473665&sdata=zTJNvYx45M5SdMG0cItrHu7O0ZRI5P3V929kqC1Bhdg%3D&reserved=0>
> https://doi.org/10.1371/journal.pcbi.1002202
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190612/e088f10a/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jorn at artinis.com  Thu Jun 13 16:12:01 2019
From: jorn at artinis.com (=?iso-8859-1?Q?J=F6rn_M._Horschig?=)
Date: Thu, 13 Jun 2019 16:12:01 +0200
Subject: [FieldTrip] 2 PhD positions in neonatal EEG and NIRS monitoring
Message-ID: <012101d521f1$f965c910$ec315b30$@artinis.com>

Hi all,

 

A collaborator of ours has two open PhD positions within a Marie-Curie
Sklodowska ITN. The position should ideally be filled with candidates
with both strong technical and (bio-)medical knowledge. For more
information and how to apply, see
https://euraxess.ec.europa.eu/jobs/412366

 

With best regards,

Jörn

 

--
Jörn M. Horschig, PhD
Software Manager & Project Leader
 <http://www.artinis.com/> Artinis Medical Systems  |  +31 481 350 980 

  

A  Einsteinweg 17
    6662PW Elst 
    The Netherlands
T  +31 481 350 980
I    <http://www.artinis.com/> www.artinis.com

The information in this e-mail is confidential and intended solely for
the person to whom it is addressed. If this message is not addressed to
you, please be aware that you have no authorization to read this e-mail,
to copy it, to furnish it to any person other than the addressee, or to
use or misuse its content in any way whatsoever. Should you have
received this e-mail by mistake, please bring this to the attention of
the sender, after which you are kindly requested to destroy the original
message.

 

 
<http://artinis.us3.list-manage1.com/subscribe?u=6bef931b76193f0e3d1dfe6
54&id=550bfdab46> Sign up for our NIRS newsletter

 

Or meet us here: 

Or meet us at: 

May 28-June 1, 2019 - American College of Sports Medicine (ACSM) -
Orlando, Florida, USA

June 9-13, 2019 - Organization for Human Brain Mapping (OHBM) - Rome,
Italy

July 3-6, 2019 - European College on Sport Science (ECSS) - Prague,
Czech Republic

August 20-22, 2019  Society for the neurobiology of Language -
Helsinki, Finland

September 19-21, 2019 - Japanese Society of Physical Fitness and Sports
Medicine - Tsukuba, Ibaragi, Japan

September 25-27, 2019 - International Conference of the European
Geriatrics Medicine Society - Krakow, Poland

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190613/c3509430/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 9919 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190613/c3509430/attachment.png>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jorn at artinis.com  Thu Jun 13 16:12:01 2019
From: jorn at artinis.com (=?iso-8859-1?Q?J=F6rn_M._Horschig?=)
Date: Thu, 13 Jun 2019 16:12:01 +0200
Subject: [FieldTrip] 2 PhD positions in neonatal EEG and NIRS monitoring
Message-ID: <012101d521f1$f965c910$ec315b30$@artinis.com>

Hi all,

 

A collaborator of ours has two open PhD positions within a Marie-Curie
Sklodowska ITN. The position should ideally be filled with candidates
with both strong technical and (bio-)medical knowledge. For more
information and how to apply, see
https://euraxess.ec.europa.eu/jobs/412366

 

With best regards,

Jörn

 

--
Jörn M. Horschig, PhD
Software Manager & Project Leader
 <http://www.artinis.com/> Artinis Medical Systems  |  +31 481 350 980 

  

A  Einsteinweg 17
    6662PW Elst 
    The Netherlands
T  +31 481 350 980
I    <http://www.artinis.com/> www.artinis.com

The information in this e-mail is confidential and intended solely for
the person to whom it is addressed. If this message is not addressed to
you, please be aware that you have no authorization to read this e-mail,
to copy it, to furnish it to any person other than the addressee, or to
use or misuse its content in any way whatsoever. Should you have
received this e-mail by mistake, please bring this to the attention of
the sender, after which you are kindly requested to destroy the original
message.

 

 
<http://artinis.us3.list-manage1.com/subscribe?u=6bef931b76193f0e3d1dfe6
54&id=550bfdab46> Sign up for our NIRS newsletter

 

Or meet us here: 

Or meet us at: 

May 28-June 1, 2019 - American College of Sports Medicine (ACSM) -
Orlando, Florida, USA

June 9-13, 2019 - Organization for Human Brain Mapping (OHBM) - Rome,
Italy

July 3-6, 2019 - European College on Sport Science (ECSS) - Prague,
Czech Republic

August 20-22, 2019  Society for the neurobiology of Language -
Helsinki, Finland

September 19-21, 2019 - Japanese Society of Physical Fitness and Sports
Medicine - Tsukuba, Ibaragi, Japan

September 25-27, 2019 - International Conference of the European
Geriatrics Medicine Society - Krakow, Poland

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190613/c3509430/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 9919 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190613/c3509430/attachment-0001.png>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From stefan.rampp at gmail.com  Thu Jun 13 17:03:54 2019
From: stefan.rampp at gmail.com (Stefan Rampp)
Date: Thu, 13 Jun 2019 17:03:54 +0200
Subject: [FieldTrip] Summer School on Imaging in Epilepsies
In-Reply-To: <CAMhDSb9rRuzcj_sadaJrZ3Z6H+e03eC370MoCiCBR593u+G0NQ@mail.gmail.com>
References: <CAMhDSb9m1_0fPR=+vyC9+QnCL+tLNuV-qEpyi6D5RwcGHN1YUw@mail.gmail.com>
 <CAMhDSb_2Z3kvCy5f9hjEy8QAufRt-hjRodehdvq17cLG3De=fQ@mail.gmail.com>
 <CAMhDSb9rRuzcj_sadaJrZ3Z6H+e03eC370MoCiCBR593u+G0NQ@mail.gmail.com>
Message-ID: <CAMhDSb8FDGyyG8UiEzNscdE9wErXbsQu_WnBdiMY767bdBYpew@mail.gmail.com>

The 5th SuSIE will take place from August 25th to 28th, 2019, in Bochum,
Germany. It has an educational core of 15 clinical state-of-the-art
lectures and 16 clinical workshops. The major topics are:

   - presurgical epileptology (adult and pediatric)
   - visual and automated detection of epileptogenic lesions
   - multimodal imaging and coregistration
   - stereotactic and navigated neurosurgery
   - clinical application of EEG/MEG source analysis  (including hands-on
   workshops using BESA and sessions on analysis of epilepsy data with
   Fieldtrip and BrainStorm!)

The 2019 SuSIE further hosts scientific workshops and a symposium on:

   - stereotactic planning procedures
   - EEG/MEG source analysis methods
   - MRI physics (sequences, coils, quantitative MR, seizure imaging,
   functional imaging)
   - tele-medicine solutions in epileptology

More infos and registration: http://www.imaging-in-epilepsy.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190613/0bc3db58/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From stefan.rampp at gmail.com  Thu Jun 13 17:03:54 2019
From: stefan.rampp at gmail.com (Stefan Rampp)
Date: Thu, 13 Jun 2019 17:03:54 +0200
Subject: [FieldTrip] Summer School on Imaging in Epilepsies
In-Reply-To: <CAMhDSb9rRuzcj_sadaJrZ3Z6H+e03eC370MoCiCBR593u+G0NQ@mail.gmail.com>
References: <CAMhDSb9m1_0fPR=+vyC9+QnCL+tLNuV-qEpyi6D5RwcGHN1YUw@mail.gmail.com>
 <CAMhDSb_2Z3kvCy5f9hjEy8QAufRt-hjRodehdvq17cLG3De=fQ@mail.gmail.com>
 <CAMhDSb9rRuzcj_sadaJrZ3Z6H+e03eC370MoCiCBR593u+G0NQ@mail.gmail.com>
Message-ID: <CAMhDSb8FDGyyG8UiEzNscdE9wErXbsQu_WnBdiMY767bdBYpew@mail.gmail.com>

The 5th SuSIE will take place from August 25th to 28th, 2019, in Bochum,
Germany. It has an educational core of 15 clinical state-of-the-art
lectures and 16 clinical workshops. The major topics are:

   - presurgical epileptology (adult and pediatric)
   - visual and automated detection of epileptogenic lesions
   - multimodal imaging and coregistration
   - stereotactic and navigated neurosurgery
   - clinical application of EEG/MEG source analysis  (including hands-on
   workshops using BESA and sessions on analysis of epilepsy data with
   Fieldtrip and BrainStorm!)

The 2019 SuSIE further hosts scientific workshops and a symposium on:

   - stereotactic planning procedures
   - EEG/MEG source analysis methods
   - MRI physics (sequences, coils, quantitative MR, seizure imaging,
   functional imaging)
   - tele-medicine solutions in epileptology

More infos and registration: http://www.imaging-in-epilepsy.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190613/0bc3db58/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jan.schoffelen at donders.ru.nl  Thu Jun 13 18:07:37 2019
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Thu, 13 Jun 2019 16:07:37 +0000
Subject: [FieldTrip] EGI mff file import
In-Reply-To: <CALhXZTY5JFj6UoNRhtSXaPbb=bBm=k8nv=XAeHqeU4N+DzdZvQ@mail.gmail.com>
References: <CALhXZTY5JFj6UoNRhtSXaPbb=bBm=k8nv=XAeHqeU4N+DzdZvQ@mail.gmail.com>
Message-ID: <2C638EED-5DBF-49F0-AA9C-1DE8E0AF430D@donders.ru.nl>

Dear Raphael,

I happened to bump into Trey Avery, from Philips/egi the other day, and he mentioned that you might want to consider to increase the java heap memory to a larger value. How this can be done is shown here: https://www.mathworks.com/help/matlab/matlab_external/java-heap-memory-preferences.html

That is, in your message you are a bit ambiguous as to where exactly in the code the slowdown takes place. If it is indeed preproc, as you mention, then it’s probably not an input/output problem.

Anyway, it wouldn’t hurt to try I think. Could you let us know whether this works for you? In that case we can add this to our documentation section of ‘getting started with egi data’ on our fieldtriptoolbox.org<http://fieldtriptoolbox.org/> website. Also, the current version of that part of the documentation could be improved a bit I think to reflect better the recent improvements to the code (i.e. the use of the v3 reader…). Feel free to suggest changes yourself.

Best wishes,

Jan-Mathijs

On 24 May 2019, at 15:58, Raphaël Thézé <raphael.theze at gmail.com<mailto:raphael.theze at gmail.com>> wrote:

Dear all,

I have a question regarding the import of mff file format.

I used to import my EGI data with fieldtrip version 20180201 which worked fine (with egi_mff_v1) but when I switched to fieldtrip version 20190325, it uses egi_mff_v3 as default. The latter also works well except that when it used to take 1 sec per trial to be imported with V1, now it takes about 1 minute per trial with V3. The amount of time needed to import one subject in my case would be theoretically 3 hours, which is ridiculously long. I understand that the switch of version takes place in ft_read_data, which is called by ft_preprocessing, but apparently it is preproc, also called by ft_preprocessing, that takes forever to compute, but I can't explain why. I tried to manually request to use the version egi_mff_V1 but then there is an error regarding xml file, that I have not tried to explore so far.

For now I will just go back to the 20180201 version of fieldtrip so I can quickly import data into matlab, but I would like to understand what is going wrong here, or if it is to be expected.

In advance, thank you all.
Best,
Raphaël
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190613/4e291b52/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jan.schoffelen at donders.ru.nl  Thu Jun 13 18:07:37 2019
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Thu, 13 Jun 2019 16:07:37 +0000
Subject: [FieldTrip] EGI mff file import
In-Reply-To: <CALhXZTY5JFj6UoNRhtSXaPbb=bBm=k8nv=XAeHqeU4N+DzdZvQ@mail.gmail.com>
References: <CALhXZTY5JFj6UoNRhtSXaPbb=bBm=k8nv=XAeHqeU4N+DzdZvQ@mail.gmail.com>
Message-ID: <2C638EED-5DBF-49F0-AA9C-1DE8E0AF430D@donders.ru.nl>

Dear Raphael,

I happened to bump into Trey Avery, from Philips/egi the other day, and he mentioned that you might want to consider to increase the java heap memory to a larger value. How this can be done is shown here: https://www.mathworks.com/help/matlab/matlab_external/java-heap-memory-preferences.html

That is, in your message you are a bit ambiguous as to where exactly in the code the slowdown takes place. If it is indeed preproc, as you mention, then it’s probably not an input/output problem.

Anyway, it wouldn’t hurt to try I think. Could you let us know whether this works for you? In that case we can add this to our documentation section of ‘getting started with egi data’ on our fieldtriptoolbox.org<http://fieldtriptoolbox.org/> website. Also, the current version of that part of the documentation could be improved a bit I think to reflect better the recent improvements to the code (i.e. the use of the v3 reader…). Feel free to suggest changes yourself.

Best wishes,

Jan-Mathijs

On 24 May 2019, at 15:58, Raphaël Thézé <raphael.theze at gmail.com<mailto:raphael.theze at gmail.com>> wrote:

Dear all,

I have a question regarding the import of mff file format.

I used to import my EGI data with fieldtrip version 20180201 which worked fine (with egi_mff_v1) but when I switched to fieldtrip version 20190325, it uses egi_mff_v3 as default. The latter also works well except that when it used to take 1 sec per trial to be imported with V1, now it takes about 1 minute per trial with V3. The amount of time needed to import one subject in my case would be theoretically 3 hours, which is ridiculously long. I understand that the switch of version takes place in ft_read_data, which is called by ft_preprocessing, but apparently it is preproc, also called by ft_preprocessing, that takes forever to compute, but I can't explain why. I tried to manually request to use the version egi_mff_V1 but then there is an error regarding xml file, that I have not tried to explore so far.

For now I will just go back to the 20180201 version of fieldtrip so I can quickly import data into matlab, but I would like to understand what is going wrong here, or if it is to be expected.

In advance, thank you all.
Best,
Raphaël
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190613/4e291b52/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jan.schoffelen at donders.ru.nl  Thu Jun 13 18:20:33 2019
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Thu, 13 Jun 2019 16:20:33 +0000
Subject: [FieldTrip] Getting data from a database instead of files
In-Reply-To: <CA+P_Hze1fn2Gsz++pTh0uZqQ9JGqeDuDZN+2bvmn_sEnb=j8ig@mail.gmail.com>
References: <CA+P_HzdRM_myzfe27DYYkahi0wTqn-+rseWg9zWTj6kJpKb65Q@mail.gmail.com>
 <CA+P_HzdoSsdv=t+TDc9aTJJfiagnOPgyBy+hxtXFnXe_5-FKvg@mail.gmail.com>
 <CA+P_Hzdn93ebZxFmLBxEVBoQapdyrgFUAh6hdhp+opzCggOHmA@mail.gmail.com>
 <511490D9-FFFD-4516-ADE4-537F68647B2F@donders.ru.nl>
 <CA+P_Hze1fn2Gsz++pTh0uZqQ9JGqeDuDZN+2bvmn_sEnb=j8ig@mail.gmail.com>
Message-ID: <1735E8EE-21BF-4069-AFBA-B8C2D85F2669@donders.ru.nl>

Hi Thomas,

Sadly, removing the .trl, .channels and .dimord fields did not solve my problem. It did halve the number of warnings I get (from 8 to 4). A few quick tests showed me this came down to removing the .trl field and not the other ones.
I also get a warning about inconsistent sampleinfo, which I forgot to mention in my original email.

Warnings about not being able to detect the ‘dimord’ are typically not a problem, so no worries there. The warning about the sampleinfo being inconsistent is itself not a show-stopper, but suggests that there is something not completely correct in the numerics. This is most likely the consequence of occasional round-off errors of floating point numbers, which are really hard to beat. It could well be that this also causes the error you report.

Could it be a problem with my FT path? I had path-related errors with SPM earlier, and I ended up solving them by adding ft_defaults in my startup.m file.

Another thing I found out is that the error I get (Array dimensions must match for binary array op.) doesn't always happen at the same time. The processing counter goes up to trial 3, and then frequency somewhere between 1 and 24.  I'm not sure what this means, though.

It could be related to numeric round off errors, causing an occasional extra sample (or a dropout).

Yet, I noticed that you specified as method ’tfr’, which is code that I think is hardly used (because it’s so slow). May I suggest you to use ‘wltconvol’ instead? This is a much faster implementation of the wavelet transform, since it does not do convolution in the time domain (slow), but multiplication in the frequency domain (fast).

Best wishes,
Jan_Mathijs





Do you have any suggestions?

Thank you!

Thomas


Le lun. 3 juin 2019 à 11:35, Schoffelen, J.M. (Jan Mathijs) <jan.schoffelen at donders.ru.nl<mailto:jan.schoffelen at donders.ru.nl>> a écrit :
Hi Thomas,

Thanks for your informative e-mail :).

Here's what I did:


1- Get the data for a subset of my choosing (I tried everything with a small 4-channel, 55-trials subset)

2- Put that data into a structure built as follows, adding fields that FieldTrip required:

    fsample: 1017           (I know this is weird but we're stuck with it)
   channels: [1 17 25 29]   Added to keep track of in-house bookkeeping
      label: {'Ch:1 idElectrodeSite:181'  'Ch:17 idElectrodeSite:183'  'Ch:25 idElectrodeSite:184'
              'Ch:29 idElectrodeSite:185'}  Not the right structure, but I don't have header files to get them from
      trial: {55×1 cell}    One cell per trial, with each being [chan x time]
       time: {55×1 cell}    One cell per trial, each going from -750ms to 750ms (around target onset) This includes a 250ms pad on each side.
        trl: [55×3 double]  Built from scratch as if the trials were continuous. (Inspired by the FT function that does this)
     dimord: 'chan_time'    Added by hand, can't get Fieldtrip to recognize it
 sampleinfo: [55×2 double]  The first two columns of trl


You may need to get rid of the following fields: ’trl’ ‘dimord’ and ‘channels’. Once this is done, I think you are ready to go, without warnings and errors.


3- Try to use ft_freqanalysis using the following cfg (also attached)

cfg = [];
cfg.method= 'tfr';
cfg.pad = 'nextpow2';
cfg.width = 7;
cfg.gwidth = 3;
cfg.foi = [15:1:60];
cfg.toi = 'all';

I first get the message:
the input is raw data with 4 channels and 55 trial
This would be encouraging, but then, I get the following warnings:

Warning: could not determine dimord of "trial" in: (structure shown above)
Warning: could not determine dimord of "trl" in:   (structure shown above)
...but four pairs of them.

Looking through the debugger, I found out they're given when ft_freqanalysis, calls ft_checkdata and ft_selectdata.
Are these warnings something I should be worried about, or can everything work well the way it is?
Also, how is it that FT 'could not determine dimord' when I give it one in the data structure, and it seems to understand the way it works given the message it sends at the beginning?

After the warnings, I get this:

the call to "ft_selectdata" took 16 seconds
processing trials
trial 2, frequency 32 (46.18 Hz)
Array dimensions must match for binary array op.

Error in ft_freqanalysis (line 679)
            trlcnt(1, ifoi, :) = trlcnt(1, ifoi, :) + shiftdim(double(acttboi(:)'),-1);

...which I simply don't know how to solve.


So in summary:

1- Is it possible to make FT work without using original files to get the data?


Yes!

2- If it is, what have I done wrong, and how could I make it work?

See above.


3- Are the warnings worrisome or is it just a natural consequence of trying to jerry-rig data in FT?

Not worrisome, they should go away if you do exactly as I told :).

4- Any idea on how to solve the error message I get is appreciated, but a secondary objective.

Probably it goes away.

Keep up the good work and with best wishes,
Jan-Mathijs



I attached the function I made to build the data structure in case it could help.


Thank you very much for reading this long-winded message!

Regards

Thomas Lusignan, B. Sc.
Paul Cisek's Lab
Université de Montréal
<GetFTLFP.m>_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190613/c9cb6b97/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jan.schoffelen at donders.ru.nl  Thu Jun 13 18:20:33 2019
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Thu, 13 Jun 2019 16:20:33 +0000
Subject: [FieldTrip] Getting data from a database instead of files
In-Reply-To: <CA+P_Hze1fn2Gsz++pTh0uZqQ9JGqeDuDZN+2bvmn_sEnb=j8ig@mail.gmail.com>
References: <CA+P_HzdRM_myzfe27DYYkahi0wTqn-+rseWg9zWTj6kJpKb65Q@mail.gmail.com>
 <CA+P_HzdoSsdv=t+TDc9aTJJfiagnOPgyBy+hxtXFnXe_5-FKvg@mail.gmail.com>
 <CA+P_Hzdn93ebZxFmLBxEVBoQapdyrgFUAh6hdhp+opzCggOHmA@mail.gmail.com>
 <511490D9-FFFD-4516-ADE4-537F68647B2F@donders.ru.nl>
 <CA+P_Hze1fn2Gsz++pTh0uZqQ9JGqeDuDZN+2bvmn_sEnb=j8ig@mail.gmail.com>
Message-ID: <1735E8EE-21BF-4069-AFBA-B8C2D85F2669@donders.ru.nl>

Hi Thomas,

Sadly, removing the .trl, .channels and .dimord fields did not solve my problem. It did halve the number of warnings I get (from 8 to 4). A few quick tests showed me this came down to removing the .trl field and not the other ones.
I also get a warning about inconsistent sampleinfo, which I forgot to mention in my original email.

Warnings about not being able to detect the ‘dimord’ are typically not a problem, so no worries there. The warning about the sampleinfo being inconsistent is itself not a show-stopper, but suggests that there is something not completely correct in the numerics. This is most likely the consequence of occasional round-off errors of floating point numbers, which are really hard to beat. It could well be that this also causes the error you report.

Could it be a problem with my FT path? I had path-related errors with SPM earlier, and I ended up solving them by adding ft_defaults in my startup.m file.

Another thing I found out is that the error I get (Array dimensions must match for binary array op.) doesn't always happen at the same time. The processing counter goes up to trial 3, and then frequency somewhere between 1 and 24.  I'm not sure what this means, though.

It could be related to numeric round off errors, causing an occasional extra sample (or a dropout).

Yet, I noticed that you specified as method ’tfr’, which is code that I think is hardly used (because it’s so slow). May I suggest you to use ‘wltconvol’ instead? This is a much faster implementation of the wavelet transform, since it does not do convolution in the time domain (slow), but multiplication in the frequency domain (fast).

Best wishes,
Jan_Mathijs





Do you have any suggestions?

Thank you!

Thomas


Le lun. 3 juin 2019 à 11:35, Schoffelen, J.M. (Jan Mathijs) <jan.schoffelen at donders.ru.nl<mailto:jan.schoffelen at donders.ru.nl>> a écrit :
Hi Thomas,

Thanks for your informative e-mail :).

Here's what I did:


1- Get the data for a subset of my choosing (I tried everything with a small 4-channel, 55-trials subset)

2- Put that data into a structure built as follows, adding fields that FieldTrip required:

    fsample: 1017           (I know this is weird but we're stuck with it)
   channels: [1 17 25 29]   Added to keep track of in-house bookkeeping
      label: {'Ch:1 idElectrodeSite:181'  'Ch:17 idElectrodeSite:183'  'Ch:25 idElectrodeSite:184'
              'Ch:29 idElectrodeSite:185'}  Not the right structure, but I don't have header files to get them from
      trial: {55×1 cell}    One cell per trial, with each being [chan x time]
       time: {55×1 cell}    One cell per trial, each going from -750ms to 750ms (around target onset) This includes a 250ms pad on each side.
        trl: [55×3 double]  Built from scratch as if the trials were continuous. (Inspired by the FT function that does this)
     dimord: 'chan_time'    Added by hand, can't get Fieldtrip to recognize it
 sampleinfo: [55×2 double]  The first two columns of trl


You may need to get rid of the following fields: ’trl’ ‘dimord’ and ‘channels’. Once this is done, I think you are ready to go, without warnings and errors.


3- Try to use ft_freqanalysis using the following cfg (also attached)

cfg = [];
cfg.method= 'tfr';
cfg.pad = 'nextpow2';
cfg.width = 7;
cfg.gwidth = 3;
cfg.foi = [15:1:60];
cfg.toi = 'all';

I first get the message:
the input is raw data with 4 channels and 55 trial
This would be encouraging, but then, I get the following warnings:

Warning: could not determine dimord of "trial" in: (structure shown above)
Warning: could not determine dimord of "trl" in:   (structure shown above)
...but four pairs of them.

Looking through the debugger, I found out they're given when ft_freqanalysis, calls ft_checkdata and ft_selectdata.
Are these warnings something I should be worried about, or can everything work well the way it is?
Also, how is it that FT 'could not determine dimord' when I give it one in the data structure, and it seems to understand the way it works given the message it sends at the beginning?

After the warnings, I get this:

the call to "ft_selectdata" took 16 seconds
processing trials
trial 2, frequency 32 (46.18 Hz)
Array dimensions must match for binary array op.

Error in ft_freqanalysis (line 679)
            trlcnt(1, ifoi, :) = trlcnt(1, ifoi, :) + shiftdim(double(acttboi(:)'),-1);

...which I simply don't know how to solve.


So in summary:

1- Is it possible to make FT work without using original files to get the data?


Yes!

2- If it is, what have I done wrong, and how could I make it work?

See above.


3- Are the warnings worrisome or is it just a natural consequence of trying to jerry-rig data in FT?

Not worrisome, they should go away if you do exactly as I told :).

4- Any idea on how to solve the error message I get is appreciated, but a secondary objective.

Probably it goes away.

Keep up the good work and with best wishes,
Jan-Mathijs



I attached the function I made to build the data structure in case it could help.


Thank you very much for reading this long-winded message!

Regards

Thomas Lusignan, B. Sc.
Paul Cisek's Lab
Université de Montréal
<GetFTLFP.m>_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190613/c9cb6b97/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From daniel.strahnen at uni-ulm.de  Thu Jun 13 19:10:21 2019
From: daniel.strahnen at uni-ulm.de (daniel.strahnen at uni-ulm.de)
Date: Thu, 13 Jun 2019 19:10:21 +0200
Subject: [FieldTrip] wPLI analysis pipeline
Message-ID: <001001d5220a$e2e31d50$a8a957f0$@uni-ulm.de>

Dear Fieldtrippers,

 

I am a doctoral student and my research fields are local field potentials
(LFPs). 

Therefore I wanted to calculate the weighted phase lag index which is
implemented in the Fieldtrip toolbox.

The data I want to analyse has the following structure:

data = 

 

  struct with fields:

 

      label: {7×1 cell}

       time: {1×5 cell}

      trial: {1×5 cell}

    fsample: 1000                  % Seven channels and five trials

 

The code I produced for the wPLI is the following:

%% Freqanalysis to obtain the cross spectral density

cfg_freq = [];

cfg_freq.method = 'mtmfft';

cfg_freq.output = 'powandcsd';

cfg_freq.channel = {'CH2' 'CH4'};

cfg_freq.keeptrials = 'yes'; % do not return an average of all trials for
subsequent wpli analysis

cfg_freq.taper = 'dpss';

cfg_freq.tapsmofrq = 1;

cfg_freq.foilim = [0 48];

freq_data = ft_freqanalysis(cfg_freq, data);

%% WPLI analysis

cfg_conn = [];

cfg_conn.method = 'wpli_debiased';

wpli = ft_connectivityanalysis(cfg_conn, freq_data);

wpli = ft_checkdata(wpli, 'cmbrepresentation', 'full','datatype','freq');

 

 

I now have two questions:

1.	Why are there negative results? I already saw this question in a
previous discussion but Im still not sure about the hundred percent correct
answer.

 

2.	The results I get look rather strange at the first glance because
there are a lot of consecutive One-values which seems unrealistic to me.
Do you think my analysis has a mistake or the data is corrupted?

 

Thank you very much for your help in advance and best regards

 

Daniel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190613/d248f9ec/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From daniel.strahnen at uni-ulm.de  Thu Jun 13 19:10:21 2019
From: daniel.strahnen at uni-ulm.de (daniel.strahnen at uni-ulm.de)
Date: Thu, 13 Jun 2019 19:10:21 +0200
Subject: [FieldTrip] wPLI analysis pipeline
Message-ID: <001001d5220a$e2e31d50$a8a957f0$@uni-ulm.de>

Dear Fieldtrippers,

 

I am a doctoral student and my research fields are local field potentials
(LFPs). 

Therefore I wanted to calculate the weighted phase lag index which is
implemented in the Fieldtrip toolbox.

The data I want to analyse has the following structure:

data = 

 

  struct with fields:

 

      label: {7×1 cell}

       time: {1×5 cell}

      trial: {1×5 cell}

    fsample: 1000                  % Seven channels and five trials

 

The code I produced for the wPLI is the following:

%% Freqanalysis to obtain the cross spectral density

cfg_freq = [];

cfg_freq.method = 'mtmfft';

cfg_freq.output = 'powandcsd';

cfg_freq.channel = {'CH2' 'CH4'};

cfg_freq.keeptrials = 'yes'; % do not return an average of all trials for
subsequent wpli analysis

cfg_freq.taper = 'dpss';

cfg_freq.tapsmofrq = 1;

cfg_freq.foilim = [0 48];

freq_data = ft_freqanalysis(cfg_freq, data);

%% WPLI analysis

cfg_conn = [];

cfg_conn.method = 'wpli_debiased';

wpli = ft_connectivityanalysis(cfg_conn, freq_data);

wpli = ft_checkdata(wpli, 'cmbrepresentation', 'full','datatype','freq');

 

 

I now have two questions:

1.	Why are there negative results? I already saw this question in a
previous discussion but Im still not sure about the hundred percent correct
answer.

 

2.	The results I get look rather strange at the first glance because
there are a lot of consecutive One-values which seems unrealistic to me.
Do you think my analysis has a mistake or the data is corrupted?

 

Thank you very much for your help in advance and best regards

 

Daniel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190613/d248f9ec/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jan.schoffelen at donders.ru.nl  Thu Jun 13 20:44:45 2019
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Thu, 13 Jun 2019 18:44:45 +0000
Subject: [FieldTrip] wPLI analysis pipeline
In-Reply-To: <001001d5220a$e2e31d50$a8a957f0$@uni-ulm.de>
References: <001001d5220a$e2e31d50$a8a957f0$@uni-ulm.de>
Message-ID: <86E5725A-CC50-43D3-B167-1378FEE06C43@donders.ru.nl>

Hi Daniel,

If you only have 5 trials in your input data, the estimate itself will be enormously biased, and possibly by consequence is the bias correction ‘overshooting’.

Best wishes,
Jan-Mathijs


On 13 Jun 2019, at 19:10, daniel.strahnen at uni-ulm.de<mailto:daniel.strahnen at uni-ulm.de> wrote:

Dear Fieldtrippers,

I am a doctoral student and my research fields are local field potentials (LFPs).
Therefore I wanted to calculate the weighted phase lag index which is implemented in the Fieldtrip toolbox.
The data I want to analyse has the following structure:
data =

  struct with fields:

      label: {7×1 cell}
       time: {1×5 cell}
      trial: {1×5 cell}
    fsample: 1000                  % Seven channels and five trials

The code I produced for the wPLI is the following:
%% Freqanalysis to obtain the cross spectral density
cfg_freq = [];
cfg_freq.method = 'mtmfft';
cfg_freq.output = 'powandcsd';
cfg_freq.channel = {'CH2' 'CH4'};
cfg_freq.keeptrials = 'yes'; % do not return an average of all trials for subsequent wpli analysis
cfg_freq.taper = 'dpss';
cfg_freq.tapsmofrq = 1;
cfg_freq.foilim = [0 48];
freq_data = ft_freqanalysis(cfg_freq, data);
%% WPLI analysis
cfg_conn = [];
cfg_conn.method = 'wpli_debiased';
wpli = ft_connectivityanalysis(cfg_conn, freq_data);
wpli = ft_checkdata(wpli, 'cmbrepresentation', 'full','datatype','freq');


I now have two questions:

  1.  Why are there negative results? I already saw this question in a previous discussion but I’m still not sure about the hundred percent correct answer.



  1.  The results I get look rather strange at the first glance because there are a lot of consecutive One-values which seems unrealistic to me.
Do you think my analysis has a mistake or the data is corrupted?


Thank you very much for your help in advance and best regards

Daniel
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190613/d38d1810/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jan.schoffelen at donders.ru.nl  Thu Jun 13 20:44:45 2019
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Thu, 13 Jun 2019 18:44:45 +0000
Subject: [FieldTrip] wPLI analysis pipeline
In-Reply-To: <001001d5220a$e2e31d50$a8a957f0$@uni-ulm.de>
References: <001001d5220a$e2e31d50$a8a957f0$@uni-ulm.de>
Message-ID: <86E5725A-CC50-43D3-B167-1378FEE06C43@donders.ru.nl>

Hi Daniel,

If you only have 5 trials in your input data, the estimate itself will be enormously biased, and possibly by consequence is the bias correction ‘overshooting’.

Best wishes,
Jan-Mathijs


On 13 Jun 2019, at 19:10, daniel.strahnen at uni-ulm.de<mailto:daniel.strahnen at uni-ulm.de> wrote:

Dear Fieldtrippers,

I am a doctoral student and my research fields are local field potentials (LFPs).
Therefore I wanted to calculate the weighted phase lag index which is implemented in the Fieldtrip toolbox.
The data I want to analyse has the following structure:
data =

  struct with fields:

      label: {7×1 cell}
       time: {1×5 cell}
      trial: {1×5 cell}
    fsample: 1000                  % Seven channels and five trials

The code I produced for the wPLI is the following:
%% Freqanalysis to obtain the cross spectral density
cfg_freq = [];
cfg_freq.method = 'mtmfft';
cfg_freq.output = 'powandcsd';
cfg_freq.channel = {'CH2' 'CH4'};
cfg_freq.keeptrials = 'yes'; % do not return an average of all trials for subsequent wpli analysis
cfg_freq.taper = 'dpss';
cfg_freq.tapsmofrq = 1;
cfg_freq.foilim = [0 48];
freq_data = ft_freqanalysis(cfg_freq, data);
%% WPLI analysis
cfg_conn = [];
cfg_conn.method = 'wpli_debiased';
wpli = ft_connectivityanalysis(cfg_conn, freq_data);
wpli = ft_checkdata(wpli, 'cmbrepresentation', 'full','datatype','freq');


I now have two questions:

  1.  Why are there negative results? I already saw this question in a previous discussion but I’m still not sure about the hundred percent correct answer.



  1.  The results I get look rather strange at the first glance because there are a lot of consecutive One-values which seems unrealistic to me.
Do you think my analysis has a mistake or the data is corrupted?


Thank you very much for your help in advance and best regards

Daniel
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190613/d38d1810/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From xiew1202 at gmail.com  Thu Jun 13 22:52:07 2019
From: xiew1202 at gmail.com (Wanze Xie)
Date: Thu, 13 Jun 2019 16:52:07 -0400
Subject: [FieldTrip] wPLI analysis pipeline
In-Reply-To: <86E5725A-CC50-43D3-B167-1378FEE06C43@donders.ru.nl>
References: <001001d5220a$e2e31d50$a8a957f0$@uni-ulm.de>
 <86E5725A-CC50-43D3-B167-1378FEE06C43@donders.ru.nl>
Message-ID: <CAA6G0Y8Gh8vwXxE73Y32ooV90QZjxHAeeQkV5pm7y4hZg9aUzg@mail.gmail.com>

Hi Daniel,
One solution is to segment your five trials into 1s or 2s epochs if they
are long enough.  Re the negative values: if you used the debiased WPLI
method just ignore the negative values; in contrast, if you used the WPLI
method you may calculate the absoluate value of the WPLI values, i.e.,
abs(WPLI).

Best,
Wanze

Schoffelen, J.M. (Jan Mathijs) <jan.schoffelen at donders.ru.nl> 于2019年6月13日周四
下午2:45写道：

> Hi Daniel,
>
> If you only have 5 trials in your input data, the estimate itself will be
> enormously biased, and possibly by consequence is the bias correction
> ‘overshooting’.
>
> Best wishes,
> Jan-Mathijs
>
>
> On 13 Jun 2019, at 19:10, daniel.strahnen at uni-ulm.de wrote:
>
> Dear Fieldtrippers,
>
> I am a doctoral student and my research fields are local field potentials
> (LFPs).
> Therefore I wanted to calculate the weighted phase lag index which is
> implemented in the Fieldtrip toolbox.
> The data I want to analyse has the following structure:
> data =
>
>   struct with fields:
>
>       label: {7×1 cell}
>        time: {1×5 cell}
>       trial: {1×5 cell}
>     fsample: 1000                  % Seven channels and five trials
>
> The code I produced for the wPLI is the following:
> %% Freqanalysis to obtain the cross spectral density
> cfg_freq = [];
> cfg_freq.method = 'mtmfft';
> cfg_freq.output = 'powandcsd';
> cfg_freq.channel = {'CH2' 'CH4'};
> cfg_freq.keeptrials = 'yes'; % do not return an average of all trials for
> subsequent wpli analysis
> cfg_freq.taper = 'dpss';
> cfg_freq.tapsmofrq = 1;
> cfg_freq.foilim = [0 48];
> freq_data = ft_freqanalysis(cfg_freq, data);
> %% WPLI analysis
> cfg_conn = [];
> cfg_conn.method = 'wpli_debiased';
> wpli = ft_connectivityanalysis(cfg_conn, freq_data);
> wpli = ft_checkdata(wpli, 'cmbrepresentation', 'full','datatype','freq');
>
>
> I now have two questions:
>
>    1. Why are there negative results? I already saw this question in a
>    previous discussion but I’m still not sure about the hundred percent
>    correct answer.
>
>
>
>    1. The results I get look rather strange at the first glance because
>    there are a lot of consecutive One-values which seems unrealistic to me.
>    Do you think my analysis has a mistake or the data is corrupted?
>
>
> Thank you very much for your help in advance and best regards
>
> Daniel
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202
>
>
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190613/4e5676b8/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From xiew1202 at gmail.com  Thu Jun 13 22:52:07 2019
From: xiew1202 at gmail.com (Wanze Xie)
Date: Thu, 13 Jun 2019 16:52:07 -0400
Subject: [FieldTrip] wPLI analysis pipeline
In-Reply-To: <86E5725A-CC50-43D3-B167-1378FEE06C43@donders.ru.nl>
References: <001001d5220a$e2e31d50$a8a957f0$@uni-ulm.de>
 <86E5725A-CC50-43D3-B167-1378FEE06C43@donders.ru.nl>
Message-ID: <CAA6G0Y8Gh8vwXxE73Y32ooV90QZjxHAeeQkV5pm7y4hZg9aUzg@mail.gmail.com>

Hi Daniel,
One solution is to segment your five trials into 1s or 2s epochs if they
are long enough.  Re the negative values: if you used the debiased WPLI
method just ignore the negative values; in contrast, if you used the WPLI
method you may calculate the absoluate value of the WPLI values, i.e.,
abs(WPLI).

Best,
Wanze

Schoffelen, J.M. (Jan Mathijs) <jan.schoffelen at donders.ru.nl> 于2019年6月13日周四
下午2:45写道：

> Hi Daniel,
>
> If you only have 5 trials in your input data, the estimate itself will be
> enormously biased, and possibly by consequence is the bias correction
> ‘overshooting’.
>
> Best wishes,
> Jan-Mathijs
>
>
> On 13 Jun 2019, at 19:10, daniel.strahnen at uni-ulm.de wrote:
>
> Dear Fieldtrippers,
>
> I am a doctoral student and my research fields are local field potentials
> (LFPs).
> Therefore I wanted to calculate the weighted phase lag index which is
> implemented in the Fieldtrip toolbox.
> The data I want to analyse has the following structure:
> data =
>
>   struct with fields:
>
>       label: {7×1 cell}
>        time: {1×5 cell}
>       trial: {1×5 cell}
>     fsample: 1000                  % Seven channels and five trials
>
> The code I produced for the wPLI is the following:
> %% Freqanalysis to obtain the cross spectral density
> cfg_freq = [];
> cfg_freq.method = 'mtmfft';
> cfg_freq.output = 'powandcsd';
> cfg_freq.channel = {'CH2' 'CH4'};
> cfg_freq.keeptrials = 'yes'; % do not return an average of all trials for
> subsequent wpli analysis
> cfg_freq.taper = 'dpss';
> cfg_freq.tapsmofrq = 1;
> cfg_freq.foilim = [0 48];
> freq_data = ft_freqanalysis(cfg_freq, data);
> %% WPLI analysis
> cfg_conn = [];
> cfg_conn.method = 'wpli_debiased';
> wpli = ft_connectivityanalysis(cfg_conn, freq_data);
> wpli = ft_checkdata(wpli, 'cmbrepresentation', 'full','datatype','freq');
>
>
> I now have two questions:
>
>    1. Why are there negative results? I already saw this question in a
>    previous discussion but I’m still not sure about the hundred percent
>    correct answer.
>
>
>
>    1. The results I get look rather strange at the first glance because
>    there are a lot of consecutive One-values which seems unrealistic to me.
>    Do you think my analysis has a mistake or the data is corrupted?
>
>
> Thank you very much for your help in advance and best regards
>
> Daniel
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202
>
>
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190613/4e5676b8/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From rt.martins at campus.fct.unl.pt  Sun Jun 16 20:11:46 2019
From: rt.martins at campus.fct.unl.pt (Rita Martins)
Date: Sun, 16 Jun 2019 19:11:46 +0100
Subject: [FieldTrip] Fieldtrip dipole fit
Message-ID: <CA+WBShOnG2QSGrkh=JyMTT5vBAR5++fWPvq_4C81cF+x08ugbA@mail.gmail.com>

Hello fieldtrip community,

I'm currently working on my master's dissertation project about synchrony
between MEG and EMG signals, with the signals acquired through a Neuromag
system.

I would like to perform a dipole fit with the data from an algorithm I'm
using to process the signal, however, reading through the tutorials online,
it seems I would need an original signal acquisition file (*.fif) to get
the dipole position? Or is there any way to perform the dipole fitting with
a subset of data and some neuromag templates?

Thank you in advance for the help.
Best regards,

Rita Martins
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190616/cd2b9d86/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From rt.martins at campus.fct.unl.pt  Sun Jun 16 20:11:46 2019
From: rt.martins at campus.fct.unl.pt (Rita Martins)
Date: Sun, 16 Jun 2019 19:11:46 +0100
Subject: [FieldTrip] Fieldtrip dipole fit
Message-ID: <CA+WBShOnG2QSGrkh=JyMTT5vBAR5++fWPvq_4C81cF+x08ugbA@mail.gmail.com>

Hello fieldtrip community,

I'm currently working on my master's dissertation project about synchrony
between MEG and EMG signals, with the signals acquired through a Neuromag
system.

I would like to perform a dipole fit with the data from an algorithm I'm
using to process the signal, however, reading through the tutorials online,
it seems I would need an original signal acquisition file (*.fif) to get
the dipole position? Or is there any way to perform the dipole fitting with
a subset of data and some neuromag templates?

Thank you in advance for the help.
Best regards,

Rita Martins
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190616/cd2b9d86/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jan.schoffelen at donders.ru.nl  Sun Jun 16 20:47:45 2019
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Sun, 16 Jun 2019 18:47:45 +0000
Subject: [FieldTrip] Fieldtrip dipole fit
In-Reply-To: <CA+WBShOnG2QSGrkh=JyMTT5vBAR5++fWPvq_4C81cF+x08ugbA@mail.gmail.com>
References: <CA+WBShOnG2QSGrkh=JyMTT5vBAR5++fWPvq_4C81cF+x08ugbA@mail.gmail.com>
Message-ID: <9F4F6D0D-FFA7-4042-B0EB-B741A40588EF@donders.ru.nl>

Hi Rita,

> I would like to perform a dipole fit with the data from an algorithm I'm using to process the signal, however, reading through the tutorials online, it seems I would need an original signal acquisition file (*.fif) to get the dipole position? Or is there any way to perform the dipole fitting with a subset of data and some neuromag templates?

I think yes, but am not entirely sure, because I don’t know exactly what you mean with 

‘a subset of data’, and ’some neuromag templates’.

Could you be a bit more specific please?

In general, once you have a spatial topography of observed data, and a volume conductor model of the head in combination with a specification of the position of the MEG sensor coils, (expressed in the same coordinate system as said volume conduction model) you should be ready to go.

Best wishes,
Jan-Mathijs


_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jan.schoffelen at donders.ru.nl  Sun Jun 16 20:47:45 2019
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Sun, 16 Jun 2019 18:47:45 +0000
Subject: [FieldTrip] Fieldtrip dipole fit
In-Reply-To: <CA+WBShOnG2QSGrkh=JyMTT5vBAR5++fWPvq_4C81cF+x08ugbA@mail.gmail.com>
References: <CA+WBShOnG2QSGrkh=JyMTT5vBAR5++fWPvq_4C81cF+x08ugbA@mail.gmail.com>
Message-ID: <9F4F6D0D-FFA7-4042-B0EB-B741A40588EF@donders.ru.nl>

Hi Rita,

> I would like to perform a dipole fit with the data from an algorithm I'm using to process the signal, however, reading through the tutorials online, it seems I would need an original signal acquisition file (*.fif) to get the dipole position? Or is there any way to perform the dipole fitting with a subset of data and some neuromag templates?

I think yes, but am not entirely sure, because I don’t know exactly what you mean with 

‘a subset of data’, and ’some neuromag templates’.

Could you be a bit more specific please?

In general, once you have a spatial topography of observed data, and a volume conductor model of the head in combination with a specification of the position of the MEG sensor coils, (expressed in the same coordinate system as said volume conduction model) you should be ready to go.

Best wishes,
Jan-Mathijs


_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From rt.martins at campus.fct.unl.pt  Sun Jun 16 23:37:21 2019
From: rt.martins at campus.fct.unl.pt (Rita Martins)
Date: Sun, 16 Jun 2019 22:37:21 +0100
Subject: [FieldTrip] Fieldtrip dipole fit
In-Reply-To: <9F4F6D0D-FFA7-4042-B0EB-B741A40588EF@donders.ru.nl>
References: <CA+WBShOnG2QSGrkh=JyMTT5vBAR5++fWPvq_4C81cF+x08ugbA@mail.gmail.com>
 <9F4F6D0D-FFA7-4042-B0EB-B741A40588EF@donders.ru.nl>
Message-ID: <CA+WBShMhM8XapJenzOd9K26_imNjBRRu3k_-LXhreLV77Z6p4w@mail.gmail.com>

Hi Jan Mathijs,

Thank you for your help.

I'm using function api_ica_estimate (
https://bazaar.launchpad.net/~arabica-core-dev/arabica-ica/1.0/view/head:/api_ica_estimate.m)
in order to obtain the cluster mixing matrix of the components. How could I
import this data to fieldtrip so I can do the dipole fitting?
I’m having some trouble understanding what is actually needed from a data
point of view.

Thanks in advance.
Best regards,

Rita Martins

Schoffelen, J.M. (Jan Mathijs) <jan.schoffelen at donders.ru.nl> escreveu no
dia domingo, 16/06/2019 à(s) 20:12:

> Hi Rita,
>
> > I would like to perform a dipole fit with the data from an algorithm I'm
> using to process the signal, however, reading through the tutorials online,
> it seems I would need an original signal acquisition file (*.fif) to get
> the dipole position? Or is there any way to perform the dipole fitting with
> a subset of data and some neuromag templates?
>
> I think yes, but am not entirely sure, because I don’t know exactly what
> you mean with
>
> ‘a subset of data’, and ’some neuromag templates’.
>
> Could you be a bit more specific please?
>
> In general, once you have a spatial topography of observed data, and a
> volume conductor model of the head in combination with a specification of
> the position of the MEG sensor coils, (expressed in the same coordinate
> system as said volume conduction model) you should be ready to go.
>
> Best wishes,
> Jan-Mathijs
>
>
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190616/4de81ef4/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From rt.martins at campus.fct.unl.pt  Sun Jun 16 23:37:21 2019
From: rt.martins at campus.fct.unl.pt (Rita Martins)
Date: Sun, 16 Jun 2019 22:37:21 +0100
Subject: [FieldTrip] Fieldtrip dipole fit
In-Reply-To: <9F4F6D0D-FFA7-4042-B0EB-B741A40588EF@donders.ru.nl>
References: <CA+WBShOnG2QSGrkh=JyMTT5vBAR5++fWPvq_4C81cF+x08ugbA@mail.gmail.com>
 <9F4F6D0D-FFA7-4042-B0EB-B741A40588EF@donders.ru.nl>
Message-ID: <CA+WBShMhM8XapJenzOd9K26_imNjBRRu3k_-LXhreLV77Z6p4w@mail.gmail.com>

Hi Jan Mathijs,

Thank you for your help.

I'm using function api_ica_estimate (
https://bazaar.launchpad.net/~arabica-core-dev/arabica-ica/1.0/view/head:/api_ica_estimate.m)
in order to obtain the cluster mixing matrix of the components. How could I
import this data to fieldtrip so I can do the dipole fitting?
I’m having some trouble understanding what is actually needed from a data
point of view.

Thanks in advance.
Best regards,

Rita Martins

Schoffelen, J.M. (Jan Mathijs) <jan.schoffelen at donders.ru.nl> escreveu no
dia domingo, 16/06/2019 à(s) 20:12:

> Hi Rita,
>
> > I would like to perform a dipole fit with the data from an algorithm I'm
> using to process the signal, however, reading through the tutorials online,
> it seems I would need an original signal acquisition file (*.fif) to get
> the dipole position? Or is there any way to perform the dipole fitting with
> a subset of data and some neuromag templates?
>
> I think yes, but am not entirely sure, because I don’t know exactly what
> you mean with
>
> ‘a subset of data’, and ’some neuromag templates’.
>
> Could you be a bit more specific please?
>
> In general, once you have a spatial topography of observed data, and a
> volume conductor model of the head in combination with a specification of
> the position of the MEG sensor coils, (expressed in the same coordinate
> system as said volume conduction model) you should be ready to go.
>
> Best wishes,
> Jan-Mathijs
>
>
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190616/4de81ef4/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From brungio at gmail.com  Tue Jun 18 16:26:11 2019
From: brungio at gmail.com (Bruno L. Giordano)
Date: Tue, 18 Jun 2019 16:26:11 +0200
Subject: [FieldTrip] PhD Position: Perceptual and Cerebral Mechanisms of
 Voice Processing in Macaques
Message-ID: <CAGgLGEuDfdqJwXxXzT_0at2ACnBAzpybBY_V-uAZqk76g4qXjQ@mail.gmail.com>

Apologies for cross-posting.

Please find attached (and in text below) the description of an open PhD
position with Prof. Pascal Belin at the Institute of Neuroscience de la
Timone in Marseille, France.

Inquiries: pascal.belin at univ-amu.fr

Kind regards,

   Bruno

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PhD Position: Perceptual and Cerebral Mechanisms of Voice Processing in
Macaques

A new European Research Council (ERC) advanced grant starts at
Aix-Marseille University, France, for 5 years. Project “COVOPRIM–A
Comparative Study of Voice Processing in Primates” (
www.neuralbasesofcommunication.eu/projects/covoprim), awarded to prof.
Pascal Belin at the La Timone Neuroscience Institute, aims to compare the
perceptual and cerebral mechanisms of voice perception in humans, baboons,
macaques and marmosets.  For this a broad range of methods will be used
including ad-lib automated behavioural testing in social groups, anatomical
and functional MRI at 3T and 7T, neurophysiological recordings as well as
micro-stimulation and TMS.

A full-time PhD Student post is offered for at least 3 years specifically
focused on behavioural testing and awake fMRI scanning in rhesus macaques.
Applications of highly motivated candidates with interests in systems
neuroscience, auditory sciences and neuroimaging are welcomed. The
successful candidate will have a degree in Neuroscience, Computational
Neuroscience, Experimental Psychology, Neurobiology, Biomedical
Engineering, Biophysics or equivalent fields. He/she will have a keen
interest in investigating the auditory system of non-human primates in a
comparative framework. Methodological skills and previous experience in:
behavioural experiments involving training of non-human primates, fMRI
recordings and data analysis, knowledge in scripting and scientific
programming, such as Matlab/Python, computational modelling are
particularly valued.

Evaluation of candidates begins immediately. Candidates should contact
pascal.belin at univ-amu.fr and provide a detailed CV, a motivation letter and
the name of two potential referees before the closing date of September
1st, 2019. The appointment is expected to begin on October 1st, 2019 with a
net salary between 1650-2000 euros per month depending on level of
experience and applicable taxes.



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Bruno L. Giordano, PhD – CRCN
Institut de Neurosciences de la Timone (INT)
UMR 7289, CNRS and Aix Marseille Université
http://www.int.univ-amu.fr/
Campus santé Timone
27, boulevard Jean Moulin
13385 Marseille cedex 5
Www: http://www.brunolgiordano.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190618/4f4d344a/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PhD Position COVOPRIM.pdf
Type: application/pdf
Size: 341232 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190618/4f4d344a/attachment.pdf>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From brungio at gmail.com  Tue Jun 18 16:26:11 2019
From: brungio at gmail.com (Bruno L. Giordano)
Date: Tue, 18 Jun 2019 16:26:11 +0200
Subject: [FieldTrip] PhD Position: Perceptual and Cerebral Mechanisms of
 Voice Processing in Macaques
Message-ID: <CAGgLGEuDfdqJwXxXzT_0at2ACnBAzpybBY_V-uAZqk76g4qXjQ@mail.gmail.com>

Apologies for cross-posting.

Please find attached (and in text below) the description of an open PhD
position with Prof. Pascal Belin at the Institute of Neuroscience de la
Timone in Marseille, France.

Inquiries: pascal.belin at univ-amu.fr

Kind regards,

   Bruno

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PhD Position: Perceptual and Cerebral Mechanisms of Voice Processing in
Macaques

A new European Research Council (ERC) advanced grant starts at
Aix-Marseille University, France, for 5 years. Project “COVOPRIM–A
Comparative Study of Voice Processing in Primates” (
www.neuralbasesofcommunication.eu/projects/covoprim), awarded to prof.
Pascal Belin at the La Timone Neuroscience Institute, aims to compare the
perceptual and cerebral mechanisms of voice perception in humans, baboons,
macaques and marmosets.  For this a broad range of methods will be used
including ad-lib automated behavioural testing in social groups, anatomical
and functional MRI at 3T and 7T, neurophysiological recordings as well as
micro-stimulation and TMS.

A full-time PhD Student post is offered for at least 3 years specifically
focused on behavioural testing and awake fMRI scanning in rhesus macaques.
Applications of highly motivated candidates with interests in systems
neuroscience, auditory sciences and neuroimaging are welcomed. The
successful candidate will have a degree in Neuroscience, Computational
Neuroscience, Experimental Psychology, Neurobiology, Biomedical
Engineering, Biophysics or equivalent fields. He/she will have a keen
interest in investigating the auditory system of non-human primates in a
comparative framework. Methodological skills and previous experience in:
behavioural experiments involving training of non-human primates, fMRI
recordings and data analysis, knowledge in scripting and scientific
programming, such as Matlab/Python, computational modelling are
particularly valued.

Evaluation of candidates begins immediately. Candidates should contact
pascal.belin at univ-amu.fr and provide a detailed CV, a motivation letter and
the name of two potential referees before the closing date of September
1st, 2019. The appointment is expected to begin on October 1st, 2019 with a
net salary between 1650-2000 euros per month depending on level of
experience and applicable taxes.



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Bruno L. Giordano, PhD – CRCN
Institut de Neurosciences de la Timone (INT)
UMR 7289, CNRS and Aix Marseille Université
http://www.int.univ-amu.fr/
Campus santé Timone
27, boulevard Jean Moulin
13385 Marseille cedex 5
Www: http://www.brunolgiordano.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190618/4f4d344a/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PhD Position COVOPRIM.pdf
Type: application/pdf
Size: 341232 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190618/4f4d344a/attachment-0001.pdf>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From D.Campoy at uea.ac.uk  Tue Jun 18 20:12:00 2019
From: D.Campoy at uea.ac.uk (Daniel Campoy (CMP - Student))
Date: Tue, 18 Jun 2019 18:12:00 +0000
Subject: [FieldTrip] Issue with visualising EEG Spectrogram
Message-ID: <AM5PR0402MB28972B092462163BA419E0E8D4EA0@AM5PR0402MB2897.eurprd04.prod.outlook.com>

Hello,

I have been stuck trying to understand the results I'm seeing so please forgive me as my background is not in neuroscience. I'm a Masters student working with EEG data for a classification project using Matlab 2017b.

I have been successful at visualising the data of a test subject for a specific trigger and plot all channels (dataset has 8 channels) from the trigger (image stimuli) using ft_singleplotTFR. Thus creating a 2x4 plot of images for all 8 channels.  However I'm stuck trying understand my results when I plot an EEG spectrogram using ft_singleplotTFR for each channel across all triggers (T=1 in my dataset) the data does not show what I've seen for separate channels. It displays a plot of 8 images filled blue and a fine yellow/green bar across the bottom.  The only thing I've changed is supplying all the trials instead of one at a time using a for loop to iterate through each trial for 8 channels. I've removed the for loop outside of the for loop of channels since I'm supplying all trials. Below is my code and process. Any insight would be much appreciated and if you need further information please let me know.  I've attached an image of the results of each channel across all triggers.


My first step is to load the .mat file I've saved containing all the defined trials. After this is complete, the below code is used to extract all the trigger events where the value in cfg.events is T=1.  I run the ft_preprocessing again but for the defined trials I'm looking for T=1.

trigger = extractfield(cfg.event,'value');
channels = EEG_Data.cfg.channel;
trigger_idx = find(startsWith(trigger,'T=1'));
cfg.trials       = trigger_idx; %index location for all T=1 stimuli triggers
EEG_Data_Trial = ft_preprocessing(cfg,EEG_Data);


After completion the next block of code is ran for each channel. You may have noticed the cdat variable is in the output, this is me modifying the ft_singleplotTFR function to return the EEG spectrogram matrix I use for later analysis.


figure %used to create a figure of EEG Spectrograms

for z = 1:length(channels) %Collect the measurements from each channel for a given trigger
                    Img_idx = 1 + Img_idx;
                    cfg              = [];
                    cfg.output       = 'pow'; %return power spectra
                    cfg.channel      = channels{z};
                    cfg.method       = 'wavelet'; %use wavelet function
                    %cfg.trials       = trigger_idx; %specify index location to find event in EEG_Data_Trial.trial
                    cfg.width        = 1; % 3 has shown some promise for results
                    cfg.gwidth       = 4; %decreasing this has shown to fill out are of the figure
                    cfg.pad          = 20; %increases resolution as the value goes up
                    cfg.foilim       = [1 30]; %1 to 30 Hz range
                    %cfg.toi          = -.10:0.0001:.35; %produced a full image time window from -100 ms to 350ms in 0.1ms steps
                    cfg.toi          = -.05:0.00001:.250; %time window from -50 ms to 250ms in 0.01ms steps

                    TFRwavelet = ft_freqanalysis(cfg, EEG_Data_Trial);
                    fprintf('\n Time-Freq wavelet for trigger index %u channel %s and processed %u trigger(s)\n',trigger_idx(i),channels{z},i)
                    %Create Image of EEG Spectrogram to output cdat matrix
                    cfg = [];
                    cfg.baselinetype = 'absolute';
                    cfg.maskstyle = 'saturation';
                    cfg.zlim         =  'maxmin';
                    subplot(2,4,z)%used to create figures of plotted channels
                    [EEG_Spec,cdat] = ft_singleplotTFR(cfg, TFRwavelet);
                    subplot(2,4,z)%used to create figures of plotted channels
end

Thank you and kind regards,

Daniel C.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190618/eaae5e61/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OneSub_acrossTrails_T1.png
Type: image/png
Size: 99397 bytes
Desc: OneSub_acrossTrails_T1.png
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190618/eaae5e61/attachment.png>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From D.Campoy at uea.ac.uk  Tue Jun 18 20:12:00 2019
From: D.Campoy at uea.ac.uk (Daniel Campoy (CMP - Student))
Date: Tue, 18 Jun 2019 18:12:00 +0000
Subject: [FieldTrip] Issue with visualising EEG Spectrogram
Message-ID: <AM5PR0402MB28972B092462163BA419E0E8D4EA0@AM5PR0402MB2897.eurprd04.prod.outlook.com>

Hello,

I have been stuck trying to understand the results I'm seeing so please forgive me as my background is not in neuroscience. I'm a Masters student working with EEG data for a classification project using Matlab 2017b.

I have been successful at visualising the data of a test subject for a specific trigger and plot all channels (dataset has 8 channels) from the trigger (image stimuli) using ft_singleplotTFR. Thus creating a 2x4 plot of images for all 8 channels.  However I'm stuck trying understand my results when I plot an EEG spectrogram using ft_singleplotTFR for each channel across all triggers (T=1 in my dataset) the data does not show what I've seen for separate channels. It displays a plot of 8 images filled blue and a fine yellow/green bar across the bottom.  The only thing I've changed is supplying all the trials instead of one at a time using a for loop to iterate through each trial for 8 channels. I've removed the for loop outside of the for loop of channels since I'm supplying all trials. Below is my code and process. Any insight would be much appreciated and if you need further information please let me know.  I've attached an image of the results of each channel across all triggers.


My first step is to load the .mat file I've saved containing all the defined trials. After this is complete, the below code is used to extract all the trigger events where the value in cfg.events is T=1.  I run the ft_preprocessing again but for the defined trials I'm looking for T=1.

trigger = extractfield(cfg.event,'value');
channels = EEG_Data.cfg.channel;
trigger_idx = find(startsWith(trigger,'T=1'));
cfg.trials       = trigger_idx; %index location for all T=1 stimuli triggers
EEG_Data_Trial = ft_preprocessing(cfg,EEG_Data);


After completion the next block of code is ran for each channel. You may have noticed the cdat variable is in the output, this is me modifying the ft_singleplotTFR function to return the EEG spectrogram matrix I use for later analysis.


figure %used to create a figure of EEG Spectrograms

for z = 1:length(channels) %Collect the measurements from each channel for a given trigger
                    Img_idx = 1 + Img_idx;
                    cfg              = [];
                    cfg.output       = 'pow'; %return power spectra
                    cfg.channel      = channels{z};
                    cfg.method       = 'wavelet'; %use wavelet function
                    %cfg.trials       = trigger_idx; %specify index location to find event in EEG_Data_Trial.trial
                    cfg.width        = 1; % 3 has shown some promise for results
                    cfg.gwidth       = 4; %decreasing this has shown to fill out are of the figure
                    cfg.pad          = 20; %increases resolution as the value goes up
                    cfg.foilim       = [1 30]; %1 to 30 Hz range
                    %cfg.toi          = -.10:0.0001:.35; %produced a full image time window from -100 ms to 350ms in 0.1ms steps
                    cfg.toi          = -.05:0.00001:.250; %time window from -50 ms to 250ms in 0.01ms steps

                    TFRwavelet = ft_freqanalysis(cfg, EEG_Data_Trial);
                    fprintf('\n Time-Freq wavelet for trigger index %u channel %s and processed %u trigger(s)\n',trigger_idx(i),channels{z},i)
                    %Create Image of EEG Spectrogram to output cdat matrix
                    cfg = [];
                    cfg.baselinetype = 'absolute';
                    cfg.maskstyle = 'saturation';
                    cfg.zlim         =  'maxmin';
                    subplot(2,4,z)%used to create figures of plotted channels
                    [EEG_Spec,cdat] = ft_singleplotTFR(cfg, TFRwavelet);
                    subplot(2,4,z)%used to create figures of plotted channels
end

Thank you and kind regards,

Daniel C.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190618/eaae5e61/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OneSub_acrossTrails_T1.png
Type: image/png
Size: 99397 bytes
Desc: OneSub_acrossTrails_T1.png
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190618/eaae5e61/attachment-0001.png>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jan.schoffelen at donders.ru.nl  Wed Jun 19 11:11:43 2019
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Wed, 19 Jun 2019 09:11:43 +0000
Subject: [FieldTrip] Fieldtrip dipole fit
In-Reply-To: <CA+WBShMhM8XapJenzOd9K26_imNjBRRu3k_-LXhreLV77Z6p4w@mail.gmail.com>
References: <CA+WBShOnG2QSGrkh=JyMTT5vBAR5++fWPvq_4C81cF+x08ugbA@mail.gmail.com>
 <9F4F6D0D-FFA7-4042-B0EB-B741A40588EF@donders.ru.nl>
 <CA+WBShMhM8XapJenzOd9K26_imNjBRRu3k_-LXhreLV77Z6p4w@mail.gmail.com>
Message-ID: <A3746E39-68DD-4986-A641-647F390E1EA4@donders.ru.nl>

Hi Rita,

I don’t know what a ‘cluster mixing matrix of the components’ is.
Generally, you’d need to create a fieldtrip-compatible data structure of  the type ’timelock’ (see ft_datatype_timelock, look for it on the website and in utilities/ft_datatype_timelock), or of the type ‘comp’ (see ft_datatype_comp).

If the above mentioned cluster mixing matrix of the components is the same as just the mixing matrix that transforms from components to channels, then this is what in FieldTrip is known as the ’topo’ matrix.

If you do a targeted search on the fieldtriptoolbox.org<http://fieldtriptoolbox.org> website (don’t forget to look into the FAQ, tutorial and example script sections) I am pretty sure that you can find the necessary information.

Also, it might be useful to study the code in ft_componentanalysis, which is a wrapper around a host of blind-source separation algorithms. Feel free to add functionality for the arabica method, and submit this as a PR on github.

Best wishes,

Jan-Mathijs


On 16 Jun 2019, at 23:37, Rita Martins <rt.martins at campus.fct.unl.pt<mailto:rt.martins at campus.fct.unl.pt>> wrote:


Hi Jan Mathijs,

Thank you for your help.

I'm using function api_ica_estimate (https://bazaar.launchpad.net/~arabica-core-dev/arabica-ica/1.0/view/head:/api_ica_estimate.m) in order to obtain the cluster mixing matrix of the components. How could I import this data to fieldtrip so I can do the dipole fitting?
I’m having some trouble understanding what is actually needed from a data point of view.

Thanks in advance.
Best regards,

Rita Martins

Schoffelen, J.M. (Jan Mathijs) <jan.schoffelen at donders.ru.nl<mailto:jan.schoffelen at donders.ru.nl>> escreveu no dia domingo, 16/06/2019 à(s) 20:12:
Hi Rita,

> I would like to perform a dipole fit with the data from an algorithm I'm using to process the signal, however, reading through the tutorials online, it seems I would need an original signal acquisition file (*.fif) to get the dipole position? Or is there any way to perform the dipole fitting with a subset of data and some neuromag templates?

I think yes, but am not entirely sure, because I don’t know exactly what you mean with

‘a subset of data’, and ’some neuromag templates’.

Could you be a bit more specific please?

In general, once you have a spatial topography of observed data, and a volume conductor model of the head in combination with a specification of the position of the MEG sensor coils, (expressed in the same coordinate system as said volume conduction model) you should be ready to go.

Best wishes,
Jan-Mathijs


_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190619/9e8159ea/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jan.schoffelen at donders.ru.nl  Wed Jun 19 11:11:43 2019
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Wed, 19 Jun 2019 09:11:43 +0000
Subject: [FieldTrip] Fieldtrip dipole fit
In-Reply-To: <CA+WBShMhM8XapJenzOd9K26_imNjBRRu3k_-LXhreLV77Z6p4w@mail.gmail.com>
References: <CA+WBShOnG2QSGrkh=JyMTT5vBAR5++fWPvq_4C81cF+x08ugbA@mail.gmail.com>
 <9F4F6D0D-FFA7-4042-B0EB-B741A40588EF@donders.ru.nl>
 <CA+WBShMhM8XapJenzOd9K26_imNjBRRu3k_-LXhreLV77Z6p4w@mail.gmail.com>
Message-ID: <A3746E39-68DD-4986-A641-647F390E1EA4@donders.ru.nl>

Hi Rita,

I don’t know what a ‘cluster mixing matrix of the components’ is.
Generally, you’d need to create a fieldtrip-compatible data structure of  the type ’timelock’ (see ft_datatype_timelock, look for it on the website and in utilities/ft_datatype_timelock), or of the type ‘comp’ (see ft_datatype_comp).

If the above mentioned cluster mixing matrix of the components is the same as just the mixing matrix that transforms from components to channels, then this is what in FieldTrip is known as the ’topo’ matrix.

If you do a targeted search on the fieldtriptoolbox.org<http://fieldtriptoolbox.org> website (don’t forget to look into the FAQ, tutorial and example script sections) I am pretty sure that you can find the necessary information.

Also, it might be useful to study the code in ft_componentanalysis, which is a wrapper around a host of blind-source separation algorithms. Feel free to add functionality for the arabica method, and submit this as a PR on github.

Best wishes,

Jan-Mathijs


On 16 Jun 2019, at 23:37, Rita Martins <rt.martins at campus.fct.unl.pt<mailto:rt.martins at campus.fct.unl.pt>> wrote:


Hi Jan Mathijs,

Thank you for your help.

I'm using function api_ica_estimate (https://bazaar.launchpad.net/~arabica-core-dev/arabica-ica/1.0/view/head:/api_ica_estimate.m) in order to obtain the cluster mixing matrix of the components. How could I import this data to fieldtrip so I can do the dipole fitting?
I’m having some trouble understanding what is actually needed from a data point of view.

Thanks in advance.
Best regards,

Rita Martins

Schoffelen, J.M. (Jan Mathijs) <jan.schoffelen at donders.ru.nl<mailto:jan.schoffelen at donders.ru.nl>> escreveu no dia domingo, 16/06/2019 à(s) 20:12:
Hi Rita,

> I would like to perform a dipole fit with the data from an algorithm I'm using to process the signal, however, reading through the tutorials online, it seems I would need an original signal acquisition file (*.fif) to get the dipole position? Or is there any way to perform the dipole fitting with a subset of data and some neuromag templates?

I think yes, but am not entirely sure, because I don’t know exactly what you mean with

‘a subset of data’, and ’some neuromag templates’.

Could you be a bit more specific please?

In general, once you have a spatial topography of observed data, and a volume conductor model of the head in combination with a specification of the position of the MEG sensor coils, (expressed in the same coordinate system as said volume conduction model) you should be ready to go.

Best wishes,
Jan-Mathijs


_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190619/9e8159ea/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jan.schoffelen at donders.ru.nl  Wed Jun 19 11:24:23 2019
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Wed, 19 Jun 2019 09:24:23 +0000
Subject: [FieldTrip] Issue with visualising EEG Spectrogram
In-Reply-To: <AM5PR0402MB28972B092462163BA419E0E8D4EA0@AM5PR0402MB2897.eurprd04.prod.outlook.com>
References: <AM5PR0402MB28972B092462163BA419E0E8D4EA0@AM5PR0402MB2897.eurprd04.prod.outlook.com>
Message-ID: <6EEF74B9-0596-4AB6-A5DB-B9D658837C32@donders.ru.nl>

Hi Daniel,

May I suggest you to do 4 things, rather than trying to really understand why no apparent baselining seems to have been applied.

1 a). You can run ft_freqanalysis for all channels at once (without the for-loop)
1 b). You may want to use cfg.method = ‘wltconvol’ for ft_freqanalysis, rather than ‘wavelet’ , since it’s much faster with equivalent results.
2). Next, you can call ft_freqbaseline (again: only once, and perhaps use ‘relchange’ as a method) to ‘baseline correct' the spectrograms.
3). Next, you can use ft_multiplotTFR on the baseline corrected variable, using a cfg.layout = ‘ordered’, and don’t specify any baseline correction options here.

Best wishes,
Jan-Mathijs



On 18 Jun 2019, at 20:12, Daniel Campoy (CMP - Student) <D.Campoy at uea.ac.uk<mailto:D.Campoy at uea.ac.uk>> wrote:

Hello,

I have been stuck trying to understand the results I’m seeing so please forgive me as my background is not in neuroscience. I’m a Masters student working with EEG data for a classification project using Matlab 2017b.

I have been successful at visualising the data of a test subject for a specific trigger and plot all channels (dataset has 8 channels) from the trigger (image stimuli) using ft_singleplotTFR. Thus creating a 2x4 plot of images for all 8 channels.  However I’m stuck trying understand my results when I plot an EEG spectrogram using ft_singleplotTFR for each channel across all triggers (T=1 in my dataset) the data does not show what I’ve seen for separate channels. It displays a plot of 8 images filled blue and a fine yellow/green bar across the bottom.  The only thing I’ve changed is supplying all the trials instead of one at a time using a for loop to iterate through each trial for 8 channels. I’ve removed the for loop outside of the for loop of channels since I’m supplying all trials. Below is my code and process. Any insight would be much appreciated and if you need further information please let me know.  I’ve attached an image of the results of each channel across all triggers.


My first step is to load the .mat file I’ve saved containing all the defined trials. After this is complete, the below code is used to extract all the trigger events where the value in cfg.events is T=1.  I run the ft_preprocessingagain but for the defined trials I’m looking for T=1.

trigger = extractfield(cfg.event,'value');
channels = EEG_Data.cfg.channel;
trigger_idx = find(startsWith(trigger,'T=1'));
cfg.trials       = trigger_idx; %index location for all T=1 stimuli triggers
EEG_Data_Trial = ft_preprocessing(cfg,EEG_Data);


After completion the next block of code is ran for each channel. You may have noticed the cdat variable is in the output, this is me modifying the ft_singleplotTFR function to return the EEG spectrogram matrix I use for later analysis.


figure %used to create a figure of EEG Spectrograms

for z = 1:length(channels) %Collect the measurements from each channel for a given trigger
                    Img_idx = 1 + Img_idx;
                    cfg              = [];
                    cfg.output       = 'pow'; %return power spectra
                    cfg.channel      = channels{z};
                    cfg.method       = 'wavelet'; %use wavelet function
                    %cfg.trials       = trigger_idx; %specify index location to find event in EEG_Data_Trial.trial
                    cfg.width        = 1; % 3 has shown some promise for results
                    cfg.gwidth       = 4; %decreasing this has shown to fill out are of the figure
                    cfg.pad          = 20; %increases resolution as the value goes up
                    cfg.foilim       = [1 30]; %1 to 30 Hz range
                    %cfg.toi          = -.10:0.0001:.35; %produced a full image time window from -100 ms to 350ms in 0.1ms steps
                    cfg.toi          = -.05:0.00001:.250; %time window from -50 ms to 250ms in 0.01ms steps

                    TFRwavelet = ft_freqanalysis(cfg, EEG_Data_Trial);
                    fprintf('\n Time-Freq wavelet for trigger index %u channel %s and processed %u trigger(s)\n',trigger_idx(i),channels{z},i)
                    %Create Image of EEG Spectrogram to output cdat matrix
                    cfg = [];
                    cfg.baselinetype = 'absolute';
                    cfg.maskstyle = 'saturation';
                    cfg.zlim         =  'maxmin';
                    subplot(2,4,z)%used to create figures of plotted channels
                    [EEG_Spec,cdat] = ft_singleplotTFR(cfg, TFRwavelet);
                    subplot(2,4,z)%used to create figures of plotted channels
end

Thank you and kind regards,

Daniel C.
<OneSub_acrossTrails_T1.png>_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190619/0d8c1a97/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jan.schoffelen at donders.ru.nl  Wed Jun 19 11:24:23 2019
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Wed, 19 Jun 2019 09:24:23 +0000
Subject: [FieldTrip] Issue with visualising EEG Spectrogram
In-Reply-To: <AM5PR0402MB28972B092462163BA419E0E8D4EA0@AM5PR0402MB2897.eurprd04.prod.outlook.com>
References: <AM5PR0402MB28972B092462163BA419E0E8D4EA0@AM5PR0402MB2897.eurprd04.prod.outlook.com>
Message-ID: <6EEF74B9-0596-4AB6-A5DB-B9D658837C32@donders.ru.nl>

Hi Daniel,

May I suggest you to do 4 things, rather than trying to really understand why no apparent baselining seems to have been applied.

1 a). You can run ft_freqanalysis for all channels at once (without the for-loop)
1 b). You may want to use cfg.method = ‘wltconvol’ for ft_freqanalysis, rather than ‘wavelet’ , since it’s much faster with equivalent results.
2). Next, you can call ft_freqbaseline (again: only once, and perhaps use ‘relchange’ as a method) to ‘baseline correct' the spectrograms.
3). Next, you can use ft_multiplotTFR on the baseline corrected variable, using a cfg.layout = ‘ordered’, and don’t specify any baseline correction options here.

Best wishes,
Jan-Mathijs



On 18 Jun 2019, at 20:12, Daniel Campoy (CMP - Student) <D.Campoy at uea.ac.uk<mailto:D.Campoy at uea.ac.uk>> wrote:

Hello,

I have been stuck trying to understand the results I’m seeing so please forgive me as my background is not in neuroscience. I’m a Masters student working with EEG data for a classification project using Matlab 2017b.

I have been successful at visualising the data of a test subject for a specific trigger and plot all channels (dataset has 8 channels) from the trigger (image stimuli) using ft_singleplotTFR. Thus creating a 2x4 plot of images for all 8 channels.  However I’m stuck trying understand my results when I plot an EEG spectrogram using ft_singleplotTFR for each channel across all triggers (T=1 in my dataset) the data does not show what I’ve seen for separate channels. It displays a plot of 8 images filled blue and a fine yellow/green bar across the bottom.  The only thing I’ve changed is supplying all the trials instead of one at a time using a for loop to iterate through each trial for 8 channels. I’ve removed the for loop outside of the for loop of channels since I’m supplying all trials. Below is my code and process. Any insight would be much appreciated and if you need further information please let me know.  I’ve attached an image of the results of each channel across all triggers.


My first step is to load the .mat file I’ve saved containing all the defined trials. After this is complete, the below code is used to extract all the trigger events where the value in cfg.events is T=1.  I run the ft_preprocessingagain but for the defined trials I’m looking for T=1.

trigger = extractfield(cfg.event,'value');
channels = EEG_Data.cfg.channel;
trigger_idx = find(startsWith(trigger,'T=1'));
cfg.trials       = trigger_idx; %index location for all T=1 stimuli triggers
EEG_Data_Trial = ft_preprocessing(cfg,EEG_Data);


After completion the next block of code is ran for each channel. You may have noticed the cdat variable is in the output, this is me modifying the ft_singleplotTFR function to return the EEG spectrogram matrix I use for later analysis.


figure %used to create a figure of EEG Spectrograms

for z = 1:length(channels) %Collect the measurements from each channel for a given trigger
                    Img_idx = 1 + Img_idx;
                    cfg              = [];
                    cfg.output       = 'pow'; %return power spectra
                    cfg.channel      = channels{z};
                    cfg.method       = 'wavelet'; %use wavelet function
                    %cfg.trials       = trigger_idx; %specify index location to find event in EEG_Data_Trial.trial
                    cfg.width        = 1; % 3 has shown some promise for results
                    cfg.gwidth       = 4; %decreasing this has shown to fill out are of the figure
                    cfg.pad          = 20; %increases resolution as the value goes up
                    cfg.foilim       = [1 30]; %1 to 30 Hz range
                    %cfg.toi          = -.10:0.0001:.35; %produced a full image time window from -100 ms to 350ms in 0.1ms steps
                    cfg.toi          = -.05:0.00001:.250; %time window from -50 ms to 250ms in 0.01ms steps

                    TFRwavelet = ft_freqanalysis(cfg, EEG_Data_Trial);
                    fprintf('\n Time-Freq wavelet for trigger index %u channel %s and processed %u trigger(s)\n',trigger_idx(i),channels{z},i)
                    %Create Image of EEG Spectrogram to output cdat matrix
                    cfg = [];
                    cfg.baselinetype = 'absolute';
                    cfg.maskstyle = 'saturation';
                    cfg.zlim         =  'maxmin';
                    subplot(2,4,z)%used to create figures of plotted channels
                    [EEG_Spec,cdat] = ft_singleplotTFR(cfg, TFRwavelet);
                    subplot(2,4,z)%used to create figures of plotted channels
end

Thank you and kind regards,

Daniel C.
<OneSub_acrossTrails_T1.png>_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190619/0d8c1a97/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From D.Campoy at uea.ac.uk  Wed Jun 19 14:15:05 2019
From: D.Campoy at uea.ac.uk (Daniel Campoy (CMP - Student))
Date: Wed, 19 Jun 2019 12:15:05 +0000
Subject: [FieldTrip] Issue with visualising EEG Spectrogram
In-Reply-To: <6EEF74B9-0596-4AB6-A5DB-B9D658837C32@donders.ru.nl>
References: <AM5PR0402MB28972B092462163BA419E0E8D4EA0@AM5PR0402MB2897.eurprd04.prod.outlook.com>,
 <6EEF74B9-0596-4AB6-A5DB-B9D658837C32@donders.ru.nl>
Message-ID: <AM5PR0402MB289795696B4666A832DA8731D4E50@AM5PR0402MB2897.eurprd04.prod.outlook.com>

Hi Jan-Mathijs,

Thank you for replying back to me.  I made the suggested changes and I'm seeing better results as the majority of the area is not as blue and on some of the channels I'm seeing a more defined shaped.  In case you are interested I attached the new results.  Overall I'm satisfied with the results and see in come trials a more clearer response.

I added a couple questions to two of your suggestions below.

This is the new block of code as well.

cfg              = [];
                    cfg.output       = 'pow'; %return power spectra
                    cfg.channel      = 'all';
                    cfg.method       = 'wltconvol';
                    %cfg.trials       = trigger_idx; %specify index location to find event in EEG_Data_Trial.trial
                    cfg.width        = 1; % 3 has shown some promise for results
                    cfg.gwidth       = 4; %decreasing this has shown to fill out are of the figure
                    cfg.pad          = 20; %increases resolution as the value goes up
                    cfg.foilim       = [1 30]; %1 to 30 Hz range
                    %cfg.toi          = -.10:0.0001:.35; %produced a full image time window from -100 ms to 350ms in 0.1ms steps
                    cfg.toi          = -.05:0.00001:.250; %time window from -50 ms to 250ms in 0.01ms steps

                    TFRwavelet = ft_freqanalysis(cfg, EEG_Data_Trial);
                    fprintf('\n Time-Freq wavelet for trigger index %u channel %s and processed %u trigger(s)\n',trigger_idx(i),channels{z},i)
                    %Create Image of EEG Spectrogram to output cdat matrix
                    cfg = [];
                    %cfg.baselinetype = 'relchange';
                    cfg.maskstyle = 'saturation';
                    cfg.zlim         =  'maxmin';
                    cfg.layout       = 'ordered';
                    cfg.showlabels   = 'yes';
                    cfg.showoutline      = 'yes';
                    %subplot(2,4,z)%used to create figures of plotted channels
                    [EEG_Spec] = ft_multiplotTFR(cfg, TFRwavelet);





1 a). You can run ft_freqanalysis for all channels at once (without the for-loop)

>From my understanding if I supply all channels for ft_freqanalysis and use ft_singleplotTFR then this will show one plot for a trial  with an average across all the channels (in my case 8).

1 b). You may want to use cfg.method = 'wltconvol' for ft_freqanalysis, rather than 'wavelet' , since it's much faster with equivalent results.

2). Next, you can call ft_freqbaseline (again: only once, and perhaps use 'relchange' as a method) to 'baseline correct' the spectrograms.

What are the consequences of  running this more than once?

3). Next, you can use ft_multiplotTFR on the baseline corrected variable, using a cfg.layout = 'ordered', and don't specify any baseline correction options here.


If I use ft_singleplotTFR again would you recommend I omit the baseline parameter too?


I also want to add that when performing ft_freqanalysis I'm seeing these messages "Warning: output time-bins are different from input time-bins, multiples of the sametrial" for all my trails processing. When I'm looking at the trial cell data type and looking at the maxtrix defined inside their numbers are not same.  I was not able to find much information as to exactly how this is triggered. I did find the line of code the produces this but not entirely sure why it is triggered.  Is this message typically ignored?


Kind Regards,

Daniel C.

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

________________________________
From: fieldtrip <fieldtrip-bounces at science.ru.nl> on behalf of Schoffelen, J.M. (Jan Mathijs) <jan.schoffelen at donders.ru.nl>
Sent: Wednesday, June 19, 2019 10:24:23 AM
To: FieldTrip discussion list
Subject: Re: [FieldTrip] Issue with visualising EEG Spectrogram

Hi Daniel,

May I suggest you to do 4 things, rather than trying to really understand why no apparent baselining seems to have been applied.

1 a). You can run ft_freqanalysis for all channels at once (without the for-loop)
1 b). You may want to use cfg.method = 'wltconvol' for ft_freqanalysis, rather than 'wavelet' , since it's much faster with equivalent results.
2). Next, you can call ft_freqbaseline (again: only once, and perhaps use 'relchange' as a method) to 'baseline correct' the spectrograms.
3). Next, you can use ft_multiplotTFR on the baseline corrected variable, using a cfg.layout = 'ordered', and don't specify any baseline correction options here.

Best wishes,
Jan-Mathijs




On 18 Jun 2019, at 20:12, Daniel Campoy (CMP - Student) <D.Campoy at uea.ac.uk<mailto:D.Campoy at uea.ac.uk>> wrote:

Hello,

I have been stuck trying to understand the results I'm seeing so please forgive me as my background is not in neuroscience. I'm a Masters student working with EEG data for a classification project using Matlab 2017b.

I have been successful at visualising the data of a test subject for a specific trigger and plot all channels (dataset has 8 channels) from the trigger (image stimuli) using ft_singleplotTFR. Thus creating a 2x4 plot of images for all 8 channels.  However I'm stuck trying understand my results when I plot an EEG spectrogram using ft_singleplotTFR for each channel across all triggers (T=1 in my dataset) the data does not show what I've seen for separate channels. It displays a plot of 8 images filled blue and a fine yellow/green bar across the bottom.  The only thing I've changed is supplying all the trials instead of one at a time using a for loop to iterate through each trial for 8 channels. I've removed the for loop outside of the for loop of channels since I'm supplying all trials. Below is my code and process. Any insight would be much appreciated and if you need further information please let me know.  I've attached an image of the results of each channel across all triggers.


My first step is to load the .mat file I've saved containing all the defined trials. After this is complete, the below code is used to extract all the trigger events where the value in cfg.events is T=1.  I run the ft_preprocessingagain but for the defined trials I'm looking for T=1.

trigger = extractfield(cfg.event,'value');
channels = EEG_Data.cfg.channel;
trigger_idx = find(startsWith(trigger,'T=1'));
cfg.trials       = trigger_idx; %index location for all T=1 stimuli triggers
EEG_Data_Trial = ft_preprocessing(cfg,EEG_Data);


After completion the next block of code is ran for each channel. You may have noticed the cdat variable is in the output, this is me modifying the ft_singleplotTFR function to return the EEG spectrogram matrix I use for later analysis.


figure %used to create a figure of EEG Spectrograms

for z = 1:length(channels) %Collect the measurements from each channel for a given trigger
                    Img_idx = 1 + Img_idx;
                    cfg              = [];
                    cfg.output       = 'pow'; %return power spectra
                    cfg.channel      = channels{z};
                    cfg.method       = 'wavelet'; %use wavelet function
                    %cfg.trials       = trigger_idx; %specify index location to find event in EEG_Data_Trial.trial
                    cfg.width        = 1; % 3 has shown some promise for results
                    cfg.gwidth       = 4; %decreasing this has shown to fill out are of the figure
                    cfg.pad          = 20; %increases resolution as the value goes up
                    cfg.foilim       = [1 30]; %1 to 30 Hz range
                    %cfg.toi          = -.10:0.0001:.35; %produced a full image time window from -100 ms to 350ms in 0.1ms steps
                    cfg.toi          = -.05:0.00001:.250; %time window from -50 ms to 250ms in 0.01ms steps

                    TFRwavelet = ft_freqanalysis(cfg, EEG_Data_Trial);
                    fprintf('\n Time-Freq wavelet for trigger index %u channel %s and processed %u trigger(s)\n',trigger_idx(i),channels{z},i)
                    %Create Image of EEG Spectrogram to output cdat matrix
                    cfg = [];
                    cfg.baselinetype = 'absolute';
                    cfg.maskstyle = 'saturation';
                    cfg.zlim         =  'maxmin';
                    subplot(2,4,z)%used to create figures of plotted channels
                    [EEG_Spec,cdat] = ft_singleplotTFR(cfg, TFRwavelet);
                    subplot(2,4,z)%used to create figures of plotted channels
end

Thank you and kind regards,

Daniel C.
<OneSub_acrossTrails_T1.png>_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=02%7C01%7CD.Campoy%40uea.ac.uk%7C0d621a78d97846b0dc3508d6f4983ae3%7Cc65f8795ba3d43518a070865e5d8f090%7C0%7C0%7C636965332006247409&sdata=4UGJMnGMb2swnfBUuhyzfLOzEU09VmONTG98868xfmE%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=02%7C01%7CD.Campoy%40uea.ac.uk%7C0d621a78d97846b0dc3508d6f4983ae3%7Cc65f8795ba3d43518a070865e5d8f090%7C0%7C0%7C636965332006247409&sdata=KuDpLZP51plE5ifAuPvM5xD8WiHQyvMWKuPJBLZOagM%3D&reserved=0>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190619/b55a4d98/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 10HzSub02a_T1_All_Trials.png
Type: image/png
Size: 88775 bytes
Desc: 10HzSub02a_T1_All_Trials.png
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190619/b55a4d98/attachment.png>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From D.Campoy at uea.ac.uk  Wed Jun 19 14:15:05 2019
From: D.Campoy at uea.ac.uk (Daniel Campoy (CMP - Student))
Date: Wed, 19 Jun 2019 12:15:05 +0000
Subject: [FieldTrip] Issue with visualising EEG Spectrogram
In-Reply-To: <6EEF74B9-0596-4AB6-A5DB-B9D658837C32@donders.ru.nl>
References: <AM5PR0402MB28972B092462163BA419E0E8D4EA0@AM5PR0402MB2897.eurprd04.prod.outlook.com>,
 <6EEF74B9-0596-4AB6-A5DB-B9D658837C32@donders.ru.nl>
Message-ID: <AM5PR0402MB289795696B4666A832DA8731D4E50@AM5PR0402MB2897.eurprd04.prod.outlook.com>

Hi Jan-Mathijs,

Thank you for replying back to me.  I made the suggested changes and I'm seeing better results as the majority of the area is not as blue and on some of the channels I'm seeing a more defined shaped.  In case you are interested I attached the new results.  Overall I'm satisfied with the results and see in come trials a more clearer response.

I added a couple questions to two of your suggestions below.

This is the new block of code as well.

cfg              = [];
                    cfg.output       = 'pow'; %return power spectra
                    cfg.channel      = 'all';
                    cfg.method       = 'wltconvol';
                    %cfg.trials       = trigger_idx; %specify index location to find event in EEG_Data_Trial.trial
                    cfg.width        = 1; % 3 has shown some promise for results
                    cfg.gwidth       = 4; %decreasing this has shown to fill out are of the figure
                    cfg.pad          = 20; %increases resolution as the value goes up
                    cfg.foilim       = [1 30]; %1 to 30 Hz range
                    %cfg.toi          = -.10:0.0001:.35; %produced a full image time window from -100 ms to 350ms in 0.1ms steps
                    cfg.toi          = -.05:0.00001:.250; %time window from -50 ms to 250ms in 0.01ms steps

                    TFRwavelet = ft_freqanalysis(cfg, EEG_Data_Trial);
                    fprintf('\n Time-Freq wavelet for trigger index %u channel %s and processed %u trigger(s)\n',trigger_idx(i),channels{z},i)
                    %Create Image of EEG Spectrogram to output cdat matrix
                    cfg = [];
                    %cfg.baselinetype = 'relchange';
                    cfg.maskstyle = 'saturation';
                    cfg.zlim         =  'maxmin';
                    cfg.layout       = 'ordered';
                    cfg.showlabels   = 'yes';
                    cfg.showoutline      = 'yes';
                    %subplot(2,4,z)%used to create figures of plotted channels
                    [EEG_Spec] = ft_multiplotTFR(cfg, TFRwavelet);





1 a). You can run ft_freqanalysis for all channels at once (without the for-loop)

>From my understanding if I supply all channels for ft_freqanalysis and use ft_singleplotTFR then this will show one plot for a trial  with an average across all the channels (in my case 8).

1 b). You may want to use cfg.method = 'wltconvol' for ft_freqanalysis, rather than 'wavelet' , since it's much faster with equivalent results.

2). Next, you can call ft_freqbaseline (again: only once, and perhaps use 'relchange' as a method) to 'baseline correct' the spectrograms.

What are the consequences of  running this more than once?

3). Next, you can use ft_multiplotTFR on the baseline corrected variable, using a cfg.layout = 'ordered', and don't specify any baseline correction options here.


If I use ft_singleplotTFR again would you recommend I omit the baseline parameter too?


I also want to add that when performing ft_freqanalysis I'm seeing these messages "Warning: output time-bins are different from input time-bins, multiples of the sametrial" for all my trails processing. When I'm looking at the trial cell data type and looking at the maxtrix defined inside their numbers are not same.  I was not able to find much information as to exactly how this is triggered. I did find the line of code the produces this but not entirely sure why it is triggered.  Is this message typically ignored?


Kind Regards,

Daniel C.

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

________________________________
From: fieldtrip <fieldtrip-bounces at science.ru.nl> on behalf of Schoffelen, J.M. (Jan Mathijs) <jan.schoffelen at donders.ru.nl>
Sent: Wednesday, June 19, 2019 10:24:23 AM
To: FieldTrip discussion list
Subject: Re: [FieldTrip] Issue with visualising EEG Spectrogram

Hi Daniel,

May I suggest you to do 4 things, rather than trying to really understand why no apparent baselining seems to have been applied.

1 a). You can run ft_freqanalysis for all channels at once (without the for-loop)
1 b). You may want to use cfg.method = 'wltconvol' for ft_freqanalysis, rather than 'wavelet' , since it's much faster with equivalent results.
2). Next, you can call ft_freqbaseline (again: only once, and perhaps use 'relchange' as a method) to 'baseline correct' the spectrograms.
3). Next, you can use ft_multiplotTFR on the baseline corrected variable, using a cfg.layout = 'ordered', and don't specify any baseline correction options here.

Best wishes,
Jan-Mathijs




On 18 Jun 2019, at 20:12, Daniel Campoy (CMP - Student) <D.Campoy at uea.ac.uk<mailto:D.Campoy at uea.ac.uk>> wrote:

Hello,

I have been stuck trying to understand the results I'm seeing so please forgive me as my background is not in neuroscience. I'm a Masters student working with EEG data for a classification project using Matlab 2017b.

I have been successful at visualising the data of a test subject for a specific trigger and plot all channels (dataset has 8 channels) from the trigger (image stimuli) using ft_singleplotTFR. Thus creating a 2x4 plot of images for all 8 channels.  However I'm stuck trying understand my results when I plot an EEG spectrogram using ft_singleplotTFR for each channel across all triggers (T=1 in my dataset) the data does not show what I've seen for separate channels. It displays a plot of 8 images filled blue and a fine yellow/green bar across the bottom.  The only thing I've changed is supplying all the trials instead of one at a time using a for loop to iterate through each trial for 8 channels. I've removed the for loop outside of the for loop of channels since I'm supplying all trials. Below is my code and process. Any insight would be much appreciated and if you need further information please let me know.  I've attached an image of the results of each channel across all triggers.


My first step is to load the .mat file I've saved containing all the defined trials. After this is complete, the below code is used to extract all the trigger events where the value in cfg.events is T=1.  I run the ft_preprocessingagain but for the defined trials I'm looking for T=1.

trigger = extractfield(cfg.event,'value');
channels = EEG_Data.cfg.channel;
trigger_idx = find(startsWith(trigger,'T=1'));
cfg.trials       = trigger_idx; %index location for all T=1 stimuli triggers
EEG_Data_Trial = ft_preprocessing(cfg,EEG_Data);


After completion the next block of code is ran for each channel. You may have noticed the cdat variable is in the output, this is me modifying the ft_singleplotTFR function to return the EEG spectrogram matrix I use for later analysis.


figure %used to create a figure of EEG Spectrograms

for z = 1:length(channels) %Collect the measurements from each channel for a given trigger
                    Img_idx = 1 + Img_idx;
                    cfg              = [];
                    cfg.output       = 'pow'; %return power spectra
                    cfg.channel      = channels{z};
                    cfg.method       = 'wavelet'; %use wavelet function
                    %cfg.trials       = trigger_idx; %specify index location to find event in EEG_Data_Trial.trial
                    cfg.width        = 1; % 3 has shown some promise for results
                    cfg.gwidth       = 4; %decreasing this has shown to fill out are of the figure
                    cfg.pad          = 20; %increases resolution as the value goes up
                    cfg.foilim       = [1 30]; %1 to 30 Hz range
                    %cfg.toi          = -.10:0.0001:.35; %produced a full image time window from -100 ms to 350ms in 0.1ms steps
                    cfg.toi          = -.05:0.00001:.250; %time window from -50 ms to 250ms in 0.01ms steps

                    TFRwavelet = ft_freqanalysis(cfg, EEG_Data_Trial);
                    fprintf('\n Time-Freq wavelet for trigger index %u channel %s and processed %u trigger(s)\n',trigger_idx(i),channels{z},i)
                    %Create Image of EEG Spectrogram to output cdat matrix
                    cfg = [];
                    cfg.baselinetype = 'absolute';
                    cfg.maskstyle = 'saturation';
                    cfg.zlim         =  'maxmin';
                    subplot(2,4,z)%used to create figures of plotted channels
                    [EEG_Spec,cdat] = ft_singleplotTFR(cfg, TFRwavelet);
                    subplot(2,4,z)%used to create figures of plotted channels
end

Thank you and kind regards,

Daniel C.
<OneSub_acrossTrails_T1.png>_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=02%7C01%7CD.Campoy%40uea.ac.uk%7C0d621a78d97846b0dc3508d6f4983ae3%7Cc65f8795ba3d43518a070865e5d8f090%7C0%7C0%7C636965332006247409&sdata=4UGJMnGMb2swnfBUuhyzfLOzEU09VmONTG98868xfmE%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=02%7C01%7CD.Campoy%40uea.ac.uk%7C0d621a78d97846b0dc3508d6f4983ae3%7Cc65f8795ba3d43518a070865e5d8f090%7C0%7C0%7C636965332006247409&sdata=KuDpLZP51plE5ifAuPvM5xD8WiHQyvMWKuPJBLZOagM%3D&reserved=0>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190619/b55a4d98/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 10HzSub02a_T1_All_Trials.png
Type: image/png
Size: 88775 bytes
Desc: 10HzSub02a_T1_All_Trials.png
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190619/b55a4d98/attachment-0001.png>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jan.schoffelen at donders.ru.nl  Wed Jun 19 15:39:48 2019
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Wed, 19 Jun 2019 13:39:48 +0000
Subject: [FieldTrip] Issue with visualising EEG Spectrogram
In-Reply-To: <AM5PR0402MB289795696B4666A832DA8731D4E50@AM5PR0402MB2897.eurprd04.prod.outlook.com>
References: <AM5PR0402MB28972B092462163BA419E0E8D4EA0@AM5PR0402MB2897.eurprd04.prod.outlook.com>
 <6EEF74B9-0596-4AB6-A5DB-B9D658837C32@donders.ru.nl>
 <AM5PR0402MB289795696B4666A832DA8731D4E50@AM5PR0402MB2897.eurprd04.prod.outlook.com>
Message-ID: <228D12E4-959C-43C5-A915-DA2CE4A5E2F8@donders.ru.nl>

Daniel, it looks as if the baseline correction is not applied. You’d need to specify cfg.baseline = ‘yes’ in order to achieve this.
Note also, that I again recommend to do the baseline correction in a separate step, not asking the plotting function to do it.
Recursive baseline corrections with a ‘relchange’ may be problematic, since at some point you start dividing by 0.
Best,
JanMathijs


On 19 Jun 2019, at 14:15, Daniel Campoy (CMP - Student) <D.Campoy at uea.ac.uk<mailto:D.Campoy at uea.ac.uk>> wrote:

Hi Jan-Mathijs,

Thank you for replying back to me.  I made the suggested changes and I’m seeing better results as the majority of the area is not as blue and on some of the channels I’m seeing a more defined shaped.  In case you are interested I attached the new results.  Overall I’m satisfied with the results and see in come trials a more clearer response.

I added a couple questions to two of your suggestions below.

This is the new block of code as well.

cfg              = [];
                    cfg.output       = 'pow'; %return power spectra
                    cfg.channel      = 'all';
                    cfg.method       = 'wltconvol';
                    %cfg.trials       = trigger_idx; %specify index location to find event in EEG_Data_Trial.trial
                    cfg.width        = 1; % 3 has shown some promise for results
                    cfg.gwidth       = 4; %decreasing this has shown to fill out are of the figure
                    cfg.pad          = 20; %increases resolution as the value goes up
                    cfg.foilim       = [1 30]; %1 to 30 Hz range
                    %cfg.toi          = -.10:0.0001:.35; %produced a full image time window from -100 ms to 350ms in 0.1ms steps
                    cfg.toi          = -.05:0.00001:.250; %time window from -50 ms to 250ms in 0.01ms steps

                    TFRwavelet = ft_freqanalysis(cfg, EEG_Data_Trial);
                    fprintf('\n Time-Freq wavelet for trigger index %u channel %s and processed %u trigger(s)\n',trigger_idx(i),channels{z},i)
                    %Create Image of EEG Spectrogram to output cdat matrix
                    cfg = [];
                    %cfg.baselinetype = 'relchange';
                    cfg.maskstyle = 'saturation';
                    cfg.zlim         =  'maxmin';
                    cfg.layout       = 'ordered';
                    cfg.showlabels   = 'yes';
                    cfg.showoutline      = 'yes';
                    %subplot(2,4,z)%used to create figures of plotted channels
                    [EEG_Spec] = ft_multiplotTFR(cfg, TFRwavelet);





1 a). You can run ft_freqanalysis for all channels at once (without the for-loop)

From my understanding if I supply all channels for ft_freqanalysis and use ft_singleplotTFR then this will show one plot for a trial  with an average across all the channels (in my case 8).

1 b). You may want to use cfg.method = ‘wltconvol’ for ft_freqanalysis, rather than ‘wavelet’ , since it’s much faster with equivalent results.

2). Next, you can call ft_freqbaseline (again: only once, and perhaps use ‘relchange’ as a method) to ‘baseline correct' the spectrograms.

What are the consequences of  running this more than once?

3). Next, you can use ft_multiplotTFR on the baseline corrected variable, using a cfg.layout = ‘ordered’, and don’t specify any baseline correction options here.


If I use ft_singleplotTFR again would you recommend I omit the baseline parameter too?


I also want to add that when performing ft_freqanalysis I’m seeing these messages “Warning: output time-bins are different from input time-bins, multiples of the sametrial” for all my trails processing. When I’m looking at the trial cell data type and looking at the maxtrix defined inside their numbers are not same.  I was not able to find much information as to exactly how this is triggered. I did find the line of code the produces this but not entirely sure why it is triggered.  Is this message typically ignored?


Kind Regards,

Daniel C.

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

________________________________
From: fieldtrip <fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl>> on behalf of Schoffelen, J.M. (Jan Mathijs) <jan.schoffelen at donders.ru.nl<mailto:jan.schoffelen at donders.ru.nl>>
Sent: Wednesday, June 19, 2019 10:24:23 AM
To: FieldTrip discussion list
Subject: Re: [FieldTrip] Issue with visualising EEG Spectrogram

Hi Daniel,

May I suggest you to do 4 things, rather than trying to really understand why no apparent baselining seems to have been applied.

1 a). You can run ft_freqanalysis for all channels at once (without the for-loop)
1 b). You may want to use cfg.method = ‘wltconvol’ for ft_freqanalysis, rather than ‘wavelet’ , since it’s much faster with equivalent results.
2). Next, you can call ft_freqbaseline (again: only once, and perhaps use ‘relchange’ as a method) to ‘baseline correct' the spectrograms.
3). Next, you can use ft_multiplotTFR on the baseline corrected variable, using a cfg.layout = ‘ordered’, and don’t specify any baseline correction options here.

Best wishes,
Jan-Mathijs




On 18 Jun 2019, at 20:12, Daniel Campoy (CMP - Student) <D.Campoy at uea.ac.uk<mailto:D.Campoy at uea.ac.uk>> wrote:

Hello,

I have been stuck trying to understand the results I’m seeing so please forgive me as my background is not in neuroscience. I’m a Masters student working with EEG data for a classification project using Matlab 2017b.

I have been successful at visualising the data of a test subject for a specific trigger and plot all channels (dataset has 8 channels) from the trigger (image stimuli) using ft_singleplotTFR. Thus creating a 2x4 plot of images for all 8 channels.  However I’m stuck trying understand my results when I plot an EEG spectrogram using ft_singleplotTFR for each channel across all triggers (T=1 in my dataset) the data does not show what I’ve seen for separate channels. It displays a plot of 8 images filled blue and a fine yellow/green bar across the bottom.  The only thing I’ve changed is supplying all the trials instead of one at a time using a for loop to iterate through each trial for 8 channels. I’ve removed the for loop outside of the for loop of channels since I’m supplying all trials. Below is my code and process. Any insight would be much appreciated and if you need further information please let me know.  I’ve attached an image of the results of each channel across all triggers.


My first step is to load the .mat file I’ve saved containing all the defined trials. After this is complete, the below code is used to extract all the trigger events where the value in cfg.events is T=1.  I run the ft_preprocessingagain but for the defined trials I’m looking for T=1.

trigger = extractfield(cfg.event,'value');
channels = EEG_Data.cfg.channel;
trigger_idx = find(startsWith(trigger,'T=1'));
cfg.trials       = trigger_idx; %index location for all T=1 stimuli triggers
EEG_Data_Trial = ft_preprocessing(cfg,EEG_Data);


After completion the next block of code is ran for each channel. You may have noticed the cdat variable is in the output, this is me modifying the ft_singleplotTFR function to return the EEG spectrogram matrix I use for later analysis.


figure %used to create a figure of EEG Spectrograms

for z = 1:length(channels) %Collect the measurements from each channel for a given trigger
                    Img_idx = 1 + Img_idx;
                    cfg              = [];
                    cfg.output       = 'pow'; %return power spectra
                    cfg.channel      = channels{z};
                    cfg.method       = 'wavelet'; %use wavelet function
                    %cfg.trials       = trigger_idx; %specify index location to find event in EEG_Data_Trial.trial
                    cfg.width        = 1; % 3 has shown some promise for results
                    cfg.gwidth       = 4; %decreasing this has shown to fill out are of the figure
                    cfg.pad          = 20; %increases resolution as the value goes up
                    cfg.foilim       = [1 30]; %1 to 30 Hz range
                    %cfg.toi          = -.10:0.0001:.35; %produced a full image time window from -100 ms to 350ms in 0.1ms steps
                    cfg.toi          = -.05:0.00001:.250; %time window from -50 ms to 250ms in 0.01ms steps

                    TFRwavelet = ft_freqanalysis(cfg, EEG_Data_Trial);
                    fprintf('\n Time-Freq wavelet for trigger index %u channel %s and processed %u trigger(s)\n',trigger_idx(i),channels{z},i)
                    %Create Image of EEG Spectrogram to output cdat matrix
                    cfg = [];
                    cfg.baselinetype = 'absolute';
                    cfg.maskstyle = 'saturation';
                    cfg.zlim         =  'maxmin';
                    subplot(2,4,z)%used to create figures of plotted channels
                    [EEG_Spec,cdat] = ft_singleplotTFR(cfg, TFRwavelet);
                    subplot(2,4,z)%used to create figures of plotted channels
end

Thank you and kind regards,

Daniel C.
<OneSub_acrossTrails_T1.png>_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=02%7C01%7CD.Campoy%40uea.ac.uk%7C0d621a78d97846b0dc3508d6f4983ae3%7Cc65f8795ba3d43518a070865e5d8f090%7C0%7C0%7C636965332006247409&sdata=4UGJMnGMb2swnfBUuhyzfLOzEU09VmONTG98868xfmE%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=02%7C01%7CD.Campoy%40uea.ac.uk%7C0d621a78d97846b0dc3508d6f4983ae3%7Cc65f8795ba3d43518a070865e5d8f090%7C0%7C0%7C636965332006247409&sdata=KuDpLZP51plE5ifAuPvM5xD8WiHQyvMWKuPJBLZOagM%3D&reserved=0>

<10HzSub02a_T1_All_Trials.png>_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190619/3eaa0f31/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jan.schoffelen at donders.ru.nl  Wed Jun 19 15:39:48 2019
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Wed, 19 Jun 2019 13:39:48 +0000
Subject: [FieldTrip] Issue with visualising EEG Spectrogram
In-Reply-To: <AM5PR0402MB289795696B4666A832DA8731D4E50@AM5PR0402MB2897.eurprd04.prod.outlook.com>
References: <AM5PR0402MB28972B092462163BA419E0E8D4EA0@AM5PR0402MB2897.eurprd04.prod.outlook.com>
 <6EEF74B9-0596-4AB6-A5DB-B9D658837C32@donders.ru.nl>
 <AM5PR0402MB289795696B4666A832DA8731D4E50@AM5PR0402MB2897.eurprd04.prod.outlook.com>
Message-ID: <228D12E4-959C-43C5-A915-DA2CE4A5E2F8@donders.ru.nl>

Daniel, it looks as if the baseline correction is not applied. You’d need to specify cfg.baseline = ‘yes’ in order to achieve this.
Note also, that I again recommend to do the baseline correction in a separate step, not asking the plotting function to do it.
Recursive baseline corrections with a ‘relchange’ may be problematic, since at some point you start dividing by 0.
Best,
JanMathijs


On 19 Jun 2019, at 14:15, Daniel Campoy (CMP - Student) <D.Campoy at uea.ac.uk<mailto:D.Campoy at uea.ac.uk>> wrote:

Hi Jan-Mathijs,

Thank you for replying back to me.  I made the suggested changes and I’m seeing better results as the majority of the area is not as blue and on some of the channels I’m seeing a more defined shaped.  In case you are interested I attached the new results.  Overall I’m satisfied with the results and see in come trials a more clearer response.

I added a couple questions to two of your suggestions below.

This is the new block of code as well.

cfg              = [];
                    cfg.output       = 'pow'; %return power spectra
                    cfg.channel      = 'all';
                    cfg.method       = 'wltconvol';
                    %cfg.trials       = trigger_idx; %specify index location to find event in EEG_Data_Trial.trial
                    cfg.width        = 1; % 3 has shown some promise for results
                    cfg.gwidth       = 4; %decreasing this has shown to fill out are of the figure
                    cfg.pad          = 20; %increases resolution as the value goes up
                    cfg.foilim       = [1 30]; %1 to 30 Hz range
                    %cfg.toi          = -.10:0.0001:.35; %produced a full image time window from -100 ms to 350ms in 0.1ms steps
                    cfg.toi          = -.05:0.00001:.250; %time window from -50 ms to 250ms in 0.01ms steps

                    TFRwavelet = ft_freqanalysis(cfg, EEG_Data_Trial);
                    fprintf('\n Time-Freq wavelet for trigger index %u channel %s and processed %u trigger(s)\n',trigger_idx(i),channels{z},i)
                    %Create Image of EEG Spectrogram to output cdat matrix
                    cfg = [];
                    %cfg.baselinetype = 'relchange';
                    cfg.maskstyle = 'saturation';
                    cfg.zlim         =  'maxmin';
                    cfg.layout       = 'ordered';
                    cfg.showlabels   = 'yes';
                    cfg.showoutline      = 'yes';
                    %subplot(2,4,z)%used to create figures of plotted channels
                    [EEG_Spec] = ft_multiplotTFR(cfg, TFRwavelet);





1 a). You can run ft_freqanalysis for all channels at once (without the for-loop)

From my understanding if I supply all channels for ft_freqanalysis and use ft_singleplotTFR then this will show one plot for a trial  with an average across all the channels (in my case 8).

1 b). You may want to use cfg.method = ‘wltconvol’ for ft_freqanalysis, rather than ‘wavelet’ , since it’s much faster with equivalent results.

2). Next, you can call ft_freqbaseline (again: only once, and perhaps use ‘relchange’ as a method) to ‘baseline correct' the spectrograms.

What are the consequences of  running this more than once?

3). Next, you can use ft_multiplotTFR on the baseline corrected variable, using a cfg.layout = ‘ordered’, and don’t specify any baseline correction options here.


If I use ft_singleplotTFR again would you recommend I omit the baseline parameter too?


I also want to add that when performing ft_freqanalysis I’m seeing these messages “Warning: output time-bins are different from input time-bins, multiples of the sametrial” for all my trails processing. When I’m looking at the trial cell data type and looking at the maxtrix defined inside their numbers are not same.  I was not able to find much information as to exactly how this is triggered. I did find the line of code the produces this but not entirely sure why it is triggered.  Is this message typically ignored?


Kind Regards,

Daniel C.

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

________________________________
From: fieldtrip <fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl>> on behalf of Schoffelen, J.M. (Jan Mathijs) <jan.schoffelen at donders.ru.nl<mailto:jan.schoffelen at donders.ru.nl>>
Sent: Wednesday, June 19, 2019 10:24:23 AM
To: FieldTrip discussion list
Subject: Re: [FieldTrip] Issue with visualising EEG Spectrogram

Hi Daniel,

May I suggest you to do 4 things, rather than trying to really understand why no apparent baselining seems to have been applied.

1 a). You can run ft_freqanalysis for all channels at once (without the for-loop)
1 b). You may want to use cfg.method = ‘wltconvol’ for ft_freqanalysis, rather than ‘wavelet’ , since it’s much faster with equivalent results.
2). Next, you can call ft_freqbaseline (again: only once, and perhaps use ‘relchange’ as a method) to ‘baseline correct' the spectrograms.
3). Next, you can use ft_multiplotTFR on the baseline corrected variable, using a cfg.layout = ‘ordered’, and don’t specify any baseline correction options here.

Best wishes,
Jan-Mathijs




On 18 Jun 2019, at 20:12, Daniel Campoy (CMP - Student) <D.Campoy at uea.ac.uk<mailto:D.Campoy at uea.ac.uk>> wrote:

Hello,

I have been stuck trying to understand the results I’m seeing so please forgive me as my background is not in neuroscience. I’m a Masters student working with EEG data for a classification project using Matlab 2017b.

I have been successful at visualising the data of a test subject for a specific trigger and plot all channels (dataset has 8 channels) from the trigger (image stimuli) using ft_singleplotTFR. Thus creating a 2x4 plot of images for all 8 channels.  However I’m stuck trying understand my results when I plot an EEG spectrogram using ft_singleplotTFR for each channel across all triggers (T=1 in my dataset) the data does not show what I’ve seen for separate channels. It displays a plot of 8 images filled blue and a fine yellow/green bar across the bottom.  The only thing I’ve changed is supplying all the trials instead of one at a time using a for loop to iterate through each trial for 8 channels. I’ve removed the for loop outside of the for loop of channels since I’m supplying all trials. Below is my code and process. Any insight would be much appreciated and if you need further information please let me know.  I’ve attached an image of the results of each channel across all triggers.


My first step is to load the .mat file I’ve saved containing all the defined trials. After this is complete, the below code is used to extract all the trigger events where the value in cfg.events is T=1.  I run the ft_preprocessingagain but for the defined trials I’m looking for T=1.

trigger = extractfield(cfg.event,'value');
channels = EEG_Data.cfg.channel;
trigger_idx = find(startsWith(trigger,'T=1'));
cfg.trials       = trigger_idx; %index location for all T=1 stimuli triggers
EEG_Data_Trial = ft_preprocessing(cfg,EEG_Data);


After completion the next block of code is ran for each channel. You may have noticed the cdat variable is in the output, this is me modifying the ft_singleplotTFR function to return the EEG spectrogram matrix I use for later analysis.


figure %used to create a figure of EEG Spectrograms

for z = 1:length(channels) %Collect the measurements from each channel for a given trigger
                    Img_idx = 1 + Img_idx;
                    cfg              = [];
                    cfg.output       = 'pow'; %return power spectra
                    cfg.channel      = channels{z};
                    cfg.method       = 'wavelet'; %use wavelet function
                    %cfg.trials       = trigger_idx; %specify index location to find event in EEG_Data_Trial.trial
                    cfg.width        = 1; % 3 has shown some promise for results
                    cfg.gwidth       = 4; %decreasing this has shown to fill out are of the figure
                    cfg.pad          = 20; %increases resolution as the value goes up
                    cfg.foilim       = [1 30]; %1 to 30 Hz range
                    %cfg.toi          = -.10:0.0001:.35; %produced a full image time window from -100 ms to 350ms in 0.1ms steps
                    cfg.toi          = -.05:0.00001:.250; %time window from -50 ms to 250ms in 0.01ms steps

                    TFRwavelet = ft_freqanalysis(cfg, EEG_Data_Trial);
                    fprintf('\n Time-Freq wavelet for trigger index %u channel %s and processed %u trigger(s)\n',trigger_idx(i),channels{z},i)
                    %Create Image of EEG Spectrogram to output cdat matrix
                    cfg = [];
                    cfg.baselinetype = 'absolute';
                    cfg.maskstyle = 'saturation';
                    cfg.zlim         =  'maxmin';
                    subplot(2,4,z)%used to create figures of plotted channels
                    [EEG_Spec,cdat] = ft_singleplotTFR(cfg, TFRwavelet);
                    subplot(2,4,z)%used to create figures of plotted channels
end

Thank you and kind regards,

Daniel C.
<OneSub_acrossTrails_T1.png>_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=02%7C01%7CD.Campoy%40uea.ac.uk%7C0d621a78d97846b0dc3508d6f4983ae3%7Cc65f8795ba3d43518a070865e5d8f090%7C0%7C0%7C636965332006247409&sdata=4UGJMnGMb2swnfBUuhyzfLOzEU09VmONTG98868xfmE%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=02%7C01%7CD.Campoy%40uea.ac.uk%7C0d621a78d97846b0dc3508d6f4983ae3%7Cc65f8795ba3d43518a070865e5d8f090%7C0%7C0%7C636965332006247409&sdata=KuDpLZP51plE5ifAuPvM5xD8WiHQyvMWKuPJBLZOagM%3D&reserved=0>

<10HzSub02a_T1_All_Trials.png>_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190619/3eaa0f31/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From stephen.whitmarsh at gmail.com  Wed Jun 19 16:59:13 2019
From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh)
Date: Wed, 19 Jun 2019 16:59:13 +0200
Subject: [FieldTrip] Registration open for WIRED 2019,
 19-20th November 2019 at ICM, Paris
Message-ID: <CAFrxm=yFYs7ZTRiP=eD1JVCWNJdoqak+bdW4Ng_kt-6-UZvfig@mail.gmail.com>

Dear all,

The registrations for the 2019 edition of WIRED (Workshop on Intracranial
Recordings in humans: Epilepsy, DBS) is now open. It will take place*
19-20th November 2019 at ICM* (Paris.


The website <http://wired-icm.org/>has been updated, but note that the
program is still provisional and will probably change a bit.



Please help us making this edition as great as the first one by
broadcasting the info among your networks (see attached flyer).

Don't hesitate to contact Katia (katia.lehongre at icm-institute.org) or
Adrien (adrien at impulse-science.com) if you have any questions or
suggestions.


All the best,

Stephen (on the behalf of the organizing committee)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190619/46110803/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: WiredFlyer.jpg
Type: image/jpeg
Size: 581089 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190619/46110803/attachment.jpg>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From stephen.whitmarsh at gmail.com  Wed Jun 19 16:59:13 2019
From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh)
Date: Wed, 19 Jun 2019 16:59:13 +0200
Subject: [FieldTrip] Registration open for WIRED 2019,
 19-20th November 2019 at ICM, Paris
Message-ID: <CAFrxm=yFYs7ZTRiP=eD1JVCWNJdoqak+bdW4Ng_kt-6-UZvfig@mail.gmail.com>

Dear all,

The registrations for the 2019 edition of WIRED (Workshop on Intracranial
Recordings in humans: Epilepsy, DBS) is now open. It will take place*
19-20th November 2019 at ICM* (Paris.


The website <http://wired-icm.org/>has been updated, but note that the
program is still provisional and will probably change a bit.



Please help us making this edition as great as the first one by
broadcasting the info among your networks (see attached flyer).

Don't hesitate to contact Katia (katia.lehongre at icm-institute.org) or
Adrien (adrien at impulse-science.com) if you have any questions or
suggestions.


All the best,

Stephen (on the behalf of the organizing committee)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190619/46110803/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: WiredFlyer.jpg
Type: image/jpeg
Size: 581089 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190619/46110803/attachment-0001.jpg>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From D.Campoy at uea.ac.uk  Wed Jun 19 17:46:54 2019
From: D.Campoy at uea.ac.uk (Daniel Campoy (CMP - Student))
Date: Wed, 19 Jun 2019 15:46:54 +0000
Subject: [FieldTrip] Issue with visualising EEG Spectrogram
In-Reply-To: <228D12E4-959C-43C5-A915-DA2CE4A5E2F8@donders.ru.nl>
References: <AM5PR0402MB28972B092462163BA419E0E8D4EA0@AM5PR0402MB2897.eurprd04.prod.outlook.com>
 <6EEF74B9-0596-4AB6-A5DB-B9D658837C32@donders.ru.nl>
 <AM5PR0402MB289795696B4666A832DA8731D4E50@AM5PR0402MB2897.eurprd04.prod.outlook.com>
 <228D12E4-959C-43C5-A915-DA2CE4A5E2F8@donders.ru.nl>
Message-ID: <AM5PR0402MB2897288A769350F98BC79C25D4E50@AM5PR0402MB2897.eurprd04.prod.outlook.com>

Hi JanMathijs,

Thank you, sorry that I did not read your statement correctly about the baseline correction. I added ft_freqbaseline function between ft_freqanalysis and ft_multiplotTFR and I’m seeing a lot more detail of activation across time and frequency now that I’m not having the plot function perform the baseline.  Attached is the new image set.
cfg              = [];
                    cfg.output       = 'pow'; %return power spectra
                    cfg.channel      = 'all';
                    cfg.method       = 'wltconvol';
                    cfg.width        = 1; % 3 has shown some promise for results
                    cfg.gwidth       = 4; %decreasing this has shown to fill out are of the figure
                    cfg.pad          = 20; %increases resolution as the value goes up
                    cfg.foilim       = [1 30]; %1 to 30 Hz range
                    cfg.toi          = -.05:0.00001:.250; %time window from -50 ms to 250ms in 0.01ms steps

                    TFRwavelet = ft_freqanalysis(cfg, EEG_Data_Trial);

                    cfg = [];
                    cfg.baseline  = 'yes';
                    cfg.baselinetype = 'relchange';
                    [freq] = ft_freqbaseline(cfg, TFRwavelet)
                    cfg = [];

                    cfg.maskstyle = 'saturation';
                    cfg.zlim         =  'maxmin';
                    cfg.layout       = 'ordered';
                    cfg.showlabels   = 'yes';
                    cfg.showoutline      = 'yes';
                    [EEG_Spec] = ft_multiplotTFR(cfg, freq);


I really appreciate the help.

Kind Regards,

Daniel C.


From: fieldtrip <fieldtrip-bounces at science.ru.nl> On Behalf Of Schoffelen, J.M. (Jan Mathijs)
Sent: 19 June 2019 14:40
To: FieldTrip discussion list <fieldtrip at science.ru.nl>
Subject: Re: [FieldTrip] Issue with visualising EEG Spectrogram

Daniel, it looks as if the baseline correction is not applied. You’d need to specify cfg.baseline = ‘yes’ in order to achieve this.
Note also, that I again recommend to do the baseline correction in a separate step, not asking the plotting function to do it.
Recursive baseline corrections with a ‘relchange’ may be problematic, since at some point you start dividing by 0.
Best,
JanMathijs



On 19 Jun 2019, at 14:15, Daniel Campoy (CMP - Student) <D.Campoy at uea.ac.uk<mailto:D.Campoy at uea.ac.uk>> wrote:

Hi Jan-Mathijs,

Thank you for replying back to me.  I made the suggested changes and I’m seeing better results as the majority of the area is not as blue and on some of the channels I’m seeing a more defined shaped.  In case you are interested I attached the new results.  Overall I’m satisfied with the results and see in come trials a more clearer response.

I added a couple questions to two of your suggestions below.

This is the new block of code as well.

cfg              = [];
                    cfg.output       = 'pow'; %return power spectra
                    cfg.channel      = 'all';
                    cfg.method       = 'wltconvol';
                    %cfg.trials       = trigger_idx; %specify index location to find event in EEG_Data_Trial.trial
                    cfg.width        = 1; % 3 has shown some promise for results
                    cfg.gwidth       = 4; %decreasing this has shown to fill out are of the figure
                    cfg.pad          = 20; %increases resolution as the value goes up
                    cfg.foilim       = [1 30]; %1 to 30 Hz range
                    %cfg.toi          = -.10:0.0001:.35; %produced a full image time window from -100 ms to 350ms in 0.1ms steps
                    cfg.toi          = -.05:0.00001:.250; %time window from -50 ms to 250ms in 0.01ms steps

                    TFRwavelet = ft_freqanalysis(cfg, EEG_Data_Trial);
                    fprintf('\n Time-Freq wavelet for trigger index %u channel %s and processed %u trigger(s)\n',trigger_idx(i),channels{z},i)
                    %Create Image of EEG Spectrogram to output cdat matrix
                    cfg = [];
                    %cfg.baselinetype = 'relchange';
                    cfg.maskstyle = 'saturation';
                    cfg.zlim         =  'maxmin';
                    cfg.layout       = 'ordered';
                    cfg.showlabels   = 'yes';
                    cfg.showoutline      = 'yes';
                    %subplot(2,4,z)%used to create figures of plotted channels
                    [EEG_Spec] = ft_multiplotTFR(cfg, TFRwavelet);





1 a). You can run ft_freqanalysis for all channels at once (without the for-loop)

From my understanding if I supply all channels for ft_freqanalysis and use ft_singleplotTFR then this will show one plot for a trial  with an average across all the channels (in my case 8).

1 b). You may want to use cfg.method = ‘wltconvol’ for ft_freqanalysis, rather than ‘wavelet’ , since it’s much faster with equivalent results.

2). Next, you can call ft_freqbaseline (again: only once, and perhaps use ‘relchange’ as a method) to ‘baseline correct' the spectrograms.

What are the consequences of  running this more than once?

3). Next, you can use ft_multiplotTFR on the baseline corrected variable, using a cfg.layout = ‘ordered’, and don’t specify any baseline correction options here.


If I use ft_singleplotTFR again would you recommend I omit the baseline parameter too?


I also want to add that when performing ft_freqanalysis I’m seeing these messages “Warning: output time-bins are different from input time-bins, multiples of the sametrial” for all my trails processing. When I’m looking at the trial cell data type and looking at the maxtrix defined inside their numbers are not same.  I was not able to find much information as to exactly how this is triggered. I did find the line of code the produces this but not entirely sure why it is triggered.  Is this message typically ignored?


Kind Regards,

Daniel C.

Sent from Mail<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgo.microsoft.com%2Ffwlink%2F%3FLinkId%3D550986&data=02%7C01%7CD.Campoy%40uea.ac.uk%7Cceb777a35f6c42538daf08d6f4bc3841%7Cc65f8795ba3d43518a070865e5d8f090%7C0%7C0%7C636965486572083954&sdata=tg81Kk8Ho0NnveTgFKTvoRsZtiTJ9xF1%2B05afgc%2BeGA%3D&reserved=0> for Windows 10

________________________________
From: fieldtrip <fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl>> on behalf of Schoffelen, J.M. (Jan Mathijs) <jan.schoffelen at donders.ru.nl<mailto:jan.schoffelen at donders.ru.nl>>
Sent: Wednesday, June 19, 2019 10:24:23 AM
To: FieldTrip discussion list
Subject: Re: [FieldTrip] Issue with visualising EEG Spectrogram

Hi Daniel,

May I suggest you to do 4 things, rather than trying to really understand why no apparent baselining seems to have been applied.

1 a). You can run ft_freqanalysis for all channels at once (without the for-loop)
1 b). You may want to use cfg.method = ‘wltconvol’ for ft_freqanalysis, rather than ‘wavelet’ , since it’s much faster with equivalent results.
2). Next, you can call ft_freqbaseline (again: only once, and perhaps use ‘relchange’ as a method) to ‘baseline correct' the spectrograms.
3). Next, you can use ft_multiplotTFR on the baseline corrected variable, using a cfg.layout = ‘ordered’, and don’t specify any baseline correction options here.

Best wishes,
Jan-Mathijs





On 18 Jun 2019, at 20:12, Daniel Campoy (CMP - Student) <D.Campoy at uea.ac.uk<mailto:D.Campoy at uea.ac.uk>> wrote:

Hello,

I have been stuck trying to understand the results I’m seeing so please forgive me as my background is not in neuroscience. I’m a Masters student working with EEG data for a classification project using Matlab 2017b.

I have been successful at visualising the data of a test subject for a specific trigger and plot all channels (dataset has 8 channels) from the trigger (image stimuli) using ft_singleplotTFR. Thus creating a 2x4 plot of images for all 8 channels.  However I’m stuck trying understand my results when I plot an EEG spectrogram using ft_singleplotTFR for each channel across all triggers (T=1 in my dataset) the data does not show what I’ve seen for separate channels. It displays a plot of 8 images filled blue and a fine yellow/green bar across the bottom.  The only thing I’ve changed is supplying all the trials instead of one at a time using a for loop to iterate through each trial for 8 channels. I’ve removed the for loop outside of the for loop of channels since I’m supplying all trials. Below is my code and process. Any insight would be much appreciated and if you need further information please let me know.  I’ve attached an image of the results of each channel across all triggers.


My first step is to load the .mat file I’ve saved containing all the defined trials. After this is complete, the below code is used to extract all the trigger events where the value in cfg.events is T=1.  I run the ft_preprocessingagain but for the defined trials I’m looking for T=1.

trigger = extractfield(cfg.event,'value');
channels = EEG_Data.cfg.channel;
trigger_idx = find(startsWith(trigger,'T=1'));
cfg.trials       = trigger_idx; %index location for all T=1 stimuli triggers
EEG_Data_Trial = ft_preprocessing(cfg,EEG_Data);


After completion the next block of code is ran for each channel. You may have noticed the cdat variable is in the output, this is me modifying the ft_singleplotTFR function to return the EEG spectrogram matrix I use for later analysis.


figure %used to create a figure of EEG Spectrograms

for z = 1:length(channels) %Collect the measurements from each channel for a given trigger
                    Img_idx = 1 + Img_idx;
                    cfg              = [];
                    cfg.output       = 'pow'; %return power spectra
                    cfg.channel      = channels{z};
                    cfg.method       = 'wavelet'; %use wavelet function
                    %cfg.trials       = trigger_idx; %specify index location to find event in EEG_Data_Trial.trial
                    cfg.width        = 1; % 3 has shown some promise for results
                    cfg.gwidth       = 4; %decreasing this has shown to fill out are of the figure
                    cfg.pad          = 20; %increases resolution as the value goes up
                    cfg.foilim       = [1 30]; %1 to 30 Hz range
                    %cfg.toi          = -.10:0.0001:.35; %produced a full image time window from -100 ms to 350ms in 0.1ms steps
                    cfg.toi          = -.05:0.00001:.250; %time window from -50 ms to 250ms in 0.01ms steps

                    TFRwavelet = ft_freqanalysis(cfg, EEG_Data_Trial);
                    fprintf('\n Time-Freq wavelet for trigger index %u channel %s and processed %u trigger(s)\n',trigger_idx(i),channels{z},i)
                    %Create Image of EEG Spectrogram to output cdat matrix
                    cfg = [];
                    cfg.baselinetype = 'absolute';
                    cfg.maskstyle = 'saturation';
                    cfg.zlim         =  'maxmin';
                    subplot(2,4,z)%used to create figures of plotted channels
                    [EEG_Spec,cdat] = ft_singleplotTFR(cfg, TFRwavelet);
                    subplot(2,4,z)%used to create figures of plotted channels
end

Thank you and kind regards,

Daniel C.
<OneSub_acrossTrails_T1.png>_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=02%7C01%7CD.Campoy%40uea.ac.uk%7Cceb777a35f6c42538daf08d6f4bc3841%7Cc65f8795ba3d43518a070865e5d8f090%7C0%7C0%7C636965486572093958&sdata=OAQIp0ZPne5jKOG%2FZfWA64S%2BtRwTqO%2FHEyu83JcrPFA%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=02%7C01%7CD.Campoy%40uea.ac.uk%7Cceb777a35f6c42538daf08d6f4bc3841%7Cc65f8795ba3d43518a070865e5d8f090%7C0%7C0%7C636965486572103975&sdata=OcCfSqAAnTFAkFtqByp9ySWis2JvsOlqVgtQCaEZY3g%3D&reserved=0>

<10HzSub02a_T1_All_Trials.png>_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=02%7C01%7CD.Campoy%40uea.ac.uk%7Cceb777a35f6c42538daf08d6f4bc3841%7Cc65f8795ba3d43518a070865e5d8f090%7C0%7C0%7C636965486572103975&sdata=GI%2Fq7ZakEjArOtXC1gzb18itK3IZYZiGk3KpjEU%2B0tE%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=02%7C01%7CD.Campoy%40uea.ac.uk%7Cceb777a35f6c42538daf08d6f4bc3841%7Cc65f8795ba3d43518a070865e5d8f090%7C0%7C0%7C636965486572113979&sdata=OOBbW7o%2BULlYJsZHmh%2F3g9DzDKAGpzMmrA6vR5tIFgI%3D&reserved=0>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190619/66392cd4/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 10HzSub02a_T1_All_Trials.png
Type: image/png
Size: 181992 bytes
Desc: 10HzSub02a_T1_All_Trials.png
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190619/66392cd4/attachment.png>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From D.Campoy at uea.ac.uk  Wed Jun 19 17:46:54 2019
From: D.Campoy at uea.ac.uk (Daniel Campoy (CMP - Student))
Date: Wed, 19 Jun 2019 15:46:54 +0000
Subject: [FieldTrip] Issue with visualising EEG Spectrogram
In-Reply-To: <228D12E4-959C-43C5-A915-DA2CE4A5E2F8@donders.ru.nl>
References: <AM5PR0402MB28972B092462163BA419E0E8D4EA0@AM5PR0402MB2897.eurprd04.prod.outlook.com>
 <6EEF74B9-0596-4AB6-A5DB-B9D658837C32@donders.ru.nl>
 <AM5PR0402MB289795696B4666A832DA8731D4E50@AM5PR0402MB2897.eurprd04.prod.outlook.com>
 <228D12E4-959C-43C5-A915-DA2CE4A5E2F8@donders.ru.nl>
Message-ID: <AM5PR0402MB2897288A769350F98BC79C25D4E50@AM5PR0402MB2897.eurprd04.prod.outlook.com>

Hi JanMathijs,

Thank you, sorry that I did not read your statement correctly about the baseline correction. I added ft_freqbaseline function between ft_freqanalysis and ft_multiplotTFR and I’m seeing a lot more detail of activation across time and frequency now that I’m not having the plot function perform the baseline.  Attached is the new image set.
cfg              = [];
                    cfg.output       = 'pow'; %return power spectra
                    cfg.channel      = 'all';
                    cfg.method       = 'wltconvol';
                    cfg.width        = 1; % 3 has shown some promise for results
                    cfg.gwidth       = 4; %decreasing this has shown to fill out are of the figure
                    cfg.pad          = 20; %increases resolution as the value goes up
                    cfg.foilim       = [1 30]; %1 to 30 Hz range
                    cfg.toi          = -.05:0.00001:.250; %time window from -50 ms to 250ms in 0.01ms steps

                    TFRwavelet = ft_freqanalysis(cfg, EEG_Data_Trial);

                    cfg = [];
                    cfg.baseline  = 'yes';
                    cfg.baselinetype = 'relchange';
                    [freq] = ft_freqbaseline(cfg, TFRwavelet)
                    cfg = [];

                    cfg.maskstyle = 'saturation';
                    cfg.zlim         =  'maxmin';
                    cfg.layout       = 'ordered';
                    cfg.showlabels   = 'yes';
                    cfg.showoutline      = 'yes';
                    [EEG_Spec] = ft_multiplotTFR(cfg, freq);


I really appreciate the help.

Kind Regards,

Daniel C.


From: fieldtrip <fieldtrip-bounces at science.ru.nl> On Behalf Of Schoffelen, J.M. (Jan Mathijs)
Sent: 19 June 2019 14:40
To: FieldTrip discussion list <fieldtrip at science.ru.nl>
Subject: Re: [FieldTrip] Issue with visualising EEG Spectrogram

Daniel, it looks as if the baseline correction is not applied. You’d need to specify cfg.baseline = ‘yes’ in order to achieve this.
Note also, that I again recommend to do the baseline correction in a separate step, not asking the plotting function to do it.
Recursive baseline corrections with a ‘relchange’ may be problematic, since at some point you start dividing by 0.
Best,
JanMathijs



On 19 Jun 2019, at 14:15, Daniel Campoy (CMP - Student) <D.Campoy at uea.ac.uk<mailto:D.Campoy at uea.ac.uk>> wrote:

Hi Jan-Mathijs,

Thank you for replying back to me.  I made the suggested changes and I’m seeing better results as the majority of the area is not as blue and on some of the channels I’m seeing a more defined shaped.  In case you are interested I attached the new results.  Overall I’m satisfied with the results and see in come trials a more clearer response.

I added a couple questions to two of your suggestions below.

This is the new block of code as well.

cfg              = [];
                    cfg.output       = 'pow'; %return power spectra
                    cfg.channel      = 'all';
                    cfg.method       = 'wltconvol';
                    %cfg.trials       = trigger_idx; %specify index location to find event in EEG_Data_Trial.trial
                    cfg.width        = 1; % 3 has shown some promise for results
                    cfg.gwidth       = 4; %decreasing this has shown to fill out are of the figure
                    cfg.pad          = 20; %increases resolution as the value goes up
                    cfg.foilim       = [1 30]; %1 to 30 Hz range
                    %cfg.toi          = -.10:0.0001:.35; %produced a full image time window from -100 ms to 350ms in 0.1ms steps
                    cfg.toi          = -.05:0.00001:.250; %time window from -50 ms to 250ms in 0.01ms steps

                    TFRwavelet = ft_freqanalysis(cfg, EEG_Data_Trial);
                    fprintf('\n Time-Freq wavelet for trigger index %u channel %s and processed %u trigger(s)\n',trigger_idx(i),channels{z},i)
                    %Create Image of EEG Spectrogram to output cdat matrix
                    cfg = [];
                    %cfg.baselinetype = 'relchange';
                    cfg.maskstyle = 'saturation';
                    cfg.zlim         =  'maxmin';
                    cfg.layout       = 'ordered';
                    cfg.showlabels   = 'yes';
                    cfg.showoutline      = 'yes';
                    %subplot(2,4,z)%used to create figures of plotted channels
                    [EEG_Spec] = ft_multiplotTFR(cfg, TFRwavelet);





1 a). You can run ft_freqanalysis for all channels at once (without the for-loop)

From my understanding if I supply all channels for ft_freqanalysis and use ft_singleplotTFR then this will show one plot for a trial  with an average across all the channels (in my case 8).

1 b). You may want to use cfg.method = ‘wltconvol’ for ft_freqanalysis, rather than ‘wavelet’ , since it’s much faster with equivalent results.

2). Next, you can call ft_freqbaseline (again: only once, and perhaps use ‘relchange’ as a method) to ‘baseline correct' the spectrograms.

What are the consequences of  running this more than once?

3). Next, you can use ft_multiplotTFR on the baseline corrected variable, using a cfg.layout = ‘ordered’, and don’t specify any baseline correction options here.


If I use ft_singleplotTFR again would you recommend I omit the baseline parameter too?


I also want to add that when performing ft_freqanalysis I’m seeing these messages “Warning: output time-bins are different from input time-bins, multiples of the sametrial” for all my trails processing. When I’m looking at the trial cell data type and looking at the maxtrix defined inside their numbers are not same.  I was not able to find much information as to exactly how this is triggered. I did find the line of code the produces this but not entirely sure why it is triggered.  Is this message typically ignored?


Kind Regards,

Daniel C.

Sent from Mail<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgo.microsoft.com%2Ffwlink%2F%3FLinkId%3D550986&data=02%7C01%7CD.Campoy%40uea.ac.uk%7Cceb777a35f6c42538daf08d6f4bc3841%7Cc65f8795ba3d43518a070865e5d8f090%7C0%7C0%7C636965486572083954&sdata=tg81Kk8Ho0NnveTgFKTvoRsZtiTJ9xF1%2B05afgc%2BeGA%3D&reserved=0> for Windows 10

________________________________
From: fieldtrip <fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl>> on behalf of Schoffelen, J.M. (Jan Mathijs) <jan.schoffelen at donders.ru.nl<mailto:jan.schoffelen at donders.ru.nl>>
Sent: Wednesday, June 19, 2019 10:24:23 AM
To: FieldTrip discussion list
Subject: Re: [FieldTrip] Issue with visualising EEG Spectrogram

Hi Daniel,

May I suggest you to do 4 things, rather than trying to really understand why no apparent baselining seems to have been applied.

1 a). You can run ft_freqanalysis for all channels at once (without the for-loop)
1 b). You may want to use cfg.method = ‘wltconvol’ for ft_freqanalysis, rather than ‘wavelet’ , since it’s much faster with equivalent results.
2). Next, you can call ft_freqbaseline (again: only once, and perhaps use ‘relchange’ as a method) to ‘baseline correct' the spectrograms.
3). Next, you can use ft_multiplotTFR on the baseline corrected variable, using a cfg.layout = ‘ordered’, and don’t specify any baseline correction options here.

Best wishes,
Jan-Mathijs





On 18 Jun 2019, at 20:12, Daniel Campoy (CMP - Student) <D.Campoy at uea.ac.uk<mailto:D.Campoy at uea.ac.uk>> wrote:

Hello,

I have been stuck trying to understand the results I’m seeing so please forgive me as my background is not in neuroscience. I’m a Masters student working with EEG data for a classification project using Matlab 2017b.

I have been successful at visualising the data of a test subject for a specific trigger and plot all channels (dataset has 8 channels) from the trigger (image stimuli) using ft_singleplotTFR. Thus creating a 2x4 plot of images for all 8 channels.  However I’m stuck trying understand my results when I plot an EEG spectrogram using ft_singleplotTFR for each channel across all triggers (T=1 in my dataset) the data does not show what I’ve seen for separate channels. It displays a plot of 8 images filled blue and a fine yellow/green bar across the bottom.  The only thing I’ve changed is supplying all the trials instead of one at a time using a for loop to iterate through each trial for 8 channels. I’ve removed the for loop outside of the for loop of channels since I’m supplying all trials. Below is my code and process. Any insight would be much appreciated and if you need further information please let me know.  I’ve attached an image of the results of each channel across all triggers.


My first step is to load the .mat file I’ve saved containing all the defined trials. After this is complete, the below code is used to extract all the trigger events where the value in cfg.events is T=1.  I run the ft_preprocessingagain but for the defined trials I’m looking for T=1.

trigger = extractfield(cfg.event,'value');
channels = EEG_Data.cfg.channel;
trigger_idx = find(startsWith(trigger,'T=1'));
cfg.trials       = trigger_idx; %index location for all T=1 stimuli triggers
EEG_Data_Trial = ft_preprocessing(cfg,EEG_Data);


After completion the next block of code is ran for each channel. You may have noticed the cdat variable is in the output, this is me modifying the ft_singleplotTFR function to return the EEG spectrogram matrix I use for later analysis.


figure %used to create a figure of EEG Spectrograms

for z = 1:length(channels) %Collect the measurements from each channel for a given trigger
                    Img_idx = 1 + Img_idx;
                    cfg              = [];
                    cfg.output       = 'pow'; %return power spectra
                    cfg.channel      = channels{z};
                    cfg.method       = 'wavelet'; %use wavelet function
                    %cfg.trials       = trigger_idx; %specify index location to find event in EEG_Data_Trial.trial
                    cfg.width        = 1; % 3 has shown some promise for results
                    cfg.gwidth       = 4; %decreasing this has shown to fill out are of the figure
                    cfg.pad          = 20; %increases resolution as the value goes up
                    cfg.foilim       = [1 30]; %1 to 30 Hz range
                    %cfg.toi          = -.10:0.0001:.35; %produced a full image time window from -100 ms to 350ms in 0.1ms steps
                    cfg.toi          = -.05:0.00001:.250; %time window from -50 ms to 250ms in 0.01ms steps

                    TFRwavelet = ft_freqanalysis(cfg, EEG_Data_Trial);
                    fprintf('\n Time-Freq wavelet for trigger index %u channel %s and processed %u trigger(s)\n',trigger_idx(i),channels{z},i)
                    %Create Image of EEG Spectrogram to output cdat matrix
                    cfg = [];
                    cfg.baselinetype = 'absolute';
                    cfg.maskstyle = 'saturation';
                    cfg.zlim         =  'maxmin';
                    subplot(2,4,z)%used to create figures of plotted channels
                    [EEG_Spec,cdat] = ft_singleplotTFR(cfg, TFRwavelet);
                    subplot(2,4,z)%used to create figures of plotted channels
end

Thank you and kind regards,

Daniel C.
<OneSub_acrossTrails_T1.png>_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=02%7C01%7CD.Campoy%40uea.ac.uk%7Cceb777a35f6c42538daf08d6f4bc3841%7Cc65f8795ba3d43518a070865e5d8f090%7C0%7C0%7C636965486572093958&sdata=OAQIp0ZPne5jKOG%2FZfWA64S%2BtRwTqO%2FHEyu83JcrPFA%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=02%7C01%7CD.Campoy%40uea.ac.uk%7Cceb777a35f6c42538daf08d6f4bc3841%7Cc65f8795ba3d43518a070865e5d8f090%7C0%7C0%7C636965486572103975&sdata=OcCfSqAAnTFAkFtqByp9ySWis2JvsOlqVgtQCaEZY3g%3D&reserved=0>

<10HzSub02a_T1_All_Trials.png>_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=02%7C01%7CD.Campoy%40uea.ac.uk%7Cceb777a35f6c42538daf08d6f4bc3841%7Cc65f8795ba3d43518a070865e5d8f090%7C0%7C0%7C636965486572103975&sdata=GI%2Fq7ZakEjArOtXC1gzb18itK3IZYZiGk3KpjEU%2B0tE%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=02%7C01%7CD.Campoy%40uea.ac.uk%7Cceb777a35f6c42538daf08d6f4bc3841%7Cc65f8795ba3d43518a070865e5d8f090%7C0%7C0%7C636965486572113979&sdata=OOBbW7o%2BULlYJsZHmh%2F3g9DzDKAGpzMmrA6vR5tIFgI%3D&reserved=0>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190619/66392cd4/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 10HzSub02a_T1_All_Trials.png
Type: image/png
Size: 181992 bytes
Desc: 10HzSub02a_T1_All_Trials.png
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190619/66392cd4/attachment-0001.png>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From D.Campoy at uea.ac.uk  Wed Jun 19 18:17:00 2019
From: D.Campoy at uea.ac.uk (Daniel Campoy (CMP - Student))
Date: Wed, 19 Jun 2019 16:17:00 +0000
Subject: [FieldTrip] Issue with visualising EEG Spectrogram
In-Reply-To: <AM5PR0402MB2897288A769350F98BC79C25D4E50@AM5PR0402MB2897.eurprd04.prod.outlook.com>
References: <AM5PR0402MB28972B092462163BA419E0E8D4EA0@AM5PR0402MB2897.eurprd04.prod.outlook.com>
 <6EEF74B9-0596-4AB6-A5DB-B9D658837C32@donders.ru.nl>
 <AM5PR0402MB289795696B4666A832DA8731D4E50@AM5PR0402MB2897.eurprd04.prod.outlook.com>
 <228D12E4-959C-43C5-A915-DA2CE4A5E2F8@donders.ru.nl>
 <AM5PR0402MB2897288A769350F98BC79C25D4E50@AM5PR0402MB2897.eurprd04.prod.outlook.com>
Message-ID: <AM5PR0402MB2897B665CBB9CB81326C3EABD4E50@AM5PR0402MB2897.eurprd04.prod.outlook.com>

Hi JanMathijs,

I have a question about the baseline function and what I’m trying to accomplish. I would like to extract the matrix value for each channel for one trial and in my case have a MxNX8 matrix of the greyscale images the multiplotTFR would produce. My thought is to loop through the code I recently sent in my last email and supply one trial and all the channels for the multiplotTFR to process and return the information for that one trial. Would this decrease my chance of dividing by 0 if I call this block of code once per trial as I loop through each trial and call ft_freqanalysis > ft_freqbaseline > ft_multiplotTFR to return an MxNX8 matrix for me to store into a larger matrix, then saved after all the specific trials have been processed?

Thank you in advance,

Daniel C.

From: fieldtrip <fieldtrip-bounces at science.ru.nl> On Behalf Of Daniel Campoy (CMP - Student)
Sent: 19 June 2019 16:47
To: FieldTrip discussion list <fieldtrip at science.ru.nl>
Subject: Re: [FieldTrip] Issue with visualising EEG Spectrogram

Hi JanMathijs,

Thank you, sorry that I did not read your statement correctly about the baseline correction. I added ft_freqbaseline function between ft_freqanalysis and ft_multiplotTFR and I’m seeing a lot more detail of activation across time and frequency now that I’m not having the plot function perform the baseline.  Attached is the new image set.
cfg              = [];
                    cfg.output       = 'pow'; %return power spectra
                    cfg.channel      = 'all';
                    cfg.method       = 'wltconvol';
                    cfg.width        = 1; % 3 has shown some promise for results
                    cfg.gwidth       = 4; %decreasing this has shown to fill out are of the figure
                    cfg.pad          = 20; %increases resolution as the value goes up
                    cfg.foilim       = [1 30]; %1 to 30 Hz range
                    cfg.toi          = -.05:0.00001:.250; %time window from -50 ms to 250ms in 0.01ms steps

                    TFRwavelet = ft_freqanalysis(cfg, EEG_Data_Trial);

                    cfg = [];
                    cfg.baseline  = 'yes';
                    cfg.baselinetype = 'relchange';
                    [freq] = ft_freqbaseline(cfg, TFRwavelet)

                    cfg = [];

                    cfg.maskstyle = 'saturation';
                    cfg.zlim         =  'maxmin';
                    cfg.layout       = 'ordered';
                    cfg.showlabels   = 'yes';
                    cfg.showoutline      = 'yes';
                    [EEG_Spec] = ft_multiplotTFR(cfg, freq);


I really appreciate the help.

Kind Regards,

Daniel C.


From: fieldtrip <fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl>> On Behalf Of Schoffelen, J.M. (Jan Mathijs)
Sent: 19 June 2019 14:40
To: FieldTrip discussion list <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>>
Subject: Re: [FieldTrip] Issue with visualising EEG Spectrogram

Daniel, it looks as if the baseline correction is not applied. You’d need to specify cfg.baseline = ‘yes’ in order to achieve this.
Note also, that I again recommend to do the baseline correction in a separate step, not asking the plotting function to do it.
Recursive baseline corrections with a ‘relchange’ may be problematic, since at some point you start dividing by 0.
Best,
JanMathijs


On 19 Jun 2019, at 14:15, Daniel Campoy (CMP - Student) <D.Campoy at uea.ac.uk<mailto:D.Campoy at uea.ac.uk>> wrote:

Hi Jan-Mathijs,

Thank you for replying back to me.  I made the suggested changes and I’m seeing better results as the majority of the area is not as blue and on some of the channels I’m seeing a more defined shaped.  In case you are interested I attached the new results.  Overall I’m satisfied with the results and see in come trials a more clearer response.

I added a couple questions to two of your suggestions below.

This is the new block of code as well.

cfg              = [];
                    cfg.output       = 'pow'; %return power spectra
                    cfg.channel      = 'all';
                    cfg.method       = 'wltconvol';
                    %cfg.trials       = trigger_idx; %specify index location to find event in EEG_Data_Trial.trial
                    cfg.width        = 1; % 3 has shown some promise for results
                    cfg.gwidth       = 4; %decreasing this has shown to fill out are of the figure
                    cfg.pad          = 20; %increases resolution as the value goes up
                    cfg.foilim       = [1 30]; %1 to 30 Hz range
                    %cfg.toi          = -.10:0.0001:.35; %produced a full image time window from -100 ms to 350ms in 0.1ms steps
                    cfg.toi          = -.05:0.00001:.250; %time window from -50 ms to 250ms in 0.01ms steps

                    TFRwavelet = ft_freqanalysis(cfg, EEG_Data_Trial);
                    fprintf('\n Time-Freq wavelet for trigger index %u channel %s and processed %u trigger(s)\n',trigger_idx(i),channels{z},i)
                    %Create Image of EEG Spectrogram to output cdat matrix
                    cfg = [];
                    %cfg.baselinetype = 'relchange';
                    cfg.maskstyle = 'saturation';
                    cfg.zlim         =  'maxmin';
                    cfg.layout       = 'ordered';
                    cfg.showlabels   = 'yes';
                    cfg.showoutline      = 'yes';
                    %subplot(2,4,z)%used to create figures of plotted channels
                    [EEG_Spec] = ft_multiplotTFR(cfg, TFRwavelet);





1 a). You can run ft_freqanalysis for all channels at once (without the for-loop)

From my understanding if I supply all channels for ft_freqanalysis and use ft_singleplotTFR then this will show one plot for a trial  with an average across all the channels (in my case 8).

1 b). You may want to use cfg.method = ‘wltconvol’ for ft_freqanalysis, rather than ‘wavelet’ , since it’s much faster with equivalent results.

2). Next, you can call ft_freqbaseline (again: only once, and perhaps use ‘relchange’ as a method) to ‘baseline correct' the spectrograms.

What are the consequences of  running this more than once?

3). Next, you can use ft_multiplotTFR on the baseline corrected variable, using a cfg.layout = ‘ordered’, and don’t specify any baseline correction options here.


If I use ft_singleplotTFR again would you recommend I omit the baseline parameter too?


I also want to add that when performing ft_freqanalysis I’m seeing these messages “Warning: output time-bins are different from input time-bins, multiples of the sametrial” for all my trails processing. When I’m looking at the trial cell data type and looking at the maxtrix defined inside their numbers are not same.  I was not able to find much information as to exactly how this is triggered. I did find the line of code the produces this but not entirely sure why it is triggered.  Is this message typically ignored?


Kind Regards,

Daniel C.

Sent from Mail<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgo.microsoft.com%2Ffwlink%2F%3FLinkId%3D550986&data=02%7C01%7CD.Campoy%40uea.ac.uk%7C13df5a4674c4460dfd2208d6f4ce27fe%7Cc65f8795ba3d43518a070865e5d8f090%7C0%7C0%7C636965563613904295&sdata=%2F8x87VgyGgcYcxKounMf8eO3LNNCO5rySUKIQ54mr6Q%3D&reserved=0> for Windows 10

________________________________
From: fieldtrip <fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl>> on behalf of Schoffelen, J.M. (Jan Mathijs) <jan.schoffelen at donders.ru.nl<mailto:jan.schoffelen at donders.ru.nl>>
Sent: Wednesday, June 19, 2019 10:24:23 AM
To: FieldTrip discussion list
Subject: Re: [FieldTrip] Issue with visualising EEG Spectrogram

Hi Daniel,

May I suggest you to do 4 things, rather than trying to really understand why no apparent baselining seems to have been applied.

1 a). You can run ft_freqanalysis for all channels at once (without the for-loop)
1 b). You may want to use cfg.method = ‘wltconvol’ for ft_freqanalysis, rather than ‘wavelet’ , since it’s much faster with equivalent results.
2). Next, you can call ft_freqbaseline (again: only once, and perhaps use ‘relchange’ as a method) to ‘baseline correct' the spectrograms.
3). Next, you can use ft_multiplotTFR on the baseline corrected variable, using a cfg.layout = ‘ordered’, and don’t specify any baseline correction options here.

Best wishes,
Jan-Mathijs




On 18 Jun 2019, at 20:12, Daniel Campoy (CMP - Student) <D.Campoy at uea.ac.uk<mailto:D.Campoy at uea.ac.uk>> wrote:

Hello,

I have been stuck trying to understand the results I’m seeing so please forgive me as my background is not in neuroscience. I’m a Masters student working with EEG data for a classification project using Matlab 2017b.

I have been successful at visualising the data of a test subject for a specific trigger and plot all channels (dataset has 8 channels) from the trigger (image stimuli) using ft_singleplotTFR. Thus creating a 2x4 plot of images for all 8 channels.  However I’m stuck trying understand my results when I plot an EEG spectrogram using ft_singleplotTFR for each channel across all triggers (T=1 in my dataset) the data does not show what I’ve seen for separate channels. It displays a plot of 8 images filled blue and a fine yellow/green bar across the bottom.  The only thing I’ve changed is supplying all the trials instead of one at a time using a for loop to iterate through each trial for 8 channels. I’ve removed the for loop outside of the for loop of channels since I’m supplying all trials. Below is my code and process. Any insight would be much appreciated and if you need further information please let me know.  I’ve attached an image of the results of each channel across all triggers.


My first step is to load the .mat file I’ve saved containing all the defined trials. After this is complete, the below code is used to extract all the trigger events where the value in cfg.events is T=1.  I run the ft_preprocessingagain but for the defined trials I’m looking for T=1.

trigger = extractfield(cfg.event,'value');
channels = EEG_Data.cfg.channel;
trigger_idx = find(startsWith(trigger,'T=1'));
cfg.trials       = trigger_idx; %index location for all T=1 stimuli triggers
EEG_Data_Trial = ft_preprocessing(cfg,EEG_Data);


After completion the next block of code is ran for each channel. You may have noticed the cdat variable is in the output, this is me modifying the ft_singleplotTFR function to return the EEG spectrogram matrix I use for later analysis.


figure %used to create a figure of EEG Spectrograms

for z = 1:length(channels) %Collect the measurements from each channel for a given trigger
                    Img_idx = 1 + Img_idx;
                    cfg              = [];
                    cfg.output       = 'pow'; %return power spectra
                    cfg.channel      = channels{z};
                    cfg.method       = 'wavelet'; %use wavelet function
                    %cfg.trials       = trigger_idx; %specify index location to find event in EEG_Data_Trial.trial
                    cfg.width        = 1; % 3 has shown some promise for results
                    cfg.gwidth       = 4; %decreasing this has shown to fill out are of the figure
                    cfg.pad          = 20; %increases resolution as the value goes up
                    cfg.foilim       = [1 30]; %1 to 30 Hz range
                    %cfg.toi          = -.10:0.0001:.35; %produced a full image time window from -100 ms to 350ms in 0.1ms steps
                    cfg.toi          = -.05:0.00001:.250; %time window from -50 ms to 250ms in 0.01ms steps

                    TFRwavelet = ft_freqanalysis(cfg, EEG_Data_Trial);
                    fprintf('\n Time-Freq wavelet for trigger index %u channel %s and processed %u trigger(s)\n',trigger_idx(i),channels{z},i)
                    %Create Image of EEG Spectrogram to output cdat matrix
                    cfg = [];
                    cfg.baselinetype = 'absolute';
                    cfg.maskstyle = 'saturation';
                    cfg.zlim         =  'maxmin';
                    subplot(2,4,z)%used to create figures of plotted channels
                    [EEG_Spec,cdat] = ft_singleplotTFR(cfg, TFRwavelet);
                    subplot(2,4,z)%used to create figures of plotted channels
end

Thank you and kind regards,

Daniel C.
<OneSub_acrossTrails_T1.png>_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=02%7C01%7CD.Campoy%40uea.ac.uk%7C13df5a4674c4460dfd2208d6f4ce27fe%7Cc65f8795ba3d43518a070865e5d8f090%7C0%7C0%7C636965563613914304&sdata=PcF0JnJK%2BWjTsUR7465kha%2Fq7VUJmULAgMg7YeXkKf4%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=02%7C01%7CD.Campoy%40uea.ac.uk%7C13df5a4674c4460dfd2208d6f4ce27fe%7Cc65f8795ba3d43518a070865e5d8f090%7C0%7C0%7C636965563613924316&sdata=AigpbJwlrse%2FYbcvQOamGZzd6pxj%2F31ypegOvdoqsQc%3D&reserved=0>

<10HzSub02a_T1_All_Trials.png>_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=02%7C01%7CD.Campoy%40uea.ac.uk%7C13df5a4674c4460dfd2208d6f4ce27fe%7Cc65f8795ba3d43518a070865e5d8f090%7C0%7C0%7C636965563613934320&sdata=akNH%2Be4xejHHE6bdjPkY3H8%2B68QbdAlYjbXgLqsrNZI%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=02%7C01%7CD.Campoy%40uea.ac.uk%7C13df5a4674c4460dfd2208d6f4ce27fe%7Cc65f8795ba3d43518a070865e5d8f090%7C0%7C0%7C636965563613934320&sdata=ztF9gc2bjEWDXxG%2F1sc21R6KQeR1rflin%2BGOAGz0MSY%3D&reserved=0>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190619/e86a46fd/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From D.Campoy at uea.ac.uk  Wed Jun 19 18:17:00 2019
From: D.Campoy at uea.ac.uk (Daniel Campoy (CMP - Student))
Date: Wed, 19 Jun 2019 16:17:00 +0000
Subject: [FieldTrip] Issue with visualising EEG Spectrogram
In-Reply-To: <AM5PR0402MB2897288A769350F98BC79C25D4E50@AM5PR0402MB2897.eurprd04.prod.outlook.com>
References: <AM5PR0402MB28972B092462163BA419E0E8D4EA0@AM5PR0402MB2897.eurprd04.prod.outlook.com>
 <6EEF74B9-0596-4AB6-A5DB-B9D658837C32@donders.ru.nl>
 <AM5PR0402MB289795696B4666A832DA8731D4E50@AM5PR0402MB2897.eurprd04.prod.outlook.com>
 <228D12E4-959C-43C5-A915-DA2CE4A5E2F8@donders.ru.nl>
 <AM5PR0402MB2897288A769350F98BC79C25D4E50@AM5PR0402MB2897.eurprd04.prod.outlook.com>
Message-ID: <AM5PR0402MB2897B665CBB9CB81326C3EABD4E50@AM5PR0402MB2897.eurprd04.prod.outlook.com>

Hi JanMathijs,

I have a question about the baseline function and what I’m trying to accomplish. I would like to extract the matrix value for each channel for one trial and in my case have a MxNX8 matrix of the greyscale images the multiplotTFR would produce. My thought is to loop through the code I recently sent in my last email and supply one trial and all the channels for the multiplotTFR to process and return the information for that one trial. Would this decrease my chance of dividing by 0 if I call this block of code once per trial as I loop through each trial and call ft_freqanalysis > ft_freqbaseline > ft_multiplotTFR to return an MxNX8 matrix for me to store into a larger matrix, then saved after all the specific trials have been processed?

Thank you in advance,

Daniel C.

From: fieldtrip <fieldtrip-bounces at science.ru.nl> On Behalf Of Daniel Campoy (CMP - Student)
Sent: 19 June 2019 16:47
To: FieldTrip discussion list <fieldtrip at science.ru.nl>
Subject: Re: [FieldTrip] Issue with visualising EEG Spectrogram

Hi JanMathijs,

Thank you, sorry that I did not read your statement correctly about the baseline correction. I added ft_freqbaseline function between ft_freqanalysis and ft_multiplotTFR and I’m seeing a lot more detail of activation across time and frequency now that I’m not having the plot function perform the baseline.  Attached is the new image set.
cfg              = [];
                    cfg.output       = 'pow'; %return power spectra
                    cfg.channel      = 'all';
                    cfg.method       = 'wltconvol';
                    cfg.width        = 1; % 3 has shown some promise for results
                    cfg.gwidth       = 4; %decreasing this has shown to fill out are of the figure
                    cfg.pad          = 20; %increases resolution as the value goes up
                    cfg.foilim       = [1 30]; %1 to 30 Hz range
                    cfg.toi          = -.05:0.00001:.250; %time window from -50 ms to 250ms in 0.01ms steps

                    TFRwavelet = ft_freqanalysis(cfg, EEG_Data_Trial);

                    cfg = [];
                    cfg.baseline  = 'yes';
                    cfg.baselinetype = 'relchange';
                    [freq] = ft_freqbaseline(cfg, TFRwavelet)

                    cfg = [];

                    cfg.maskstyle = 'saturation';
                    cfg.zlim         =  'maxmin';
                    cfg.layout       = 'ordered';
                    cfg.showlabels   = 'yes';
                    cfg.showoutline      = 'yes';
                    [EEG_Spec] = ft_multiplotTFR(cfg, freq);


I really appreciate the help.

Kind Regards,

Daniel C.


From: fieldtrip <fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl>> On Behalf Of Schoffelen, J.M. (Jan Mathijs)
Sent: 19 June 2019 14:40
To: FieldTrip discussion list <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>>
Subject: Re: [FieldTrip] Issue with visualising EEG Spectrogram

Daniel, it looks as if the baseline correction is not applied. You’d need to specify cfg.baseline = ‘yes’ in order to achieve this.
Note also, that I again recommend to do the baseline correction in a separate step, not asking the plotting function to do it.
Recursive baseline corrections with a ‘relchange’ may be problematic, since at some point you start dividing by 0.
Best,
JanMathijs


On 19 Jun 2019, at 14:15, Daniel Campoy (CMP - Student) <D.Campoy at uea.ac.uk<mailto:D.Campoy at uea.ac.uk>> wrote:

Hi Jan-Mathijs,

Thank you for replying back to me.  I made the suggested changes and I’m seeing better results as the majority of the area is not as blue and on some of the channels I’m seeing a more defined shaped.  In case you are interested I attached the new results.  Overall I’m satisfied with the results and see in come trials a more clearer response.

I added a couple questions to two of your suggestions below.

This is the new block of code as well.

cfg              = [];
                    cfg.output       = 'pow'; %return power spectra
                    cfg.channel      = 'all';
                    cfg.method       = 'wltconvol';
                    %cfg.trials       = trigger_idx; %specify index location to find event in EEG_Data_Trial.trial
                    cfg.width        = 1; % 3 has shown some promise for results
                    cfg.gwidth       = 4; %decreasing this has shown to fill out are of the figure
                    cfg.pad          = 20; %increases resolution as the value goes up
                    cfg.foilim       = [1 30]; %1 to 30 Hz range
                    %cfg.toi          = -.10:0.0001:.35; %produced a full image time window from -100 ms to 350ms in 0.1ms steps
                    cfg.toi          = -.05:0.00001:.250; %time window from -50 ms to 250ms in 0.01ms steps

                    TFRwavelet = ft_freqanalysis(cfg, EEG_Data_Trial);
                    fprintf('\n Time-Freq wavelet for trigger index %u channel %s and processed %u trigger(s)\n',trigger_idx(i),channels{z},i)
                    %Create Image of EEG Spectrogram to output cdat matrix
                    cfg = [];
                    %cfg.baselinetype = 'relchange';
                    cfg.maskstyle = 'saturation';
                    cfg.zlim         =  'maxmin';
                    cfg.layout       = 'ordered';
                    cfg.showlabels   = 'yes';
                    cfg.showoutline      = 'yes';
                    %subplot(2,4,z)%used to create figures of plotted channels
                    [EEG_Spec] = ft_multiplotTFR(cfg, TFRwavelet);





1 a). You can run ft_freqanalysis for all channels at once (without the for-loop)

From my understanding if I supply all channels for ft_freqanalysis and use ft_singleplotTFR then this will show one plot for a trial  with an average across all the channels (in my case 8).

1 b). You may want to use cfg.method = ‘wltconvol’ for ft_freqanalysis, rather than ‘wavelet’ , since it’s much faster with equivalent results.

2). Next, you can call ft_freqbaseline (again: only once, and perhaps use ‘relchange’ as a method) to ‘baseline correct' the spectrograms.

What are the consequences of  running this more than once?

3). Next, you can use ft_multiplotTFR on the baseline corrected variable, using a cfg.layout = ‘ordered’, and don’t specify any baseline correction options here.


If I use ft_singleplotTFR again would you recommend I omit the baseline parameter too?


I also want to add that when performing ft_freqanalysis I’m seeing these messages “Warning: output time-bins are different from input time-bins, multiples of the sametrial” for all my trails processing. When I’m looking at the trial cell data type and looking at the maxtrix defined inside their numbers are not same.  I was not able to find much information as to exactly how this is triggered. I did find the line of code the produces this but not entirely sure why it is triggered.  Is this message typically ignored?


Kind Regards,

Daniel C.

Sent from Mail<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgo.microsoft.com%2Ffwlink%2F%3FLinkId%3D550986&data=02%7C01%7CD.Campoy%40uea.ac.uk%7C13df5a4674c4460dfd2208d6f4ce27fe%7Cc65f8795ba3d43518a070865e5d8f090%7C0%7C0%7C636965563613904295&sdata=%2F8x87VgyGgcYcxKounMf8eO3LNNCO5rySUKIQ54mr6Q%3D&reserved=0> for Windows 10

________________________________
From: fieldtrip <fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl>> on behalf of Schoffelen, J.M. (Jan Mathijs) <jan.schoffelen at donders.ru.nl<mailto:jan.schoffelen at donders.ru.nl>>
Sent: Wednesday, June 19, 2019 10:24:23 AM
To: FieldTrip discussion list
Subject: Re: [FieldTrip] Issue with visualising EEG Spectrogram

Hi Daniel,

May I suggest you to do 4 things, rather than trying to really understand why no apparent baselining seems to have been applied.

1 a). You can run ft_freqanalysis for all channels at once (without the for-loop)
1 b). You may want to use cfg.method = ‘wltconvol’ for ft_freqanalysis, rather than ‘wavelet’ , since it’s much faster with equivalent results.
2). Next, you can call ft_freqbaseline (again: only once, and perhaps use ‘relchange’ as a method) to ‘baseline correct' the spectrograms.
3). Next, you can use ft_multiplotTFR on the baseline corrected variable, using a cfg.layout = ‘ordered’, and don’t specify any baseline correction options here.

Best wishes,
Jan-Mathijs




On 18 Jun 2019, at 20:12, Daniel Campoy (CMP - Student) <D.Campoy at uea.ac.uk<mailto:D.Campoy at uea.ac.uk>> wrote:

Hello,

I have been stuck trying to understand the results I’m seeing so please forgive me as my background is not in neuroscience. I’m a Masters student working with EEG data for a classification project using Matlab 2017b.

I have been successful at visualising the data of a test subject for a specific trigger and plot all channels (dataset has 8 channels) from the trigger (image stimuli) using ft_singleplotTFR. Thus creating a 2x4 plot of images for all 8 channels.  However I’m stuck trying understand my results when I plot an EEG spectrogram using ft_singleplotTFR for each channel across all triggers (T=1 in my dataset) the data does not show what I’ve seen for separate channels. It displays a plot of 8 images filled blue and a fine yellow/green bar across the bottom.  The only thing I’ve changed is supplying all the trials instead of one at a time using a for loop to iterate through each trial for 8 channels. I’ve removed the for loop outside of the for loop of channels since I’m supplying all trials. Below is my code and process. Any insight would be much appreciated and if you need further information please let me know.  I’ve attached an image of the results of each channel across all triggers.


My first step is to load the .mat file I’ve saved containing all the defined trials. After this is complete, the below code is used to extract all the trigger events where the value in cfg.events is T=1.  I run the ft_preprocessingagain but for the defined trials I’m looking for T=1.

trigger = extractfield(cfg.event,'value');
channels = EEG_Data.cfg.channel;
trigger_idx = find(startsWith(trigger,'T=1'));
cfg.trials       = trigger_idx; %index location for all T=1 stimuli triggers
EEG_Data_Trial = ft_preprocessing(cfg,EEG_Data);


After completion the next block of code is ran for each channel. You may have noticed the cdat variable is in the output, this is me modifying the ft_singleplotTFR function to return the EEG spectrogram matrix I use for later analysis.


figure %used to create a figure of EEG Spectrograms

for z = 1:length(channels) %Collect the measurements from each channel for a given trigger
                    Img_idx = 1 + Img_idx;
                    cfg              = [];
                    cfg.output       = 'pow'; %return power spectra
                    cfg.channel      = channels{z};
                    cfg.method       = 'wavelet'; %use wavelet function
                    %cfg.trials       = trigger_idx; %specify index location to find event in EEG_Data_Trial.trial
                    cfg.width        = 1; % 3 has shown some promise for results
                    cfg.gwidth       = 4; %decreasing this has shown to fill out are of the figure
                    cfg.pad          = 20; %increases resolution as the value goes up
                    cfg.foilim       = [1 30]; %1 to 30 Hz range
                    %cfg.toi          = -.10:0.0001:.35; %produced a full image time window from -100 ms to 350ms in 0.1ms steps
                    cfg.toi          = -.05:0.00001:.250; %time window from -50 ms to 250ms in 0.01ms steps

                    TFRwavelet = ft_freqanalysis(cfg, EEG_Data_Trial);
                    fprintf('\n Time-Freq wavelet for trigger index %u channel %s and processed %u trigger(s)\n',trigger_idx(i),channels{z},i)
                    %Create Image of EEG Spectrogram to output cdat matrix
                    cfg = [];
                    cfg.baselinetype = 'absolute';
                    cfg.maskstyle = 'saturation';
                    cfg.zlim         =  'maxmin';
                    subplot(2,4,z)%used to create figures of plotted channels
                    [EEG_Spec,cdat] = ft_singleplotTFR(cfg, TFRwavelet);
                    subplot(2,4,z)%used to create figures of plotted channels
end

Thank you and kind regards,

Daniel C.
<OneSub_acrossTrails_T1.png>_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=02%7C01%7CD.Campoy%40uea.ac.uk%7C13df5a4674c4460dfd2208d6f4ce27fe%7Cc65f8795ba3d43518a070865e5d8f090%7C0%7C0%7C636965563613914304&sdata=PcF0JnJK%2BWjTsUR7465kha%2Fq7VUJmULAgMg7YeXkKf4%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=02%7C01%7CD.Campoy%40uea.ac.uk%7C13df5a4674c4460dfd2208d6f4ce27fe%7Cc65f8795ba3d43518a070865e5d8f090%7C0%7C0%7C636965563613924316&sdata=AigpbJwlrse%2FYbcvQOamGZzd6pxj%2F31ypegOvdoqsQc%3D&reserved=0>

<10HzSub02a_T1_All_Trials.png>_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=02%7C01%7CD.Campoy%40uea.ac.uk%7C13df5a4674c4460dfd2208d6f4ce27fe%7Cc65f8795ba3d43518a070865e5d8f090%7C0%7C0%7C636965563613934320&sdata=akNH%2Be4xejHHE6bdjPkY3H8%2B68QbdAlYjbXgLqsrNZI%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=02%7C01%7CD.Campoy%40uea.ac.uk%7C13df5a4674c4460dfd2208d6f4ce27fe%7Cc65f8795ba3d43518a070865e5d8f090%7C0%7C0%7C636965563613934320&sdata=ztF9gc2bjEWDXxG%2F1sc21R6KQeR1rflin%2BGOAGz0MSY%3D&reserved=0>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190619/e86a46fd/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From rajankashyap6 at gmail.com  Thu Jun 20 12:29:07 2019
From: rajankashyap6 at gmail.com (Rajan Kashyap)
Date: Thu, 20 Jun 2019 18:29:07 +0800
Subject: [FieldTrip] A query for solution
Message-ID: <CADumxLaSsfUoZut+y-_qO=Y3spCJ5J+UdcuNqDLnuCMsueKBBw@mail.gmail.com>

Dear all
I have used AAL atlas to parcellate my resting state fMRI data. So the
matrix is (Resting state Matrix =Spatial areas x Number of Volumes). I used
PCA on each subject and obtained the first PCA component. The matrix
becomes (Spatial Areas x 1).
I wanted to overlay the PCA component to the atlas so that I can visualise
the component across the spatial areas. I could see the function
*ft_datatype_parcellation* that could possibly project the data to the the
atlas. Am I right, or is their any other function. Can anyone help me with
the procedure?

Regards
Rajan Kashyap
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190620/ef86cb91/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From rajankashyap6 at gmail.com  Thu Jun 20 12:29:07 2019
From: rajankashyap6 at gmail.com (Rajan Kashyap)
Date: Thu, 20 Jun 2019 18:29:07 +0800
Subject: [FieldTrip] A query for solution
Message-ID: <CADumxLaSsfUoZut+y-_qO=Y3spCJ5J+UdcuNqDLnuCMsueKBBw@mail.gmail.com>

Dear all
I have used AAL atlas to parcellate my resting state fMRI data. So the
matrix is (Resting state Matrix =Spatial areas x Number of Volumes). I used
PCA on each subject and obtained the first PCA component. The matrix
becomes (Spatial Areas x 1).
I wanted to overlay the PCA component to the atlas so that I can visualise
the component across the spatial areas. I could see the function
*ft_datatype_parcellation* that could possibly project the data to the the
atlas. Am I right, or is their any other function. Can anyone help me with
the procedure?

Regards
Rajan Kashyap
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190620/ef86cb91/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From edoardo.pinzuti at gmail.com  Thu Jun 20 15:30:39 2019
From: edoardo.pinzuti at gmail.com (Edoardo Pinzuti)
Date: Thu, 20 Jun 2019 15:30:39 +0200
Subject: [FieldTrip] spectral_granger
Message-ID: <CAKN_vchJFhmKxana3xadhfnAaGJf8CmyAYsW47TWucDPXFP9QQ@mail.gmail.com>

Dear all,

Looking at the code for conditional spectral Granger it looks like that if
one want to derive GC from s1 to s2 conditional on the rest e.g. s3, the
nonparametric spectral factorization is computed on cross-spectral matrix
containing all s1,s2,s3 areas and  on cross-spectral matrix containing s2
and s3. These two factorization are used to derive GC from s1 to s2
conditional on the rest.

Suppose s1  has two components:  s1a and s1b , s2 as well: s2a and s2b and
so on, I would like to compute the conditional Granger as before from s1 to
s2 using a blockwise approach (where s1a and s1b are one block etc). These
blocks can be specified with cfg.granger.block and channels combination ?
Since it is poorly documented someone can provide a simple example ?

thanks
Edoardo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190620/158eddcc/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From edoardo.pinzuti at gmail.com  Thu Jun 20 15:30:39 2019
From: edoardo.pinzuti at gmail.com (Edoardo Pinzuti)
Date: Thu, 20 Jun 2019 15:30:39 +0200
Subject: [FieldTrip] spectral_granger
Message-ID: <CAKN_vchJFhmKxana3xadhfnAaGJf8CmyAYsW47TWucDPXFP9QQ@mail.gmail.com>

Dear all,

Looking at the code for conditional spectral Granger it looks like that if
one want to derive GC from s1 to s2 conditional on the rest e.g. s3, the
nonparametric spectral factorization is computed on cross-spectral matrix
containing all s1,s2,s3 areas and  on cross-spectral matrix containing s2
and s3. These two factorization are used to derive GC from s1 to s2
conditional on the rest.

Suppose s1  has two components:  s1a and s1b , s2 as well: s2a and s2b and
so on, I would like to compute the conditional Granger as before from s1 to
s2 using a blockwise approach (where s1a and s1b are one block etc). These
blocks can be specified with cfg.granger.block and channels combination ?
Since it is poorly documented someone can provide a simple example ?

thanks
Edoardo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190620/158eddcc/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From longo.luca at gmail.com  Sun Jun 23 11:15:26 2019
From: longo.luca at gmail.com (Luca L.)
Date: Sun, 23 Jun 2019 10:15:26 +0100
Subject: [FieldTrip] labeling EEG maps against mental workload
Message-ID: <CAGxtvSNd7kCDTL_yqdKC4aq+b8Jg_s=73FpSfKhKpKQQQGabbA@mail.gmail.com>

Dear community

I was wondering whether you can help me with the problem described below.

I have 5 head maps (for different  EEG bands, horizontally displayed),
produced from 32 electrodes (10-20 system). Each picture (sets of 5
horizontal head maps) is the summary of 1 second EEG activity. Each head
map uses colors for power ( BLUE -> very low power; RED -> very high power
for that band)

I would need:
1) given 5 head maps (horizontally displayed and representing 1 second of
activity via different EEG bands), how can I extract a representative class
of mental workload (for that 1 second)
2) if the above is possible, does it require a human expert who can label
via visual inspection or can this labeling be done automatically?
3) which theories/procedures/methods would you use for enabling this
mapping and could you explain how this can be done in details please?

Thanking you in advance for your kind help, I wish you all a nice day.
Luca



Example 1
[image: 500-502.png]
Example 2
[image: 100-102.png]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190623/539e1e12/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 100-102.png
Type: image/png
Size: 257760 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190623/539e1e12/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 500-502.png
Type: image/png
Size: 246733 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190623/539e1e12/attachment-0001.png>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From longo.luca at gmail.com  Sun Jun 23 11:15:26 2019
From: longo.luca at gmail.com (Luca L.)
Date: Sun, 23 Jun 2019 10:15:26 +0100
Subject: [FieldTrip] labeling EEG maps against mental workload
Message-ID: <CAGxtvSNd7kCDTL_yqdKC4aq+b8Jg_s=73FpSfKhKpKQQQGabbA@mail.gmail.com>

Dear community

I was wondering whether you can help me with the problem described below.

I have 5 head maps (for different  EEG bands, horizontally displayed),
produced from 32 electrodes (10-20 system). Each picture (sets of 5
horizontal head maps) is the summary of 1 second EEG activity. Each head
map uses colors for power ( BLUE -> very low power; RED -> very high power
for that band)

I would need:
1) given 5 head maps (horizontally displayed and representing 1 second of
activity via different EEG bands), how can I extract a representative class
of mental workload (for that 1 second)
2) if the above is possible, does it require a human expert who can label
via visual inspection or can this labeling be done automatically?
3) which theories/procedures/methods would you use for enabling this
mapping and could you explain how this can be done in details please?

Thanking you in advance for your kind help, I wish you all a nice day.
Luca



Example 1
[image: 500-502.png]
Example 2
[image: 100-102.png]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190623/539e1e12/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 100-102.png
Type: image/png
Size: 257760 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190623/539e1e12/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 500-502.png
Type: image/png
Size: 246733 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190623/539e1e12/attachment-0003.png>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From longo.luca at gmail.com  Tue Jun 25 10:36:21 2019
From: longo.luca at gmail.com (Luca L.)
Date: Tue, 25 Jun 2019 09:36:21 +0100
Subject: [FieldTrip] labeling EEG head maps against classes of mental
 workload
Message-ID: <CAGxtvSOM7o2GEbkAU0Kyg-MbX6MhyNP_6_ZT-9PhRkYqosdnWQ@mail.gmail.com>

Dear community

I was wondering whether you can help me with the problem described below.

I have 5 head maps (for different  EEG bands, horizontally displayed),
produced from 32 electrodes (10-20 system). Each picture (sets of 5
horizontal head maps) is the summary of 1 second of EEG recordings (not
confined to stimuli and randomly taken on the time line). Each head map
uses colors for power ( BLUE -> very low power; RED -> very high power for
that band)

I would need:
1) given 5 head maps (horizontally displayed and representing 1 second of
activity via different EEG bands), how can I extract a representative class
of mental workload (for that 1 second)
2) if the above is possible, does it require a human expert who can label
via visual inspection or can this labeling be done automatically?
3) which theories/procedures/methods would you use for enabling this
mapping and could you explain how this can be done in details please?

Thanking you in advance for your kind help, I wish you all a nice day.
Luca
[image: 500-502.png]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190625/29004288/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 500-502.png
Type: image/png
Size: 246733 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190625/29004288/attachment.png>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From longo.luca at gmail.com  Tue Jun 25 10:36:21 2019
From: longo.luca at gmail.com (Luca L.)
Date: Tue, 25 Jun 2019 09:36:21 +0100
Subject: [FieldTrip] labeling EEG head maps against classes of mental
 workload
Message-ID: <CAGxtvSOM7o2GEbkAU0Kyg-MbX6MhyNP_6_ZT-9PhRkYqosdnWQ@mail.gmail.com>

Dear community

I was wondering whether you can help me with the problem described below.

I have 5 head maps (for different  EEG bands, horizontally displayed),
produced from 32 electrodes (10-20 system). Each picture (sets of 5
horizontal head maps) is the summary of 1 second of EEG recordings (not
confined to stimuli and randomly taken on the time line). Each head map
uses colors for power ( BLUE -> very low power; RED -> very high power for
that band)

I would need:
1) given 5 head maps (horizontally displayed and representing 1 second of
activity via different EEG bands), how can I extract a representative class
of mental workload (for that 1 second)
2) if the above is possible, does it require a human expert who can label
via visual inspection or can this labeling be done automatically?
3) which theories/procedures/methods would you use for enabling this
mapping and could you explain how this can be done in details please?

Thanking you in advance for your kind help, I wish you all a nice day.
Luca
[image: 500-502.png]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190625/29004288/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 500-502.png
Type: image/png
Size: 246733 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190625/29004288/attachment-0001.png>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From tonychshug at 126.com  Tue Jun 25 11:41:36 2019
From: tonychshug at 126.com (Tony TREE)
Date: Tue, 25 Jun 2019 17:41:36 +0800 (CST)
Subject: [FieldTrip] Subject: Dysfunction with ft_definetrial
Message-ID: <24b331bf.7083.16b8e031b53.Coremail.tonychshug@126.com>

Subject: Dysfunction with ft_definetrial 


Dear Community,


My name is Tony Chen and I am a PhD student in neurorehabililtation from China. I am focusing on the research of brain computer interface on stroke rehabilitation. Currently I am analyzing EEG data which was recorded from Brain Products, Gilching, Germany.


I tried ft_definetrial but I received the following error message:
Error using fopen_or_error (line 24)
could not open file .
Error in load_curry_data_file (line 54)
fid = fopen_or_error(ParameterFile,'rt');
Error in ft_read_header (line 744)
    orig            = load_curry_data_file(filename);
Error in ft_trialfun_general (line 84)
  hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat);
Error in ft_definetrial (line 185)
    [trl, event] = feval(cfg.trialfun, cfg);


The cfg (run ft definetrial) and data (LM_1) I used are in the link: https://www.dropbox.com/sh/zggeusihhbeoeg0/AACWpO6MgiLr_lOTZRCzBm2ba?dl=0.


The versions I used are: Matlab R2013b, eeglab14_1_2b and fieldtrip-20190618. I have also tried Matlab 2019, eeglab13_5_4b, fieldtrip-20190606, fieldtrip-20131231 as well as fieldtrip-20121231. But they didn't work and came out with the same error.


Besides, I also run:
restoredefaultpath
addpath E:\fieldtrip-20190618
ft_defaults
but it still didn't work.


Now I have no idea of what is the problem. I am sincerely hoping that you can help me solve this problem. Waiting for your kind reply.


Regard,
Tony Chen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190625/c309f566/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From tonychshug at 126.com  Tue Jun 25 11:41:36 2019
From: tonychshug at 126.com (Tony TREE)
Date: Tue, 25 Jun 2019 17:41:36 +0800 (CST)
Subject: [FieldTrip] Subject: Dysfunction with ft_definetrial
Message-ID: <24b331bf.7083.16b8e031b53.Coremail.tonychshug@126.com>

Subject: Dysfunction with ft_definetrial 


Dear Community,


My name is Tony Chen and I am a PhD student in neurorehabililtation from China. I am focusing on the research of brain computer interface on stroke rehabilitation. Currently I am analyzing EEG data which was recorded from Brain Products, Gilching, Germany.


I tried ft_definetrial but I received the following error message:
Error using fopen_or_error (line 24)
could not open file .
Error in load_curry_data_file (line 54)
fid = fopen_or_error(ParameterFile,'rt');
Error in ft_read_header (line 744)
    orig            = load_curry_data_file(filename);
Error in ft_trialfun_general (line 84)
  hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat);
Error in ft_definetrial (line 185)
    [trl, event] = feval(cfg.trialfun, cfg);


The cfg (run ft definetrial) and data (LM_1) I used are in the link: https://www.dropbox.com/sh/zggeusihhbeoeg0/AACWpO6MgiLr_lOTZRCzBm2ba?dl=0.


The versions I used are: Matlab R2013b, eeglab14_1_2b and fieldtrip-20190618. I have also tried Matlab 2019, eeglab13_5_4b, fieldtrip-20190606, fieldtrip-20131231 as well as fieldtrip-20121231. But they didn't work and came out with the same error.


Besides, I also run:
restoredefaultpath
addpath E:\fieldtrip-20190618
ft_defaults
but it still didn't work.


Now I have no idea of what is the problem. I am sincerely hoping that you can help me solve this problem. Waiting for your kind reply.


Regard,
Tony Chen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190625/c309f566/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From julian.keil at gmail.com  Tue Jun 25 12:05:58 2019
From: julian.keil at gmail.com (Julian Keil)
Date: Tue, 25 Jun 2019 12:05:58 +0200
Subject: [FieldTrip] labeling EEG head maps against classes of mental
 workload
In-Reply-To: <CAGxtvSOM7o2GEbkAU0Kyg-MbX6MhyNP_6_ZT-9PhRkYqosdnWQ@mail.gmail.com>
References: <CAGxtvSOM7o2GEbkAU0Kyg-MbX6MhyNP_6_ZT-9PhRkYqosdnWQ@mail.gmail.com>
Message-ID: <9C19512D-32A7-4F3E-8E6A-2218DA92872D@gmail.com>

Dear Luca,

this seems to be more of conceptual problem than a fieldtrip-related problem, which is possibly why nobody has answered you so far.
The main problem with your question I see is that you are trying to infer a psychological concept (workload) from your electrophysiological data.
However, this is only possible if you know beforehand how your psychological concept maps to electrophysiology.
In other words, you need some sort of (e.g. behavioral) test to indicate your psychological concept, which you can then relate (e.g. via a correlation) to your EEG data.

I hope this helps,

Julian


________________
Prof. Dr. Julian Keil

Biological Psychology
Olshausenstrasse 62 - R. 306
24118 Kiel, Germany

+49 - 0431 - 880 - 4872
http://www.biopsych.uni-kiel.de/en


> Am 25.06.2019 um 10:36 schrieb Luca L. <longo.luca at gmail.com>:
> 
> Dear community
> 
> I was wondering whether you can help me with the problem described below.
> 
> I have 5 head maps (for different  EEG bands, horizontally displayed), produced from 32 electrodes (10-20 system). Each picture (sets of 5 horizontal head maps) is the summary of 1 second of EEG recordings (not confined to stimuli and randomly taken on the time line). Each head map uses colors for power ( BLUE -> very low power; RED -> very high power for that band)
> 
> I would need:
> 1) given 5 head maps (horizontally displayed and representing 1 second of activity via different EEG bands), how can I extract a representative class of mental workload (for that 1 second)
> 2) if the above is possible, does it require a human expert who can label via visual inspection or can this labeling be done automatically?
> 3) which theories/procedures/methods would you use for enabling this mapping and could you explain how this can be done in details please?
> 
> Thanking you in advance for your kind help, I wish you all a nice day.
> Luca
> <500-502.png>
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190625/33cb8a5c/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From julian.keil at gmail.com  Tue Jun 25 12:05:58 2019
From: julian.keil at gmail.com (Julian Keil)
Date: Tue, 25 Jun 2019 12:05:58 +0200
Subject: [FieldTrip] labeling EEG head maps against classes of mental
 workload
In-Reply-To: <CAGxtvSOM7o2GEbkAU0Kyg-MbX6MhyNP_6_ZT-9PhRkYqosdnWQ@mail.gmail.com>
References: <CAGxtvSOM7o2GEbkAU0Kyg-MbX6MhyNP_6_ZT-9PhRkYqosdnWQ@mail.gmail.com>
Message-ID: <9C19512D-32A7-4F3E-8E6A-2218DA92872D@gmail.com>

Dear Luca,

this seems to be more of conceptual problem than a fieldtrip-related problem, which is possibly why nobody has answered you so far.
The main problem with your question I see is that you are trying to infer a psychological concept (workload) from your electrophysiological data.
However, this is only possible if you know beforehand how your psychological concept maps to electrophysiology.
In other words, you need some sort of (e.g. behavioral) test to indicate your psychological concept, which you can then relate (e.g. via a correlation) to your EEG data.

I hope this helps,

Julian


________________
Prof. Dr. Julian Keil

Biological Psychology
Olshausenstrasse 62 - R. 306
24118 Kiel, Germany

+49 - 0431 - 880 - 4872
http://www.biopsych.uni-kiel.de/en


> Am 25.06.2019 um 10:36 schrieb Luca L. <longo.luca at gmail.com>:
> 
> Dear community
> 
> I was wondering whether you can help me with the problem described below.
> 
> I have 5 head maps (for different  EEG bands, horizontally displayed), produced from 32 electrodes (10-20 system). Each picture (sets of 5 horizontal head maps) is the summary of 1 second of EEG recordings (not confined to stimuli and randomly taken on the time line). Each head map uses colors for power ( BLUE -> very low power; RED -> very high power for that band)
> 
> I would need:
> 1) given 5 head maps (horizontally displayed and representing 1 second of activity via different EEG bands), how can I extract a representative class of mental workload (for that 1 second)
> 2) if the above is possible, does it require a human expert who can label via visual inspection or can this labeling be done automatically?
> 3) which theories/procedures/methods would you use for enabling this mapping and could you explain how this can be done in details please?
> 
> Thanking you in advance for your kind help, I wish you all a nice day.
> Luca
> <500-502.png>
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190625/33cb8a5c/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From r.oostenveld at donders.ru.nl  Tue Jun 25 13:52:40 2019
From: r.oostenveld at donders.ru.nl (Robert Oostenveld)
Date: Tue, 25 Jun 2019 13:52:40 +0200
Subject: [FieldTrip] BIDS for EEG and iEEG
Message-ID: <913F2B5A-8FCE-4B6B-8E6F-0D76B290A189@donders.ru.nl>

Dear FieldTrip community,

EEG-BIDS, an extension to the brain imaging data structure for electroencephalography <https://www.nature.com/articles/s41597-019-0104-8> and iEEG-BIDS, extending the Brain Imaging Data Structure specification to human intracranial electrophysiology <https://www.nature.com/articles/s41597-019-0105-7> have just been published in Scientific Data. These two papers describe the extension to the BIDS standard to allow it not only to store (f)MRI and MEG, but also EEG and iEEG data. The full specification is here <https://bids-specification.readthedocs.io/en/stable/>; you can find further documentation and examples to work with BIDS here <http://www.fieldtriptoolbox.org/example/bids/> on the FieldTrip website.

These extensions to the BIDS standard represent the joint effort of many EEG, iEEG and MEG researchers and method developers who believe that it is important to embrace Open Science, as well as Open Source. Sharing data is crucial for pushing research forward, not only for giving important insights in how the brain works, but also to further the development of data analysis methods, such as the FieldTrip toolbox.  

best regards,
Robert

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190625/42424438/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From r.oostenveld at donders.ru.nl  Tue Jun 25 13:52:40 2019
From: r.oostenveld at donders.ru.nl (Robert Oostenveld)
Date: Tue, 25 Jun 2019 13:52:40 +0200
Subject: [FieldTrip] BIDS for EEG and iEEG
Message-ID: <913F2B5A-8FCE-4B6B-8E6F-0D76B290A189@donders.ru.nl>

Dear FieldTrip community,

EEG-BIDS, an extension to the brain imaging data structure for electroencephalography <https://www.nature.com/articles/s41597-019-0104-8> and iEEG-BIDS, extending the Brain Imaging Data Structure specification to human intracranial electrophysiology <https://www.nature.com/articles/s41597-019-0105-7> have just been published in Scientific Data. These two papers describe the extension to the BIDS standard to allow it not only to store (f)MRI and MEG, but also EEG and iEEG data. The full specification is here <https://bids-specification.readthedocs.io/en/stable/>; you can find further documentation and examples to work with BIDS here <http://www.fieldtriptoolbox.org/example/bids/> on the FieldTrip website.

These extensions to the BIDS standard represent the joint effort of many EEG, iEEG and MEG researchers and method developers who believe that it is important to embrace Open Science, as well as Open Source. Sharing data is crucial for pushing research forward, not only for giving important insights in how the brain works, but also to further the development of data analysis methods, such as the FieldTrip toolbox.  

best regards,
Robert

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190625/42424438/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From i.zioga at qmul.ac.uk  Wed Jun 26 11:12:01 2019
From: i.zioga at qmul.ac.uk (Ioanna Zioga)
Date: Wed, 26 Jun 2019 09:12:01 +0000
Subject: [FieldTrip] TFR with different trial lengths
Message-ID: <AM0PR0702MB37301CE725325F2F155F2439DEE20@AM0PR0702MB3730.eurprd07.prod.outlook.com>

Hello Fieldtrip community!


I want to do TFR analysis on datasets with trials with different lengths (as I'm analysing the time period from the onset of a stimulus until participant's response, which differs from trial to trial).


These are the parameters:

cfgft                   = [];
cfgft.method    = 'tfr';
cfgft.output      = 'pow';
cfgft.foi              = exp(linspace(log(2),log(45),50));
cfgft.toi              = [];
cfgft.width         = 6;
cfgft.keeptrials  = 'yes';


The result I get from the freqanalysis (powspctrm) is a trial x chan x freq x time matrix, in which the time is the time of the trial with the largest duration. The datapoints of the trials with smaller durations are filled with zeros.


I would prefer to get the powspctrm without the zeros at the end, but maybe I can just exclude them later on from the analysis?

Do you know if Fieldtrip works fine with trials of different durations? And if there is any other more efficient way to analyse trials with different durations?


Any help would be extremely appreciated, thanks so much in advance!


Best wishes,

Ioanna

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190626/1a84dccb/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From i.zioga at qmul.ac.uk  Wed Jun 26 11:12:01 2019
From: i.zioga at qmul.ac.uk (Ioanna Zioga)
Date: Wed, 26 Jun 2019 09:12:01 +0000
Subject: [FieldTrip] TFR with different trial lengths
Message-ID: <AM0PR0702MB37301CE725325F2F155F2439DEE20@AM0PR0702MB3730.eurprd07.prod.outlook.com>

Hello Fieldtrip community!


I want to do TFR analysis on datasets with trials with different lengths (as I'm analysing the time period from the onset of a stimulus until participant's response, which differs from trial to trial).


These are the parameters:

cfgft                   = [];
cfgft.method    = 'tfr';
cfgft.output      = 'pow';
cfgft.foi              = exp(linspace(log(2),log(45),50));
cfgft.toi              = [];
cfgft.width         = 6;
cfgft.keeptrials  = 'yes';


The result I get from the freqanalysis (powspctrm) is a trial x chan x freq x time matrix, in which the time is the time of the trial with the largest duration. The datapoints of the trials with smaller durations are filled with zeros.


I would prefer to get the powspctrm without the zeros at the end, but maybe I can just exclude them later on from the analysis?

Do you know if Fieldtrip works fine with trials of different durations? And if there is any other more efficient way to analyse trials with different durations?


Any help would be extremely appreciated, thanks so much in advance!


Best wishes,

Ioanna

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190626/1a84dccb/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jan.schoffelen at donders.ru.nl  Wed Jun 26 11:30:51 2019
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Wed, 26 Jun 2019 09:30:51 +0000
Subject: [FieldTrip] TFR with different trial lengths
In-Reply-To: <AM0PR0702MB37301CE725325F2F155F2439DEE20@AM0PR0702MB3730.eurprd07.prod.outlook.com>
References: <AM0PR0702MB37301CE725325F2F155F2439DEE20@AM0PR0702MB3730.eurprd07.prod.outlook.com>
Message-ID: <481D453E-CF90-4794-B4BF-49A3198D582F@donders.ru.nl>

Dear Ioanna,

Yes, FieldTrip can work with trials of different duration. Normally, the missing data are represented as NaN, and not as a 0 (as it seems to be in your case). Many downstream functions know how to handle the missing data.

Could you try and run ft_freqanalysis with cfg.method = ‘wavelet’, and check whether there are now NaNs, instead of 0’s? The method ’tfr’ is very slow and not recommended. Therefore, this code is not very actively maintained, so it could be that the 0’s are just a remnant of a distant past. If so, this should be changed. Perhaps (once you have verified that indeed ’tfr’ returns 0’s, where ‘wavelet’ returns NaNs) you could look into how the correct impelmentation should be, and post a suggested fix to the ’tfr’-code on github as a PR?

Thanks in advance,

Jan-Mathijs


On 26 Jun 2019, at 11:12, Ioanna Zioga <i.zioga at qmul.ac.uk<mailto:i.zioga at qmul.ac.uk>> wrote:

Hello Fieldtrip community!

I want to do TFR analysis on datasets with trials with different lengths (as I'm analysing the time period from the onset of a stimulus until participant's response, which differs from trial to trial).

These are the parameters:

cfgft                   = [];
cfgft.method    = 'tfr';
cfgft.output      = 'pow';
cfgft.foi              = exp(linspace(log(2),log(45),50));
cfgft.toi              = [];
cfgft.width         = 6;
cfgft.keeptrials  = 'yes';


The result I get from the freqanalysis (powspctrm) is a trial x chan x freq x time matrix, in which the time is the time of the trial with the largest duration. The datapoints of the trials with smaller durations are filled with zeros.

I would prefer to get the powspctrm without the zeros at the end, but maybe I can just exclude them later on from the analysis?
Do you know if Fieldtrip works fine with trials of different durations? And if there is any other more efficient way to analyse trials with different durations?

Any help would be extremely appreciated, thanks so much in advance!

Best wishes,
Ioanna

_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190626/10aacd5a/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jan.schoffelen at donders.ru.nl  Wed Jun 26 11:30:51 2019
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Wed, 26 Jun 2019 09:30:51 +0000
Subject: [FieldTrip] TFR with different trial lengths
In-Reply-To: <AM0PR0702MB37301CE725325F2F155F2439DEE20@AM0PR0702MB3730.eurprd07.prod.outlook.com>
References: <AM0PR0702MB37301CE725325F2F155F2439DEE20@AM0PR0702MB3730.eurprd07.prod.outlook.com>
Message-ID: <481D453E-CF90-4794-B4BF-49A3198D582F@donders.ru.nl>

Dear Ioanna,

Yes, FieldTrip can work with trials of different duration. Normally, the missing data are represented as NaN, and not as a 0 (as it seems to be in your case). Many downstream functions know how to handle the missing data.

Could you try and run ft_freqanalysis with cfg.method = ‘wavelet’, and check whether there are now NaNs, instead of 0’s? The method ’tfr’ is very slow and not recommended. Therefore, this code is not very actively maintained, so it could be that the 0’s are just a remnant of a distant past. If so, this should be changed. Perhaps (once you have verified that indeed ’tfr’ returns 0’s, where ‘wavelet’ returns NaNs) you could look into how the correct impelmentation should be, and post a suggested fix to the ’tfr’-code on github as a PR?

Thanks in advance,

Jan-Mathijs


On 26 Jun 2019, at 11:12, Ioanna Zioga <i.zioga at qmul.ac.uk<mailto:i.zioga at qmul.ac.uk>> wrote:

Hello Fieldtrip community!

I want to do TFR analysis on datasets with trials with different lengths (as I'm analysing the time period from the onset of a stimulus until participant's response, which differs from trial to trial).

These are the parameters:

cfgft                   = [];
cfgft.method    = 'tfr';
cfgft.output      = 'pow';
cfgft.foi              = exp(linspace(log(2),log(45),50));
cfgft.toi              = [];
cfgft.width         = 6;
cfgft.keeptrials  = 'yes';


The result I get from the freqanalysis (powspctrm) is a trial x chan x freq x time matrix, in which the time is the time of the trial with the largest duration. The datapoints of the trials with smaller durations are filled with zeros.

I would prefer to get the powspctrm without the zeros at the end, but maybe I can just exclude them later on from the analysis?
Do you know if Fieldtrip works fine with trials of different durations? And if there is any other more efficient way to analyse trials with different durations?

Any help would be extremely appreciated, thanks so much in advance!

Best wishes,
Ioanna

_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190626/10aacd5a/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From raphael.theze at gmail.com  Wed Jun 26 11:52:00 2019
From: raphael.theze at gmail.com (=?UTF-8?B?UmFwaGHDq2wgVGjDqXrDqQ==?=)
Date: Wed, 26 Jun 2019 11:52:00 +0200
Subject: [FieldTrip] TFR with different trial lengths
In-Reply-To: <AM0PR0702MB37301CE725325F2F155F2439DEE20@AM0PR0702MB3730.eurprd07.prod.outlook.com>
References: <AM0PR0702MB37301CE725325F2F155F2439DEE20@AM0PR0702MB3730.eurprd07.prod.outlook.com>
Message-ID: <CALhXZTaHziPptWi73Q=vAh2hAPoo3rB2V00GLUgdOYT85usohg@mail.gmail.com>

Hello Ioanna,

Because the ouput is in a 4D matrix it has to put zeros because you cannot
"not have" something that fills all dimensions. Hence the zeros.

If having the zeros is inconvenient for you because you are doing single
trial analysis, you may try to do a loop in which you call ft_freqanalysis
with cfg.trials corresponding to one different trial each time. That will
give a cell array of structure outputs that you can later merge into one
structure with trials in different cells. But depending on what kind of
stats or analysis you want to do later, the typical fieldtrip functions
might not like this arrangement.

Also depending on the kind of experiment you are working on, if the entire
duration of your trial is not need and you need to do grand averaging, you
might want to consider truncating your trials at the lenght of the shortest
trial.

Cheers,
Raphaël


Le mer. 26 juin 2019 à 11:28, Ioanna Zioga <i.zioga at qmul.ac.uk> a écrit :

> Hello Fieldtrip community!
>
>
> I want to do TFR analysis on datasets with trials with different lengths
> (as I'm analysing the time period from the onset of a stimulus until
> participant's response, which differs from trial to trial).
>
>
> These are the parameters:
>
> cfgft                   = [];
> cfgft.method    = 'tfr';
> cfgft.output      = 'pow';
> cfgft.foi              = exp(linspace(log(2),log(45),50));
> *cfgft.toi              = [];*
> cfgft.width         = 6;
> cfgft.keeptrials  = 'yes';
>
> The result I get from the freqanalysis (powspctrm) is a *trial x chan x
> freq x time *matrix, in which the *time *is the time of the trial with
> the largest duration. The datapoints of the trials with smaller durations
> are filled with zeros.
>
>
> I would prefer to get the powspctrm without the zeros at the end, but
> maybe I can just exclude them later on from the analysis?
>
> Do you know if Fieldtrip works fine with trials of different durations?
> And if there is any other more efficient way to analyse trials with
> different durations?
>
>
> Any help would be extremely appreciated, thanks so much in advance!
>
>
> Best wishes,
>
> Ioanna
>
>
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190626/2b8a31d4/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From raphael.theze at gmail.com  Wed Jun 26 11:52:00 2019
From: raphael.theze at gmail.com (=?UTF-8?B?UmFwaGHDq2wgVGjDqXrDqQ==?=)
Date: Wed, 26 Jun 2019 11:52:00 +0200
Subject: [FieldTrip] TFR with different trial lengths
In-Reply-To: <AM0PR0702MB37301CE725325F2F155F2439DEE20@AM0PR0702MB3730.eurprd07.prod.outlook.com>
References: <AM0PR0702MB37301CE725325F2F155F2439DEE20@AM0PR0702MB3730.eurprd07.prod.outlook.com>
Message-ID: <CALhXZTaHziPptWi73Q=vAh2hAPoo3rB2V00GLUgdOYT85usohg@mail.gmail.com>

Hello Ioanna,

Because the ouput is in a 4D matrix it has to put zeros because you cannot
"not have" something that fills all dimensions. Hence the zeros.

If having the zeros is inconvenient for you because you are doing single
trial analysis, you may try to do a loop in which you call ft_freqanalysis
with cfg.trials corresponding to one different trial each time. That will
give a cell array of structure outputs that you can later merge into one
structure with trials in different cells. But depending on what kind of
stats or analysis you want to do later, the typical fieldtrip functions
might not like this arrangement.

Also depending on the kind of experiment you are working on, if the entire
duration of your trial is not need and you need to do grand averaging, you
might want to consider truncating your trials at the lenght of the shortest
trial.

Cheers,
Raphaël


Le mer. 26 juin 2019 à 11:28, Ioanna Zioga <i.zioga at qmul.ac.uk> a écrit :

> Hello Fieldtrip community!
>
>
> I want to do TFR analysis on datasets with trials with different lengths
> (as I'm analysing the time period from the onset of a stimulus until
> participant's response, which differs from trial to trial).
>
>
> These are the parameters:
>
> cfgft                   = [];
> cfgft.method    = 'tfr';
> cfgft.output      = 'pow';
> cfgft.foi              = exp(linspace(log(2),log(45),50));
> *cfgft.toi              = [];*
> cfgft.width         = 6;
> cfgft.keeptrials  = 'yes';
>
> The result I get from the freqanalysis (powspctrm) is a *trial x chan x
> freq x time *matrix, in which the *time *is the time of the trial with
> the largest duration. The datapoints of the trials with smaller durations
> are filled with zeros.
>
>
> I would prefer to get the powspctrm without the zeros at the end, but
> maybe I can just exclude them later on from the analysis?
>
> Do you know if Fieldtrip works fine with trials of different durations?
> And if there is any other more efficient way to analyse trials with
> different durations?
>
>
> Any help would be extremely appreciated, thanks so much in advance!
>
>
> Best wishes,
>
> Ioanna
>
>
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190626/2b8a31d4/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From stephen.whitmarsh at gmail.com  Wed Jun 26 11:58:32 2019
From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh)
Date: Wed, 26 Jun 2019 11:58:32 +0200
Subject: [FieldTrip] TFR with different trial lengths
In-Reply-To: <AM0PR0702MB37301CE725325F2F155F2439DEE20@AM0PR0702MB3730.eurprd07.prod.outlook.com>
References: <AM0PR0702MB37301CE725325F2F155F2439DEE20@AM0PR0702MB3730.eurprd07.prod.outlook.com>
Message-ID: <03ee01d52c05$b6b85510$2428ff30$@gmail.com>

Dear Ionna,

 

First of all, in general FieldTrip works very well with different trial
durations (that's why there is a 'time' field for every trial in a 'raw'
data structure), at least in those functions where it makes sense, although
it's definitely something to always check (never hurts).

 

Secondly, in my memory at least, 'mtmfft' returns NaNs where there is no
data, but the implementation of 'tfr' might be different and I trust that
you have 0s J But it's something to keep in mind as this suggests that you
might have unexpected results if you change methods. It also emphasizes that
you are asking freqanalysis to calculate power of data that doesn't exist
and although it seems handy, it might not be the most consistent way of
scripting your analysis in the end. In particular when you will be
averaging, calculating relative differences (baseline correction e.g.),
etc., where you might not keep track of the fact that you are using 0s as if
this was true data.

 

In such situations as you describe, I myself typically do two different
analysis: first I preprocess and epoch the stimulus-locked timecourse data
once using the full (different) trial lengths, and then split my
time-frequency-analysis up into one stimulus-locked analysis, and one
response-locked analysis  (after re-aligning stimulus-locked data to the end
of the trial), both using the shortest time duration. This allows me to
easily average the time-frequency-data over trials without having different
time-points/windows that I would have gotten if I was trying to
response-lock TFR data that was calculated on stimulus-locked data. This is
especially the case when using sliding time-windows (method = 'mtmfft')
where those time-windows won't perfectly align in time. (and using sliding
time-windows with mtmfft, using steps of e.g. 0.05s will be more
memory-efficient than calculating a wavelet for every time-point). Also, it
would mean that all my power-estimates over time will have the same amount
of trials.

 

You can also ofcourse, if you really want to, loop over trials and append
the trials (powspctrm and time) afterwards.

 

Although not a direct answer to your question perhaps, I hope this helps.

 

Cheers,

Stephen

 

 

 

 

 

 

From: fieldtrip <fieldtrip-bounces at science.ru.nl> On Behalf Of Ioanna Zioga
Sent: Wednesday, June 26, 2019 11:12 AM
To: fieldtrip at science.ru.nl
Subject: [FieldTrip] TFR with different trial lengths

 

Hello Fieldtrip community!

 

I want to do TFR analysis on datasets with trials with different lengths (as
I'm analysing the time period from the onset of a stimulus until
participant's response, which differs from trial to trial).

 

These are the parameters:

cfgft                   = [];

cfgft.method    = 'tfr';

cfgft.output      = 'pow';

cfgft.foi              = exp(linspace(log(2),log(45),50));

cfgft.toi              = [];

cfgft.width         = 6;

cfgft.keeptrials  = 'yes';

 

The result I get from the freqanalysis (powspctrm) is a trial x chan x freq
x time matrix, in which the time is the time of the trial with the largest
duration. The datapoints of the trials with smaller durations are filled
with zeros.

 

I would prefer to get the powspctrm without the zeros at the end, but maybe
I can just exclude them later on from the analysis?

Do you know if Fieldtrip works fine with trials of different durations? And
if there is any other more efficient way to analyse trials with different
durations?

 

Any help would be extremely appreciated, thanks so much in advance!

 

Best wishes,

Ioanna

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190626/cd277224/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From stephen.whitmarsh at gmail.com  Wed Jun 26 11:58:32 2019
From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh)
Date: Wed, 26 Jun 2019 11:58:32 +0200
Subject: [FieldTrip] TFR with different trial lengths
In-Reply-To: <AM0PR0702MB37301CE725325F2F155F2439DEE20@AM0PR0702MB3730.eurprd07.prod.outlook.com>
References: <AM0PR0702MB37301CE725325F2F155F2439DEE20@AM0PR0702MB3730.eurprd07.prod.outlook.com>
Message-ID: <03ee01d52c05$b6b85510$2428ff30$@gmail.com>

Dear Ionna,

 

First of all, in general FieldTrip works very well with different trial
durations (that's why there is a 'time' field for every trial in a 'raw'
data structure), at least in those functions where it makes sense, although
it's definitely something to always check (never hurts).

 

Secondly, in my memory at least, 'mtmfft' returns NaNs where there is no
data, but the implementation of 'tfr' might be different and I trust that
you have 0s J But it's something to keep in mind as this suggests that you
might have unexpected results if you change methods. It also emphasizes that
you are asking freqanalysis to calculate power of data that doesn't exist
and although it seems handy, it might not be the most consistent way of
scripting your analysis in the end. In particular when you will be
averaging, calculating relative differences (baseline correction e.g.),
etc., where you might not keep track of the fact that you are using 0s as if
this was true data.

 

In such situations as you describe, I myself typically do two different
analysis: first I preprocess and epoch the stimulus-locked timecourse data
once using the full (different) trial lengths, and then split my
time-frequency-analysis up into one stimulus-locked analysis, and one
response-locked analysis  (after re-aligning stimulus-locked data to the end
of the trial), both using the shortest time duration. This allows me to
easily average the time-frequency-data over trials without having different
time-points/windows that I would have gotten if I was trying to
response-lock TFR data that was calculated on stimulus-locked data. This is
especially the case when using sliding time-windows (method = 'mtmfft')
where those time-windows won't perfectly align in time. (and using sliding
time-windows with mtmfft, using steps of e.g. 0.05s will be more
memory-efficient than calculating a wavelet for every time-point). Also, it
would mean that all my power-estimates over time will have the same amount
of trials.

 

You can also ofcourse, if you really want to, loop over trials and append
the trials (powspctrm and time) afterwards.

 

Although not a direct answer to your question perhaps, I hope this helps.

 

Cheers,

Stephen

 

 

 

 

 

 

From: fieldtrip <fieldtrip-bounces at science.ru.nl> On Behalf Of Ioanna Zioga
Sent: Wednesday, June 26, 2019 11:12 AM
To: fieldtrip at science.ru.nl
Subject: [FieldTrip] TFR with different trial lengths

 

Hello Fieldtrip community!

 

I want to do TFR analysis on datasets with trials with different lengths (as
I'm analysing the time period from the onset of a stimulus until
participant's response, which differs from trial to trial).

 

These are the parameters:

cfgft                   = [];

cfgft.method    = 'tfr';

cfgft.output      = 'pow';

cfgft.foi              = exp(linspace(log(2),log(45),50));

cfgft.toi              = [];

cfgft.width         = 6;

cfgft.keeptrials  = 'yes';

 

The result I get from the freqanalysis (powspctrm) is a trial x chan x freq
x time matrix, in which the time is the time of the trial with the largest
duration. The datapoints of the trials with smaller durations are filled
with zeros.

 

I would prefer to get the powspctrm without the zeros at the end, but maybe
I can just exclude them later on from the analysis?

Do you know if Fieldtrip works fine with trials of different durations? And
if there is any other more efficient way to analyse trials with different
durations?

 

Any help would be extremely appreciated, thanks so much in advance!

 

Best wishes,

Ioanna

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190626/cd277224/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From i.zioga at qmul.ac.uk  Wed Jun 26 14:49:22 2019
From: i.zioga at qmul.ac.uk (Ioanna Zioga)
Date: Wed, 26 Jun 2019 12:49:22 +0000
Subject: [FieldTrip] TFR with different trial lengths
In-Reply-To: <03ee01d52c05$b6b85510$2428ff30$@gmail.com>
References: <AM0PR0702MB37301CE725325F2F155F2439DEE20@AM0PR0702MB3730.eurprd07.prod.outlook.com>,
 <03ee01d52c05$b6b85510$2428ff30$@gmail.com>
Message-ID: <AM0PR0702MB3730473A86D4421C0A8C120BDEE20@AM0PR0702MB3730.eurprd07.prod.outlook.com>

Dear Jan-Mathijs, Raphaël, and Stephen,


Thanks so much for your insightful replies!


I need to analyze the whole duration of the different trials, so I think the suggestion to run freqanalysis looping over trials is really suitable!


I'm using these parameters:

cfgft = [];
cfgft.method = 'wavelet';
cfgft.output = 'pow';
cfgft.foi = 2:1:40;
cfgft.width = 6;
cfgft.pad = 'nextpow2';
cfgft.keeptrials = 'yes';
cfgft.toi = data.time{1};

But I get this error at some point:
Error using  ./
Matrix dimensions must agree.

Error in ft_freqanalysis (line 435)
    fboi   = round(cfg.foi ./ (data.fsample ./ (cfg.pad*data.fsample))) + 1;

This trial is quite long (10267 timepoints divided by 500 sampling rate = 20 seconds), so I can't think of why I get this error?
I think there is a problem with the padding, anyone has any suggestion?
Also, does the cfgft.toi need to be exactly the time resolution of my data (0.0020 sec), or can I use a lower resolution by changing the cfgft.toi?

Thank you very very much for all your help!

Best,
Ioanna



________________________________
From: fieldtrip <fieldtrip-bounces at science.ru.nl> on behalf of Stephen Whitmarsh <stephen.whitmarsh at gmail.com>
Sent: 26 June 2019 10:58:32
To: 'FieldTrip discussion list'
Subject: Re: [FieldTrip] TFR with different trial lengths


Dear Ionna,



First of all, in general FieldTrip works very well with different trial durations (that’s why there is a ‘time’ field for every trial in a ‘raw’ data structure), at least in those functions where it makes sense, although it’s definitely something to always check (never hurts).



Secondly, in my memory at least, ‘mtmfft’ returns NaNs where there is no data, but the implementation of ‘tfr’ might be different and I trust that you have 0s :) But it’s something to keep in mind as this suggests that you might have unexpected results if you change methods. It also emphasizes that you are asking freqanalysis to calculate power of data that doesn’t exist and although it seems handy, it might not be the most consistent way of scripting your analysis in the end. In particular when you will be averaging, calculating relative differences (baseline correction e.g.), etc., where you might not keep track of the fact that you are using 0s as if this was true data.



In such situations as you describe, I myself typically do two different analysis: first I preprocess and epoch the stimulus-locked timecourse data once using the full (different) trial lengths, and then split my time-frequency-analysis up into one stimulus-locked analysis, and one response-locked analysis  (after re-aligning stimulus-locked data to the end of the trial), both using the shortest time duration. This allows me to easily average the time-frequency-data over trials without having different time-points/windows that I would have gotten if I was trying to response-lock TFR data that was calculated on stimulus-locked data. This is especially the case when using sliding time-windows (method = ‘mtmfft’) where those time-windows won’t perfectly align in time. (and using sliding time-windows with mtmfft, using steps of e.g. 0.05s will be more memory-efficient than calculating a wavelet for every time-point). Also, it would mean that all my power-estimates over time will have the same amount of trials.



You can also ofcourse, if you really want to, loop over trials and append the trials (powspctrm and time) afterwards.



Although not a direct answer to your question perhaps, I hope this helps.



Cheers,

Stephen













From: fieldtrip <fieldtrip-bounces at science.ru.nl> On Behalf Of Ioanna Zioga
Sent: Wednesday, June 26, 2019 11:12 AM
To: fieldtrip at science.ru.nl
Subject: [FieldTrip] TFR with different trial lengths



Hello Fieldtrip community!



I want to do TFR analysis on datasets with trials with different lengths (as I'm analysing the time period from the onset of a stimulus until participant's response, which differs from trial to trial).



These are the parameters:

cfgft                   = [];

cfgft.method    = 'tfr';

cfgft.output      = 'pow';

cfgft.foi              = exp(linspace(log(2),log(45),50));

cfgft.toi              = [];

cfgft.width         = 6;

cfgft.keeptrials  = 'yes';



The result I get from the freqanalysis (powspctrm) is a trial x chan x freq x time matrix, in which the time is the time of the trial with the largest duration. The datapoints of the trials with smaller durations are filled with zeros.



I would prefer to get the powspctrm without the zeros at the end, but maybe I can just exclude them later on from the analysis?

Do you know if Fieldtrip works fine with trials of different durations? And if there is any other more efficient way to analyse trials with different durations?



Any help would be extremely appreciated, thanks so much in advance!



Best wishes,

Ioanna


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190626/2c50ddef/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From i.zioga at qmul.ac.uk  Wed Jun 26 14:49:22 2019
From: i.zioga at qmul.ac.uk (Ioanna Zioga)
Date: Wed, 26 Jun 2019 12:49:22 +0000
Subject: [FieldTrip] TFR with different trial lengths
In-Reply-To: <03ee01d52c05$b6b85510$2428ff30$@gmail.com>
References: <AM0PR0702MB37301CE725325F2F155F2439DEE20@AM0PR0702MB3730.eurprd07.prod.outlook.com>,
 <03ee01d52c05$b6b85510$2428ff30$@gmail.com>
Message-ID: <AM0PR0702MB3730473A86D4421C0A8C120BDEE20@AM0PR0702MB3730.eurprd07.prod.outlook.com>

Dear Jan-Mathijs, Raphaël, and Stephen,


Thanks so much for your insightful replies!


I need to analyze the whole duration of the different trials, so I think the suggestion to run freqanalysis looping over trials is really suitable!


I'm using these parameters:

cfgft = [];
cfgft.method = 'wavelet';
cfgft.output = 'pow';
cfgft.foi = 2:1:40;
cfgft.width = 6;
cfgft.pad = 'nextpow2';
cfgft.keeptrials = 'yes';
cfgft.toi = data.time{1};

But I get this error at some point:
Error using  ./
Matrix dimensions must agree.

Error in ft_freqanalysis (line 435)
    fboi   = round(cfg.foi ./ (data.fsample ./ (cfg.pad*data.fsample))) + 1;

This trial is quite long (10267 timepoints divided by 500 sampling rate = 20 seconds), so I can't think of why I get this error?
I think there is a problem with the padding, anyone has any suggestion?
Also, does the cfgft.toi need to be exactly the time resolution of my data (0.0020 sec), or can I use a lower resolution by changing the cfgft.toi?

Thank you very very much for all your help!

Best,
Ioanna



________________________________
From: fieldtrip <fieldtrip-bounces at science.ru.nl> on behalf of Stephen Whitmarsh <stephen.whitmarsh at gmail.com>
Sent: 26 June 2019 10:58:32
To: 'FieldTrip discussion list'
Subject: Re: [FieldTrip] TFR with different trial lengths


Dear Ionna,



First of all, in general FieldTrip works very well with different trial durations (that’s why there is a ‘time’ field for every trial in a ‘raw’ data structure), at least in those functions where it makes sense, although it’s definitely something to always check (never hurts).



Secondly, in my memory at least, ‘mtmfft’ returns NaNs where there is no data, but the implementation of ‘tfr’ might be different and I trust that you have 0s :) But it’s something to keep in mind as this suggests that you might have unexpected results if you change methods. It also emphasizes that you are asking freqanalysis to calculate power of data that doesn’t exist and although it seems handy, it might not be the most consistent way of scripting your analysis in the end. In particular when you will be averaging, calculating relative differences (baseline correction e.g.), etc., where you might not keep track of the fact that you are using 0s as if this was true data.



In such situations as you describe, I myself typically do two different analysis: first I preprocess and epoch the stimulus-locked timecourse data once using the full (different) trial lengths, and then split my time-frequency-analysis up into one stimulus-locked analysis, and one response-locked analysis  (after re-aligning stimulus-locked data to the end of the trial), both using the shortest time duration. This allows me to easily average the time-frequency-data over trials without having different time-points/windows that I would have gotten if I was trying to response-lock TFR data that was calculated on stimulus-locked data. This is especially the case when using sliding time-windows (method = ‘mtmfft’) where those time-windows won’t perfectly align in time. (and using sliding time-windows with mtmfft, using steps of e.g. 0.05s will be more memory-efficient than calculating a wavelet for every time-point). Also, it would mean that all my power-estimates over time will have the same amount of trials.



You can also ofcourse, if you really want to, loop over trials and append the trials (powspctrm and time) afterwards.



Although not a direct answer to your question perhaps, I hope this helps.



Cheers,

Stephen













From: fieldtrip <fieldtrip-bounces at science.ru.nl> On Behalf Of Ioanna Zioga
Sent: Wednesday, June 26, 2019 11:12 AM
To: fieldtrip at science.ru.nl
Subject: [FieldTrip] TFR with different trial lengths



Hello Fieldtrip community!



I want to do TFR analysis on datasets with trials with different lengths (as I'm analysing the time period from the onset of a stimulus until participant's response, which differs from trial to trial).



These are the parameters:

cfgft                   = [];

cfgft.method    = 'tfr';

cfgft.output      = 'pow';

cfgft.foi              = exp(linspace(log(2),log(45),50));

cfgft.toi              = [];

cfgft.width         = 6;

cfgft.keeptrials  = 'yes';



The result I get from the freqanalysis (powspctrm) is a trial x chan x freq x time matrix, in which the time is the time of the trial with the largest duration. The datapoints of the trials with smaller durations are filled with zeros.



I would prefer to get the powspctrm without the zeros at the end, but maybe I can just exclude them later on from the analysis?

Do you know if Fieldtrip works fine with trials of different durations? And if there is any other more efficient way to analyse trials with different durations?



Any help would be extremely appreciated, thanks so much in advance!



Best wishes,

Ioanna


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190626/2c50ddef/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From juan.lei at hotmail.com  Thu Jun 27 17:32:17 2019
From: juan.lei at hotmail.com (Juan Lei)
Date: Thu, 27 Jun 2019 15:32:17 +0000
Subject: [FieldTrip] Fwd: correlation with behavioural data and cluster
 statistics
In-Reply-To: <CAAiwptTz1q6pioZJtzvTZR3dCfsGzmY=Tmv=_-h7s4qYeFS8tg@mail.gmail.com>
References: <CAEP2PttySmhOVXd0Mijrf0v0YHpaZmeiOX6uRgAfUS-O+R0k5Q@mail.gmail.com>
 <CAEP2PturVWkZk8FJe2osHgyTCaCSS059jBZbb6wdKw2-uOKDxg@mail.gmail.com>
 <24502A09-8940-4825-83E2-A25B4420775D@gmail.com>
 <CAEP2Ptu97RZ_zrCtOSEoECxDoiD0ovKSyEDNcne4Pjzs0-H_pw@mail.gmail.com>
 <AM5PR0602MB275549E5CE272B7FAAF9980F91490@AM5PR0602MB2755.eurprd06.prod.outlook.com>,
 <CAAiwptTz1q6pioZJtzvTZR3dCfsGzmY=Tmv=_-h7s4qYeFS8tg@mail.gmail.com>
Message-ID: <AM5PR0602MB27553879FEA533D029DC6F0591FD0@AM5PR0602MB2755.eurprd06.prod.outlook.com>

Dear Arjen,

can this ft_statfun_indepsamplesregrT also work for ERP data, i. e. the data only have three dimensions (time, channel and subject)?

In this case, of course I have to use ft_timelockstatistics(cfg,GAalldevRi) in the end.

Best,

Juan
________________________________
From: fieldtrip <fieldtrip-bounces at science.ru.nl> on behalf of Arjen Stolk <a.stolk8 at gmail.com>
Sent: Sunday, March 17, 2019 7:12 AM
To: FieldTrip discussion list
Subject: Re: [FieldTrip] Fwd: correlation with behavioural data and cluster statistics

Dear Juan,

Your code looks fine to me. Indeed, also with ft_statfun_indepsamplesregrT, the behavioral vector goes into the design matrix.

All p-values computed with the montecarlo method correspond to one tail and, thus, you would need to correct for this one-sided test approach if you intended to do a two-sided test. Either cfg.correcttail = 'alpha' or 'prob' will achieve this, as further explained here<https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.fieldtriptoolbox.org%2Ffaq%2Fwhy_should_i_use_the_cfg.correcttail_option_when_using_statistics_montecarlo%2F&data=02%7C01%7C%7C6482c0ed5b854521095608d6aaa1afee%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636884008747439566&sdata=cCUJE92o9BrAd35xx36cP0fkXukAUhsNW%2BEt4xMnwCM%3D&reserved=0>.

Have a great weekend,
Arjen

On Tue, Mar 12, 2019 at 7:35 AM Juan Lei <juan.lei at hotmail.com<mailto:juan.lei at hotmail.com>> wrote:
Dear Arjen,

if I use ft_statfun_indepsamplesregrT, are all the Parameters the same as correlationT method ? Below are all my parameters used. Are they correct? Another question is whether I need the "cfg.correcttail  =  'alpha'" for the indepsamplesregrT methoed?

   cfg=[];
   cfg.channel          = {'*'};​
   cfg.frequency        = [15 35];
   cfg.avgoverfreq      ='no';
   cfg.latency          = [-0.7 0];​
   cfg.avgoverchan      = 'no';​
   cfg.avgovertime      = 'no';​
   cfg.parameter        = 'powspctrm';​
   cfg.method           = 'montecarlo';​
   cfg.alpha            = 0.05;
   cfg.numrandomization = 1000;​
   cfg.correctm         = 'cluster';​
   cfg.clusteralpha     = 0.05;​
   cfg.clusterstatistic = 'maxsum';​
   cfg.correcttail      =  'alpha';
   cfg.tail             = 0;​
   cfg.clustertail      = 0;​
   cfg.minnbchan        = 2;​
   cfg.neighbours       = neighbours;​
   cfg.statistic        ='ft_statfun_indepsamplesregrT';
   cfg.ivar             = 1;​
   cfg.design = [];​
   cfg.design(1,:) = xa;​% xa is my behavioral vector. Each subject has one behavioral value.
   freq_stat = ft_freqstatistics(cfg,GA_RI);% GA_RI is my time frequency data averaged across group but keeping individuals.


Best regards,

Juan Lei




________________________________
From: fieldtrip <fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl>> on behalf of Valeriya Belyaeva <vabelyaeva94 at gmail.com<mailto:vabelyaeva94 at gmail.com>>
Sent: Tuesday, February 19, 2019 7:11 PM
To: FieldTrip discussion list
Subject: Re: [FieldTrip] Fwd: correlation with behavioural data and cluster statistics

Thank you a lot, Arjen.

Best regards,
Valeriya

вт, 19 февр. 2019 г. в 18:44, Arjen Stolk <a.stolk8 at gmail.com<mailto:a.stolk8 at gmail.com>>:
Hi Valeriya,

That looks to be correct use of the correlationT method. The behavioral data goes into the design matrix, as you did.

Best,
Arjen

On Feb 19, 2019, at 6:35 AM, Valeriya Belyaeva <vabelyaeva94 at gmail.com<mailto:vabelyaeva94 at gmail.com>> wrote:



---------- Forwarded message ---------
From: Valeriya Belyaeva <vabelyaeva94 at gmail.com<mailto:vabelyaeva94 at gmail.com>>
Date: ср, 13 февр. 2019 г. в 16:28
Subject: correlation with behavioural data and cluster statistics
To: <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>>



Dear fieldtrip developers,

I have a question about correlation of neuronal and behavioural data. You have discussed this question here: http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_correlations_between_neuronal_data_and_quantitative_stimulus_and_behavioural_variables/<https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.fieldtriptoolbox.org%2Ffaq%2Fhow_can_i_test_for_correlations_between_neuronal_data_and_quantitative_stimulus_and_behavioural_variables%2F&data=02%7C01%7C%7C6482c0ed5b854521095608d6aaa1afee%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636884008747449571&sdata=qic0njE42iEFnLzLpjI5pOH3Qixs6BfGYLlsS2yuVPk%3D&reserved=0>

I have taken the code, which was given as an example and added cluster-based correction method. My goal is to perform correlation between neuronal and behavioural data and then to account for multiple comparisons with cluster statistics.

Could you, please, tell me, whether this script does it?

Here is the script:

% example script

cfg = [];

cfg.statistic        = 'ft_statfun_correlationT';

cfg.method           = 'montecarlo';

cfg.numrandomization = 1000;

cfg.correctm         = 'cluster';


cfg.clusteralpha     = 0.025;

cfg_neighb.method = 'triangulation';

cfg_neighb.layout = 'acticap_62';

cfg.neighbours = ft_prepare_neighbours(cfg_neighb, data_brain{:});


n1 = 42;    % n1 is the number of subjects

design(1,1:n1)       = behav_data(:,1); % mean reaction time by subject

cfg.design           = design;

cfg.ivar             = 1;

stat = ft_freqstatistics(cfg, data_brain{:});

Thank you a lot in advance!
--
Best regards,
Valeriya Belyaeva
HSE, Cognitive science and technologies



--
Best regards,
Valeriya Belyaeva
HSE, Cognitive science and technologies

_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=02%7C01%7C%7C6482c0ed5b854521095608d6aaa1afee%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636884008747459581&sdata=N8cEFn91nSkR8l0OA%2B6%2BqQYs%2Bcnx9ZJytZMu8uQFDYo%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=02%7C01%7C%7C6482c0ed5b854521095608d6aaa1afee%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636884008747469586&sdata=dr%2FO6kt9rbRIPu3GpQk1D9%2BVuxMfg5OxPJzNQgoZheQ%3D&reserved=0>
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=02%7C01%7C%7C6482c0ed5b854521095608d6aaa1afee%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636884008747489602&sdata=q91RtnrucbD%2Fd%2Fn9v1f9EyJihjXCUSbstmU9gYK66Wo%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=02%7C01%7C%7C6482c0ed5b854521095608d6aaa1afee%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636884008747499607&sdata=q3op8RD6C6E3WFxcQ2I8%2Fg7bkfzX6Vyc5jsGHfWOfPk%3D&reserved=0>


--
Best regards,
Valeriya Belyaeva
HSE, Cognitive science and technologies

_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=02%7C01%7C%7C6482c0ed5b854521095608d6aaa1afee%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636884008747510970&sdata=wHjEE%2B8%2FqnJYLVLjx7OmC9bBLhhV84h4ZttZtC5pUdo%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=02%7C01%7C%7C6482c0ed5b854521095608d6aaa1afee%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636884008747519617&sdata=gVJd%2BEAz4hsZKd6v2lDgXG98gsnhELRu%2B9%2BHU80jAFc%3D&reserved=0>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190627/63973ac1/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From juan.lei at hotmail.com  Thu Jun 27 17:32:17 2019
From: juan.lei at hotmail.com (Juan Lei)
Date: Thu, 27 Jun 2019 15:32:17 +0000
Subject: [FieldTrip] Fwd: correlation with behavioural data and cluster
 statistics
In-Reply-To: <CAAiwptTz1q6pioZJtzvTZR3dCfsGzmY=Tmv=_-h7s4qYeFS8tg@mail.gmail.com>
References: <CAEP2PttySmhOVXd0Mijrf0v0YHpaZmeiOX6uRgAfUS-O+R0k5Q@mail.gmail.com>
 <CAEP2PturVWkZk8FJe2osHgyTCaCSS059jBZbb6wdKw2-uOKDxg@mail.gmail.com>
 <24502A09-8940-4825-83E2-A25B4420775D@gmail.com>
 <CAEP2Ptu97RZ_zrCtOSEoECxDoiD0ovKSyEDNcne4Pjzs0-H_pw@mail.gmail.com>
 <AM5PR0602MB275549E5CE272B7FAAF9980F91490@AM5PR0602MB2755.eurprd06.prod.outlook.com>,
 <CAAiwptTz1q6pioZJtzvTZR3dCfsGzmY=Tmv=_-h7s4qYeFS8tg@mail.gmail.com>
Message-ID: <AM5PR0602MB27553879FEA533D029DC6F0591FD0@AM5PR0602MB2755.eurprd06.prod.outlook.com>

Dear Arjen,

can this ft_statfun_indepsamplesregrT also work for ERP data, i. e. the data only have three dimensions (time, channel and subject)?

In this case, of course I have to use ft_timelockstatistics(cfg,GAalldevRi) in the end.

Best,

Juan
________________________________
From: fieldtrip <fieldtrip-bounces at science.ru.nl> on behalf of Arjen Stolk <a.stolk8 at gmail.com>
Sent: Sunday, March 17, 2019 7:12 AM
To: FieldTrip discussion list
Subject: Re: [FieldTrip] Fwd: correlation with behavioural data and cluster statistics

Dear Juan,

Your code looks fine to me. Indeed, also with ft_statfun_indepsamplesregrT, the behavioral vector goes into the design matrix.

All p-values computed with the montecarlo method correspond to one tail and, thus, you would need to correct for this one-sided test approach if you intended to do a two-sided test. Either cfg.correcttail = 'alpha' or 'prob' will achieve this, as further explained here<https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.fieldtriptoolbox.org%2Ffaq%2Fwhy_should_i_use_the_cfg.correcttail_option_when_using_statistics_montecarlo%2F&data=02%7C01%7C%7C6482c0ed5b854521095608d6aaa1afee%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636884008747439566&sdata=cCUJE92o9BrAd35xx36cP0fkXukAUhsNW%2BEt4xMnwCM%3D&reserved=0>.

Have a great weekend,
Arjen

On Tue, Mar 12, 2019 at 7:35 AM Juan Lei <juan.lei at hotmail.com<mailto:juan.lei at hotmail.com>> wrote:
Dear Arjen,

if I use ft_statfun_indepsamplesregrT, are all the Parameters the same as correlationT method ? Below are all my parameters used. Are they correct? Another question is whether I need the "cfg.correcttail  =  'alpha'" for the indepsamplesregrT methoed?

   cfg=[];
   cfg.channel          = {'*'};​
   cfg.frequency        = [15 35];
   cfg.avgoverfreq      ='no';
   cfg.latency          = [-0.7 0];​
   cfg.avgoverchan      = 'no';​
   cfg.avgovertime      = 'no';​
   cfg.parameter        = 'powspctrm';​
   cfg.method           = 'montecarlo';​
   cfg.alpha            = 0.05;
   cfg.numrandomization = 1000;​
   cfg.correctm         = 'cluster';​
   cfg.clusteralpha     = 0.05;​
   cfg.clusterstatistic = 'maxsum';​
   cfg.correcttail      =  'alpha';
   cfg.tail             = 0;​
   cfg.clustertail      = 0;​
   cfg.minnbchan        = 2;​
   cfg.neighbours       = neighbours;​
   cfg.statistic        ='ft_statfun_indepsamplesregrT';
   cfg.ivar             = 1;​
   cfg.design = [];​
   cfg.design(1,:) = xa;​% xa is my behavioral vector. Each subject has one behavioral value.
   freq_stat = ft_freqstatistics(cfg,GA_RI);% GA_RI is my time frequency data averaged across group but keeping individuals.


Best regards,

Juan Lei




________________________________
From: fieldtrip <fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl>> on behalf of Valeriya Belyaeva <vabelyaeva94 at gmail.com<mailto:vabelyaeva94 at gmail.com>>
Sent: Tuesday, February 19, 2019 7:11 PM
To: FieldTrip discussion list
Subject: Re: [FieldTrip] Fwd: correlation with behavioural data and cluster statistics

Thank you a lot, Arjen.

Best regards,
Valeriya

вт, 19 февр. 2019 г. в 18:44, Arjen Stolk <a.stolk8 at gmail.com<mailto:a.stolk8 at gmail.com>>:
Hi Valeriya,

That looks to be correct use of the correlationT method. The behavioral data goes into the design matrix, as you did.

Best,
Arjen

On Feb 19, 2019, at 6:35 AM, Valeriya Belyaeva <vabelyaeva94 at gmail.com<mailto:vabelyaeva94 at gmail.com>> wrote:



---------- Forwarded message ---------
From: Valeriya Belyaeva <vabelyaeva94 at gmail.com<mailto:vabelyaeva94 at gmail.com>>
Date: ср, 13 февр. 2019 г. в 16:28
Subject: correlation with behavioural data and cluster statistics
To: <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>>



Dear fieldtrip developers,

I have a question about correlation of neuronal and behavioural data. You have discussed this question here: http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_correlations_between_neuronal_data_and_quantitative_stimulus_and_behavioural_variables/<https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.fieldtriptoolbox.org%2Ffaq%2Fhow_can_i_test_for_correlations_between_neuronal_data_and_quantitative_stimulus_and_behavioural_variables%2F&data=02%7C01%7C%7C6482c0ed5b854521095608d6aaa1afee%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636884008747449571&sdata=qic0njE42iEFnLzLpjI5pOH3Qixs6BfGYLlsS2yuVPk%3D&reserved=0>

I have taken the code, which was given as an example and added cluster-based correction method. My goal is to perform correlation between neuronal and behavioural data and then to account for multiple comparisons with cluster statistics.

Could you, please, tell me, whether this script does it?

Here is the script:

% example script

cfg = [];

cfg.statistic        = 'ft_statfun_correlationT';

cfg.method           = 'montecarlo';

cfg.numrandomization = 1000;

cfg.correctm         = 'cluster';


cfg.clusteralpha     = 0.025;

cfg_neighb.method = 'triangulation';

cfg_neighb.layout = 'acticap_62';

cfg.neighbours = ft_prepare_neighbours(cfg_neighb, data_brain{:});


n1 = 42;    % n1 is the number of subjects

design(1,1:n1)       = behav_data(:,1); % mean reaction time by subject

cfg.design           = design;

cfg.ivar             = 1;

stat = ft_freqstatistics(cfg, data_brain{:});

Thank you a lot in advance!
--
Best regards,
Valeriya Belyaeva
HSE, Cognitive science and technologies



--
Best regards,
Valeriya Belyaeva
HSE, Cognitive science and technologies

_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=02%7C01%7C%7C6482c0ed5b854521095608d6aaa1afee%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636884008747459581&sdata=N8cEFn91nSkR8l0OA%2B6%2BqQYs%2Bcnx9ZJytZMu8uQFDYo%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=02%7C01%7C%7C6482c0ed5b854521095608d6aaa1afee%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636884008747469586&sdata=dr%2FO6kt9rbRIPu3GpQk1D9%2BVuxMfg5OxPJzNQgoZheQ%3D&reserved=0>
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=02%7C01%7C%7C6482c0ed5b854521095608d6aaa1afee%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636884008747489602&sdata=q91RtnrucbD%2Fd%2Fn9v1f9EyJihjXCUSbstmU9gYK66Wo%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=02%7C01%7C%7C6482c0ed5b854521095608d6aaa1afee%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636884008747499607&sdata=q3op8RD6C6E3WFxcQ2I8%2Fg7bkfzX6Vyc5jsGHfWOfPk%3D&reserved=0>


--
Best regards,
Valeriya Belyaeva
HSE, Cognitive science and technologies

_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=02%7C01%7C%7C6482c0ed5b854521095608d6aaa1afee%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636884008747510970&sdata=wHjEE%2B8%2FqnJYLVLjx7OmC9bBLhhV84h4ZttZtC5pUdo%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=02%7C01%7C%7C6482c0ed5b854521095608d6aaa1afee%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636884008747519617&sdata=gVJd%2BEAz4hsZKd6v2lDgXG98gsnhELRu%2B9%2BHU80jAFc%3D&reserved=0>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190627/63973ac1/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From edoardo.pinzuti at gmail.com  Thu Jun 27 18:34:04 2019
From: edoardo.pinzuti at gmail.com (Edoardo Pinzuti)
Date: Thu, 27 Jun 2019 18:34:04 +0200
Subject: [FieldTrip] Subject: conditional granger causality
Message-ID: <CAKN_vcjqruc3Nj65-7kgKT_tTQ0eh7v2iox3Z8X2xXJ906yb1w@mail.gmail.com>

Dear all,

Looking at the code for conditional spectral Granger it looks like that if
one want to derive GC from s1 to s2 conditional on the rest e.g. s3, the
nonparametric spectral factorization is computed on cross-spectral matrix
containing all s1,s2,s3  and  on cross-spectral matrix containing s2 and
s3. These two factorization are used to derive GC from s1 to s2 conditional
on the rest.

Suppose s1  has two components:  s1a and s1b , s2 as well: s2a and s2b and
so on, I would like to compute the conditional Granger as before from s1 to
s2 using a blockwise approach (where s1a and s1b are one block etc). These
can be done with  cfg.granger.block and channels combination ?
Since it is poorly documented someone can provide a simple example

cfg.channel={'s1a','s1b','s2a','s2b','s3a','s3b'}

 cfg = [];
 cfg.method = 'granger';
 cfg.granger.sfmethod='multivariate';
 cfg.granger.conditional='yes';
 cfg.channelcmb = { ??     };
 cfg.granger.block = ??
 g_stopCond = ft_connectivityanalysis(cfg, freq);

thanks
Edoardo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190627/e98364dc/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From edoardo.pinzuti at gmail.com  Thu Jun 27 18:34:04 2019
From: edoardo.pinzuti at gmail.com (Edoardo Pinzuti)
Date: Thu, 27 Jun 2019 18:34:04 +0200
Subject: [FieldTrip] Subject: conditional granger causality
Message-ID: <CAKN_vcjqruc3Nj65-7kgKT_tTQ0eh7v2iox3Z8X2xXJ906yb1w@mail.gmail.com>

Dear all,

Looking at the code for conditional spectral Granger it looks like that if
one want to derive GC from s1 to s2 conditional on the rest e.g. s3, the
nonparametric spectral factorization is computed on cross-spectral matrix
containing all s1,s2,s3  and  on cross-spectral matrix containing s2 and
s3. These two factorization are used to derive GC from s1 to s2 conditional
on the rest.

Suppose s1  has two components:  s1a and s1b , s2 as well: s2a and s2b and
so on, I would like to compute the conditional Granger as before from s1 to
s2 using a blockwise approach (where s1a and s1b are one block etc). These
can be done with  cfg.granger.block and channels combination ?
Since it is poorly documented someone can provide a simple example

cfg.channel={'s1a','s1b','s2a','s2b','s3a','s3b'}

 cfg = [];
 cfg.method = 'granger';
 cfg.granger.sfmethod='multivariate';
 cfg.granger.conditional='yes';
 cfg.channelcmb = { ??     };
 cfg.granger.block = ??
 g_stopCond = ft_connectivityanalysis(cfg, freq);

thanks
Edoardo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190627/e98364dc/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From i.zioga at qmul.ac.uk  Fri Jun 28 00:08:53 2019
From: i.zioga at qmul.ac.uk (Ioanna Zioga)
Date: Thu, 27 Jun 2019 22:08:53 +0000
Subject: [FieldTrip] TFR zero padding duration?
Message-ID: <AM0PR0702MB3730EF3BCB4F037AEDB4C6C8DEFD0@AM0PR0702MB3730.eurprd07.prod.outlook.com>

Dear Fieldtrip community!

I would like to ask for your advice on zero padding when doing TFR analysis.

I'm analysing trials of different lengths, so I loop over the trials to run ft_freqanalysis.
I read in the tutorials that the padding length should be >= to the length of the trial.

Therefore, I prepared these parameters:

cfg = [];
cfg.method = 'wavelet';
cfg.output = 'pow';
cfg.foi = [2:1:40];
cfg.width = 6;
cfg.keeptrials = 'yes';
cfg.toi = data.time{1};
cfg.pad = round(length(data.time{1}(1,:))/500)+5; % duration of trial plus 5 seconds
% my sampling rate is 500
res = ft_freqanalysis(cfg,data);

Even if I add 5 seconds more to the length of the cfg.pad, SOMETIMES (and I
cannot figure out a pattern..), I get this error:
Error using ft_specest_wavelet (line 60)
the padding that you specified is shorter than the data

Error in ft_freqanalysis (line 505)
        [spectrum,foi,toi] = ft_specest_wavelet(dat, time, 'timeoi', cfg.toi, 'width', cfg.width, 'gwidth', cfg.gwidth,options{:},
        'feedback', fbopt);

The length of the above trial was 20 seconds (+5 secs padding).
Do you have any idea what is the problem?

Freqanalysis runs smoothly in trials with other trials with smaller or longer duration, and I can't find a pattern of when this error comes up..

Any idea would be extremely helpful, thanks so so much in advance!

Best,
Ioanna

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190627/315aeb32/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From i.zioga at qmul.ac.uk  Fri Jun 28 00:08:53 2019
From: i.zioga at qmul.ac.uk (Ioanna Zioga)
Date: Thu, 27 Jun 2019 22:08:53 +0000
Subject: [FieldTrip] TFR zero padding duration?
Message-ID: <AM0PR0702MB3730EF3BCB4F037AEDB4C6C8DEFD0@AM0PR0702MB3730.eurprd07.prod.outlook.com>

Dear Fieldtrip community!

I would like to ask for your advice on zero padding when doing TFR analysis.

I'm analysing trials of different lengths, so I loop over the trials to run ft_freqanalysis.
I read in the tutorials that the padding length should be >= to the length of the trial.

Therefore, I prepared these parameters:

cfg = [];
cfg.method = 'wavelet';
cfg.output = 'pow';
cfg.foi = [2:1:40];
cfg.width = 6;
cfg.keeptrials = 'yes';
cfg.toi = data.time{1};
cfg.pad = round(length(data.time{1}(1,:))/500)+5; % duration of trial plus 5 seconds
% my sampling rate is 500
res = ft_freqanalysis(cfg,data);

Even if I add 5 seconds more to the length of the cfg.pad, SOMETIMES (and I
cannot figure out a pattern..), I get this error:
Error using ft_specest_wavelet (line 60)
the padding that you specified is shorter than the data

Error in ft_freqanalysis (line 505)
        [spectrum,foi,toi] = ft_specest_wavelet(dat, time, 'timeoi', cfg.toi, 'width', cfg.width, 'gwidth', cfg.gwidth,options{:},
        'feedback', fbopt);

The length of the above trial was 20 seconds (+5 secs padding).
Do you have any idea what is the problem?

Freqanalysis runs smoothly in trials with other trials with smaller or longer duration, and I can't find a pattern of when this error comes up..

Any idea would be extremely helpful, thanks so so much in advance!

Best,
Ioanna

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190627/315aeb32/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jan.schoffelen at donders.ru.nl  Fri Jun 28 08:32:32 2019
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Fri, 28 Jun 2019 06:32:32 +0000
Subject: [FieldTrip] TFR zero padding duration?
In-Reply-To: <AM0PR0702MB3730EF3BCB4F037AEDB4C6C8DEFD0@AM0PR0702MB3730.eurprd07.prod.outlook.com>
References: <AM0PR0702MB3730EF3BCB4F037AEDB4C6C8DEFD0@AM0PR0702MB3730.eurprd07.prod.outlook.com>
Message-ID: <A4516165-B230-481F-9C63-78DB260F2894@donders.ru.nl>

From the ‘help’ section of ft_freqanalysis:


%   cfg.pad         = number, 'nextpow2', or 'maxperlen' (default), length
%                      in seconds to which the data can be padded out. The
%                      padding will determine your spectral resolution. If you
%                      want to compare spectra from data pieces of different
%                      lengths, you should use the same cfg.pad for both, in
%                      order to spectrally interpolate them to the same
%                      spectral resolution.  The new option 'nextpow2' rounds
%                      the maximum trial length up to the next power of 2.  By
%                      using that amount of padding, the FFT can be computed
%                      more efficiently in case 'maxperlen' has a large prime
%                      factor sum.

Thus, the number you give in will be the total length of the vector after padding. This number should therefore be at least as long as the longest trial in your data. Which is also what the error message reflects.

Best wishes,
Jan-Mathijs



On 28 Jun 2019, at 00:08, Ioanna Zioga <i.zioga at qmul.ac.uk<mailto:i.zioga at qmul.ac.uk>> wrote:

Dear Fieldtrip community!

I would like to ask for your advice on zero padding when doing TFR analysis.

I'm analysing trials of different lengths, so I loop over the trials to run ft_freqanalysis.
I read in the tutorials that the padding length should be >= to the length of the trial.

Therefore, I prepared these parameters:

cfg = [];
cfg.method = 'wavelet';
cfg.output = 'pow';
cfg.foi = [2:1:40];
cfg.width = 6;
cfg.keeptrials = 'yes';
cfg.toi = data.time{1};
cfg.pad = round(length(data.time{1}(1,:))/500)+5; % duration of trial plus 5 seconds
% my sampling rate is 500
res = ft_freqanalysis(cfg,data);

Even if I add 5 seconds more to the length of the cfg.pad, SOMETIMES (and I
cannot figure out a pattern..), I get this error:
Error using ft_specest_wavelet (line 60)
the padding that you specified is shorter than the data

Error in ft_freqanalysis (line 505)
        [spectrum,foi,toi] = ft_specest_wavelet(dat, time, 'timeoi', cfg.toi, 'width', cfg.width, 'gwidth', cfg.gwidth,options{:},
        'feedback', fbopt);

The length of the above trial was 20 seconds (+5 secs padding).
Do you have any idea what is the problem?

Freqanalysis runs smoothly in trials with other trials with smaller or longer duration, and I can't find a pattern of when this error comes up..

Any idea would be extremely helpful, thanks so so much in advance!

Best,
Ioanna

_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190628/43366f80/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jan.schoffelen at donders.ru.nl  Fri Jun 28 08:32:32 2019
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Fri, 28 Jun 2019 06:32:32 +0000
Subject: [FieldTrip] TFR zero padding duration?
In-Reply-To: <AM0PR0702MB3730EF3BCB4F037AEDB4C6C8DEFD0@AM0PR0702MB3730.eurprd07.prod.outlook.com>
References: <AM0PR0702MB3730EF3BCB4F037AEDB4C6C8DEFD0@AM0PR0702MB3730.eurprd07.prod.outlook.com>
Message-ID: <A4516165-B230-481F-9C63-78DB260F2894@donders.ru.nl>

From the ‘help’ section of ft_freqanalysis:


%   cfg.pad         = number, 'nextpow2', or 'maxperlen' (default), length
%                      in seconds to which the data can be padded out. The
%                      padding will determine your spectral resolution. If you
%                      want to compare spectra from data pieces of different
%                      lengths, you should use the same cfg.pad for both, in
%                      order to spectrally interpolate them to the same
%                      spectral resolution.  The new option 'nextpow2' rounds
%                      the maximum trial length up to the next power of 2.  By
%                      using that amount of padding, the FFT can be computed
%                      more efficiently in case 'maxperlen' has a large prime
%                      factor sum.

Thus, the number you give in will be the total length of the vector after padding. This number should therefore be at least as long as the longest trial in your data. Which is also what the error message reflects.

Best wishes,
Jan-Mathijs



On 28 Jun 2019, at 00:08, Ioanna Zioga <i.zioga at qmul.ac.uk<mailto:i.zioga at qmul.ac.uk>> wrote:

Dear Fieldtrip community!

I would like to ask for your advice on zero padding when doing TFR analysis.

I'm analysing trials of different lengths, so I loop over the trials to run ft_freqanalysis.
I read in the tutorials that the padding length should be >= to the length of the trial.

Therefore, I prepared these parameters:

cfg = [];
cfg.method = 'wavelet';
cfg.output = 'pow';
cfg.foi = [2:1:40];
cfg.width = 6;
cfg.keeptrials = 'yes';
cfg.toi = data.time{1};
cfg.pad = round(length(data.time{1}(1,:))/500)+5; % duration of trial plus 5 seconds
% my sampling rate is 500
res = ft_freqanalysis(cfg,data);

Even if I add 5 seconds more to the length of the cfg.pad, SOMETIMES (and I
cannot figure out a pattern..), I get this error:
Error using ft_specest_wavelet (line 60)
the padding that you specified is shorter than the data

Error in ft_freqanalysis (line 505)
        [spectrum,foi,toi] = ft_specest_wavelet(dat, time, 'timeoi', cfg.toi, 'width', cfg.width, 'gwidth', cfg.gwidth,options{:},
        'feedback', fbopt);

The length of the above trial was 20 seconds (+5 secs padding).
Do you have any idea what is the problem?

Freqanalysis runs smoothly in trials with other trials with smaller or longer duration, and I can't find a pattern of when this error comes up..

Any idea would be extremely helpful, thanks so so much in advance!

Best,
Ioanna

_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190628/43366f80/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jan.schoffelen at donders.ru.nl  Fri Jun 28 09:46:23 2019
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Fri, 28 Jun 2019 07:46:23 +0000
Subject: [FieldTrip] Subject: conditional granger causality
In-Reply-To: <CAKN_vcjqruc3Nj65-7kgKT_tTQ0eh7v2iox3Z8X2xXJ906yb1w@mail.gmail.com>
References: <CAKN_vcjqruc3Nj65-7kgKT_tTQ0eh7v2iox3Z8X2xXJ906yb1w@mail.gmail.com>
Message-ID: <E99342E1-11D1-4F40-9DE3-5DDDF9A084D1@donders.ru.nl>

Hi Edoardo,

As I alluded to in an earlier message, the conditional granger is indeed poorly documented, and can behave unpredictably if one does not know what he/she is doing.
I think a good prerequisite for being able to appreciate the algorithmic and implementational limitations would be the faculty to figure out from the code how stuff needs to be specified.

So my question back would be, what have you tried so far, and have you read the code in detail? Doing some detective work, you will probably have noticed that ft_connectivityanalysis sends you into ft_connectivity_csd2transfer, which basically tries to guess what the required bivariate-block and trivariate-block wise combinations should be, if ‘conditional’ is specified to yes. Then, further down in the code (let’s say, for the sake of it, around line 281) the actual computations take place, where possibly some hints are given as to how to specify the cfg.block struct-array.

If you dig into it a little bit, you will be rewarded! Please don’t forget to consider writing a piece of documentation for on the website (e.g. as an example script or a FAQ) for future reference.

Good luck and happy computing.

Jan-Mathijs



> On 27 Jun 2019, at 18:34, Edoardo Pinzuti <edoardo.pinzuti at gmail.com> wrote:
> 
> Dear all,
> 
> Looking at the code for conditional spectral Granger it looks like that if one want to derive GC from s1 to s2 conditional on the rest e.g. s3, the nonparametric spectral factorization is computed on cross-spectral matrix containing all s1,s2,s3  and  on cross-spectral matrix containing s2 and s3. These two factorization are used to derive GC from s1 to s2 conditional on the rest. 
> 
> Suppose s1  has two components:  s1a and s1b , s2 as well: s2a and s2b and so on, I would like to compute the conditional Granger as before from s1 to s2 using a blockwise approach (where s1a and s1b are one block etc). These can be done with  cfg.granger.block and channels combination ?  
> Since it is poorly documented someone can provide a simple example 
> 
> cfg.channel={'s1a','s1b','s2a','s2b','s3a','s3b'}
> 
>  cfg = [];
>  cfg.method = 'granger';
>  cfg.granger.sfmethod='multivariate';
>  cfg.granger.conditional='yes';
>  cfg.channelcmb = { ??     };   
>  cfg.granger.block = ??          
>  g_stopCond = ft_connectivityanalysis(cfg, freq);
> 
> thanks
> Edoardo
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202


_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jan.schoffelen at donders.ru.nl  Fri Jun 28 09:46:23 2019
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Fri, 28 Jun 2019 07:46:23 +0000
Subject: [FieldTrip] Subject: conditional granger causality
In-Reply-To: <CAKN_vcjqruc3Nj65-7kgKT_tTQ0eh7v2iox3Z8X2xXJ906yb1w@mail.gmail.com>
References: <CAKN_vcjqruc3Nj65-7kgKT_tTQ0eh7v2iox3Z8X2xXJ906yb1w@mail.gmail.com>
Message-ID: <E99342E1-11D1-4F40-9DE3-5DDDF9A084D1@donders.ru.nl>

Hi Edoardo,

As I alluded to in an earlier message, the conditional granger is indeed poorly documented, and can behave unpredictably if one does not know what he/she is doing.
I think a good prerequisite for being able to appreciate the algorithmic and implementational limitations would be the faculty to figure out from the code how stuff needs to be specified.

So my question back would be, what have you tried so far, and have you read the code in detail? Doing some detective work, you will probably have noticed that ft_connectivityanalysis sends you into ft_connectivity_csd2transfer, which basically tries to guess what the required bivariate-block and trivariate-block wise combinations should be, if ‘conditional’ is specified to yes. Then, further down in the code (let’s say, for the sake of it, around line 281) the actual computations take place, where possibly some hints are given as to how to specify the cfg.block struct-array.

If you dig into it a little bit, you will be rewarded! Please don’t forget to consider writing a piece of documentation for on the website (e.g. as an example script or a FAQ) for future reference.

Good luck and happy computing.

Jan-Mathijs



> On 27 Jun 2019, at 18:34, Edoardo Pinzuti <edoardo.pinzuti at gmail.com> wrote:
> 
> Dear all,
> 
> Looking at the code for conditional spectral Granger it looks like that if one want to derive GC from s1 to s2 conditional on the rest e.g. s3, the nonparametric spectral factorization is computed on cross-spectral matrix containing all s1,s2,s3  and  on cross-spectral matrix containing s2 and s3. These two factorization are used to derive GC from s1 to s2 conditional on the rest. 
> 
> Suppose s1  has two components:  s1a and s1b , s2 as well: s2a and s2b and so on, I would like to compute the conditional Granger as before from s1 to s2 using a blockwise approach (where s1a and s1b are one block etc). These can be done with  cfg.granger.block and channels combination ?  
> Since it is poorly documented someone can provide a simple example 
> 
> cfg.channel={'s1a','s1b','s2a','s2b','s3a','s3b'}
> 
>  cfg = [];
>  cfg.method = 'granger';
>  cfg.granger.sfmethod='multivariate';
>  cfg.granger.conditional='yes';
>  cfg.channelcmb = { ??     };   
>  cfg.granger.block = ??          
>  g_stopCond = ft_connectivityanalysis(cfg, freq);
> 
> thanks
> Edoardo
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202


_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From raphael.theze at gmail.com  Fri Jun 28 14:01:32 2019
From: raphael.theze at gmail.com (=?UTF-8?B?UmFwaGHDq2wgVGjDqXrDqQ==?=)
Date: Fri, 28 Jun 2019 14:01:32 +0200
Subject: [FieldTrip] EGI mff file import
In-Reply-To: <2C638EED-5DBF-49F0-AA9C-1DE8E0AF430D@donders.ru.nl>
References: <CALhXZTY5JFj6UoNRhtSXaPbb=bBm=k8nv=XAeHqeU4N+DzdZvQ@mail.gmail.com>
 <2C638EED-5DBF-49F0-AA9C-1DE8E0AF430D@donders.ru.nl>
Message-ID: <CALhXZTYn-Tf0aSrrgvmO=y4eMW8O22e1F0Gte3rM8NbHZHWeSA@mail.gmail.com>

Dear Jan,

I have tried increasing the java heap memory but the processing still takes
~1 min per individual trial.

Regarding the code, I have tried to break down the different steps, and my
impression was that the preproc function was slowing down the whole
process, but this is only the case in the fieldtrip version with mff v3. I
can try to go over the code again but the deeper I go into the FT
functions, the more confusing it gets!

Thanks for the help,
Best
Raphaël

Le jeu. 13 juin 2019 à 18:27, Schoffelen, J.M. (Jan Mathijs) <
jan.schoffelen at donders.ru.nl> a écrit :

> Dear Raphael,
>
> I happened to bump into Trey Avery, from Philips/egi the other day, and he
> mentioned that you might want to consider to increase the java heap memory
> to a larger value. How this can be done is shown here:
> https://www.mathworks.com/help/matlab/matlab_external/java-heap-memory-preferences.html
>
> That is, in your message you are a bit ambiguous as to where exactly in
> the code the slowdown takes place. If it is indeed preproc, as you mention,
> then it’s probably not an input/output problem.
>
> Anyway, it wouldn’t hurt to try I think. Could you let us know whether
> this works for you? In that case we can add this to our documentation
> section of ‘getting started with egi data’ on our fieldtriptoolbox.org website.
> Also, the current version of that part of the documentation could be
> improved a bit I think to reflect better the recent improvements to the
> code (i.e. the use of the v3 reader…). Feel free to suggest changes
> yourself.
>
> Best wishes,
>
> Jan-Mathijs
>
> On 24 May 2019, at 15:58, Raphaël Thézé <raphael.theze at gmail.com> wrote:
>
> Dear all,
>
> I have a question regarding the import of mff file format.
>
> I used to import my EGI data with fieldtrip version 20180201 which worked
> fine (with egi_mff_v1) but when I switched to fieldtrip version 20190325,
> it uses egi_mff_v3 as default. The latter also works well except that when
> it used to take 1 sec per trial to be imported with V1, now it takes about
> 1 minute per trial with V3. The amount of time needed to import one subject
> in my case would be theoretically 3 hours, which is ridiculously long. I
> understand that the switch of version takes place in ft_read_data, which is
> called by ft_preprocessing, but apparently it is preproc, also called by
> ft_preprocessing, that takes forever to compute, but I can't explain why. I
> tried to manually request to use the version egi_mff_V1 but then there is
> an error regarding xml file, that I have not tried to explore so far.
>
> For now I will just go back to the 20180201 version of fieldtrip so I can
> quickly import data into matlab, but I would like to understand what is
> going wrong here, or if it is to be expected.
>
> In advance, thank you all.
> Best,
> Raphaël
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202
>
>
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190628/20cbcfe4/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From raphael.theze at gmail.com  Fri Jun 28 14:01:32 2019
From: raphael.theze at gmail.com (=?UTF-8?B?UmFwaGHDq2wgVGjDqXrDqQ==?=)
Date: Fri, 28 Jun 2019 14:01:32 +0200
Subject: [FieldTrip] EGI mff file import
In-Reply-To: <2C638EED-5DBF-49F0-AA9C-1DE8E0AF430D@donders.ru.nl>
References: <CALhXZTY5JFj6UoNRhtSXaPbb=bBm=k8nv=XAeHqeU4N+DzdZvQ@mail.gmail.com>
 <2C638EED-5DBF-49F0-AA9C-1DE8E0AF430D@donders.ru.nl>
Message-ID: <CALhXZTYn-Tf0aSrrgvmO=y4eMW8O22e1F0Gte3rM8NbHZHWeSA@mail.gmail.com>

Dear Jan,

I have tried increasing the java heap memory but the processing still takes
~1 min per individual trial.

Regarding the code, I have tried to break down the different steps, and my
impression was that the preproc function was slowing down the whole
process, but this is only the case in the fieldtrip version with mff v3. I
can try to go over the code again but the deeper I go into the FT
functions, the more confusing it gets!

Thanks for the help,
Best
Raphaël

Le jeu. 13 juin 2019 à 18:27, Schoffelen, J.M. (Jan Mathijs) <
jan.schoffelen at donders.ru.nl> a écrit :

> Dear Raphael,
>
> I happened to bump into Trey Avery, from Philips/egi the other day, and he
> mentioned that you might want to consider to increase the java heap memory
> to a larger value. How this can be done is shown here:
> https://www.mathworks.com/help/matlab/matlab_external/java-heap-memory-preferences.html
>
> That is, in your message you are a bit ambiguous as to where exactly in
> the code the slowdown takes place. If it is indeed preproc, as you mention,
> then it’s probably not an input/output problem.
>
> Anyway, it wouldn’t hurt to try I think. Could you let us know whether
> this works for you? In that case we can add this to our documentation
> section of ‘getting started with egi data’ on our fieldtriptoolbox.org website.
> Also, the current version of that part of the documentation could be
> improved a bit I think to reflect better the recent improvements to the
> code (i.e. the use of the v3 reader…). Feel free to suggest changes
> yourself.
>
> Best wishes,
>
> Jan-Mathijs
>
> On 24 May 2019, at 15:58, Raphaël Thézé <raphael.theze at gmail.com> wrote:
>
> Dear all,
>
> I have a question regarding the import of mff file format.
>
> I used to import my EGI data with fieldtrip version 20180201 which worked
> fine (with egi_mff_v1) but when I switched to fieldtrip version 20190325,
> it uses egi_mff_v3 as default. The latter also works well except that when
> it used to take 1 sec per trial to be imported with V1, now it takes about
> 1 minute per trial with V3. The amount of time needed to import one subject
> in my case would be theoretically 3 hours, which is ridiculously long. I
> understand that the switch of version takes place in ft_read_data, which is
> called by ft_preprocessing, but apparently it is preproc, also called by
> ft_preprocessing, that takes forever to compute, but I can't explain why. I
> tried to manually request to use the version egi_mff_V1 but then there is
> an error regarding xml file, that I have not tried to explore so far.
>
> For now I will just go back to the 20180201 version of fieldtrip so I can
> quickly import data into matlab, but I would like to understand what is
> going wrong here, or if it is to be expected.
>
> In advance, thank you all.
> Best,
> Raphaël
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202
>
>
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190628/20cbcfe4/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From a.stolk8 at gmail.com  Sat Jun 29 00:35:36 2019
From: a.stolk8 at gmail.com (Arjen Stolk)
Date: Fri, 28 Jun 2019 15:35:36 -0700
Subject: [FieldTrip] Fwd: correlation with behavioural data and cluster
 statistics
In-Reply-To: <AM5PR0602MB27553879FEA533D029DC6F0591FD0@AM5PR0602MB2755.eurprd06.prod.outlook.com>
References: <CAEP2PttySmhOVXd0Mijrf0v0YHpaZmeiOX6uRgAfUS-O+R0k5Q@mail.gmail.com>
 <CAEP2PturVWkZk8FJe2osHgyTCaCSS059jBZbb6wdKw2-uOKDxg@mail.gmail.com>
 <24502A09-8940-4825-83E2-A25B4420775D@gmail.com>
 <CAEP2Ptu97RZ_zrCtOSEoECxDoiD0ovKSyEDNcne4Pjzs0-H_pw@mail.gmail.com>
 <AM5PR0602MB275549E5CE272B7FAAF9980F91490@AM5PR0602MB2755.eurprd06.prod.outlook.com>
 <CAAiwptTz1q6pioZJtzvTZR3dCfsGzmY=Tmv=_-h7s4qYeFS8tg@mail.gmail.com>
 <AM5PR0602MB27553879FEA533D029DC6F0591FD0@AM5PR0602MB2755.eurprd06.prod.outlook.com>
Message-ID: <CAAiwptSYNvPzG15ef1tCEoHubVbOVDwtdY4S9-_3FsBZUwk52A@mail.gmail.com>

Hi Juan,

Yes. Indeed, you will have to use ft_timelockstatistics
specifying cfg.statistic = 'ft_statfun_indepsamplesregrT'. For more
information on testing for correlations between neural and say behavioral
data, please see here
<http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_correlations_between_neuronal_data_and_quantitative_stimulus_and_behavioural_variables/>
.

Best,
Arjen

On Thu, Jun 27, 2019 at 8:33 AM Juan Lei <juan.lei at hotmail.com> wrote:

> Dear Arjen,
>
> can this ft_statfun_indepsamplesregrT also work for ERP data, i. e. the
> data only have three dimensions (time, channel and subject)?
>
> In this case, of course I have to use
> ft_timelockstatistics(cfg,GAalldevRi) in the end.
>
> Best,
>
> Juan
> ------------------------------
> *From:* fieldtrip <fieldtrip-bounces at science.ru.nl> on behalf of Arjen
> Stolk <a.stolk8 at gmail.com>
> *Sent:* Sunday, March 17, 2019 7:12 AM
> *To:* FieldTrip discussion list
> *Subject:* Re: [FieldTrip] Fwd: correlation with behavioural data and
> cluster statistics
>
> Dear Juan,
>
> Your code looks fine to me. Indeed, also with
> ft_statfun_indepsamplesregrT, the behavioral vector goes into the design
> matrix.
>
> All p-values computed with the montecarlo method correspond to one tail
> and, thus, you would need to correct for this one-sided test approach if
> you intended to do a two-sided test. Either cfg.correcttail = 'alpha' or
> 'prob' will achieve this, as further explained here
> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.fieldtriptoolbox.org%2Ffaq%2Fwhy_should_i_use_the_cfg.correcttail_option_when_using_statistics_montecarlo%2F&data=02%7C01%7C%7C6482c0ed5b854521095608d6aaa1afee%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636884008747439566&sdata=cCUJE92o9BrAd35xx36cP0fkXukAUhsNW%2BEt4xMnwCM%3D&reserved=0>
> .
>
> Have a great weekend,
> Arjen
>
> On Tue, Mar 12, 2019 at 7:35 AM Juan Lei <juan.lei at hotmail.com> wrote:
>
> Dear Arjen,
>
> if I use ft_statfun_indepsamplesregrT, are all the Parameters the same as correlationT
> method ? Below are all my parameters used. Are they correct? Another
> question is whether I need the "cfg.correcttail  =  'alpha'" for the
> indepsamplesregrT methoed?
>
>    cfg=[];
>    cfg.channel          = {'*'};​
>    cfg.frequency        = [15 35];
>    cfg.avgoverfreq      ='no';
>    cfg.latency          = [-0.7 0];​
>    cfg.avgoverchan      = 'no';​
>    cfg.avgovertime      = 'no';​
>    cfg.parameter        = 'powspctrm';​
>    cfg.method           = 'montecarlo';​
>    cfg.alpha            = 0.05;
>    cfg.numrandomization = 1000;​
>    cfg.correctm         = 'cluster';​
>    cfg.clusteralpha     = 0.05;​
>    cfg.clusterstatistic = 'maxsum';​
>    cfg.correcttail      =  'alpha';
>    cfg.tail             = 0;​
>    cfg.clustertail      = 0;​
>    cfg.minnbchan        = 2;​
>    cfg.neighbours       = neighbours;​
>    cfg.statistic        ='ft_statfun_indepsamplesregrT';
>    cfg.ivar             = 1;​
>    cfg.design = [];​
>    cfg.design(1,:) = xa;​% xa is my behavioral vector. Each subject has
> one behavioral value.
>    freq_stat = ft_freqstatistics(cfg,GA_RI);% GA_RI is my time frequency
> data averaged across group but keeping individuals.
>
>
> Best regards,
>
> Juan Lei
>
>
>
>
> ------------------------------
> *From:* fieldtrip <fieldtrip-bounces at science.ru.nl> on behalf of Valeriya
> Belyaeva <vabelyaeva94 at gmail.com>
> *Sent:* Tuesday, February 19, 2019 7:11 PM
> *To:* FieldTrip discussion list
> *Subject:* Re: [FieldTrip] Fwd: correlation with behavioural data and
> cluster statistics
>
> Thank you a lot, Arjen.
>
> Best regards,
> Valeriya
>
> вт, 19 февр. 2019 г. в 18:44, Arjen Stolk <a.stolk8 at gmail.com>:
>
> Hi Valeriya,
>
> That looks to be correct use of the correlationT method. The behavioral
> data goes into the design matrix, as you did.
>
> Best,
> Arjen
>
> On Feb 19, 2019, at 6:35 AM, Valeriya Belyaeva <vabelyaeva94 at gmail.com>
> wrote:
>
>
>
> ---------- Forwarded message ---------
> From: * Valeriya Belyaeva* <vabelyaeva94 at gmail.com>
> Date: ср, 13 февр. 2019 г. в 16:28
> Subject: correlation with behavioural data and cluster statistics
> To: <fieldtrip at science.ru.nl>
>
>
> Dear fieldtrip developers,
>
> I have a question about correlation of neuronal and behavioural data. You
> have discussed this question here:
> http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_correlations_between_neuronal_data_and_quantitative_stimulus_and_behavioural_variables/
> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.fieldtriptoolbox.org%2Ffaq%2Fhow_can_i_test_for_correlations_between_neuronal_data_and_quantitative_stimulus_and_behavioural_variables%2F&data=02%7C01%7C%7C6482c0ed5b854521095608d6aaa1afee%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636884008747449571&sdata=qic0njE42iEFnLzLpjI5pOH3Qixs6BfGYLlsS2yuVPk%3D&reserved=0>
>
> I have taken the code, which was given as an example and added
> cluster-based correction method. My goal is to perform correlation between
> neuronal and behavioural data and then to account for multiple comparisons
> with cluster statistics.
>
> Could you, please, tell me, whether this script does it?
>
> Here is the script:
>
> % example script
>
> cfg = [];
>
> cfg.statistic        = 'ft_statfun_correlationT';
>
> cfg.method           = 'montecarlo';
>
> cfg.numrandomization = 1000;
>
> cfg.correctm         = 'cluster';
>
>
> cfg.clusteralpha     = 0.025;
>
> cfg_neighb.method = 'triangulation';
>
> cfg_neighb.layout = 'acticap_62';
>
> cfg.neighbours = ft_prepare_neighbours(cfg_neighb, data_brain{:});
>
>
> n1 = 42;    % n1 is the number of subjects
>
> design(1,1:n1)       = behav_data(:,1); % mean reaction time by subject
>
> cfg.design           = design;
>
> cfg.ivar             = 1;
>
> stat = ft_freqstatistics(cfg, data_brain{:});
>
> Thank you a lot in advance!
> --
> Best regards,
> Valeriya Belyaeva
> HSE, Cognitive science and technologies
>
>
>
> --
> Best regards,
> Valeriya Belyaeva
> HSE, Cognitive science and technologies
>
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=02%7C01%7C%7C6482c0ed5b854521095608d6aaa1afee%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636884008747459581&sdata=N8cEFn91nSkR8l0OA%2B6%2BqQYs%2Bcnx9ZJytZMu8uQFDYo%3D&reserved=0>
> https://doi.org/10.1371/journal.pcbi.1002202
> <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=02%7C01%7C%7C6482c0ed5b854521095608d6aaa1afee%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636884008747469586&sdata=dr%2FO6kt9rbRIPu3GpQk1D9%2BVuxMfg5OxPJzNQgoZheQ%3D&reserved=0>
>
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=02%7C01%7C%7C6482c0ed5b854521095608d6aaa1afee%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636884008747489602&sdata=q91RtnrucbD%2Fd%2Fn9v1f9EyJihjXCUSbstmU9gYK66Wo%3D&reserved=0>
> https://doi.org/10.1371/journal.pcbi.1002202
> <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=02%7C01%7C%7C6482c0ed5b854521095608d6aaa1afee%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636884008747499607&sdata=q3op8RD6C6E3WFxcQ2I8%2Fg7bkfzX6Vyc5jsGHfWOfPk%3D&reserved=0>
>
>
>
> --
> Best regards,
> Valeriya Belyaeva
> HSE, Cognitive science and technologies
>
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=02%7C01%7C%7C6482c0ed5b854521095608d6aaa1afee%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636884008747510970&sdata=wHjEE%2B8%2FqnJYLVLjx7OmC9bBLhhV84h4ZttZtC5pUdo%3D&reserved=0>
> https://doi.org/10.1371/journal.pcbi.1002202
> <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=02%7C01%7C%7C6482c0ed5b854521095608d6aaa1afee%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636884008747519617&sdata=gVJd%2BEAz4hsZKd6v2lDgXG98gsnhELRu%2B9%2BHU80jAFc%3D&reserved=0>
>
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190628/1d4fd883/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From a.stolk8 at gmail.com  Sat Jun 29 00:35:36 2019
From: a.stolk8 at gmail.com (Arjen Stolk)
Date: Fri, 28 Jun 2019 15:35:36 -0700
Subject: [FieldTrip] Fwd: correlation with behavioural data and cluster
 statistics
In-Reply-To: <AM5PR0602MB27553879FEA533D029DC6F0591FD0@AM5PR0602MB2755.eurprd06.prod.outlook.com>
References: <CAEP2PttySmhOVXd0Mijrf0v0YHpaZmeiOX6uRgAfUS-O+R0k5Q@mail.gmail.com>
 <CAEP2PturVWkZk8FJe2osHgyTCaCSS059jBZbb6wdKw2-uOKDxg@mail.gmail.com>
 <24502A09-8940-4825-83E2-A25B4420775D@gmail.com>
 <CAEP2Ptu97RZ_zrCtOSEoECxDoiD0ovKSyEDNcne4Pjzs0-H_pw@mail.gmail.com>
 <AM5PR0602MB275549E5CE272B7FAAF9980F91490@AM5PR0602MB2755.eurprd06.prod.outlook.com>
 <CAAiwptTz1q6pioZJtzvTZR3dCfsGzmY=Tmv=_-h7s4qYeFS8tg@mail.gmail.com>
 <AM5PR0602MB27553879FEA533D029DC6F0591FD0@AM5PR0602MB2755.eurprd06.prod.outlook.com>
Message-ID: <CAAiwptSYNvPzG15ef1tCEoHubVbOVDwtdY4S9-_3FsBZUwk52A@mail.gmail.com>

Hi Juan,

Yes. Indeed, you will have to use ft_timelockstatistics
specifying cfg.statistic = 'ft_statfun_indepsamplesregrT'. For more
information on testing for correlations between neural and say behavioral
data, please see here
<http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_correlations_between_neuronal_data_and_quantitative_stimulus_and_behavioural_variables/>
.

Best,
Arjen

On Thu, Jun 27, 2019 at 8:33 AM Juan Lei <juan.lei at hotmail.com> wrote:

> Dear Arjen,
>
> can this ft_statfun_indepsamplesregrT also work for ERP data, i. e. the
> data only have three dimensions (time, channel and subject)?
>
> In this case, of course I have to use
> ft_timelockstatistics(cfg,GAalldevRi) in the end.
>
> Best,
>
> Juan
> ------------------------------
> *From:* fieldtrip <fieldtrip-bounces at science.ru.nl> on behalf of Arjen
> Stolk <a.stolk8 at gmail.com>
> *Sent:* Sunday, March 17, 2019 7:12 AM
> *To:* FieldTrip discussion list
> *Subject:* Re: [FieldTrip] Fwd: correlation with behavioural data and
> cluster statistics
>
> Dear Juan,
>
> Your code looks fine to me. Indeed, also with
> ft_statfun_indepsamplesregrT, the behavioral vector goes into the design
> matrix.
>
> All p-values computed with the montecarlo method correspond to one tail
> and, thus, you would need to correct for this one-sided test approach if
> you intended to do a two-sided test. Either cfg.correcttail = 'alpha' or
> 'prob' will achieve this, as further explained here
> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.fieldtriptoolbox.org%2Ffaq%2Fwhy_should_i_use_the_cfg.correcttail_option_when_using_statistics_montecarlo%2F&data=02%7C01%7C%7C6482c0ed5b854521095608d6aaa1afee%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636884008747439566&sdata=cCUJE92o9BrAd35xx36cP0fkXukAUhsNW%2BEt4xMnwCM%3D&reserved=0>
> .
>
> Have a great weekend,
> Arjen
>
> On Tue, Mar 12, 2019 at 7:35 AM Juan Lei <juan.lei at hotmail.com> wrote:
>
> Dear Arjen,
>
> if I use ft_statfun_indepsamplesregrT, are all the Parameters the same as correlationT
> method ? Below are all my parameters used. Are they correct? Another
> question is whether I need the "cfg.correcttail  =  'alpha'" for the
> indepsamplesregrT methoed?
>
>    cfg=[];
>    cfg.channel          = {'*'};​
>    cfg.frequency        = [15 35];
>    cfg.avgoverfreq      ='no';
>    cfg.latency          = [-0.7 0];​
>    cfg.avgoverchan      = 'no';​
>    cfg.avgovertime      = 'no';​
>    cfg.parameter        = 'powspctrm';​
>    cfg.method           = 'montecarlo';​
>    cfg.alpha            = 0.05;
>    cfg.numrandomization = 1000;​
>    cfg.correctm         = 'cluster';​
>    cfg.clusteralpha     = 0.05;​
>    cfg.clusterstatistic = 'maxsum';​
>    cfg.correcttail      =  'alpha';
>    cfg.tail             = 0;​
>    cfg.clustertail      = 0;​
>    cfg.minnbchan        = 2;​
>    cfg.neighbours       = neighbours;​
>    cfg.statistic        ='ft_statfun_indepsamplesregrT';
>    cfg.ivar             = 1;​
>    cfg.design = [];​
>    cfg.design(1,:) = xa;​% xa is my behavioral vector. Each subject has
> one behavioral value.
>    freq_stat = ft_freqstatistics(cfg,GA_RI);% GA_RI is my time frequency
> data averaged across group but keeping individuals.
>
>
> Best regards,
>
> Juan Lei
>
>
>
>
> ------------------------------
> *From:* fieldtrip <fieldtrip-bounces at science.ru.nl> on behalf of Valeriya
> Belyaeva <vabelyaeva94 at gmail.com>
> *Sent:* Tuesday, February 19, 2019 7:11 PM
> *To:* FieldTrip discussion list
> *Subject:* Re: [FieldTrip] Fwd: correlation with behavioural data and
> cluster statistics
>
> Thank you a lot, Arjen.
>
> Best regards,
> Valeriya
>
> вт, 19 февр. 2019 г. в 18:44, Arjen Stolk <a.stolk8 at gmail.com>:
>
> Hi Valeriya,
>
> That looks to be correct use of the correlationT method. The behavioral
> data goes into the design matrix, as you did.
>
> Best,
> Arjen
>
> On Feb 19, 2019, at 6:35 AM, Valeriya Belyaeva <vabelyaeva94 at gmail.com>
> wrote:
>
>
>
> ---------- Forwarded message ---------
> From: * Valeriya Belyaeva* <vabelyaeva94 at gmail.com>
> Date: ср, 13 февр. 2019 г. в 16:28
> Subject: correlation with behavioural data and cluster statistics
> To: <fieldtrip at science.ru.nl>
>
>
> Dear fieldtrip developers,
>
> I have a question about correlation of neuronal and behavioural data. You
> have discussed this question here:
> http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_correlations_between_neuronal_data_and_quantitative_stimulus_and_behavioural_variables/
> <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.fieldtriptoolbox.org%2Ffaq%2Fhow_can_i_test_for_correlations_between_neuronal_data_and_quantitative_stimulus_and_behavioural_variables%2F&data=02%7C01%7C%7C6482c0ed5b854521095608d6aaa1afee%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636884008747449571&sdata=qic0njE42iEFnLzLpjI5pOH3Qixs6BfGYLlsS2yuVPk%3D&reserved=0>
>
> I have taken the code, which was given as an example and added
> cluster-based correction method. My goal is to perform correlation between
> neuronal and behavioural data and then to account for multiple comparisons
> with cluster statistics.
>
> Could you, please, tell me, whether this script does it?
>
> Here is the script:
>
> % example script
>
> cfg = [];
>
> cfg.statistic        = 'ft_statfun_correlationT';
>
> cfg.method           = 'montecarlo';
>
> cfg.numrandomization = 1000;
>
> cfg.correctm         = 'cluster';
>
>
> cfg.clusteralpha     = 0.025;
>
> cfg_neighb.method = 'triangulation';
>
> cfg_neighb.layout = 'acticap_62';
>
> cfg.neighbours = ft_prepare_neighbours(cfg_neighb, data_brain{:});
>
>
> n1 = 42;    % n1 is the number of subjects
>
> design(1,1:n1)       = behav_data(:,1); % mean reaction time by subject
>
> cfg.design           = design;
>
> cfg.ivar             = 1;
>
> stat = ft_freqstatistics(cfg, data_brain{:});
>
> Thank you a lot in advance!
> --
> Best regards,
> Valeriya Belyaeva
> HSE, Cognitive science and technologies
>
>
>
> --
> Best regards,
> Valeriya Belyaeva
> HSE, Cognitive science and technologies
>
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=02%7C01%7C%7C6482c0ed5b854521095608d6aaa1afee%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636884008747459581&sdata=N8cEFn91nSkR8l0OA%2B6%2BqQYs%2Bcnx9ZJytZMu8uQFDYo%3D&reserved=0>
> https://doi.org/10.1371/journal.pcbi.1002202
> <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=02%7C01%7C%7C6482c0ed5b854521095608d6aaa1afee%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636884008747469586&sdata=dr%2FO6kt9rbRIPu3GpQk1D9%2BVuxMfg5OxPJzNQgoZheQ%3D&reserved=0>
>
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=02%7C01%7C%7C6482c0ed5b854521095608d6aaa1afee%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636884008747489602&sdata=q91RtnrucbD%2Fd%2Fn9v1f9EyJihjXCUSbstmU9gYK66Wo%3D&reserved=0>
> https://doi.org/10.1371/journal.pcbi.1002202
> <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=02%7C01%7C%7C6482c0ed5b854521095608d6aaa1afee%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636884008747499607&sdata=q3op8RD6C6E3WFxcQ2I8%2Fg7bkfzX6Vyc5jsGHfWOfPk%3D&reserved=0>
>
>
>
> --
> Best regards,
> Valeriya Belyaeva
> HSE, Cognitive science and technologies
>
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=02%7C01%7C%7C6482c0ed5b854521095608d6aaa1afee%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636884008747510970&sdata=wHjEE%2B8%2FqnJYLVLjx7OmC9bBLhhV84h4ZttZtC5pUdo%3D&reserved=0>
> https://doi.org/10.1371/journal.pcbi.1002202
> <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=02%7C01%7C%7C6482c0ed5b854521095608d6aaa1afee%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636884008747519617&sdata=gVJd%2BEAz4hsZKd6v2lDgXG98gsnhELRu%2B9%2BHU80jAFc%3D&reserved=0>
>
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190628/1d4fd883/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jan.schoffelen at donders.ru.nl  Sat Jun 29 12:27:08 2019
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Sat, 29 Jun 2019 10:27:08 +0000
Subject: [FieldTrip] EGI mff file import
In-Reply-To: <CALhXZTYn-Tf0aSrrgvmO=y4eMW8O22e1F0Gte3rM8NbHZHWeSA@mail.gmail.com>
References: <CALhXZTY5JFj6UoNRhtSXaPbb=bBm=k8nv=XAeHqeU4N+DzdZvQ@mail.gmail.com>
 <2C638EED-5DBF-49F0-AA9C-1DE8E0AF430D@donders.ru.nl>
 <CALhXZTYn-Tf0aSrrgvmO=y4eMW8O22e1F0Gte3rM8NbHZHWeSA@mail.gmail.com>
Message-ID: <F5B81600-51C2-4129-A981-73113E2E4AB0@donders.ru.nl>

Hi Raphael,

If you are unsure about where the slowdown takes place you can evaluate this using the matlab profiler. If you type 'profview on’ a graphical interface to the profiler opens, and you can execute commands, which will then be stopwatched.

Best wishes,
Jan-Mathijs


On 28 Jun 2019, at 14:01, Raphaël Thézé <raphael.theze at gmail.com<mailto:raphael.theze at gmail.com>> wrote:

Dear Jan,

I have tried increasing the java heap memory but the processing still takes ~1 min per individual trial.

Regarding the code, I have tried to break down the different steps, and my impression was that the preproc function was slowing down the whole process, but this is only the case in the fieldtrip version with mff v3. I can try to go over the code again but the deeper I go into the FT functions, the more confusing it gets!

Thanks for the help,
Best
Raphaël

Le jeu. 13 juin 2019 à 18:27, Schoffelen, J.M. (Jan Mathijs) <jan.schoffelen at donders.ru.nl<mailto:jan.schoffelen at donders.ru.nl>> a écrit :
Dear Raphael,

I happened to bump into Trey Avery, from Philips/egi the other day, and he mentioned that you might want to consider to increase the java heap memory to a larger value. How this can be done is shown here: https://www.mathworks.com/help/matlab/matlab_external/java-heap-memory-preferences.html

That is, in your message you are a bit ambiguous as to where exactly in the code the slowdown takes place. If it is indeed preproc, as you mention, then it’s probably not an input/output problem.

Anyway, it wouldn’t hurt to try I think. Could you let us know whether this works for you? In that case we can add this to our documentation section of ‘getting started with egi data’ on our fieldtriptoolbox.org<http://fieldtriptoolbox.org/> website. Also, the current version of that part of the documentation could be improved a bit I think to reflect better the recent improvements to the code (i.e. the use of the v3 reader…). Feel free to suggest changes yourself.

Best wishes,

Jan-Mathijs

On 24 May 2019, at 15:58, Raphaël Thézé <raphael.theze at gmail.com<mailto:raphael.theze at gmail.com>> wrote:

Dear all,

I have a question regarding the import of mff file format.

I used to import my EGI data with fieldtrip version 20180201 which worked fine (with egi_mff_v1) but when I switched to fieldtrip version 20190325, it uses egi_mff_v3 as default. The latter also works well except that when it used to take 1 sec per trial to be imported with V1, now it takes about 1 minute per trial with V3. The amount of time needed to import one subject in my case would be theoretically 3 hours, which is ridiculously long. I understand that the switch of version takes place in ft_read_data, which is called by ft_preprocessing, but apparently it is preproc, also called by ft_preprocessing, that takes forever to compute, but I can't explain why. I tried to manually request to use the version egi_mff_V1 but then there is an error regarding xml file, that I have not tried to explore so far.

For now I will just go back to the 20180201 version of fieldtrip so I can quickly import data into matlab, but I would like to understand what is going wrong here, or if it is to be expected.

In advance, thank you all.
Best,
Raphaël
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190629/931120a0/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From jan.schoffelen at donders.ru.nl  Sat Jun 29 12:27:08 2019
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Sat, 29 Jun 2019 10:27:08 +0000
Subject: [FieldTrip] EGI mff file import
In-Reply-To: <CALhXZTYn-Tf0aSrrgvmO=y4eMW8O22e1F0Gte3rM8NbHZHWeSA@mail.gmail.com>
References: <CALhXZTY5JFj6UoNRhtSXaPbb=bBm=k8nv=XAeHqeU4N+DzdZvQ@mail.gmail.com>
 <2C638EED-5DBF-49F0-AA9C-1DE8E0AF430D@donders.ru.nl>
 <CALhXZTYn-Tf0aSrrgvmO=y4eMW8O22e1F0Gte3rM8NbHZHWeSA@mail.gmail.com>
Message-ID: <F5B81600-51C2-4129-A981-73113E2E4AB0@donders.ru.nl>

Hi Raphael,

If you are unsure about where the slowdown takes place you can evaluate this using the matlab profiler. If you type 'profview on’ a graphical interface to the profiler opens, and you can execute commands, which will then be stopwatched.

Best wishes,
Jan-Mathijs


On 28 Jun 2019, at 14:01, Raphaël Thézé <raphael.theze at gmail.com<mailto:raphael.theze at gmail.com>> wrote:

Dear Jan,

I have tried increasing the java heap memory but the processing still takes ~1 min per individual trial.

Regarding the code, I have tried to break down the different steps, and my impression was that the preproc function was slowing down the whole process, but this is only the case in the fieldtrip version with mff v3. I can try to go over the code again but the deeper I go into the FT functions, the more confusing it gets!

Thanks for the help,
Best
Raphaël

Le jeu. 13 juin 2019 à 18:27, Schoffelen, J.M. (Jan Mathijs) <jan.schoffelen at donders.ru.nl<mailto:jan.schoffelen at donders.ru.nl>> a écrit :
Dear Raphael,

I happened to bump into Trey Avery, from Philips/egi the other day, and he mentioned that you might want to consider to increase the java heap memory to a larger value. How this can be done is shown here: https://www.mathworks.com/help/matlab/matlab_external/java-heap-memory-preferences.html

That is, in your message you are a bit ambiguous as to where exactly in the code the slowdown takes place. If it is indeed preproc, as you mention, then it’s probably not an input/output problem.

Anyway, it wouldn’t hurt to try I think. Could you let us know whether this works for you? In that case we can add this to our documentation section of ‘getting started with egi data’ on our fieldtriptoolbox.org<http://fieldtriptoolbox.org/> website. Also, the current version of that part of the documentation could be improved a bit I think to reflect better the recent improvements to the code (i.e. the use of the v3 reader…). Feel free to suggest changes yourself.

Best wishes,

Jan-Mathijs

On 24 May 2019, at 15:58, Raphaël Thézé <raphael.theze at gmail.com<mailto:raphael.theze at gmail.com>> wrote:

Dear all,

I have a question regarding the import of mff file format.

I used to import my EGI data with fieldtrip version 20180201 which worked fine (with egi_mff_v1) but when I switched to fieldtrip version 20190325, it uses egi_mff_v3 as default. The latter also works well except that when it used to take 1 sec per trial to be imported with V1, now it takes about 1 minute per trial with V3. The amount of time needed to import one subject in my case would be theoretically 3 hours, which is ridiculously long. I understand that the switch of version takes place in ft_read_data, which is called by ft_preprocessing, but apparently it is preproc, also called by ft_preprocessing, that takes forever to compute, but I can't explain why. I tried to manually request to use the version egi_mff_V1 but then there is an error regarding xml file, that I have not tried to explore so far.

For now I will just go back to the 20180201 version of fieldtrip so I can quickly import data into matlab, but I would like to understand what is going wrong here, or if it is to be expected.

In advance, thank you all.
Best,
Raphaël
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190629/931120a0/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From Winson.Yang at ttu.edu  Sun Jun 30 17:57:32 2019
From: Winson.Yang at ttu.edu (Yang, Winson)
Date: Sun, 30 Jun 2019 15:57:32 +0000
Subject: [FieldTrip] Problem streaming realtime data from BrainVision
In-Reply-To: <DM6PR06MB5003DF3A0F243AB3CB8E19EBE8FC0@DM6PR06MB5003.namprd06.prod.outlook.com>
References: <DM6PR06MB5003DF3A0F243AB3CB8E19EBE8FC0@DM6PR06MB5003.namprd06.prod.outlook.com>
Message-ID: <DM6PR06MB500362571B6C68F52FA24756E8FE0@DM6PR06MB5003.namprd06.prod.outlook.com>

Hello Fieldtrip experts!

I am running a neurofeedback experiment. I am using BrainVision to record my signals, and MATLAB FIELDTRIP to provide the feedback using sounds. I am trying to connect BrainVision to MATLAB, but I keep having problems streaming the signals in matlab.
This is what I have done:

In one matlab session:
%% Add paths
addpath('C:\Program Files\MATLAB\packages\fieldtrip-20190419');
addpath('C:\Program Files\MATLAB\packages\RDA_Client_Matlab64');
cd('C:\Program Files\MATLAB\packages\RDA_Client_Matlab64');
%% Enable online tracking
ft_defaults

cfg                = [];
cfg.host           = 'yantang-THINK'; % of computer running the recorder software (default = 'eeg002')
cfg.port           = 51244; % TCP port to connect to (default = 51244)
cfg.channel        = 'all'; % see FT_CHANNELSELECTION (default = 'all')
cfg.feedback       = 'no'; % 'yes' or 'no' (default = 'no')

cfg.target.datafile      = 'buffer://localhost:1972'; % target destination for the data (default = 'buffer://localhost:1972')
cfg.target.eventfile     = 'buffer://localhost:1972'; % target destination for the events (default = 'buffer://localhost:1972')

ft_realtime_brainampproxy(cfg)

And this is the output:
Loaded pnet MEX-file for the tcp/udp/ip-toolbox Compiled @ May 18 2012 09:12:16
Version  2.0.5  2003-09-16
Copyright (C) Peter Rydesäter, Sweden, et al. , 1998 - 2003
GNU General Public License, se license.txt for full license notis.
You are allowed to (dynamicaly) link this file with non-free code.

   http://www.rydesater.com

===============================================================================

connection establised with host 127.0.0.1 on port 51244


In another matlab session:
cfg                = [];
cfg.blocksize      = 1;                            % seconds
cfg.dataset        = 'buffer://localhost:1972';    % where to read the data
ft_realtime_signalviewer(cfg)

And this is the output:
Warning: could not read header from buffer://localhost:1972, retrying in 1 second
Warning: could not read header from buffer://localhost:1972, retrying in 1 second
Warning: could not read header from buffer://localhost:1972, retrying in 1 second

I'm not sure why the signal is not going through.
Does anyone have any idea?


Regards,
Winson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190630/0508b832/attachment.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

From Winson.Yang at ttu.edu  Sun Jun 30 17:57:32 2019
From: Winson.Yang at ttu.edu (Yang, Winson)
Date: Sun, 30 Jun 2019 15:57:32 +0000
Subject: [FieldTrip] Problem streaming realtime data from BrainVision
In-Reply-To: <DM6PR06MB5003DF3A0F243AB3CB8E19EBE8FC0@DM6PR06MB5003.namprd06.prod.outlook.com>
References: <DM6PR06MB5003DF3A0F243AB3CB8E19EBE8FC0@DM6PR06MB5003.namprd06.prod.outlook.com>
Message-ID: <DM6PR06MB500362571B6C68F52FA24756E8FE0@DM6PR06MB5003.namprd06.prod.outlook.com>

Hello Fieldtrip experts!

I am running a neurofeedback experiment. I am using BrainVision to record my signals, and MATLAB FIELDTRIP to provide the feedback using sounds. I am trying to connect BrainVision to MATLAB, but I keep having problems streaming the signals in matlab.
This is what I have done:

In one matlab session:
%% Add paths
addpath('C:\Program Files\MATLAB\packages\fieldtrip-20190419');
addpath('C:\Program Files\MATLAB\packages\RDA_Client_Matlab64');
cd('C:\Program Files\MATLAB\packages\RDA_Client_Matlab64');
%% Enable online tracking
ft_defaults

cfg                = [];
cfg.host           = 'yantang-THINK'; % of computer running the recorder software (default = 'eeg002')
cfg.port           = 51244; % TCP port to connect to (default = 51244)
cfg.channel        = 'all'; % see FT_CHANNELSELECTION (default = 'all')
cfg.feedback       = 'no'; % 'yes' or 'no' (default = 'no')

cfg.target.datafile      = 'buffer://localhost:1972'; % target destination for the data (default = 'buffer://localhost:1972')
cfg.target.eventfile     = 'buffer://localhost:1972'; % target destination for the events (default = 'buffer://localhost:1972')

ft_realtime_brainampproxy(cfg)

And this is the output:
Loaded pnet MEX-file for the tcp/udp/ip-toolbox Compiled @ May 18 2012 09:12:16
Version  2.0.5  2003-09-16
Copyright (C) Peter Rydesäter, Sweden, et al. , 1998 - 2003
GNU General Public License, se license.txt for full license notis.
You are allowed to (dynamicaly) link this file with non-free code.

   http://www.rydesater.com

===============================================================================

connection establised with host 127.0.0.1 on port 51244


In another matlab session:
cfg                = [];
cfg.blocksize      = 1;                            % seconds
cfg.dataset        = 'buffer://localhost:1972';    % where to read the data
ft_realtime_signalviewer(cfg)

And this is the output:
Warning: could not read header from buffer://localhost:1972, retrying in 1 second
Warning: could not read header from buffer://localhost:1972, retrying in 1 second
Warning: could not read header from buffer://localhost:1972, retrying in 1 second

I'm not sure why the signal is not going through.
Does anyone have any idea?


Regards,
Winson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190630/0508b832/attachment-0001.htm>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

