From mhaney377 at gmail.com  Mon Jun  1 05:37:02 2020
From: mhaney377 at gmail.com (Mark Haney)
Date: Sun, 31 May 2020 22:37:02 -0500
Subject: [FieldTrip] 3 General Questions on Design Matrices
Message-ID: <CAJ1TMU+2bMo-kywHcR4DiM5GFG0BsQ1aLha5gUWTK641-1VCvw@mail.gmail.com>

Greetings Fieldtrip members and the Worldwide EEG Community!

*Background:* 4 subjects, 30 conditions, 10 trials per condition. A 31st
condition with 7 trials is included.

*Questions: *

1. *Could one compare all 30 conditions compared to the 31st and rank each
condition's p-value for later analysis within a single subject? *

cfg.design = [ones(1,10)      ...     30*ones(1,10)    31*ones(1,7)]

2. *If I wanted to take things even further, could I compare the 30
conditions across all subjects compared to all of the subjects' 31st
condition:*

*First Row: *[ 1 2 3 4          1 2 3 4           1 2 3 4            ...
   1 2 3 4]
*Second Row: *[ ones(1,4)    2*ones(1,4)  ... 31*ones(1,4) ]

3. *Would it make more sense to compare one of the 30 conditions at a time
to the 31st condition using a for-loop in options 1 and 2?*

Regards,

Mark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200531/9b149534/attachment.htm>

From saadatmehr.b at gmail.com  Mon Jun  1 10:36:25 2020
From: saadatmehr.b at gmail.com (Bahar Saadatmehr)
Date: Mon, 1 Jun 2020 13:06:25 +0430
Subject: [FieldTrip] Question
Message-ID: <CAFP59Yx2DCxi3e8QhFZuEOOeByWRHSGj7-yL2+-VNfZJQF4NOw@mail.gmail.com>

Hello. I was wondering if I could have your help.
How can I put electrode positions in the .elc format to use it with CURRY?

Thank you in advance for your help.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200601/4cf1b1c6/attachment.htm>

From frsantos at fpce.up.pt  Mon Jun  1 18:55:26 2020
From: frsantos at fpce.up.pt (Fernando Ferreira-Santos)
Date: Mon, 1 Jun 2020 16:55:26 +0000
Subject: [FieldTrip] Online EEG/ERP Summer School and Neuropsychophysiology
 Webinars
In-Reply-To: <2BAB036A9BAEA44984A131DFCE446108029903FD25@SRVMBX01.fpceup.psi.up.pt>
References: <2BAB036A9BAEA44984A131DFCE446108029903F269@SRVMBX01.fpceup.psi.up.pt>
 <2BAB036A9BAEA44984A131DFCE446108029903FD25@SRVMBX01.fpceup.psi.up.pt>
Message-ID: <2BAB036A9BAEA44984A131DFCE446108029903FDB4@SRVMBX01.fpceup.psi.up.pt>

Dear colleagues,

The Laboratory of Neuropsychopsysiology is pleased to announce the 1st Online Cognitive and Affective Neurophysiology Summer School from 7-10 September 2020 (16h course).

This summer school is focused on the application of Electroencephalography (EEG) and Event Related Potential (ERP) techniques to the study of cognitive and affective processes. The course is designed as an introduction to these techniques, and does not require prior knowledge or experience with EEG/ERP. However, participants with some degree of experience also considered the course helpful. Basic knowledge of statistics is expected (general understanding of statistical tests, correlation, ANOVA, regression). This year's program will include:

1) Introduction to the EEG/ERP techniques in Cognitive and Affective Neuroscience

2) Collecting EEG data and ERP Research Design

3) Electrophysiological signal processing

4) Statistical analysis of ERP data

5) Breakout meetings on specific topics (more information in the website – link below)

This course has a 80€ fee. You can find more details in the summer school website: https://sites.google.com/view/can-summerschool-porto/

Preceding this year's Summer School we will present 3 free neuropsychophysiology webinars during June and July:

· 17th June at 5pm (Portugal, GMT+1) The neurobiological bases of psychopathy: insights from event-related potentials with Tiago O. Paiva and Rita Pasión

· 1st July at 5pm - Predictive Processing in the developing brain with Mariana R. Pereira

· 15th July at 5pm - The effects of aging in some domains of social cognition and decision-making with Carina Fernandes

These webinars are free but require previous registration in this link https://forms.gle/2CB7WifL6tkRubBK6.

If you have any additional questions, please do not hesitate to contact us at labnpf at fpce.up.pt<mailto:labnpf at fpce.up.pt>.

Best wishes,


Fernando Ferreira-Santos
Professor Auxiliar | Assistant Professor

Laboratório de Neuropsicofisiologia | Laboratory of Neuropsychophysiology
Faculdade de Psicologia e de Ciências da Educação da Universidade do Porto
Faculty of Psychology and Education Sciences – University of Porto
Rua Alfredo Allen, 4200–135 Porto, Portugal
http://www.fpce.up.pt<http://www.fpce.up.pt/> | frsantos at fpce.up.pt<mailto:frsantos at fpce.up.pt> | (+351) 22 607 97 00 (ext. 409)

Lab: http://www.fpce.up.pt/labpsi
Personal: http://ferreira-santos.eu


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200601/062265a9/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Poster_IX_CAN_2020.jpg
Type: image/jpeg
Size: 310107 bytes
Desc: Poster_IX_CAN_2020.jpg
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200601/062265a9/attachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Webinars2020.jpeg
Type: image/jpeg
Size: 269293 bytes
Desc: Webinars2020.jpeg
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200601/062265a9/attachment.jpeg>

From hri.pereira at campus.fct.unl.pt  Mon Jun  1 20:51:57 2020
From: hri.pereira at campus.fct.unl.pt (Helena Pereira)
Date: Mon, 1 Jun 2020 19:51:57 +0100
Subject: [FieldTrip] ft_rejectvisual function gives errors in 2020 fieldtrip
 versions
Message-ID: <3BC7EDA6-0A9C-45D9-88D9-FC880768FA71@hxcore.ol>

An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200601/bcfd2d64/attachment.htm>

From sara.hussain at nih.gov  Mon Jun  1 21:04:40 2020
From: sara.hussain at nih.gov (Hussain, Sara (NIH/NINDS) [F])
Date: Mon, 1 Jun 2020 19:04:40 +0000
Subject: [FieldTrip] ft_sourcestatistics output
Message-ID: <13DBCC53-1172-453F-82FE-876B7C0EB67C@nih.gov>

Hi FieldTrippers-



I have a somewhat simple question. I am running some statistics on source-localized frequency domain data across two groups of subjects. I would like to use the independent samples t-test statistic for cluster-based permutation testing. However, the output in the command window when I run my code seems to disagree with what I am specifying. I’ve followed the tutorials closely on this to ensure I am doing the analysis appropriately.



I am running the following:



cfg=[];

cfg.parameter='pow';

cfg.method='montecarlo';

cfg.statistic='indepsamplesT';

cfg.correctm='cluster';

cfg.clusteralpha=0.05;

cfg.clusterstatistic='maxsum';

cfg.tail=0;

cfg.clustertail=0;

cfg.alpha=0.025;

cfg.numrandomization=1000;

cfg.design=[repmat(1,1,numel(cond_A)) repmat(2,1,numel(cond_B))]; %1=cond A, 2=cond B

stat=ft_sourcestatistics(cfg,cond_A{:},cond_B{:});



The command window prints the following. Bolded are the items that seem misleading. I have not specified any connectivity analysis. Also, the bit talking about single-sample statistics leads me to believe that this is running a single sample t-test where a set of observations is being contrasted against some expected mean value:



using "ft_statistics_montecarlo" for the statistical testing

using connectivity of voxels in 3-D volume

using "ft_statfun_indepsamplesT" for the single-sample statistics

constructing randomized design

total number of measurements     = 33

total number of variables        = 1

number of independent variables  = 1

number of unit variables         = 0

number of within-cell variables  = 0

number of control variables      = 0

using a permutation resampling approach

computing a parametric threshold for clustering

Any tips anyone has would be very much appreciated!

Sara
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200601/6f71312a/attachment.htm>

From randolph.helfrich at gmail.com  Tue Jun  2 09:24:03 2020
From: randolph.helfrich at gmail.com (Randolph Helfrich)
Date: Tue, 2 Jun 2020 09:24:03 +0200
Subject: [FieldTrip] PhD and Postdoc Position in intracranial human
 electrophysiology
Message-ID: <CA+qvkOq07k0dWbuKUTLWCaPSSU-SDCRZazsXT-Bu+JFJx92x7A@mail.gmail.com>

Dear colleagues,

I am recruiting *PhD students and Postdocs* for my lab at the Hertie
Institute for Clinical Brain Research at the University of Tuebingen. The
lab is studying network dynamics underlying cognitive processing and sleep
physiology, primarily using intracranial human recordings. The positions
are fully funded for three years, with a possible extension.


For further information please see the job ad below and*
https://www.hih-tuebingen.de/en/forschung/independent-research-groups/junior-research-group-randolph-helfrich/
<https://www.hih-tuebingen.de/en/forschung/independent-research-groups/junior-research-group-randolph-helfrich/>*


Please help to spread the word

Thanks a lot


Best regards,

Randolph



PhD and Postdoc positions:


The Helfrich lab at the Center for Neurology and Hertie Institute for
Clinical Brain Research at the University of Tübingen is inviting
applications for fully funded positions for *PhD students and Postdocs* with
an interest in the neuronal network dynamics underlying cognitive
processing and sleep physiology. The lab is conducting cognitive
neuroscience studies in a clinical environment. Our key goal is to
understand the network neuroscience underlying higher cognitive functions
in the human brain. We are particularly interested in recruiting in the
following areas:

We are particularly interested in recruiting in the following areas:



*I. Rhythmic building blocks of human attention: How network oscillations
link perception and action. *Attention is a fundamental cognitive function
necessary to efficiently translate sensory experiences into goal-directed
actions . Traditionally, attention has been conceptualized as a constant
spotlight that amplifies behaviorally relevant information. Recently,
several lines of inquiry probing attention on a fine-grained temporal scale
revealed frequency-specific behavioral fluctuations that align with ongoing
brain oscillations, indicating that attention is a discrete process. Our
aim is to understand the structural and functional basis as well as the
physiologic purpose of attentional rhythmic fluctuations. *See also* *Helfrich
et al. **(2018b) Neuron, Helfrich et al. **(2019) Current Opinion in
Psychology*



*II. Context-dependent predictive processing in human prefrontal cortex.*
Over the last few decades, several lines of research indicated that the
prefrontal cortex (PFC) provides the structural basis for goal-directed
behavior based on endogenous predictions, but its functional architecture
is not well understood. Our goal is to investigate how predictions are
implemented in the human brain to optimize sensory processing and
goal-directed behavior. *Further information Helfrich and Knight (2016)
Trends in Cognitive Sciences; Helfrich et al. (2017) PNAS*



*III. (Patho-) Physiology of human memory networks during wakefulness and
sleep* Hippocampus-Prefrontal interactions are central to memory formation
in the human brain. Critically, this network also constitutes a
predilection site for various pathological entities that are associated
with memory deficits. Our goal is to further dissect and understand the
network circuitry underlying memory disorders in various patient
populations (epilepsy, stroke and degenerative diseases).* Additional
information see Helfrich et al. (2018a) Neuron; Helfrich et al. (2019)
Nature Commun.; Winer, Mander, Helfrich et al. (2019) JNeurosci*



*Key Methodology*: We are combining detailed behavioral testing with
intracranial EEG recordings in humans (ECoG, sEEG, Single Unit Activity) as
well as non-invasive neurophysiology (EEG, MEG) and electrical brain
stimulation (direct cortical stimulation, deep brain stimulation,
responsive neurostimulation). A methodological focus of the group is a
multimodal approach combining invasive and non-invasive approaches
(sEEG-MEG). We offer hands-on training on all aspects of study design and
data collection as well as state-of-the-art analysis methods of
electrophysiological data.



*Skills and qualifications*: The positions are well suited for candidates
from a wide-range of backgrounds, including biology, computer science,
psychology, medicine, cognitive- and neuroscience. We particularly
encourage applications from researchers with previous experience in human
imaging or primate neurophysiology who are seeking to apply their skills to
basic science questions in a clinical context with various opportunities
for translational application. Prior coding experience in e.g. MatLab or
Python is helpful, but not a pre-requisite. We welcome researchers with an
international background. German language skills are not necessary.
Tübingen offers a rich and diverse neuroscience campus, where key
facilitates (epilepsy monitoring unit and MEG center) are in close
proximity. PhD students will be enrolled in Neuroscience Graduate Center
Training School in Tübingen (https://www.neuroschool-tuebingen.de/).



The lab is headed by Randolph Helfrich, a clinician-scientist at the Center
for Neurology and Epileptology at the University Medical Center in
Tübingen. We are striving to provide a diverse and family-friendly
atmosphere, which fosters international exchange with ample opportunity for
collaborations.



If we have sparked your interest, please send your application, including a
CV, relevant certificates or diplomas and a cover letter outlining your
research interest in English or German to
*randolph.helfrich at med.uni-tuebingen.de
<randolph.helfrich at med.uni-tuebingen.de>*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200602/6126ea80/attachment.htm>

From jan.schoffelen at donders.ru.nl  Tue Jun  2 09:36:16 2020
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Tue, 2 Jun 2020 07:36:16 +0000
Subject: [FieldTrip] ft_sourcestatistics output
In-Reply-To: <13DBCC53-1172-453F-82FE-876B7C0EB67C@nih.gov>
References: <13DBCC53-1172-453F-82FE-876B7C0EB67C@nih.gov>
Message-ID: <F7E46E7E-DF55-4B3A-A02E-6F461302693F@donders.ru.nl>

Hi Sara,

Thanks for reaching out. I am sorry that you are confused by the textual output of the function.

The statement ‘using connectivity of voxels in 3-D volume’ refers to the fact that you requested a cluster-based heuristic for multiple comparison correcion. Thus, the code needs to define how individual space-time-frequency points are connected, hence the term connectivity in this context.

The statement ‘using … for the single-sample statistics’: the single sample here refers to the fact that the test-statistic-of-interest, here an unpaired T-statistic, is computed for each individual (space-time-frequency) sample of the data.

If you have a good suggestion as to how to amend this text, please feel free to make a Pull Request on github with your suggestions included.

Best wishes,

Jan-Mathijs




On 1 Jun 2020, at 21:04, Hussain, Sara (NIH/NINDS) [F] <sara.hussain at nih.gov<mailto:sara.hussain at nih.gov>> wrote:

Hi FieldTrippers-

I have a somewhat simple question. I am running some statistics on source-localized frequency domain data across two groups of subjects. I would like to use the independent samples t-test statistic for cluster-based permutation testing. However, the output in the command window when I run my code seems to disagree with what I am specifying. I’ve followed the tutorials closely on this to ensure I am doing the analysis appropriately.

I am running the following:

cfg=[];
cfg.parameter='pow';
cfg.method='montecarlo';
cfg.statistic='indepsamplesT';
cfg.correctm='cluster';
cfg.clusteralpha=0.05;
cfg.clusterstatistic='maxsum';
cfg.tail=0;
cfg.clustertail=0;
cfg.alpha=0.025;
cfg.numrandomization=1000;
cfg.design=[repmat(1,1,numel(cond_A)) repmat(2,1,numel(cond_B))]; %1=cond A, 2=cond B
stat=ft_sourcestatistics(cfg,cond_A{:},cond_B{:});

The command window prints the following. Bolded are the items that seem misleading. I have not specified any connectivity analysis. Also, the bit talking about single-sample statistics leads me to believe that this is running a single sample t-test where a set of observations is being contrasted against some expected mean value:

using "ft_statistics_montecarlo" for the statistical testing
using connectivity of voxels in 3-D volume
using "ft_statfun_indepsamplesT" for the single-sample statistics
constructing randomized design
total number of measurements     = 33
total number of variables        = 1
number of independent variables  = 1
number of unit variables         = 0
number of within-cell variables  = 0
number of control variables      = 0
using a permutation resampling approach
computing a parametric threshold for clustering

Any tips anyone has would be very much appreciated!

Sara
_______________________________________________
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/20200602/67e25df0/attachment.htm>

From jan.schoffelen at donders.ru.nl  Tue Jun  2 09:48:31 2020
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Tue, 2 Jun 2020 07:48:31 +0000
Subject: [FieldTrip] ft_rejectvisual function gives errors in 2020
 fieldtrip versions
In-Reply-To: <3BC7EDA6-0A9C-45D9-88D9-FC880768FA71@hxcore.ol>
References: <3BC7EDA6-0A9C-45D9-88D9-FC880768FA71@hxcore.ol>
Message-ID: <A17B13BB-9504-4DFB-8D14-2E5F06201888@donders.ru.nl>

Hi Helena,

ft_rejectvisual is not deprecated. As a matter of fact, there has been some recent updates to this function, to make its behavior more robust. Since these changes have passed our internal tests, the new version has made it into the release version. Unfortunately, this seems to cause you some problems. As of yet, it is not clear whether this now is a genuine bug, or a feature of an inconsistency in your data, which only surfaces now. In order to be able to confirm your problem, you’d need to give a bit more detail about what you have been doing. Important details to include are some characteristics of the data, and a specification of the cfg that you used as an input to ft_rejectvisual. Also, you couuld try and diagnose the problem a bit more yourself by using the matlab debugger, which you can use to investigate why the variable info.cfg.ylim seems to have an unexpected number of elements (as the error message suggests).


Best wishes,

Jan-Mathijs



On 1 Jun 2020, at 20:51, Helena Pereira <hri.pereira at campus.fct.unl.pt<mailto:hri.pereira at campus.fct.unl.pt>> wrote:

Dear all,

I am analysing data from EEG subjects. To remove artifacts, I used a code that was computed using the ft_rejectvisual function of 20191019 fieldtrip version. However, when the fieldtrip was uptaded to the 20200521, this error appeared:

Index exceeds the number of array elements (1).

Error in rejectvisual_trial>redraw (line 274)
  ymax = info.cfg.ylim(2);

Error in rejectvisual_trial (line 96)
  redraw(h);

Error in ft_rejectvisual (line 230)
    [chansel, trlsel, cfg] = rejectvisual_trial(cfg,
    tmpdata);

Is ft_rejectvisual function deprecated? How can I solve this error? The version 20191019 is no longer available at the FTP server, but I know it works well because I tested the code with that old version.

Thanks in advance,
Best regards,
Helena Pereira

_______________________________________________
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/20200602/60fced15/attachment.htm>

From e.spaak at donders.ru.nl  Tue Jun  2 10:04:05 2020
From: e.spaak at donders.ru.nl (Eelke Spaak)
Date: Tue, 2 Jun 2020 10:04:05 +0200
Subject: [FieldTrip] ft_sourcestatistics output
In-Reply-To: <13DBCC53-1172-453F-82FE-876B7C0EB67C@nih.gov>
References: <13DBCC53-1172-453F-82FE-876B7C0EB67C@nih.gov>
Message-ID: <CABPNLUqJ=tN=NF4yhHMG6yOmJavJPhdCVodfObvoOdNs6gZ82g@mail.gmail.com>

Hi Sara,

The 'connectivity' in the output is not referring to neural functional
connectivity or anything like that, but simply to the geometric
connectedness of the voxel space. This could e.g. be neighbourhood
structure in channel space ("channel A is a neighbour of channels B,
C, D, etc.") or adjacency in time/frequency/isometric 3D space. This
particular statement just means that FieldTrip is clustering across
voxels located in regular 3D space (I guess you could say that their
"connectivity" is Euclidean).

The statement about single-sample statistics is similarly innocuous:
the "single sample" here refers to the statistic being computed on
each single voxel (before the clustering routine). In the case of
source statistics, "single voxel" would have been a better wording,
but the clustering can also happen in other spaces, where "voxel" is
not appropriate, hence the use of "sample" (not related to the
statistical use of the same word). But I agree this is potentially
confusing.

Hope that helps!

Best,
Eelke

On Mon, 1 Jun 2020 at 21:04, Hussain, Sara (NIH/NINDS) [F]
<sara.hussain at nih.gov> wrote:
>
> Hi FieldTrippers-
>
>
>
> I have a somewhat simple question. I am running some statistics on source-localized frequency domain data across two groups of subjects. I would like to use the independent samples t-test statistic for cluster-based permutation testing. However, the output in the command window when I run my code seems to disagree with what I am specifying. I’ve followed the tutorials closely on this to ensure I am doing the analysis appropriately.
>
>
>
> I am running the following:
>
>
>
> cfg=[];
>
> cfg.parameter='pow';
>
> cfg.method='montecarlo';
>
> cfg.statistic='indepsamplesT';
>
> cfg.correctm='cluster';
>
> cfg.clusteralpha=0.05;
>
> cfg.clusterstatistic='maxsum';
>
> cfg.tail=0;
>
> cfg.clustertail=0;
>
> cfg.alpha=0.025;
>
> cfg.numrandomization=1000;
>
> cfg.design=[repmat(1,1,numel(cond_A)) repmat(2,1,numel(cond_B))]; %1=cond A, 2=cond B
>
> stat=ft_sourcestatistics(cfg,cond_A{:},cond_B{:});
>
>
>
> The command window prints the following. Bolded are the items that seem misleading. I have not specified any connectivity analysis. Also, the bit talking about single-sample statistics leads me to believe that this is running a single sample t-test where a set of observations is being contrasted against some expected mean value:
>
>
>
> using "ft_statistics_montecarlo" for the statistical testing
>
> using connectivity of voxels in 3-D volume
>
> using "ft_statfun_indepsamplesT" for the single-sample statistics
>
> constructing randomized design
>
> total number of measurements     = 33
>
> total number of variables        = 1
>
> number of independent variables  = 1
>
> number of unit variables         = 0
>
> number of within-cell variables  = 0
>
> number of control variables      = 0
>
> using a permutation resampling approach
>
> computing a parametric threshold for clustering
>
>
>
> Any tips anyone has would be very much appreciated!
>
>
>
> Sara
>
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202



From hri.pereira at campus.fct.unl.pt  Tue Jun  2 11:16:00 2020
From: hri.pereira at campus.fct.unl.pt (Helena Pereira)
Date: Tue, 2 Jun 2020 10:16:00 +0100
Subject: [FieldTrip] ft_rejectvisual function gives errors in 2020
 fieldtrip versions
In-Reply-To: <A17B13BB-9504-4DFB-8D14-2E5F06201888@donders.ru.nl>
References: <3BC7EDA6-0A9C-45D9-88D9-FC880768FA71@hxcore.ol>
 <A17B13BB-9504-4DFB-8D14-2E5F06201888@donders.ru.nl>
Message-ID: <CACZYJ4spwd2gt7fKSdhRutj5Oi6EVgM_NN35XQuSVGozhS5Wqw@mail.gmail.com>

Dear Jan-Mathijs,

Thank you for your e-mail.

I am using data from the output of ICA (.mat data). Here is my *cfg for
visual artifact*:

cgf = [];
cfg.preproc.demean = 'yes';
cfg.prepoc.baselinewindow  = [-0.2 0];
data_process=ft_preprocessing(cfg,data_process );

cgf = [];
cfg.method   = 'trial';
cfg.ylim =  60;
visual_cleaned = ft_rejectvisual(cfg,data_process);

cgf = [];
cfg.method   = 'channel';
cfg.alim =  50 ; %why this value?
%cfg.eogscale = 5e-8;
vc_data = ft_rejectvisual(cfg,visual_cleaned);

*For ICA: *
cfg = [];
%cfg.channel = 1:64;
cfg.method = 'runica';
cfg.demean = 'yes';
ica_cleaned = ft_componentanalysis(cfg, vc_data);

% %Save ICA data
outfile=strcat(save_dir,'/',infile,'_', sti,'.mat')
save(outfile, 'ica_cleaned', '-v7.3')

*Before ICA, I did the following processing steps:*
cfg = [];
cfg.dataset=infile;   % infile: data.seg
cfg.trialfun = 'ft_trialfun_general'; % this is the default
cfg.trialdef.eventtype  = 'Stimulus'; %Event type: e.g. Stimulus, response,
STATUS
cfg.trialdef.eventvalue = {stimulus};

cfg.trialdef.prestim    = 2; %latency in seconds
cfg.trialdef.poststim   = 2; %latency in seconds
cfg=ft_definetrial(cfg);

% Processing AOC, AMC and MC data
cfg.channel = [1:69]; %discard channels not used
cfg.preproc.reref = 'yes';
cfg.preproc.refchannel = {'M1' 'M2'}; %avg mastoids
cfg.continuous = 'no';
cfg.preproc.detrend = 'no';
%Baseline correction
cfg.preproc.demean = 'yes';
cfg.prepoc.baselinewindow  = [-0.2 0];
%Filtering
cfg.preproc.lpfilter = 'yes';
cfg.preproc.hpfilter = 'yes';
cfg.preproc.lpfreq = 100;
cfg.preproc.hpfreq = 1;
data_process=ft_preprocessing(cfg);

Can the error be associated with the fact that I am using
non-continuous data?

I am using BrainVision Format, that is, .seg, .vmrk and vhdr data.

Thank you,
Stay safe,
Helena Pereira




Schoffelen, J.M. (Jan Mathijs) <jan.schoffelen at donders.ru.nl> escreveu no
dia terça, 2/06/2020 à(s) 09:28:

> Hi Helena,
>
> ft_rejectvisual is not deprecated. As a matter of fact, there has been
> some recent updates to this function, to make its behavior more robust.
> Since these changes have passed our internal tests, the new version has
> made it into the release version. Unfortunately, this seems to cause you
> some problems. As of yet, it is not clear whether this now is a genuine
> bug, or a feature of an inconsistency in your data, which only surfaces
> now. In order to be able to confirm your problem, you’d need to give a bit
> more detail about what you have been doing. Important details to include
> are some characteristics of the data, and a specification of the cfg that
> you used as an input to ft_rejectvisual. Also, you couuld try and diagnose
> the problem a bit more yourself by using the matlab debugger, which you can
> use to investigate why the variable info.cfg.ylim seems to have an
> unexpected number of elements (as the error message suggests).
>
>
> Best wishes,
>
> Jan-Mathijs
>
>
>
> On 1 Jun 2020, at 20:51, Helena Pereira <hri.pereira at campus.fct.unl.pt>
> wrote:
>
> Dear all,
>
> I am analysing data from EEG subjects. To remove artifacts, I used a code
> that was computed using the ft_rejectvisual function of 20191019 fieldtrip
> version. However, when the fieldtrip was uptaded to the 20200521, this
> error appeared:
>
> Index exceeds the number of array elements (1).
>
> Error in rejectvisual_trial>redraw (line 274)
>   ymax = info.cfg.ylim(2);
>
> Error in rejectvisual_trial (line 96)
>   redraw(h);
>
> Error in ft_rejectvisual (line 230)
>     [chansel, trlsel, cfg] = rejectvisual_trial(cfg,
>     tmpdata);
>
> Is ft_rejectvisual function deprecated? How can I solve this error? The
> version 20191019 is no longer available at the FTP server, but I know it
> works well because I tested the code with that old version.
>
> Thanks in advance,
> Best regards,
> Helena Pereira
>
> _______________________________________________
> 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/20200602/05e5f30d/attachment.htm>

From jan.schoffelen at donders.ru.nl  Tue Jun  2 11:37:01 2020
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Tue, 2 Jun 2020 09:37:01 +0000
Subject: [FieldTrip] ft_rejectvisual function gives errors in 2020
 fieldtrip versions
In-Reply-To: <CACZYJ4spwd2gt7fKSdhRutj5Oi6EVgM_NN35XQuSVGozhS5Wqw@mail.gmail.com>
References: <3BC7EDA6-0A9C-45D9-88D9-FC880768FA71@hxcore.ol>
 <A17B13BB-9504-4DFB-8D14-2E5F06201888@donders.ru.nl>
 <CACZYJ4spwd2gt7fKSdhRutj5Oi6EVgM_NN35XQuSVGozhS5Wqw@mail.gmail.com>
Message-ID: <460987F4-9D1C-427E-BA95-75D9FC55F2BF@donders.ru.nl>

Dear Helena,

Thanks for providing some more details. Indeed, the error occurs (as I suspected) because you explicitly define the cfg.ylim to have only a single element. This is incorrect because the code expects a 2-element vector (e.g. [-60 60]) once this parameter is defined as a numeric variable. I suspect that things will run through fine for you if you either omit cfg.ylim altogether, or specify it as ‘maxmin’, or specify a 2-element vector. I saw that this parameter is not documented in the help-section of the function, and I suspect there might be more undocumented options. Please feel free to update the documentation section of the function in order to avoid similar future problems with other users, and send us a PR through github.
Thanks for noticing!

Best wishes,
Jan-Mathijs


On 2 Jun 2020, at 11:16, Helena Pereira <hri.pereira at campus.fct.unl.pt<mailto:hri.pereira at campus.fct.unl.pt>> wrote:

Dear Jan-Mathijs,

Thank you for your e-mail.

I am using data from the output of ICA (.mat data). Here is my cfg for visual artifact:

cgf = [];
cfg.preproc.demean = 'yes';
cfg.prepoc.baselinewindow  = [-0.2 0];
data_process=ft_preprocessing(cfg,data_process );

cgf = [];
cfg.method   = 'trial';
cfg.ylim =  60;
visual_cleaned = ft_rejectvisual(cfg,data_process);

cgf = [];
cfg.method   = 'channel';
cfg.alim =  50 ; %why this value?
%cfg.eogscale = 5e-8;
vc_data = ft_rejectvisual(cfg,visual_cleaned);

For ICA:
cfg = [];
%cfg.channel = 1:64;
cfg.method = 'runica';
cfg.demean = 'yes';
ica_cleaned = ft_componentanalysis(cfg, vc_data);

% %Save ICA data
outfile=strcat(save_dir,'/',infile,'_', sti,'.mat')
save(outfile, 'ica_cleaned', '-v7.3')

Before ICA, I did the following processing steps:
cfg = [];
cfg.dataset=infile;   % infile: data.seg
cfg.trialfun = 'ft_trialfun_general'; % this is the default
cfg.trialdef.eventtype  = 'Stimulus'; %Event type: e.g. Stimulus, response, STATUS
cfg.trialdef.eventvalue = {stimulus};

cfg.trialdef.prestim    = 2; %latency in seconds
cfg.trialdef.poststim   = 2; %latency in seconds
cfg=ft_definetrial(cfg);

% Processing AOC, AMC and MC data
cfg.channel = [1:69]; %discard channels not used
cfg.preproc.reref = 'yes';
cfg.preproc.refchannel = {'M1' 'M2'}; %avg mastoids
cfg.continuous = 'no';
cfg.preproc.detrend = 'no';
%Baseline correction
cfg.preproc.demean = 'yes';
cfg.prepoc.baselinewindow  = [-0.2 0];
%Filtering
cfg.preproc.lpfilter = 'yes';
cfg.preproc.hpfilter = 'yes';
cfg.preproc.lpfreq = 100;
cfg.preproc.hpfreq = 1;
data_process=ft_preprocessing(cfg);

Can the error be associated with the fact that I am using non-continuous data?

I am using BrainVision Format, that is, .seg, .vmrk and vhdr data.

Thank you,
Stay safe,
Helena Pereira




Schoffelen, J.M. (Jan Mathijs) <jan.schoffelen at donders.ru.nl<mailto:jan.schoffelen at donders.ru.nl>> escreveu no dia terça, 2/06/2020 à(s) 09:28:
Hi Helena,

ft_rejectvisual is not deprecated. As a matter of fact, there has been some recent updates to this function, to make its behavior more robust. Since these changes have passed our internal tests, the new version has made it into the release version. Unfortunately, this seems to cause you some problems. As of yet, it is not clear whether this now is a genuine bug, or a feature of an inconsistency in your data, which only surfaces now. In order to be able to confirm your problem, you’d need to give a bit more detail about what you have been doing. Important details to include are some characteristics of the data, and a specification of the cfg that you used as an input to ft_rejectvisual. Also, you couuld try and diagnose the problem a bit more yourself by using the matlab debugger, which you can use to investigate why the variable info.cfg.ylim seems to have an unexpected number of elements (as the error message suggests).


Best wishes,

Jan-Mathijs



On 1 Jun 2020, at 20:51, Helena Pereira <hri.pereira at campus.fct.unl.pt<mailto:hri.pereira at campus.fct.unl.pt>> wrote:

Dear all,

I am analysing data from EEG subjects. To remove artifacts, I used a code that was computed using the ft_rejectvisual function of 20191019 fieldtrip version. However, when the fieldtrip was uptaded to the 20200521, this error appeared:

Index exceeds the number of array elements (1).

Error in rejectvisual_trial>redraw (line 274)
  ymax = info.cfg.ylim(2);

Error in rejectvisual_trial (line 96)
  redraw(h);

Error in ft_rejectvisual (line 230)
    [chansel, trlsel, cfg] = rejectvisual_trial(cfg,
    tmpdata);

Is ft_rejectvisual function deprecated? How can I solve this error? The version 20191019 is no longer available at the FTP server, but I know it works well because I tested the code with that old version.

Thanks in advance,
Best regards,
Helena Pereira

_______________________________________________
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/20200602/13a00df9/attachment.htm>

From sara.hussain at nih.gov  Tue Jun  2 12:45:19 2020
From: sara.hussain at nih.gov (Hussain, Sara (NIH/NINDS) [F])
Date: Tue, 2 Jun 2020 10:45:19 +0000
Subject: [FieldTrip] ft_sourcestatistics output
In-Reply-To: <F7E46E7E-DF55-4B3A-A02E-6F461302693F@donders.ru.nl>
References: <13DBCC53-1172-453F-82FE-876B7C0EB67C@nih.gov>
 <F7E46E7E-DF55-4B3A-A02E-6F461302693F@donders.ru.nl>
Message-ID: <DE07224B-E0DA-4BBB-8A91-E458DB6C89AD@nih.gov>

Hi Jan-Mathijs,
Thanks for this information, this makes sense.

Sara

From: "Schoffelen, J.M. (Jan Mathijs)" <jan.schoffelen at donders.ru.nl>
Reply-To: FieldTrip discussion list <fieldtrip at science.ru.nl>
Date: Tuesday, June 2, 2020 at 4:28 AM
To: FieldTrip discussion list <fieldtrip at science.ru.nl>
Subject: Re: [FieldTrip] ft_sourcestatistics output

Hi Sara,

Thanks for reaching out. I am sorry that you are confused by the textual output of the function.

The statement ‘using connectivity of voxels in 3-D volume’ refers to the fact that you requested a cluster-based heuristic for multiple comparison correcion. Thus, the code needs to define how individual space-time-frequency points are connected, hence the term connectivity in this context.

The statement ‘using … for the single-sample statistics’: the single sample here refers to the fact that the test-statistic-of-interest, here an unpaired T-statistic, is computed for each individual (space-time-frequency) sample of the data.

If you have a good suggestion as to how to amend this text, please feel free to make a Pull Request on github with your suggestions included.

Best wishes,

Jan-Mathijs





On 1 Jun 2020, at 21:04, Hussain, Sara (NIH/NINDS) [F] <sara.hussain at nih.gov<mailto:sara.hussain at nih.gov>> wrote:

Hi FieldTrippers-

I have a somewhat simple question. I am running some statistics on source-localized frequency domain data across two groups of subjects. I would like to use the independent samples t-test statistic for cluster-based permutation testing. However, the output in the command window when I run my code seems to disagree with what I am specifying. I’ve followed the tutorials closely on this to ensure I am doing the analysis appropriately.

I am running the following:

cfg=[];
cfg.parameter='pow';
cfg.method='montecarlo';
cfg.statistic='indepsamplesT';
cfg.correctm='cluster';
cfg.clusteralpha=0.05;
cfg.clusterstatistic='maxsum';
cfg.tail=0;
cfg.clustertail=0;
cfg.alpha=0.025;
cfg.numrandomization=1000;
cfg.design=[repmat(1,1,numel(cond_A)) repmat(2,1,numel(cond_B))]; %1=cond A, 2=cond B
stat=ft_sourcestatistics(cfg,cond_A{:},cond_B{:});

The command window prints the following. Bolded are the items that seem misleading. I have not specified any connectivity analysis. Also, the bit talking about single-sample statistics leads me to believe that this is running a single sample t-test where a set of observations is being contrasted against some expected mean value:

using "ft_statistics_montecarlo" for the statistical testing
using connectivity of voxels in 3-D volume
using "ft_statfun_indepsamplesT" for the single-sample statistics
constructing randomized design
total number of measurements     = 33
total number of variables        = 1
number of independent variables  = 1
number of unit variables         = 0
number of within-cell variables  = 0
number of control variables      = 0
using a permutation resampling approach
computing a parametric threshold for clustering

Any tips anyone has would be very much appreciated!

Sara
_______________________________________________
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/20200602/d1a24954/attachment.htm>

From hri.pereira at campus.fct.unl.pt  Tue Jun  2 13:55:51 2020
From: hri.pereira at campus.fct.unl.pt (Helena Pereira)
Date: Tue, 2 Jun 2020 12:55:51 +0100
Subject: [FieldTrip] ft_rejectvisual function gives errors in 2020
 fieldtrip versions
In-Reply-To: <460987F4-9D1C-427E-BA95-75D9FC55F2BF@donders.ru.nl>
References: <3BC7EDA6-0A9C-45D9-88D9-FC880768FA71@hxcore.ol>
 <A17B13BB-9504-4DFB-8D14-2E5F06201888@donders.ru.nl>
 <CACZYJ4spwd2gt7fKSdhRutj5Oi6EVgM_NN35XQuSVGozhS5Wqw@mail.gmail.com>
 <460987F4-9D1C-427E-BA95-75D9FC55F2BF@donders.ru.nl>
Message-ID: <CACZYJ4u+OFMzpiSRoAg=aZv184Wn84moS5WzpuDiX_GoxBaBMg@mail.gmail.com>

Dear Jan-Mathijs,

Thank you for your quick response.

The code is now working!

*Please feel free to update the documentation section of the function in
order to avoid similar future problems with other users, and send us a PR
through github.  -> * I will do it!

Thanks!
Best wishes,
Helena Pereira



Schoffelen, J.M. (Jan Mathijs) <jan.schoffelen at donders.ru.nl> escreveu no
dia terça, 2/06/2020 à(s) 11:13:

> Dear Helena,
>
> Thanks for providing some more details. Indeed, the error occurs (as I
> suspected) because you explicitly define the cfg.ylim to have only a single
> element. This is incorrect because the code expects a 2-element vector
> (e.g. [-60 60]) once this parameter is defined as a numeric variable. I
> suspect that things will run through fine for you if you either omit
> cfg.ylim altogether, or specify it as ‘maxmin’, or specify a 2-element
> vector. I saw that this parameter is not documented in the help-section of
> the function, and I suspect there might be more undocumented options.
> Please feel free to update the documentation section of the function in
> order to avoid similar future problems with other users, and send us a PR
> through github.
> Thanks for noticing!
>
> Best wishes,
> Jan-Mathijs
>
>
> On 2 Jun 2020, at 11:16, Helena Pereira <hri.pereira at campus.fct.unl.pt>
> wrote:
>
> Dear Jan-Mathijs,
>
> Thank you for your e-mail.
>
> I am using data from the output of ICA (.mat data). Here is my * cfg for
> visual artifact*:
>
> cgf = [];
> cfg.preproc.demean = 'yes';
> cfg.prepoc.baselinewindow  = [-0.2 0];
> data_process=ft_preprocessing(cfg,data_process );
>
> cgf = [];
> cfg.method   = 'trial';
> cfg.ylim =  60;
> visual_cleaned = ft_rejectvisual(cfg,data_process);
>
> cgf = [];
> cfg.method   = 'channel';
> cfg.alim =  50 ; %why this value?
> %cfg.eogscale = 5e-8;
> vc_data = ft_rejectvisual(cfg,visual_cleaned);
>
> *For ICA: *
> cfg = [];
> %cfg.channel = 1:64;
> cfg.method = 'runica';
> cfg.demean = 'yes';
> ica_cleaned = ft_componentanalysis(cfg, vc_data);
>
> % %Save ICA data
> outfile=strcat(save_dir,'/',infile,'_', sti,'.mat')
> save(outfile, 'ica_cleaned', '-v7.3')
>
> *Before ICA, I did the following processing steps:*
> cfg = [];
> cfg.dataset=infile;   % infile: data.seg
> cfg.trialfun = 'ft_trialfun_general'; % this is the default
> cfg.trialdef.eventtype  = 'Stimulus'; %Event type: e.g. Stimulus,
> response, STATUS
> cfg.trialdef.eventvalue = {stimulus};
>
> cfg.trialdef.prestim    = 2; %latency in seconds
> cfg.trialdef.poststim   = 2; %latency in seconds
> cfg=ft_definetrial(cfg);
>
> % Processing AOC, AMC and MC data
> cfg.channel = [1:69]; %discard channels not used
> cfg.preproc.reref = 'yes';
> cfg.preproc.refchannel = {'M1' 'M2'}; %avg mastoids
> cfg.continuous = 'no';
> cfg.preproc.detrend = 'no';
> %Baseline correction
> cfg.preproc.demean = 'yes';
> cfg.prepoc.baselinewindow  = [-0.2 0];
> %Filtering
> cfg.preproc.lpfilter = 'yes';
> cfg.preproc.hpfilter = 'yes';
> cfg.preproc.lpfreq = 100;
> cfg.preproc.hpfreq = 1;
> data_process=ft_preprocessing(cfg);
>
> Can the error be associated with the fact that I am using
> non-continuous data?
>
> I am using BrainVision Format, that is, .seg, .vmrk and vhdr data.
>
> Thank you,
> Stay safe,
> Helena Pereira
>
>
>
>
> Schoffelen, J.M. (Jan Mathijs) <jan.schoffelen at donders.ru.nl> escreveu no
> dia terça, 2/06/2020 à(s) 09:28:
>
>> Hi Helena,
>>
>> ft_rejectvisual is not deprecated. As a matter of fact, there has been
>> some recent updates to this function, to make its behavior more robust.
>> Since these changes have passed our internal tests, the new version has
>> made it into the release version. Unfortunately, this seems to cause you
>> some problems. As of yet, it is not clear whether this now is a genuine
>> bug, or a feature of an inconsistency in your data, which only surfaces
>> now. In order to be able to confirm your problem, you’d need to give a bit
>> more detail about what you have been doing. Important details to include
>> are some characteristics of the data, and a specification of the cfg that
>> you used as an input to ft_rejectvisual. Also, you couuld try and diagnose
>> the problem a bit more yourself by using the matlab debugger, which you can
>> use to investigate why the variable info.cfg.ylim seems to have an
>> unexpected number of elements (as the error message suggests).
>>
>>
>> Best wishes,
>>
>> Jan-Mathijs
>>
>>
>>
>> On 1 Jun 2020, at 20:51, Helena Pereira <hri.pereira at campus.fct.unl.pt>
>> wrote:
>>
>> Dear all,
>>
>> I am analysing data from EEG subjects. To remove artifacts, I used a code
>> that was computed using the ft_rejectvisual function of 20191019 fieldtrip
>> version. However, when the fieldtrip was uptaded to the 20200521, this
>> error appeared:
>>
>> Index exceeds the number of array elements (1).
>>
>> Error in rejectvisual_trial>redraw (line 274)
>>   ymax = info.cfg.ylim(2);
>>
>> Error in rejectvisual_trial (line 96)
>>   redraw(h);
>>
>> Error in ft_rejectvisual (line 230)
>>     [chansel, trlsel, cfg] = rejectvisual_trial(cfg,
>>     tmpdata);
>>
>> Is ft_rejectvisual function deprecated? How can I solve this error? The
>> version 20191019 is no longer available at the FTP server, but I know it
>> works well because I tested the code with that old version.
>>
>> Thanks in advance,
>> Best regards,
>> Helena Pereira
>>
>> _______________________________________________
>> 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
>
>
> _______________________________________________
> 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/20200602/6fdedea0/attachment.htm>

From sara.hussain at nih.gov  Tue Jun  2 15:05:27 2020
From: sara.hussain at nih.gov (Hussain, Sara (NIH/NINDS) [F])
Date: Tue, 2 Jun 2020 13:05:27 +0000
Subject: [FieldTrip] ft_sourcestatistics output
In-Reply-To: <CABPNLUqJ=tN=NF4yhHMG6yOmJavJPhdCVodfObvoOdNs6gZ82g@mail.gmail.com>
References: <13DBCC53-1172-453F-82FE-876B7C0EB67C@nih.gov>
 <CABPNLUqJ=tN=NF4yhHMG6yOmJavJPhdCVodfObvoOdNs6gZ82g@mail.gmail.com>
Message-ID: <D064DFBF-4618-4C83-B410-19BA81F47F6D@nih.gov>

Thanks Elke for your quick response. Jan-Mathijs said something similar, and I will keep all of this in mind moving forward. 

Best,
Sara

﻿On 6/2/20, 4:58 AM, "Eelke Spaak" <e.spaak at donders.ru.nl> wrote:

    Hi Sara,
    
    The 'connectivity' in the output is not referring to neural functional
    connectivity or anything like that, but simply to the geometric
    connectedness of the voxel space. This could e.g. be neighbourhood
    structure in channel space ("channel A is a neighbour of channels B,
    C, D, etc.") or adjacency in time/frequency/isometric 3D space. This
    particular statement just means that FieldTrip is clustering across
    voxels located in regular 3D space (I guess you could say that their
    "connectivity" is Euclidean).
    
    The statement about single-sample statistics is similarly innocuous:
    the "single sample" here refers to the statistic being computed on
    each single voxel (before the clustering routine). In the case of
    source statistics, "single voxel" would have been a better wording,
    but the clustering can also happen in other spaces, where "voxel" is
    not appropriate, hence the use of "sample" (not related to the
    statistical use of the same word). But I agree this is potentially
    confusing.
    
    Hope that helps!
    
    Best,
    Eelke
    
    On Mon, 1 Jun 2020 at 21:04, Hussain, Sara (NIH/NINDS) [F]
    <sara.hussain at nih.gov> wrote:
    >
    > Hi FieldTrippers-
    >
    >
    >
    > I have a somewhat simple question. I am running some statistics on source-localized frequency domain data across two groups of subjects. I would like to use the independent samples t-test statistic for cluster-based permutation testing. However, the output in the command window when I run my code seems to disagree with what I am specifying. I’ve followed the tutorials closely on this to ensure I am doing the analysis appropriately.
    >
    >
    >
    > I am running the following:
    >
    >
    >
    > cfg=[];
    >
    > cfg.parameter='pow';
    >
    > cfg.method='montecarlo';
    >
    > cfg.statistic='indepsamplesT';
    >
    > cfg.correctm='cluster';
    >
    > cfg.clusteralpha=0.05;
    >
    > cfg.clusterstatistic='maxsum';
    >
    > cfg.tail=0;
    >
    > cfg.clustertail=0;
    >
    > cfg.alpha=0.025;
    >
    > cfg.numrandomization=1000;
    >
    > cfg.design=[repmat(1,1,numel(cond_A)) repmat(2,1,numel(cond_B))]; %1=cond A, 2=cond B
    >
    > stat=ft_sourcestatistics(cfg,cond_A{:},cond_B{:});
    >
    >
    >
    > The command window prints the following. Bolded are the items that seem misleading. I have not specified any connectivity analysis. Also, the bit talking about single-sample statistics leads me to believe that this is running a single sample t-test where a set of observations is being contrasted against some expected mean value:
    >
    >
    >
    > using "ft_statistics_montecarlo" for the statistical testing
    >
    > using connectivity of voxels in 3-D volume
    >
    > using "ft_statfun_indepsamplesT" for the single-sample statistics
    >
    > constructing randomized design
    >
    > total number of measurements     = 33
    >
    > total number of variables        = 1
    >
    > number of independent variables  = 1
    >
    > number of unit variables         = 0
    >
    > number of within-cell variables  = 0
    >
    > number of control variables      = 0
    >
    > using a permutation resampling approach
    >
    > computing a parametric threshold for clustering
    >
    >
    >
    > Any tips anyone has would be very much appreciated!
    >
    >
    >
    > Sara
    >
    > _______________________________________________
    > 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 m.chait at ucl.ac.uk  Tue Jun  2 15:07:46 2020
From: m.chait at ucl.ac.uk (Chait, Maria)
Date: Tue, 2 Jun 2020 13:07:46 +0000
Subject: [FieldTrip] Research Assistant Position at the UCL Ear Institute
Message-ID: <AM6PR01MB4631FD113EE1F8E88F15130FA88B0@AM6PR01MB4631.eurprd01.prod.exchangelabs.com>

Dear colleagues, I would appreciate your help in forwarding the advert below to relevant members of your department.



We are seeking to appoint an enthusiastic and motivated Research Assistant and Laboratory Manager to provide essential support for ongoing research aimed at developing transformative treatments for deafness and hearing problems. The post is funded for 12 months (with a possibility of extension). The post will involve collection and analysis of audiometry as well as behavioural (psychophysics), eye tracking and EEG data in humans. The post holder will also be expected to contribute to the induction and direction of other research staff and students.  The UCL Ear Institute, located in the heart of London,  provides state-of-the-art research facilities across a wide range of disciplines and is one of the foremost centres for hearing, speech and language-related research within Europe.



Applicants should hold a 1st class, or upper 2nd (or equivalent) BSc or MSc degree in an engineering or Neuroscience-related subject. Previous experience with neuroscience research, functional brain imaging and/or acoustics is desirable.
For more information, and to submit an application, please search for job#1865043 on UCL's job application site (https://www.ucl.ac.uk/work-at-ucl/search-jobs). For informal enquiries feel free to contact me (Maria Chait) m.chait at ucl.ac.uk<mailto:m.chait at ucl.ac.uk>



Closing Date: 03 July 2020




Maria Chait PhD
m.chait at ucl.ac.uk<mailto:m.chait at ucl.ac.uk>
Professor in Auditory Cognitive Neuroscience
Lab site: http://www.ucl.ac.uk/ear/research/chaitlab/
UCL Ear Institute
332 Gray's Inn Road
London WC1X 8EE
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200602/f9269074/attachment.htm>

From KennethSPrice at protonmail.com  Tue Jun  2 21:44:20 2020
From: KennethSPrice at protonmail.com (KennethSPrice)
Date: Tue, 02 Jun 2020 19:44:20 +0000
Subject: [FieldTrip] export ft_volumereslice as nifti file
Message-ID: <Ovki2cpq8IrdtXvvLzQ2AEeV696hN0gAVosxHLr8w3wWfzvyC-z5dN8KPWPDPCDnaXSCk0zqwoXO29uxv0jq26N47OXC28hPWwBx7mLRIvM=@protonmail.com>

Hello all!

I am just starting out using fieldtrip and am having some trouble exporting the result of voluereslice. How does one export the output of ft_volumereslice (struct) as a nifti file?

I have tried 'niftiwrite' but get the error message:
Error using niftiwrite>parseInputs (line 149)
The input volume must be specified as a numeric
matrix.

Any help would be appreciated.

Thanks!
Ken

Sent with [ProtonMail](https://protonmail.com) Secure Email.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200602/10665148/attachment.htm>

From jan.schoffelen at donders.ru.nl  Tue Jun  2 21:47:26 2020
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Tue, 2 Jun 2020 19:47:26 +0000
Subject: [FieldTrip] export ft_volumereslice as nifti file
In-Reply-To: <Ovki2cpq8IrdtXvvLzQ2AEeV696hN0gAVosxHLr8w3wWfzvyC-z5dN8KPWPDPCDnaXSCk0zqwoXO29uxv0jq26N47OXC28hPWwBx7mLRIvM=@protonmail.com>
References: <Ovki2cpq8IrdtXvvLzQ2AEeV696hN0gAVosxHLr8w3wWfzvyC-z5dN8KPWPDPCDnaXSCk0zqwoXO29uxv0jq26N47OXC28hPWwBx7mLRIvM=@protonmail.com>
Message-ID: <4A952134-CC86-416A-A565-5791ABD8680A@donders.ru.nl>

Dear Ken,

ft_volumewrite is your friend if you want to write a volumetric image to a file.

Best wishes,

Jan-Mathijs


On 2 Jun 2020, at 21:44, KennethSPrice <KennethSPrice at protonmail.com<mailto:KennethSPrice at protonmail.com>> wrote:

Hello all!

I am just starting out using fieldtrip and am having some trouble exporting the result of voluereslice. How does one export the output of ft_volumereslice (struct) as a nifti file?

I have tried 'niftiwrite' but get the error message:
Error using niftiwrite>parseInputs (line 149)
The input volume must be specified as a numeric
matrix.

Any help would be appreciated.

Thanks!
Ken



Sent with ProtonMail<https://protonmail.com/> Secure Email.

_______________________________________________
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/20200602/c214bd64/attachment.htm>

From marion.vincent at univ-lille.fr  Wed Jun  3 10:37:44 2020
From: marion.vincent at univ-lille.fr (Marion Vincent)
Date: Wed, 3 Jun 2020 10:37:44 +0200 (CEST)
Subject: [FieldTrip] Errors with ft_clusterplot
Message-ID: <187664949.108562617.1591173464849.JavaMail.zimbra@univ-lille.fr>

Dear Fieldtrip users, 

I'm having some issues when trying to plot the results of my statistical analysis (with cluster-based permutation) with the clusterplot function.

First, the computation is very long (half an hour for 4 channels..) so I was wondering if it is "normal". Or should the calculation be faster? 

Second, the function stops after a while, saying the layout is no detected (cf. code below). This seems strange to me as it is able to compute the first 4 subplot, and so the layout was found. Do you have any idea why ?

Finally, in the clusterplot function: 
does the alpha parameter needs to correspond to the clusteralpha or to the alpha from the statistics part? 

Thanks a lot, 

Marion 

--- ERROR ---

reading layout from file biosemi128.lay
the call to "ft_prepare_layout" took 0 seconds
There are 2 clusters smaller than alpha (0.05)
Positive cluster: 1, pvalue: 0.000999 (*), t = 0.30957 to 1
Negative cluster: 1, pvalue: 0.020979 (x), t = 0 to 0.40039
making subplots...
making subplot 1 from 101
making subplot 2 from 101
making subplot 3 from 101
making subplot 4 from 101
Error using ft_prepare_layout (line 927)
no layout detected, please specify cfg.layout



------- Here's the code : ------- 

% Set parameters
avg_time = 'no';
avg_freq = 'yes';

% prepare the 'design' matrix for the statistical evaluation
nsubj = length(condA);
design = [1:nsubj 1:nsubj ; ones(1,nsubj) ones(1,nsubj)*2]; % on compare 2 condtions  donc seulement 2 conditions !

% load neighbours
load(fullfile(results_path,'neighboursAVPred.mat'))


%--- Statisctics parameters with cluster
cfg                  = [];
cfg.feedback         = 'yes'
cfg.neighbours       = neighbours;
cfg.channels         = {'all'};
cfg.latency          = 'all';
cfg.avgovertime       = avg_time;
cfg.frequency        = 'all';
cfg.avgoverfreq      = avg_freq;
cfg.method           = 'montecarlo';
cfg.clusterthreshold = 'nonparametric_common';
cfg.correctm         = 'cluster';
cfg.clusteralpha     = 0.05;
cfg.clusterstatistic = 'maxsum';
cfg.minnbchan        = 2;
cfg.tail             = 0; % 2-sided
cfg.clustertail      = 0;
cfg.alpha            = 0.025;
cfg.numrandomization = 1000;
cfg.statistic        = 'ft_statfun_depsamplesT';
cfg.design           = design;
cfg.uvar             = 1; 
cfg.ivar             = 2;


statPw = ft_freqstatistics(cfg, condA{:}, condB{:}); % the 2 conditions to compare, obtained from previous code 

% clusterplot
cfg = [];
cfg.zlim = [-5 5];
cfg.alpha = 0.05; % cluster alpha
cfg.layout = 'biosemi128.lay';

ft_clusterplot(cfg,statPw);


From rene.andrade at edu.uah.es  Wed Jun  3 19:37:02 2020
From: rene.andrade at edu.uah.es (=?iso-8859-1?Q?Andrade_Rey_Ren=E9?=)
Date: Wed, 3 Jun 2020 17:37:02 +0000
Subject: [FieldTrip] definetrial error
Message-ID: <VE1PR03MB5901C6D571B1CB08CB6D7AD1AF880@VE1PR03MB5901.eurprd03.prod.outlook.com>

Dear FieldtripToolbox experts:
I am presenting myself as I am new in the community. I am a student of Medicine in University of Alcala de Henares in Madrid Spain.
I have a problem when running the dipole fitting tutorial. I have downloaded and set to path this trialfun_oddball_stimlocked.m file.

>> cfg=ft_definetrial(cfg)
evaluating trialfunction 'trialfun_oddball_stimlocked'
Warning: channels with different sampling rate not supported, selecting subset of 33 channels at 250.000000 Hz
Warning: channels with different sampling rate not supported, selecting subset of 33 channels at 250.000000 Hz
Error using ft_definetrial (line 196)
no trials were defined, see FT_DEFINETRIAL for help


I am running on Temple University Hospital TUH EEG dataset of epilepsy.

Thank you for your help in advance!
Best,
Rene Andrade.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200603/fdd1834a/attachment.htm>

From jan.schoffelen at donders.ru.nl  Wed Jun  3 21:43:07 2020
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Wed, 3 Jun 2020 19:43:07 +0000
Subject: [FieldTrip] definetrial error
In-Reply-To: <VE1PR03MB5901C6D571B1CB08CB6D7AD1AF880@VE1PR03MB5901.eurprd03.prod.outlook.com>
References: <VE1PR03MB5901C6D571B1CB08CB6D7AD1AF880@VE1PR03MB5901.eurprd03.prod.outlook.com>
Message-ID: <DFAE80EC-E7F7-4FD6-A401-B6C6138AF57E@donders.ru.nl>

Dear René,

It is not clear what you want to do exactly, but in general you should not expect that a tutorial that was written for task based data, for instance an oddball task, works as is for any other data, in your case a clinical EEG dataset.
There are several reasons for this. First of all, an experimental dataset  typically contains markers at specified timepoints in the data, that indicate certain events happening, for instance the onset of a visual stimulus on the screen, or a button pressed by the participant. Using this event information (which is represented in a dataset specific way) the experimenter can determine which chunks of the data are interesting for further investigation. The definition of the chunks of interest is done in ft_definetrial (which is the function that throws the error), but this only works if the data aligns with the instructions that the function is given. Now, given that you input clinical EEG data in combination with an event extraction recipe (’trialfun_oddball_stimlocked') that has no relation whatsoever with any event information stored in the EEG data file, it is bound to fail.

So the question now is whether you want to learn about dipole fitting, or whether you want to learn about epilepsy data analysis, or about a combination thereof.

We don’t have a lot of teaching material about epilepsy, but a good start might be http://www.fieldtriptoolbox.org/tutorial/epilepsy/, rather than the tutorial you referred to. Note, however, that this tutorial concerns MEG data, and some parts of it are not relevant in case of EEG data. On the other hand, it might give you some handles on how this type of data can be analyzed.

Best wishes,
Jan-Mathijs




On 3 Jun 2020, at 19:37, Andrade Rey René <rene.andrade at edu.uah.es<mailto:rene.andrade at edu.uah.es>> wrote:

Dear FieldtripToolbox experts:
I am presenting myself as I am new in the community. I am a student of Medicine in University of Alcala de Henares in Madrid Spain.
I have a problem when running the dipole fitting tutorial. I have downloaded and set to path this trialfun_oddball_stimlocked.m file.

>> cfg=ft_definetrial(cfg)
evaluating trialfunction 'trialfun_oddball_stimlocked'
Warning: channels with different sampling rate not supported, selecting subset of 33 channels at 250.000000 Hz
Warning: channels with different sampling rate not supported, selecting subset of 33 channels at 250.000000 Hz
Error using ft_definetrial (line 196)
no trials were defined, see FT_DEFINETRIAL for help


I am running on Temple University Hospital TUH EEG dataset of epilepsy.

Thank you for your help in advance!
Best,
Rene Andrade.
_______________________________________________
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/20200603/7dccd292/attachment.htm>

From saadatmehr.b at gmail.com  Thu Jun  4 10:11:44 2020
From: saadatmehr.b at gmail.com (Bahar Saadatmehr)
Date: Thu, 4 Jun 2020 12:41:44 +0430
Subject: [FieldTrip] Fwd: Question
In-Reply-To: <CAFP59Yx2DCxi3e8QhFZuEOOeByWRHSGj7-yL2+-VNfZJQF4NOw@mail.gmail.com>
References: <CAFP59Yx2DCxi3e8QhFZuEOOeByWRHSGj7-yL2+-VNfZJQF4NOw@mail.gmail.com>
Message-ID: <CAFP59Yz-9rEHJMCBMEpYU=J0D=5eVU-Md7sBi-yaUv4_Hd7E9Q@mail.gmail.com>

---------- Forwarded message ---------
From: Bahar Saadatmehr <saadatmehr.b at gmail.com>
Date: Mon, 1 Jun 2020, 13:06
Subject: Question
To: <fieldtrip at science.ru.nl>


Hello. I was wondering if I could have your help.
How can I put electrode positions in the .elc format to use it with CURRY?

Thank you in advance for your help.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200604/1e98be93/attachment.htm>

From jan.schoffelen at donders.ru.nl  Thu Jun  4 10:19:53 2020
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Thu, 4 Jun 2020 08:19:53 +0000
Subject: [FieldTrip] Question
In-Reply-To: <CAFP59Yz-9rEHJMCBMEpYU=J0D=5eVU-Md7sBi-yaUv4_Hd7E9Q@mail.gmail.com>
References: <CAFP59Yx2DCxi3e8QhFZuEOOeByWRHSGj7-yL2+-VNfZJQF4NOw@mail.gmail.com>
 <CAFP59Yz-9rEHJMCBMEpYU=J0D=5eVU-Md7sBi-yaUv4_Hd7E9Q@mail.gmail.com>
Message-ID: <3600C155-E580-4EAF-A55A-26A981F31D21@donders.ru.nl>

Dear Bahar,

In general, it does not make sense to forward or resend a message to the discussion in case you haven’t received a reply. The reason for this is that people who invest their time and efforts to answer questions on this list, do so on a voluntary basis. Besides this, your question was so unspecific that I guess nobody knows how to provide an sufficiently informative answer.

I suggest that you 1) try and search on the fieldtrip website yourself, there should be information there which already points into the direction of a solution, and 2) carefully read some of the linked pages on http://www.fieldtriptoolbox.org/discussion_list/, which give you some information about the best way of asking questions on these types of lists.

Best wishes and good luck,
Jan-Mathijs



J.M.Schoffelen, MD PhD
Associate PI, VIDI-fellow - PI, language in interaction
Telephone: +31-24-3614793
Physical location: room 00.028
Donders Centre for Cognitive Neuroimaging, Nijmegen, The Netherlands




On 4 Jun 2020, at 10:11, Bahar Saadatmehr <saadatmehr.b at gmail.com<mailto:saadatmehr.b at gmail.com>> wrote:


---------- Forwarded message ---------
From: Bahar Saadatmehr <saadatmehr.b at gmail.com<mailto:saadatmehr.b at gmail.com>>
Date: Mon, 1 Jun 2020, 13:06
Subject: Question
To: <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>>


Hello. I was wondering if I could have your help.
How can I put electrode positions in the .elc format to use it with CURRY?

Thank you in advance for your help.

_______________________________________________
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/20200604/615f25c2/attachment.htm>

From ykrsch at gmail.com  Thu Jun  4 12:00:04 2020
From: ykrsch at gmail.com (ykrsch k)
Date: Thu, 4 Jun 2020 11:00:04 +0100
Subject: [FieldTrip] Read Plexon nex5 file
Message-ID: <CAN5=aXYHXAGYUY70XzOaaLg4uwiommmWR6m=NWzp3KXsYrDQHA@mail.gmail.com>

Hi Fieldtrip community,

Fieldtrip seems to read only ddt, plx and nex formats for Plexon files (
http://www.fieldtriptoolbox.org/getting_started/plexon/) but is there any
development to read nex5 in the future as now more data can be stored only
in nex5 files which support 64-bit timestamps?

Best wishes,

Yuki
----------------------------------------------------------
Yuki Kikuchi PhD
Newcastle University Medical School
Phone: +44-191-208-3275
Email: yukiko.kikuchi at newcastle.ac.uk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200604/00f92ec1/attachment.htm>

From rene.andrade at edu.uah.es  Thu Jun  4 14:06:03 2020
From: rene.andrade at edu.uah.es (=?utf-8?B?QW5kcmFkZSBSZXkgUmVuw6k=?=)
Date: Thu, 4 Jun 2020 12:06:03 +0000
Subject: [FieldTrip] fieldtrip Digest, Vol 115, Issue 5
In-Reply-To: <mailman.15.1591264802.24623.fieldtrip@science.ru.nl>
References: <mailman.15.1591264802.24623.fieldtrip@science.ru.nl>
Message-ID: <F26A8F1C-F96F-4CC2-81A3-B58BCF05E952@edu.uah.es>


> On 4 Jun 2020, at 12:29, "fieldtrip-request at science.ru.nl" <fieldtrip-request at science.ru.nl> wrote:
> 
> ﻿Send fieldtrip mailing list submissions to
>    fieldtrip at science.ru.nl
> 
> To subscribe or unsubscribe via the World Wide Web, visit
>    https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> or, via email, send a message with subject or body 'help' to
>    fieldtrip-request at science.ru.nl
> 
> You can reach the person managing the list at
>    fieldtrip-owner at science.ru.nl
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of fieldtrip digest..."
> 
> 
> Today's Topics:
> 
>   1. definetrial error (Andrade Rey René)
>   2. Re: definetrial error (Schoffelen, J.M. (Jan Mathijs))
>   3. Fwd: Question (Bahar Saadatmehr)
>   4. Re: Question (Schoffelen, J.M. (Jan Mathijs))
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Wed, 3 Jun 2020 17:37:02 +0000
> From: Andrade Rey René <rene.andrade at edu.uah.es>
> To: "fieldtrip at science.ru.nl" <fieldtrip at science.ru.nl>
> Subject: [FieldTrip] definetrial error
> Message-ID:
>    <VE1PR03MB5901C6D571B1CB08CB6D7AD1AF880 at VE1PR03MB5901.eurprd03.prod.outlook.com>
>    
> Content-Type: text/plain; charset="iso-8859-1"
> 
> Dear FieldtripToolbox experts:
> I am presenting myself as I am new in the community. I am a student of Medicine in University of Alcala de Henares in Madrid Spain.
> I have a problem when running the dipole fitting tutorial. I have downloaded and set to path this trialfun_oddball_stimlocked.m file.
> 
>>> cfg=ft_definetrial(cfg)
> evaluating trialfunction 'trialfun_oddball_stimlocked'
> Warning: channels with different sampling rate not supported, selecting subset of 33 channels at 250.000000 Hz
> Warning: channels with different sampling rate not supported, selecting subset of 33 channels at 250.000000 Hz
> Error using ft_definetrial (line 196)
> no trials were defined, see FT_DEFINETRIAL for help
> 
> 
> I am running on Temple University Hospital TUH EEG dataset of epilepsy.
> 
> Thank you for your help in advance!
> Best,
> Rene Andrade.
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200603/fdd1834a/attachment-0001.htm>
> 
> ------------------------------
> 
> Message: 2
> Date: Wed, 3 Jun 2020 19:43:07 +0000
> From: "Schoffelen, J.M. (Jan Mathijs)" <jan.schoffelen at donders.ru.nl>
> To: FieldTrip discussion list <fieldtrip at science.ru.nl>
> Subject: Re: [FieldTrip] definetrial error
> Message-ID: <DFAE80EC-E7F7-4FD6-A401-B6C6138AF57E at donders.ru.nl>
> Content-Type: text/plain; charset="utf-8"
> 
> Dear René,
> 
> It is not clear what you want to do exactly,

I want to find the origin of  focal or more complex seizures of epilepsy
> but in general you should not expect that a tutorial that was written for task based data, for instance an oddball task, works as is for any other data, in your case a clinical EEG dataset.

I understand 

my question would be then how to proceed (see below)
 

> There are several reasons for this. First of all, an experimental dataset  typically contains markers at specified timepoints in the data, that indicate certain events happening, for instance the onset of a visual stimulus on the screen, or a button pressed by the participant. Using this event information (which is represented in a dataset specific way) the experimenter can determine which chunks of the data are interesting for further investigation. The definition of the chunks of interest is done in ft_definetrial (which is the function that throws the error), but this only works if the data aligns with the instructions that the function is given. Now, given that you input clinical EEG data in combination with an event extraction recipe (’trialfun_oddball_stimlocked') that has no relation whatsoever with any event information stored in the EEG data file, it is bound to fail.
> 
> So the question now is whether you want to learn about dipole fitting, or whether you want to learn about epilepsy data analysis, or about a combination thereof.
> 

I need the combination because sometimes the focal seizure location is in the ROI of maximum activity and there is no need for dipole fitting but sometimes there is propagation and it is required to do analysis with dipole to know where it came from 

> We don’t have a lot of teaching material about epilepsy, but a good start might be http://www.fieldtriptoolbox.org/tutorial/epilepsy/, rather than the tutorial you referred to. Note, however, that this tutorial concerns MEG data, and some parts of it are not relevant in case of EEG data. On the other hand, it might give you some handles on how this type of data can be analyzed.
> 
I will check for the tutorial but please tell me what changes do I need to do or what data do I need, to run dipole fitting in epilepsy dataset. 

Also I have data from epilepsy that shows no epileptic seizure or epileptic activity whatsoever (that is healthy subjects) is it easier to analyse eeg with dipole fitting in that case? How should I proceed? 

Thank you for your kindness and dedication!! 


> Best wishes,
> Jan-Mathijs
> 
> 
> 
> 
> On 3 Jun 2020, at 19:37, Andrade Rey René <rene.andrade at edu.uah.es<mailto:rene.andrade at edu.uah.es>> wrote:
> 
> Dear FieldtripToolbox experts:
> I am presenting myself as I am new in the community. I am a student of Medicine in University of Alcala de Henares in Madrid Spain.
> I have a problem when running the dipole fitting tutorial. I have downloaded and set to path this trialfun_oddball_stimlocked.m file.
> 
>>> cfg=ft_definetrial(cfg)
> evaluating trialfunction 'trialfun_oddball_stimlocked'
> Warning: channels with different sampling rate not supported, selecting subset of 33 channels at 250.000000 Hz
> Warning: channels with different sampling rate not supported, selecting subset of 33 channels at 250.000000 Hz
> Error using ft_definetrial (line 196)
> no trials were defined, see FT_DEFINETRIAL for help
> 
> 
> I am running on Temple University Hospital TUH EEG dataset of epilepsy.
> 
> Thank you for your help in advance!
> Best,
> Rene Andrade.
> _______________________________________________
> 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/20200603/7dccd292/attachment-0001.htm>
> 
> ------------------------------
> 
> Message: 3
> Date: Thu, 4 Jun 2020 12:41:44 +0430
> From: Bahar Saadatmehr <saadatmehr.b at gmail.com>
> To: fieldtrip at science.ru.nl
> Subject: [FieldTrip] Fwd: Question
> Message-ID:
>    <CAFP59Yz-9rEHJMCBMEpYU=J0D=5eVU-Md7sBi-yaUv4_Hd7E9Q at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
> 
> ---------- Forwarded message ---------
> From: Bahar Saadatmehr <saadatmehr.b at gmail.com>
> Date: Mon, 1 Jun 2020, 13:06
> Subject: Question
> To: <fieldtrip at science.ru.nl>
> 
> 
> Hello. I was wondering if I could have your help.
> How can I put electrode positions in the .elc format to use it with CURRY?
> 
> Thank you in advance for your help.
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200604/1e98be93/attachment-0001.htm>
> 
> ------------------------------
> 
> Message: 4
> Date: Thu, 4 Jun 2020 08:19:53 +0000
> From: "Schoffelen, J.M. (Jan Mathijs)" <jan.schoffelen at donders.ru.nl>
> To: FieldTrip discussion list <fieldtrip at science.ru.nl>
> Subject: Re: [FieldTrip] Question
> Message-ID: <3600C155-E580-4EAF-A55A-26A981F31D21 at donders.ru.nl>
> Content-Type: text/plain; charset="utf-8"
> 
> Dear Bahar,
> 
> In general, it does not make sense to forward or resend a message to the discussion in case you haven’t received a reply. The reason for this is that people who invest their time and efforts to answer questions on this list, do so on a voluntary basis. Besides this, your question was so unspecific that I guess nobody knows how to provide an sufficiently informative answer.
> 
> I suggest that you 1) try and search on the fieldtrip website yourself, there should be information there which already points into the direction of a solution, and 2) carefully read some of the linked pages on http://www.fieldtriptoolbox.org/discussion_list/, which give you some information about the best way of asking questions on these types of lists.
> 
> Best wishes and good luck,
> Jan-Mathijs
> 
> 
> 
> J.M.Schoffelen, MD PhD
> Associate PI, VIDI-fellow - PI, language in interaction
> Telephone: +31-24-3614793
> Physical location: room 00.028
> Donders Centre for Cognitive Neuroimaging, Nijmegen, The Netherlands
> 
> 
> 
> 
> On 4 Jun 2020, at 10:11, Bahar Saadatmehr <saadatmehr.b at gmail.com<mailto:saadatmehr.b at gmail.com>> wrote:
> 
> 
> ---------- Forwarded message ---------
> From: Bahar Saadatmehr <saadatmehr.b at gmail.com<mailto:saadatmehr.b at gmail.com>>
> Date: Mon, 1 Jun 2020, 13:06
> Subject: Question
> To: <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>>
> 
> 
> Hello. I was wondering if I could have your help.
> How can I put electrode positions in the .elc format to use it with CURRY?
> 
> Thank you in advance for your help.
> 
> _______________________________________________
> 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/20200604/615f25c2/attachment-0001.htm>
> 
> ------------------------------
> 
> Subject: Digest Footer
> 
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202
> 
> 
> ------------------------------
> 
> End of fieldtrip Digest, Vol 115, Issue 5
> *****************************************



From e.spaak at donders.ru.nl  Fri Jun  5 08:51:46 2020
From: e.spaak at donders.ru.nl (Eelke Spaak)
Date: Fri, 5 Jun 2020 08:51:46 +0200
Subject: [FieldTrip] Errors with ft_clusterplot
In-Reply-To: <187664949.108562617.1591173464849.JavaMail.zimbra@univ-lille.fr>
References: <187664949.108562617.1591173464849.JavaMail.zimbra@univ-lille.fr>
Message-ID: <CABPNLUowg0USNERAoPZeeeVzZ4Td+SivpcjS4-sLFm5ET09fbA@mail.gmail.com>

Dear Marion,

> First, the computation is very long (half an hour for 4 channels..) so I was wondering if it is "normal". Or should the calculation be faster?

This indeed is very long. ft_clusterplot will plot channel
topographies for every time (/frequency) point in the clusters in the
data. From the command window feedback you pasted I see that in your
case, this results in 101 (!) subplots. Given how relatively slow
Matlab plotting is in general, that would explain the slowness here. I
would recommend some other way of plotting the results of the
statistical test, e.g. "manually" using ft_topoplotER, selecting a
time window, and using cfg.highlightchannel or so (based on
stat.mask).

> Second, the function stops after a while, saying the layout is no detected (cf. code below). This seems strange to me as it is able to compute the first 4 subplot, and so the layout was found. Do you have any idea why ?

This is strange, and I have no direct answer here.

> does the alpha parameter needs to correspond to the clusteralpha or to the alpha from the statistics part?

The cfg.alpha from the statistics part. This is the parameter that
determines the false alarm rate of the statistical test.
cfg.clusteralpha is only used to form and group cluster candidates and
is strictly speaking not related to the statistical test (i.e. the
comparison of the observed data to the randomization distribution)
itself.

Best,
Eelke

>
> Thanks a lot,
>
> Marion
>
> --- ERROR ---
>
> reading layout from file biosemi128.lay
> the call to "ft_prepare_layout" took 0 seconds
> There are 2 clusters smaller than alpha (0.05)
> Positive cluster: 1, pvalue: 0.000999 (*), t = 0.30957 to 1
> Negative cluster: 1, pvalue: 0.020979 (x), t = 0 to 0.40039
> making subplots...
> making subplot 1 from 101
> making subplot 2 from 101
> making subplot 3 from 101
> making subplot 4 from 101
> Error using ft_prepare_layout (line 927)
> no layout detected, please specify cfg.layout
>
>
>
> ------- Here's the code : -------
>
> % Set parameters
> avg_time = 'no';
> avg_freq = 'yes';
>
> % prepare the 'design' matrix for the statistical evaluation
> nsubj = length(condA);
> design = [1:nsubj 1:nsubj ; ones(1,nsubj) ones(1,nsubj)*2]; % on compare 2 condtions  donc seulement 2 conditions !
>
> % load neighbours
> load(fullfile(results_path,'neighboursAVPred.mat'))
>
>
> %--- Statisctics parameters with cluster
> cfg                  = [];
> cfg.feedback         = 'yes'
> cfg.neighbours       = neighbours;
> cfg.channels         = {'all'};
> cfg.latency          = 'all';
> cfg.avgovertime       = avg_time;
> cfg.frequency        = 'all';
> cfg.avgoverfreq      = avg_freq;
> cfg.method           = 'montecarlo';
> cfg.clusterthreshold = 'nonparametric_common';
> cfg.correctm         = 'cluster';
> cfg.clusteralpha     = 0.05;
> cfg.clusterstatistic = 'maxsum';
> cfg.minnbchan        = 2;
> cfg.tail             = 0; % 2-sided
> cfg.clustertail      = 0;
> cfg.alpha            = 0.025;
> cfg.numrandomization = 1000;
> cfg.statistic        = 'ft_statfun_depsamplesT';
> cfg.design           = design;
> cfg.uvar             = 1;
> cfg.ivar             = 2;
>
>
> statPw = ft_freqstatistics(cfg, condA{:}, condB{:}); % the 2 conditions to compare, obtained from previous code
>
> % clusterplot
> cfg = [];
> cfg.zlim = [-5 5];
> cfg.alpha = 0.05; % cluster alpha
> cfg.layout = 'biosemi128.lay';
>
> ft_clusterplot(cfg,statPw);
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202


From johnnguyen.education at gmail.com  Fri Jun  5 10:09:53 2020
From: johnnguyen.education at gmail.com (John Nguyen)
Date: Fri, 5 Jun 2020 04:09:53 -0400
Subject: [FieldTrip] Question with ft_statfun_depsamplesFmultivariate.m
Message-ID: <CACzaKkEvnmFrMiTW8rtA1qi-P27OLUaaG8hiCLpoY7gjfhzmxg@mail.gmail.com>

Hi All,

Hope things are well. I have a question about one of the ft's stat
function, as I'm trying to replicated something similar so I can use the
cluster permutation test.
In ft_statfun_depsamplesFmultivariate.m, the s.critval and s.prob
calculation involves them being adjusted by

"((nunits-1).*ncontrasts./(nunits-ncontrasts))"
and
 "((nunits-ncontrasts)./((nunits-1).*ncontrasts))"
respectively

Which isn't seen in ft_statfun_depsamplesFunivariate.m. Why are they being
adjusted? I've tried looking around trying to see when critvals are
adjusted (like during manovas) with no luck so I thought to ask here. Am I
forgetting something here?

Thank you,
John Nguyen
Boston University.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200605/b8e15123/attachment.htm>

From Laurent.Sheybani at unige.ch  Mon Jun  8 14:27:19 2020
From: Laurent.Sheybani at unige.ch (Laurent Sheybani)
Date: Mon, 8 Jun 2020 12:27:19 +0000
Subject: [FieldTrip] Phase synchronization and coherence spectrum
Message-ID: <960bef9830564bff9f633ff3a06ebc1c@unige.ch>

Dear Fieldtrippers,

I am trying to implement the example provided here (http://www.fieldtriptoolbox.org/tutorial/fourier/) to measure the phase synchronization between two signals. I followed the paragraph starting by "The coherence spectrum".

>From what I understand of the "Coherence spectrum" example script of this web-page, the plot that one should obtain when calling plot(coh) is a 2-D plot with the y-axis corresponding to the coherence index between 0 to 1 and x-axis corresponding to frequencies (right ?).

However, when I changed the length of the signal (argument "len"), I noticed that the frequency (x-) axis increased by the same factor (e.g. if I change len from 1 to 2.5, the x-axis changes from 100 to 250). The coherence is no more on 10 Hz, but on 25 Hz. I must have missed something simple, but I do not understand why the results (& frequency axis) depend on the duration of the signal ? Did I miss a normalization somewhere ?

Any help would be greatly appreciated !
Thanks in advance !

-----------------------------
Dr. Laurent Sheybani, Ph.D
Médecin interne en Neurologie Clinique
Clinique de Neurologie
Hôpitaux Universitaires de Genève
Rue Gabrielle-Perret-Gentil, 4
1205 Genève
Switzerland

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200608/0f31a160/attachment.htm>

From jan.schoffelen at donders.ru.nl  Mon Jun  8 18:12:41 2020
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Mon, 8 Jun 2020 16:12:41 +0000
Subject: [FieldTrip] Phase synchronization and coherence spectrum
In-Reply-To: <960bef9830564bff9f633ff3a06ebc1c@unige.ch>
References: <960bef9830564bff9f633ff3a06ebc1c@unige.ch>
Message-ID: <47F8D0CF-AB1B-4F56-80C3-374AE6E9CA4A@donders.ru.nl>

Dear Laurent,

Hmmm, interesting that you managed to find this tutorial, since it does not seem to be linked. This is a very ‘old’ tutorial (i.e. > 15 years), and hasn’t been updated for quite a while. You are indeed correct that the x-axis represents frequency bins, but given the way that the data are plotted, i.e. as plot(<some-vector>) these frequency bins are not reflecting physical units as expressed in Hz. Rather, the number of points in the graph just reflect the number of points of the fft, which is by definition equal to the number of samples in the time domain signal. These frequency bins essentially span an axis that runs from 0 Hz up to (in this case) twice the Nyquist frequency (minus a little bit), where the Nyquist frequency is defined as the sampling frequency divided by 2. In other words, the 100 ‘bins’ on the frequency axis run from 0 to 99 Hz, which nicely correspond to a bin width of 1 Hz per bin. As you see in the graph, the coherence peak is actually at the 11’th bin, coinciding with a frequency of 10 Hz.
Now, if you change the length of  your signal to 2.5 seconds (at a sampling frequency of 100 Hz), your signals will be 250 samples long, and by consequence the fft of the signals will also be 250 samples long. Now the total frequency range (i.e. 0 Hz up to 100 Hz minus a bit) will be divided into 250 bins. This indeed causes the bin with the maximum coherence to be the 26th bin, but this still corresponds to a physical frequency of 10 Hz, because the bin width has changed from 1 bins/Hz into 2.5 bins/Hz.

Best wishes,
Jan-Mathijs




On 8 Jun 2020, at 14:27, Laurent Sheybani <Laurent.Sheybani at unige.ch<mailto:Laurent.Sheybani at unige.ch>> wrote:

Dear Fieldtrippers,

I am trying to implement the example provided here (http://www.fieldtriptoolbox.org/tutorial/fourier/) to measure the phase synchronization between two signals. I followed the paragraph starting by “The coherence spectrum”.

From what I understand of the “Coherence spectrum” example script of this web-page, the plot that one should obtain when calling plot(coh) is a 2-D plot with the y-axis corresponding to the coherence index between 0 to 1 and x-axis corresponding to frequencies (right ?).

However, when I changed the length of the signal (argument “len”), I noticed that the frequency (x-) axis increased by the same factor (e.g. if I change len from 1 to 2.5, the x-axis changes from 100 to 250). The coherence is no more on 10 Hz, but on 25 Hz. I must have missed something simple, but I do not understand why the results (& frequency axis) depend on the duration of the signal ? Did I miss a normalization somewhere ?

Any help would be greatly appreciated !
Thanks in advance !

-----------------------------
Dr. Laurent Sheybani, Ph.D
Médecin interne en Neurologie Clinique
Clinique de Neurologie
Hôpitaux Universitaires de Genève
Rue Gabrielle-Perret-Gentil, 4
1205 Genève
Switzerland

_______________________________________________
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/20200608/11b350a3/attachment.htm>

From hri.pereira at campus.fct.unl.pt  Mon Jun  8 21:42:31 2020
From: hri.pereira at campus.fct.unl.pt (Helena Pereira)
Date: Mon, 8 Jun 2020 20:42:31 +0100
Subject: [FieldTrip] Can the warning "Warning: could not determine dimord of
 "comp" in:" influence the results?
Message-ID: <CACZYJ4s-q+ameLJgQ=57TWa4MGv6X1awVHLLF3tKdgK3NgrOng@mail.gmail.com>

Dear FieldTrip users,

I'm running the ft_componentanalysis function after applying ICA to my
data. Although I'm not getting any error, the following warning came out:









*Warning: could not determine dimord of "comp" in:             label: {69×1
cell}               cfg: [1×1 struct]              topo: [69×1 double]
  topodimord: 'chan_comp'              comp: 7          unmixing: [1×69
double]    unmixingdimord: 'chan_topochan'*

Can this influence the way the components are displayed and consequently my
results? Is this associated with the layout that I used or with the
"demean" option?

My code is as follows:
cfg = [];
%cfg.channel = 1:64;
cfg.method = 'runica';
cfg.demean = 'yes';
ica_cleaned = ft_componentanalysis(cfg, data);

cfg = [];
cfg.component = 1:20;
cfg.layout = 'biosemi64.lay';
cfg.comment   = 'no';
ft_topoplotIC(cfg, ica_cleaned )

Thanks in advance,
Keep safe,
Helena Pereira
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200608/a77e1a1f/attachment.htm>

From nzhen340 at gmail.com  Mon Jun  8 22:30:28 2020
From: nzhen340 at gmail.com (Zhen Ni)
Date: Mon, 8 Jun 2020 16:30:28 -0400
Subject: [FieldTrip] Permutation test
Message-ID: <CACg_EhBw9x4=nek-DXmNS8dLergwKEbMACiUpVcV6NZPRgvCkw@mail.gmail.com>

Hello,
My name is Zhen Ni. I'm a senior research fellow working at the National
Institutes of Health.
I'm using FieldTrip (version 20200423) to perform a cluster-based
permutation test. My script is largely based on the example you showed on
the FieldTrip webpage. The script stopped after a while with a technical
problem. I copied the error message below.
I also tried following your instruction and used the dataset you uploaded
on the webpage. The same error message comes out. I wonder if you may take
a look at my codes and help me out.

Many thanks.
Zhen



Invalid MEX-file
'/Users/nz/Documents/MATLAB/external/spm8/spm_bwlabel.mexmaci64':
dlopen(/Users/nz/Documents/MATLAB/external/spm8/spm_bwlabel.mexmaci64, 6):
Library
not loaded: @loader_path/libmex.dylib
  Referenced from:
/Users/nz/Documents/MATLAB/external/spm8/spm_bwlabel.mexmaci64
  Reason: image not found

Error in findcluster (line 87)
    [labelmat(spatdimlev, :, :), num] =
spm_bwlabel(double(reshape(onoff(spatdimlev,
    :, :), nfreq, ntime)), 6); % the previous code contained a '4' for input

Error in clusterstat (line 202)
      posclusobs = findcluster(reshape(postailobs,
      [cfg.dim,1]),channeighbstructmat,cfg.minnbchan);

Error in ft_statistics_montecarlo (line 353)
  [stat, cfg] = clusterstat(cfg, statrand, statobs);

Error in ft_timelockstatistics (line 184)
  [stat, cfg] = statmethod(cfg, dat, design);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200608/63b3121a/attachment.htm>

From e.spaak at donders.ru.nl  Tue Jun  9 08:37:03 2020
From: e.spaak at donders.ru.nl (Eelke Spaak)
Date: Tue, 9 Jun 2020 08:37:03 +0200
Subject: [FieldTrip] Can the warning "Warning: could not determine
 dimord of "comp" in:" influence the results?
In-Reply-To: <CACZYJ4s-q+ameLJgQ=57TWa4MGv6X1awVHLLF3tKdgK3NgrOng@mail.gmail.com>
References: <CACZYJ4s-q+ameLJgQ=57TWa4MGv6X1awVHLLF3tKdgK3NgrOng@mail.gmail.com>
Message-ID: <CABPNLUopzcnZHXs4sKn=oBNBdKD4F6EufOXARKxju34FxBU4bg@mail.gmail.com>

Dear Helena,

In general, you can probably safely ignore the warning. It just means
that FieldTrip is unsure of the dimensionality of the 'comp' field,
because there is no 'compdimord' and also the dimensionality does not
match the data in any straightforward way.

However, the structure of your componentanalysis output is somewhat
strange. From .topo and .unmixing, it appears there is only one
component. However, .label has 69 elements, and there is no .topolabel
(which usually is there). Is the output you posted directly produced
by ft_componentanalysis (i.e. it is the 'ica_cleaned' variable
immediately after the step you showed)?

Best,
Eelke

On Mon, 8 Jun 2020 at 21:42, Helena Pereira
<hri.pereira at campus.fct.unl.pt> wrote:
>
> Dear FieldTrip users,
>
> I'm running the ft_componentanalysis function after applying ICA to my data. Although I'm not getting any error, the following warning came out:
>
> Warning: could not determine dimord of "comp" in:
>
>              label: {69×1 cell}
>                cfg: [1×1 struct]
>               topo: [69×1 double]
>         topodimord: 'chan_comp'
>               comp: 7
>           unmixing: [1×69 double]
>     unmixingdimord: 'chan_topochan'
>
> Can this influence the way the components are displayed and consequently my results? Is this associated with the layout that I used or with the "demean" option?
>
> My code is as follows:
> cfg = [];
> %cfg.channel = 1:64;
> cfg.method = 'runica';
> cfg.demean = 'yes';
> ica_cleaned = ft_componentanalysis(cfg, data);
>
> cfg = [];
> cfg.component = 1:20;
> cfg.layout = 'biosemi64.lay';
> cfg.comment   = 'no';
> ft_topoplotIC(cfg, ica_cleaned )
>
> Thanks in advance,
> Keep safe,
> Helena Pereira
>
>
>
>
>
>
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202



From mcarlapiastra at gmail.com  Tue Jun  9 09:50:03 2020
From: mcarlapiastra at gmail.com (Maria Carla Piastra)
Date: Tue, 9 Jun 2020 09:50:03 +0200
Subject: [FieldTrip] tetrahedral to hexahedral mesh
In-Reply-To: <0C1496AA-EE8F-4D9B-8CF8-DC69C4068D32@gmail.com>
References: <2fd108830fb249eab06332279dcddce2@artorg.unibe.ch>
 <0C1496AA-EE8F-4D9B-8CF8-DC69C4068D32@gmail.com>
Message-ID: <CACa4E9vxyq_Fmbb4eoWTibN+tkgr9+vD+QXzBMBdr0DA96DS0A@mail.gmail.com>

Hi all,
following up on this email exchange, I created a pull request you can
follow by adding a comment here:
https://github.com/fieldtrip/fieldtrip/pull/1427
Best,
Maria Carla

On Wed, 27 May 2020 at 10:58, Johannes Vorwerk <j.vorw01 at gmail.com> wrote:

> Hi Roberto,
>
> having implemented the FieldTrip-Simbio pipeline and having worked on DBS
> myself, I would recommend you not to use a hexahedral mesh for this kind of
> simulations, since it is very hard to properly resolve the geometry of a
> DBS lead in a hexahedral mesh. Furthermore, the mesh should be especially
> refined around the DBS lead to achieve high numerical accuracies, which is
> only (easily) possible using tetrahedral meshes.
>
> To achieve anisotropic conductivities in a tetrahedral mesh, I would
> recommend you to assign the anisotropy tensor of the voxel closest to the
> center of the tetrahedral element for each element. Additional
> interpolation of the tensors is quite tricky.
>
> For DBS computations, I would also recommend you to take a look at LeadDBS
> (Horn, Andreas, et al. "Lead-DBS v2: Towards a comprehensive pipeline for
> deep brain stimulation imaging." Neuroimage 184 (2019): 293-316.,
> lead-dbs.org), which relies on the same numerical background as
> FieldTrip-SimBio.
>
> Best,
> Johannes
>
> On 27. May 2020, at 10:48, <roberto.garza at artorg.unibe.ch> <
> roberto.garza at artorg.unibe.ch> wrote:
>
> Good morning,
> I'm working in the DBS field and I'm using your library to obtain the
> headmodel. My aim is to include conductivity anisotropy in the computation
> of the electric field (by using the FieldTrip-SimBio pipeline). I have one
> conductivity matrix for each voxel in the image, so I built a hexahedral
> mesh to get a straightforward correspondence between an element and its
> conductivity. Now I need to integrate in the model the electrode as well: I
> have it in the form of a tetrahedral mesh. Is there a way to convert
> tetrahedral mesh to hexahedral? Or is there another way to integrate the
> two models that I'm not seeing?
>
> Thank you for your time
>
> Roberto Garza
> _______________________________________________
> 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/20200609/749009f5/attachment.htm>

From hri.pereira at campus.fct.unl.pt  Tue Jun  9 10:38:17 2020
From: hri.pereira at campus.fct.unl.pt (Helena Pereira)
Date: Tue, 9 Jun 2020 09:38:17 +0100
Subject: [FieldTrip] Can the warning "Warning: could not determine
 dimord of "comp" in:" influence the results?
In-Reply-To: <CABPNLUopzcnZHXs4sKn=oBNBdKD4F6EufOXARKxju34FxBU4bg@mail.gmail.com>
References: <CACZYJ4s-q+ameLJgQ=57TWa4MGv6X1awVHLLF3tKdgK3NgrOng@mail.gmail.com>
 <CABPNLUopzcnZHXs4sKn=oBNBdKD4F6EufOXARKxju34FxBU4bg@mail.gmail.com>
Message-ID: <CACZYJ4uN=c1L0n6AMYH3QuGJUfWgR9HbWSxMiwG2zeomwSzPBA@mail.gmail.com>

Dear Eelk,

Yes, 'ica_cleaned' is produced directly from ft_componentanalysis:

cfg = [];
cfg.dataset=subject;
cfg.trialfun = 'ft_trialfun_general'; % this is the default
cfg.trialdef.eventtype  = 'Stimulus';
cfg.trialdef.eventvalue ={Stimulus}';
cfg.trialdef.prestim    = 2; %latency in seconds
cfg.trialdef.poststim   = 2; %latency in seconds
cfg=ft_definetrial(cfg);

cfg.channel = [1:69]; %discard channels not used
cfg.preproc.reref = 'yes';
cfg.preproc.refchannel = {'M1' 'M2'}; %avg mastoids
cfg.continuous = 'yes';
cfg.preproc.detrend = 'no';
%Baseline correction
%cfg.preproc.demean = 'yes';
cfg.prepoc.baselinewindow  = [-0.2 0];
%Filtering
cfg.preproc.lpfilter = 'yes';
cfg.preproc.hpfilter = 'yes';
cfg.preproc.lpfreq = 100;
cfg.preproc.hpfreq = 1;
data=ft_preprocessing(cfg);

cfg = [];
cfg.method = 'runica';
cfg.demean = 'yes';
ica_cleaned = ft_componentanalysis(cfg,data);

% %Save ICA data
% outfile=strcat(save_dir,'/',infile,'_', sti,'.mat')
% save(outfile, 'ica_cleaned', '-v7.3')

cfg = [];
cfg.component = 1:20;

cfg.layout = 'biosemi64.lay';
cfg.comment   = 'no';
figure();
ft_topoplotIC(cfg,ica_cleaned)

The data is in the BrainVision Format ( .vhdr, .vmrk and .seg), obtained as
suggested by Fieldtrip website:
http://www.fieldtriptoolbox.org/getting_started/brainvision/

Can I ignore the Warning?

Best,
Helena Pereira

Eelke Spaak <e.spaak at donders.ru.nl> escreveu no dia terça, 9/06/2020 à(s)
08:15:

> Dear Helena,
>
> In general, you can probably safely ignore the warning. It just means
> that FieldTrip is unsure of the dimensionality of the 'comp' field,
> because there is no 'compdimord' and also the dimensionality does not
> match the data in any straightforward way.
>
> However, the structure of your componentanalysis output is somewhat
> strange. From .topo and .unmixing, it appears there is only one
> component. However, .label has 69 elements, and there is no .topolabel
> (which usually is there). Is the output you posted directly produced
> by ft_componentanalysis (i.e. it is the 'ica_cleaned' variable
> immediately after the step you showed)?
>
> Best,
> Eelke
>
> On Mon, 8 Jun 2020 at 21:42, Helena Pereira
> <hri.pereira at campus.fct.unl.pt> wrote:
> >
> > Dear FieldTrip users,
> >
> > I'm running the ft_componentanalysis function after applying ICA to my
> data. Although I'm not getting any error, the following warning came out:
> >
> > Warning: could not determine dimord of "comp" in:
> >
> >              label: {69×1 cell}
> >                cfg: [1×1 struct]
> >               topo: [69×1 double]
> >         topodimord: 'chan_comp'
> >               comp: 7
> >           unmixing: [1×69 double]
> >     unmixingdimord: 'chan_topochan'
> >
> > Can this influence the way the components are displayed and consequently
> my results? Is this associated with the layout that I used or with the
> "demean" option?
> >
> > My code is as follows:
> > cfg = [];
> > %cfg.channel = 1:64;
> > cfg.method = 'runica';
> > cfg.demean = 'yes';
> > ica_cleaned = ft_componentanalysis(cfg, data);
> >
> > cfg = [];
> > cfg.component = 1:20;
> > cfg.layout = 'biosemi64.lay';
> > cfg.comment   = 'no';
> > ft_topoplotIC(cfg, ica_cleaned )
> >
> > Thanks in advance,
> > Keep safe,
> > Helena Pereira
> >
> >
> >
> >
> >
> >
> > _______________________________________________
> > 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/20200609/dec77af4/attachment.htm>

From tom.marshall at psy.ox.ac.uk  Tue Jun  9 11:11:17 2020
From: tom.marshall at psy.ox.ac.uk (Tom Marshall)
Date: Tue, 9 Jun 2020 09:11:17 +0000
Subject: [FieldTrip] Permutation test
In-Reply-To: <CACg_EhBw9x4=nek-DXmNS8dLergwKEbMACiUpVcV6NZPRgvCkw@mail.gmail.com>
References: <CACg_EhBw9x4=nek-DXmNS8dLergwKEbMACiUpVcV6NZPRgvCkw@mail.gmail.com>
Message-ID: <CWXP265MB2200032BE720B521512DE668F9820@CWXP265MB2200.GBRP265.PROD.OUTLOOK.COM>

Hi Zhen,

I've encountered a similar error before. Does it help if you add this line to your cfg?

cfg.spmversion = 'spm12';

Best,
Tom
________________________________
From: fieldtrip <fieldtrip-bounces at science.ru.nl> on behalf of Zhen Ni <nzhen340 at gmail.com>
Sent: 08 June 2020 21:30
To: fieldtrip at science.ru.nl <fieldtrip at science.ru.nl>
Subject: [FieldTrip] Permutation test

Hello,
My name is Zhen Ni. I'm a senior research fellow working at the National Institutes of Health.
I'm using FieldTrip (version 20200423) to perform a cluster-based permutation test. My script is largely based on the example you showed on the FieldTrip webpage. The script stopped after a while with a technical problem. I copied the error message below.
I also tried following your instruction and used the dataset you uploaded on the webpage. The same error message comes out. I wonder if you may take a look at my codes and help me out.

Many thanks.
Zhen



Invalid MEX-file '/Users/nz/Documents/MATLAB/external/spm8/spm_bwlabel.mexmaci64':
dlopen(/Users/nz/Documents/MATLAB/external/spm8/spm_bwlabel.mexmaci64, 6): Library
not loaded: @loader_path/libmex.dylib
  Referenced from: /Users/nz/Documents/MATLAB/external/spm8/spm_bwlabel.mexmaci64
  Reason: image not found

Error in findcluster (line 87)
    [labelmat(spatdimlev, :, :), num] = spm_bwlabel(double(reshape(onoff(spatdimlev,
    :, :), nfreq, ntime)), 6); % the previous code contained a '4' for input

Error in clusterstat (line 202)
      posclusobs = findcluster(reshape(postailobs,
      [cfg.dim,1]),channeighbstructmat,cfg.minnbchan);

Error in ft_statistics_montecarlo (line 353)
  [stat, cfg] = clusterstat(cfg, statrand, statobs);

Error in ft_timelockstatistics (line 184)
  [stat, cfg] = statmethod(cfg, dat, design);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200609/79b5ee2a/attachment.htm>

From hanqiuishere at 163.com  Tue Jun  9 11:35:12 2020
From: hanqiuishere at 163.com (hanqiuishere)
Date: Tue, 09 Jun 2020 17:35:12 +0800
Subject: [FieldTrip] Permutation test
Message-ID: <hi25h11s6nkdhb1calx0ljc9.1591695024875@email.android.com>

An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200609/14bf0324/attachment.htm>
-------------- next part --------------
Hi,
About the mex file problem, Spm provide another version of spm8 to solve this in the faq sesseion in its website. And I also tried to delete all fieldtrip folder and fieldtrip paths in MATLAB, then downloaded a new one, it also succeeded. Hope that helps.


best,
Qiu

-------- Original message --------
Sender: Zhen Ni <nzhen340 at gmail.com>
Time: 2020/6/9 04:31
To: fieldtrip <fieldtrip at science.ru.nl>
 Subject: [FieldTrip] Permutation test

>Hello,
>
>My name is Zhen Ni. I'm a senior research fellow working at the National Institutes of Health.
>
>I'm using FieldTrip (version 20200423) to perform a cluster-based permutation test. My script is largely based on the example you showed on the FieldTrip webpage. The script stopped after a while with a technical problem. I copied the error message below.
>
>I also tried following your instruction and used the dataset you uploaded on the webpage. The same error message comes out. I wonder if you may take a look at my codes and help me out.
>
>
>Many thanks.
>
>Zhen
>
>
>
>
>Invalid MEX-file '/Users/nz/Documents/MATLAB/external/spm8/spm_bwlabel.mexmaci64':
>
>dlopen(/Users/nz/Documents/MATLAB/external/spm8/spm_bwlabel.mexmaci64, 6): Library
>
>not loaded: @loader_path/libmex.dylib
>
>  Referenced from: /Users/nz/Documents/MATLAB/external/spm8/spm_bwlabel.mexmaci64
>
>  Reason: image not found
>
>
>Error in findcluster (line 87)
>
>    [labelmat(spatdimlev, :, :), num] = spm_bwlabel(double(reshape(onoff(spatdimlev,
>
>    :, :), nfreq, ntime)), 6); % the previous code contained a '4' for input
>
>
>Error in clusterstat (line 202)
>
>      posclusobs = findcluster(reshape(postailobs,
>
>      [cfg.dim,1]),channeighbstructmat,cfg.minnbchan);
>
>
>Error in ft_statistics_montecarlo (line 353)
>
>  [stat, cfg] = clusterstat(cfg, statrand, statobs);
>
>
>Error in ft_timelockstatistics (line 184)
>
>  [stat, cfg] = statmethod(cfg, dat, design);
>

From hri.pereira at campus.fct.unl.pt  Tue Jun  9 12:14:37 2020
From: hri.pereira at campus.fct.unl.pt (Helena Pereira)
Date: Tue, 9 Jun 2020 11:14:37 +0100
Subject: [FieldTrip] Can the warning "Warning: could not determine
 dimord of "comp" in:" influence the results?
In-Reply-To: <CACZYJ4uN=c1L0n6AMYH3QuGJUfWgR9HbWSxMiwG2zeomwSzPBA@mail.gmail.com>
References: <CACZYJ4s-q+ameLJgQ=57TWa4MGv6X1awVHLLF3tKdgK3NgrOng@mail.gmail.com>
 <CABPNLUopzcnZHXs4sKn=oBNBdKD4F6EufOXARKxju34FxBU4bg@mail.gmail.com>
 <CACZYJ4uN=c1L0n6AMYH3QuGJUfWgR9HbWSxMiwG2zeomwSzPBA@mail.gmail.com>
Message-ID: <CACZYJ4vqOuA5TE=cRJZGj2W-H1sdzm8FMYhvzvKMtEG5a_6JKg@mail.gmail.com>

Dear Eelk,

Perhaps everything is ok, and I can ignore the warning. The structure of my
data is as follows (and contains the components that you mentioned: e.g.
.topolabel), or it should also appear in the component analysis?

ica_cleaned =
  struct with fields:
       fsample: 512
          time: {1×100 cell}
         trial: {1×100 cell}
          topo: [69×69 double]
      unmixing: [69×69 double]
         label: {69×1 cell}
     topolabel: {69×1 cell}
    sampleinfo: [100×2 double]
     trialinfo: [100×1 double]
           cfg: [1×1 struct]

Thank you for your time and help.

Best,
Helena Pereira


Helena Pereira <hri.pereira at campus.fct.unl.pt> escreveu no dia terça,
9/06/2020 à(s) 09:38:

> Dear Eelk,
>
> Yes, 'ica_cleaned' is produced directly from ft_componentanalysis:
>
> cfg = [];
> cfg.dataset=subject;
> cfg.trialfun = 'ft_trialfun_general'; % this is the default
> cfg.trialdef.eventtype  = 'Stimulus';
> cfg.trialdef.eventvalue ={Stimulus}';
> cfg.trialdef.prestim    = 2; %latency in seconds
> cfg.trialdef.poststim   = 2; %latency in seconds
> cfg=ft_definetrial(cfg);
>
> cfg.channel = [1:69]; %discard channels not used
> cfg.preproc.reref = 'yes';
> cfg.preproc.refchannel = {'M1' 'M2'}; %avg mastoids
> cfg.continuous = 'yes';
> cfg.preproc.detrend = 'no';
> %Baseline correction
> %cfg.preproc.demean = 'yes';
> cfg.prepoc.baselinewindow  = [-0.2 0];
> %Filtering
> cfg.preproc.lpfilter = 'yes';
> cfg.preproc.hpfilter = 'yes';
> cfg.preproc.lpfreq = 100;
> cfg.preproc.hpfreq = 1;
> data=ft_preprocessing(cfg);
>
> cfg = [];
> cfg.method = 'runica';
> cfg.demean = 'yes';
> ica_cleaned = ft_componentanalysis(cfg,data);
>
> % %Save ICA data
> % outfile=strcat(save_dir,'/',infile,'_', sti,'.mat')
> % save(outfile, 'ica_cleaned', '-v7.3')
>
> cfg = [];
> cfg.component = 1:20;
>
> cfg.layout = 'biosemi64.lay';
> cfg.comment   = 'no';
> figure();
> ft_topoplotIC(cfg,ica_cleaned)
>
> The data is in the BrainVision Format ( .vhdr, .vmrk and .seg), obtained
> as suggested by Fieldtrip website:
> http://www.fieldtriptoolbox.org/getting_started/brainvision/
>
> Can I ignore the Warning?
>
> Best,
> Helena Pereira
>
> Eelke Spaak <e.spaak at donders.ru.nl> escreveu no dia terça, 9/06/2020 à(s)
> 08:15:
>
>> Dear Helena,
>>
>> In general, you can probably safely ignore the warning. It just means
>> that FieldTrip is unsure of the dimensionality of the 'comp' field,
>> because there is no 'compdimord' and also the dimensionality does not
>> match the data in any straightforward way.
>>
>> However, the structure of your componentanalysis output is somewhat
>> strange. From .topo and .unmixing, it appears there is only one
>> component. However, .label has 69 elements, and there is no .topolabel
>> (which usually is there). Is the output you posted directly produced
>> by ft_componentanalysis (i.e. it is the 'ica_cleaned' variable
>> immediately after the step you showed)?
>>
>> Best,
>> Eelke
>>
>> On Mon, 8 Jun 2020 at 21:42, Helena Pereira
>> <hri.pereira at campus.fct.unl.pt> wrote:
>> >
>> > Dear FieldTrip users,
>> >
>> > I'm running the ft_componentanalysis function after applying ICA to my
>> data. Although I'm not getting any error, the following warning came out:
>> >
>> > Warning: could not determine dimord of "comp" in:
>> >
>> >              label: {69×1 cell}
>> >                cfg: [1×1 struct]
>> >               topo: [69×1 double]
>> >         topodimord: 'chan_comp'
>> >               comp: 7
>> >           unmixing: [1×69 double]
>> >     unmixingdimord: 'chan_topochan'
>> >
>> > Can this influence the way the components are displayed and
>> consequently my results? Is this associated with the layout that I used or
>> with the "demean" option?
>> >
>> > My code is as follows:
>> > cfg = [];
>> > %cfg.channel = 1:64;
>> > cfg.method = 'runica';
>> > cfg.demean = 'yes';
>> > ica_cleaned = ft_componentanalysis(cfg, data);
>> >
>> > cfg = [];
>> > cfg.component = 1:20;
>> > cfg.layout = 'biosemi64.lay';
>> > cfg.comment   = 'no';
>> > ft_topoplotIC(cfg, ica_cleaned )
>> >
>> > Thanks in advance,
>> > Keep safe,
>> > Helena Pereira
>> >
>> >
>> >
>> >
>> >
>> >
>> > _______________________________________________
>> > 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/20200609/1a95732b/attachment.htm>

From nzhen340 at gmail.com  Tue Jun  9 12:49:52 2020
From: nzhen340 at gmail.com (Zhen Ni)
Date: Tue, 9 Jun 2020 06:49:52 -0400
Subject: [FieldTrip] Permutation test
In-Reply-To: <CWXP265MB2200032BE720B521512DE668F9820@CWXP265MB2200.GBRP265.PROD.OUTLOOK.COM>
References: <CACg_EhBw9x4=nek-DXmNS8dLergwKEbMACiUpVcV6NZPRgvCkw@mail.gmail.com>
 <CWXP265MB2200032BE720B521512DE668F9820@CWXP265MB2200.GBRP265.PROD.OUTLOOK.COM>
Message-ID: <CACg_EhCL_9s24Cp=vmOjJybUJZPVHRx41z1fV==rj+fUH+cRTg@mail.gmail.com>

Thank you very much, Tom.
It's working now!

Zhen

On Tue, Jun 9, 2020 at 6:12 AM Tom Marshall <tom.marshall at psy.ox.ac.uk>
wrote:

> Hi Zhen,
>
> I've encountered a similar error before. Does it help if you add this line
> to your cfg?
>
> *cfg.spmversion = 'spm12';*
>
> Best,
> Tom
> ------------------------------
> *From:* fieldtrip <fieldtrip-bounces at science.ru.nl> on behalf of Zhen Ni <
> nzhen340 at gmail.com>
> *Sent:* 08 June 2020 21:30
> *To:* fieldtrip at science.ru.nl <fieldtrip at science.ru.nl>
> *Subject:* [FieldTrip] Permutation test
>
> Hello,
> My name is Zhen Ni. I'm a senior research fellow working at the National
> Institutes of Health.
> I'm using FieldTrip (version 20200423) to perform a cluster-based
> permutation test. My script is largely based on the example you showed on
> the FieldTrip webpage. The script stopped after a while with a technical
> problem. I copied the error message below.
> I also tried following your instruction and used the dataset you uploaded
> on the webpage. The same error message comes out. I wonder if you may take
> a look at my codes and help me out.
>
> Many thanks.
> Zhen
>
>
>
> Invalid MEX-file
> '/Users/nz/Documents/MATLAB/external/spm8/spm_bwlabel.mexmaci64':
> dlopen(/Users/nz/Documents/MATLAB/external/spm8/spm_bwlabel.mexmaci64, 6):
> Library
> not loaded: @loader_path/libmex.dylib
>   Referenced from:
> /Users/nz/Documents/MATLAB/external/spm8/spm_bwlabel.mexmaci64
>   Reason: image not found
>
> Error in findcluster (line 87)
>     [labelmat(spatdimlev, :, :), num] =
> spm_bwlabel(double(reshape(onoff(spatdimlev,
>     :, :), nfreq, ntime)), 6); % the previous code contained a '4' for
> input
>
> Error in clusterstat (line 202)
>       posclusobs = findcluster(reshape(postailobs,
>       [cfg.dim,1]),channeighbstructmat,cfg.minnbchan);
>
> Error in ft_statistics_montecarlo (line 353)
>   [stat, cfg] = clusterstat(cfg, statrand, statobs);
>
> Error in ft_timelockstatistics (line 184)
>   [stat, cfg] = statmethod(cfg, dat, design);
> _______________________________________________
> 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/20200609/386caddb/attachment.htm>

From e.spaak at donders.ru.nl  Tue Jun  9 13:26:26 2020
From: e.spaak at donders.ru.nl (Eelke Spaak)
Date: Tue, 9 Jun 2020 13:26:26 +0200
Subject: [FieldTrip] Can the warning "Warning: could not determine
 dimord of "comp" in:" influence the results?
In-Reply-To: <CACZYJ4vqOuA5TE=cRJZGj2W-H1sdzm8FMYhvzvKMtEG5a_6JKg@mail.gmail.com>
References: <CACZYJ4s-q+ameLJgQ=57TWa4MGv6X1awVHLLF3tKdgK3NgrOng@mail.gmail.com>
 <CABPNLUopzcnZHXs4sKn=oBNBdKD4F6EufOXARKxju34FxBU4bg@mail.gmail.com>
 <CACZYJ4uN=c1L0n6AMYH3QuGJUfWgR9HbWSxMiwG2zeomwSzPBA@mail.gmail.com>
 <CACZYJ4vqOuA5TE=cRJZGj2W-H1sdzm8FMYhvzvKMtEG5a_6JKg@mail.gmail.com>
Message-ID: <CABPNLUobi88QQC1XBXmn54uzxAiGVcZ7YMAYE6AkAJfwbd9fMQ@mail.gmail.com>

Dear Helena,

Yes, you can safely ignore the warning.

Best,
Eelke

On Tue, 9 Jun 2020 at 12:14, Helena Pereira
<hri.pereira at campus.fct.unl.pt> wrote:
>
> Dear Eelk,
>
> Perhaps everything is ok, and I can ignore the warning. The structure of my data is as follows (and contains the components that you mentioned: e.g. .topolabel), or it should also appear in the component analysis?
>
> ica_cleaned =
>   struct with fields:
>        fsample: 512
>           time: {1×100 cell}
>          trial: {1×100 cell}
>           topo: [69×69 double]
>       unmixing: [69×69 double]
>          label: {69×1 cell}
>      topolabel: {69×1 cell}
>     sampleinfo: [100×2 double]
>      trialinfo: [100×1 double]
>            cfg: [1×1 struct]
>
> Thank you for your time and help.
>
> Best,
> Helena Pereira
>
>
> Helena Pereira <hri.pereira at campus.fct.unl.pt> escreveu no dia terça, 9/06/2020 à(s) 09:38:
>>
>> Dear Eelk,
>>
>> Yes, 'ica_cleaned' is produced directly from ft_componentanalysis:
>>
>> cfg = [];
>> cfg.dataset=subject;
>> cfg.trialfun = 'ft_trialfun_general'; % this is the default
>> cfg.trialdef.eventtype  = 'Stimulus';
>> cfg.trialdef.eventvalue ={Stimulus}';
>> cfg.trialdef.prestim    = 2; %latency in seconds
>> cfg.trialdef.poststim   = 2; %latency in seconds
>> cfg=ft_definetrial(cfg);
>>
>> cfg.channel = [1:69]; %discard channels not used
>> cfg.preproc.reref = 'yes';
>> cfg.preproc.refchannel = {'M1' 'M2'}; %avg mastoids
>> cfg.continuous = 'yes';
>> cfg.preproc.detrend = 'no';
>> %Baseline correction
>> %cfg.preproc.demean = 'yes';
>> cfg.prepoc.baselinewindow  = [-0.2 0];
>> %Filtering
>> cfg.preproc.lpfilter = 'yes';
>> cfg.preproc.hpfilter = 'yes';
>> cfg.preproc.lpfreq = 100;
>> cfg.preproc.hpfreq = 1;
>> data=ft_preprocessing(cfg);
>>
>> cfg = [];
>> cfg.method = 'runica';
>> cfg.demean = 'yes';
>> ica_cleaned = ft_componentanalysis(cfg,data);
>>
>> % %Save ICA data
>> % outfile=strcat(save_dir,'/',infile,'_', sti,'.mat')
>> % save(outfile, 'ica_cleaned', '-v7.3')
>>
>> cfg = [];
>> cfg.component = 1:20;
>>
>> cfg.layout = 'biosemi64.lay';
>> cfg.comment   = 'no';
>> figure();
>> ft_topoplotIC(cfg,ica_cleaned)
>>
>> The data is in the BrainVision Format ( .vhdr, .vmrk and .seg), obtained as suggested by Fieldtrip website: http://www.fieldtriptoolbox.org/getting_started/brainvision/
>>
>> Can I ignore the Warning?
>>
>> Best,
>> Helena Pereira
>>
>> Eelke Spaak <e.spaak at donders.ru.nl> escreveu no dia terça, 9/06/2020 à(s) 08:15:
>>>
>>> Dear Helena,
>>>
>>> In general, you can probably safely ignore the warning. It just means
>>> that FieldTrip is unsure of the dimensionality of the 'comp' field,
>>> because there is no 'compdimord' and also the dimensionality does not
>>> match the data in any straightforward way.
>>>
>>> However, the structure of your componentanalysis output is somewhat
>>> strange. From .topo and .unmixing, it appears there is only one
>>> component. However, .label has 69 elements, and there is no .topolabel
>>> (which usually is there). Is the output you posted directly produced
>>> by ft_componentanalysis (i.e. it is the 'ica_cleaned' variable
>>> immediately after the step you showed)?
>>>
>>> Best,
>>> Eelke
>>>
>>> On Mon, 8 Jun 2020 at 21:42, Helena Pereira
>>> <hri.pereira at campus.fct.unl.pt> wrote:
>>> >
>>> > Dear FieldTrip users,
>>> >
>>> > I'm running the ft_componentanalysis function after applying ICA to my data. Although I'm not getting any error, the following warning came out:
>>> >
>>> > Warning: could not determine dimord of "comp" in:
>>> >
>>> >              label: {69×1 cell}
>>> >                cfg: [1×1 struct]
>>> >               topo: [69×1 double]
>>> >         topodimord: 'chan_comp'
>>> >               comp: 7
>>> >           unmixing: [1×69 double]
>>> >     unmixingdimord: 'chan_topochan'
>>> >
>>> > Can this influence the way the components are displayed and consequently my results? Is this associated with the layout that I used or with the "demean" option?
>>> >
>>> > My code is as follows:
>>> > cfg = [];
>>> > %cfg.channel = 1:64;
>>> > cfg.method = 'runica';
>>> > cfg.demean = 'yes';
>>> > ica_cleaned = ft_componentanalysis(cfg, data);
>>> >
>>> > cfg = [];
>>> > cfg.component = 1:20;
>>> > cfg.layout = 'biosemi64.lay';
>>> > cfg.comment   = 'no';
>>> > ft_topoplotIC(cfg, ica_cleaned )
>>> >
>>> > Thanks in advance,
>>> > Keep safe,
>>> > Helena Pereira
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> > _______________________________________________
>>> > 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 hri.pereira at campus.fct.unl.pt  Tue Jun  9 16:03:23 2020
From: hri.pereira at campus.fct.unl.pt (Helena Pereira)
Date: Tue, 9 Jun 2020 15:03:23 +0100
Subject: [FieldTrip] Can the warning "Warning: could not determine
 dimord of "comp" in:" influence the results?
In-Reply-To: <CABPNLUobi88QQC1XBXmn54uzxAiGVcZ7YMAYE6AkAJfwbd9fMQ@mail.gmail.com>
References: <CACZYJ4s-q+ameLJgQ=57TWa4MGv6X1awVHLLF3tKdgK3NgrOng@mail.gmail.com>
 <CABPNLUopzcnZHXs4sKn=oBNBdKD4F6EufOXARKxju34FxBU4bg@mail.gmail.com>
 <CACZYJ4uN=c1L0n6AMYH3QuGJUfWgR9HbWSxMiwG2zeomwSzPBA@mail.gmail.com>
 <CACZYJ4vqOuA5TE=cRJZGj2W-H1sdzm8FMYhvzvKMtEG5a_6JKg@mail.gmail.com>
 <CABPNLUobi88QQC1XBXmn54uzxAiGVcZ7YMAYE6AkAJfwbd9fMQ@mail.gmail.com>
Message-ID: <CACZYJ4s+-BkNmYv86A6PNqUeomptnVD5ax6EKAiSMhaSAd+eaQ@mail.gmail.com>

Thank you very much, Eelke.

Best,
Helena

Eelke Spaak <e.spaak at donders.ru.nl> escreveu no dia terça, 9/06/2020 à(s)
12:59:

> Dear Helena,
>
> Yes, you can safely ignore the warning.
>
> Best,
> Eelke
>
> On Tue, 9 Jun 2020 at 12:14, Helena Pereira
> <hri.pereira at campus.fct.unl.pt> wrote:
> >
> > Dear Eelk,
> >
> > Perhaps everything is ok, and I can ignore the warning. The structure of
> my data is as follows (and contains the components that you mentioned: e.g.
> .topolabel), or it should also appear in the component analysis?
> >
> > ica_cleaned =
> >   struct with fields:
> >        fsample: 512
> >           time: {1×100 cell}
> >          trial: {1×100 cell}
> >           topo: [69×69 double]
> >       unmixing: [69×69 double]
> >          label: {69×1 cell}
> >      topolabel: {69×1 cell}
> >     sampleinfo: [100×2 double]
> >      trialinfo: [100×1 double]
> >            cfg: [1×1 struct]
> >
> > Thank you for your time and help.
> >
> > Best,
> > Helena Pereira
> >
> >
> > Helena Pereira <hri.pereira at campus.fct.unl.pt> escreveu no dia terça,
> 9/06/2020 à(s) 09:38:
> >>
> >> Dear Eelk,
> >>
> >> Yes, 'ica_cleaned' is produced directly from ft_componentanalysis:
> >>
> >> cfg = [];
> >> cfg.dataset=subject;
> >> cfg.trialfun = 'ft_trialfun_general'; % this is the default
> >> cfg.trialdef.eventtype  = 'Stimulus';
> >> cfg.trialdef.eventvalue ={Stimulus}';
> >> cfg.trialdef.prestim    = 2; %latency in seconds
> >> cfg.trialdef.poststim   = 2; %latency in seconds
> >> cfg=ft_definetrial(cfg);
> >>
> >> cfg.channel = [1:69]; %discard channels not used
> >> cfg.preproc.reref = 'yes';
> >> cfg.preproc.refchannel = {'M1' 'M2'}; %avg mastoids
> >> cfg.continuous = 'yes';
> >> cfg.preproc.detrend = 'no';
> >> %Baseline correction
> >> %cfg.preproc.demean = 'yes';
> >> cfg.prepoc.baselinewindow  = [-0.2 0];
> >> %Filtering
> >> cfg.preproc.lpfilter = 'yes';
> >> cfg.preproc.hpfilter = 'yes';
> >> cfg.preproc.lpfreq = 100;
> >> cfg.preproc.hpfreq = 1;
> >> data=ft_preprocessing(cfg);
> >>
> >> cfg = [];
> >> cfg.method = 'runica';
> >> cfg.demean = 'yes';
> >> ica_cleaned = ft_componentanalysis(cfg,data);
> >>
> >> % %Save ICA data
> >> % outfile=strcat(save_dir,'/',infile,'_', sti,'.mat')
> >> % save(outfile, 'ica_cleaned', '-v7.3')
> >>
> >> cfg = [];
> >> cfg.component = 1:20;
> >>
> >> cfg.layout = 'biosemi64.lay';
> >> cfg.comment   = 'no';
> >> figure();
> >> ft_topoplotIC(cfg,ica_cleaned)
> >>
> >> The data is in the BrainVision Format ( .vhdr, .vmrk and .seg),
> obtained as suggested by Fieldtrip website:
> http://www.fieldtriptoolbox.org/getting_started/brainvision/
> >>
> >> Can I ignore the Warning?
> >>
> >> Best,
> >> Helena Pereira
> >>
> >> Eelke Spaak <e.spaak at donders.ru.nl> escreveu no dia terça, 9/06/2020
> à(s) 08:15:
> >>>
> >>> Dear Helena,
> >>>
> >>> In general, you can probably safely ignore the warning. It just means
> >>> that FieldTrip is unsure of the dimensionality of the 'comp' field,
> >>> because there is no 'compdimord' and also the dimensionality does not
> >>> match the data in any straightforward way.
> >>>
> >>> However, the structure of your componentanalysis output is somewhat
> >>> strange. From .topo and .unmixing, it appears there is only one
> >>> component. However, .label has 69 elements, and there is no .topolabel
> >>> (which usually is there). Is the output you posted directly produced
> >>> by ft_componentanalysis (i.e. it is the 'ica_cleaned' variable
> >>> immediately after the step you showed)?
> >>>
> >>> Best,
> >>> Eelke
> >>>
> >>> On Mon, 8 Jun 2020 at 21:42, Helena Pereira
> >>> <hri.pereira at campus.fct.unl.pt> wrote:
> >>> >
> >>> > Dear FieldTrip users,
> >>> >
> >>> > I'm running the ft_componentanalysis function after applying ICA to
> my data. Although I'm not getting any error, the following warning came out:
> >>> >
> >>> > Warning: could not determine dimord of "comp" in:
> >>> >
> >>> >              label: {69×1 cell}
> >>> >                cfg: [1×1 struct]
> >>> >               topo: [69×1 double]
> >>> >         topodimord: 'chan_comp'
> >>> >               comp: 7
> >>> >           unmixing: [1×69 double]
> >>> >     unmixingdimord: 'chan_topochan'
> >>> >
> >>> > Can this influence the way the components are displayed and
> consequently my results? Is this associated with the layout that I used or
> with the "demean" option?
> >>> >
> >>> > My code is as follows:
> >>> > cfg = [];
> >>> > %cfg.channel = 1:64;
> >>> > cfg.method = 'runica';
> >>> > cfg.demean = 'yes';
> >>> > ica_cleaned = ft_componentanalysis(cfg, data);
> >>> >
> >>> > cfg = [];
> >>> > cfg.component = 1:20;
> >>> > cfg.layout = 'biosemi64.lay';
> >>> > cfg.comment   = 'no';
> >>> > ft_topoplotIC(cfg, ica_cleaned )
> >>> >
> >>> > Thanks in advance,
> >>> > Keep safe,
> >>> > Helena Pereira
> >>> >
> >>> >
> >>> >
> >>> >
> >>> >
> >>> >
> >>> > _______________________________________________
> >>> > 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
>
> _______________________________________________
> 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/20200609/3f535651/attachment.htm>

From Laurent.Sheybani at unige.ch  Tue Jun  9 17:57:49 2020
From: Laurent.Sheybani at unige.ch (Laurent Sheybani)
Date: Tue, 9 Jun 2020 15:57:49 +0000
Subject: [FieldTrip] Phase synchronization and coherence spectrum
In-Reply-To: <47F8D0CF-AB1B-4F56-80C3-374AE6E9CA4A@donders.ru.nl>
References: <960bef9830564bff9f633ff3a06ebc1c@unige.ch>
 <47F8D0CF-AB1B-4F56-80C3-374AE6E9CA4A@donders.ru.nl>
Message-ID: <f68e6713c6234f3c8fd165e689df57ea@unige.ch>

Dear Jan-Mathijs,

Thank you for this very clear answer !

May I ask a further question on the same topic? Why the script gives a result of ‘1’ for each frequency bin if I change the number of repetitions (‘numrpt’) to 1 ? I would expect that, even over 1 single trial, phase synchronization can still be measured across time between two signals, and should thus not be equal to 1 (except if both signals are not identical, which is not the case) ?

- it is true that I did not find this tutorial straight away, but I am trying different methods to calculate phase synchronization between pairs of sensors. If you have another method that I could use without a Fourier transform, I would greatly appreciate it ! (I already tried the inter-trial coherence of the phase differences between the 2 sensors across time).

Thanks again for your help!
Laurent

De : fieldtrip <fieldtrip-bounces at science.ru.nl> De la part de Schoffelen, J.M. (Jan Mathijs)
Envoyé : lundi, 8 juin 2020 18:13
À : FieldTrip discussion list <fieldtrip at science.ru.nl>
Objet : Re: [FieldTrip] Phase synchronization and coherence spectrum

Dear Laurent,

Hmmm, interesting that you managed to find this tutorial, since it does not seem to be linked. This is a very ‘old’ tutorial (i.e. > 15 years), and hasn’t been updated for quite a while. You are indeed correct that the x-axis represents frequency bins, but given the way that the data are plotted, i.e. as plot(<some-vector>) these frequency bins are not reflecting physical units as expressed in Hz. Rather, the number of points in the graph just reflect the number of points of the fft, which is by definition equal to the number of samples in the time domain signal. These frequency bins essentially span an axis that runs from 0 Hz up to (in this case) twice the Nyquist frequency (minus a little bit), where the Nyquist frequency is defined as the sampling frequency divided by 2. In other words, the 100 ‘bins’ on the frequency axis run from 0 to 99 Hz, which nicely correspond to a bin width of 1 Hz per bin. As you see in the graph, the coherence peak is actually at the 11’th bin, coinciding with a frequency of 10 Hz.
Now, if you change the length of  your signal to 2.5 seconds (at a sampling frequency of 100 Hz), your signals will be 250 samples long, and by consequence the fft of the signals will also be 250 samples long. Now the total frequency range (i.e. 0 Hz up to 100 Hz minus a bit) will be divided into 250 bins. This indeed causes the bin with the maximum coherence to be the 26th bin, but this still corresponds to a physical frequency of 10 Hz, because the bin width has changed from 1 bins/Hz into 2.5 bins/Hz.

Best wishes,
Jan-Mathijs





On 8 Jun 2020, at 14:27, Laurent Sheybani <Laurent.Sheybani at unige.ch<mailto:Laurent.Sheybani at unige.ch>> wrote:

Dear Fieldtrippers,

I am trying to implement the example provided here (http://www.fieldtriptoolbox.org/tutorial/fourier/) to measure the phase synchronization between two signals. I followed the paragraph starting by “The coherence spectrum”.

From what I understand of the “Coherence spectrum” example script of this web-page, the plot that one should obtain when calling plot(coh) is a 2-D plot with the y-axis corresponding to the coherence index between 0 to 1 and x-axis corresponding to frequencies (right ?).

However, when I changed the length of the signal (argument “len”), I noticed that the frequency (x-) axis increased by the same factor (e.g. if I change len from 1 to 2.5, the x-axis changes from 100 to 250). The coherence is no more on 10 Hz, but on 25 Hz. I must have missed something simple, but I do not understand why the results (& frequency axis) depend on the duration of the signal ? Did I miss a normalization somewhere ?

Any help would be greatly appreciated !
Thanks in advance !

-----------------------------
Dr. Laurent Sheybani, Ph.D
Médecin interne en Neurologie Clinique
Clinique de Neurologie
Hôpitaux Universitaires de Genève
Rue Gabrielle-Perret-Gentil, 4
1205 Genève
Switzerland

_______________________________________________
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/20200609/86af1477/attachment.htm>

From lsmith at cortechsolutions.com  Tue Jun  9 19:17:23 2020
From: lsmith at cortechsolutions.com (Lloyd Smith)
Date: Tue, 9 Jun 2020 13:17:23 -0400
Subject: [FieldTrip] support for Biosemi firmware 4.0?
In-Reply-To: <EB988ECD-23DB-4539-B308-13C60F7CE7DD@donders.ru.nl>
References: <CAJr_e2uBbVXLr0WQV2s_ws-G_=oaoSw4P5bbj+0YCmHXHwsZFA@mail.gmail.com>
 <EB988ECD-23DB-4539-B308-13C60F7CE7DD@donders.ru.nl>
Message-ID: <CAJr_e2sAzqZmDKXzijAQs2Fi4buFjzjejWC6tiHmfeV+wZX4rQ@mail.gmail.com>

Thank you, Robert.

Shortly after sending that inquiry, I learned from Biosemi that Fieldtrip (also
Lab Streaming Layer, and other third-party tools whose Biosemi interface
was implemented using the Biosemi SDK) are agnostic of ActiveTwo firmware
version. The firmware version only affects the communication between the
AD-box and the optical receiver / USB interface. The communication between
the driver and the acquisition software is the same regardless of firmware
version.

When time permits, I will have a look at the documentation and do some
testing.

Best regards,

Lloyd Smith
President
Cortech Solutions, Inc.

E-mail: LSmith at cortechsolutions.com
Tel: 910-362-1143 x202
Cell: 910-431-2811




On Thu, May 28, 2020 at 3:15 AM Robert Oostenveld <
r.oostenveld at donders.ru.nl> wrote:

> Hi Loyd,
>
> Welcome on the mailing list!
>
> The realtime interface to the Biosemi amplifiers was implemented and
> contributed by FieldTrip users, not by the core team. I recall that it had
> contributions from two separate groups. Also, we don’t have a Biosemi
> amplifier, so we don’t use it ourselves and cannot test ourselves.
>
> If I look at the commit history at
>
> https://github.com/fieldtrip/fieldtrip/commits/master/realtime/src/acquisition/biosemi
> and
>
> https://github.com/fieldtrip/fieldtrip/commits/master/realtime/src/acquisition/biosemi/biosemi2ft.cc
>
> I see it dates back to 2012 and that later changes mainly relate to
> streamlining the build process and Makefile. Part of the history details
> appears to be missing, since it predates the moment when we switched over
> from an internal Subversion server to GitHub. But most of it seems to be
> pre-2015, which suggests that it was written for firmware 3.0. I also
> assume that at the time firmware 4.0 was introduced on new devices, it was
> still slow to get updated on existing devices, which means that the code
> changes in 2015 (done by people that were not likely to have a brand-new
> device) were not related to the new firmware.
>
> It would be good if the documentation on
> http://www.fieldtriptoolbox.org/development/realtime/biosemi/ (which is
> maintained here
> <https://github.com/fieldtrip/website/blob/master/development/realtime/biosemi.md>)
> would be updated to reflect this. E.g. add a section about the different
> firmware versions, how to determine yourself which one is installed on your
> amplifier, etc. Possibly also test it both with a 3.0 and a 4.0 version of
> the amplifier and report on the results. Editing that page on the website
> is as simple as clicking on the pencil button on the upper right.
>
>
> All contributions are reviewed and stylistically corrected by me or
> another team member, so don’t worry if the markdown formatting is not
> totally correct yet.
>
> It would even be better if the source code of the Biosemi real-time
> interface was reviewed and would be updated to reflect the 4.0 firmware.
> Changes should be compatible with the 3.0 version, or a a copy of the
> exiting code should be kept to ensure that researchers with 3.0 version
> amplifiers can continue to use it.
>
> I am looking forward to the contribution of Biosemi or Cortech Solutions
> to improve the researchers’ experience with this hardware.
>
> best regards,
> Robert
>
>
>
>
>
>
> On 26 May 2020, at 19:42, Lloyd Smith <lsmith at cortechsolutions.com> wrote:
>
> Hi, all. First time posting here, so please pardon any lack of default
> knowledge. My company handles US/Canada sales and support for the Biosemi
> ActiveTwo EEG system, and I know a lot of our customers use Fieldtrip.
> Until now I have never had a pre-sales question from a customer about
> Fieldtrip. I was unable to find an answer in your archives, so I am posting
> it here.
>
> In mid-2015, Biosemi released firmware 4.0 for the optical receiver / USB
> interface. This eliminates the need to install a driver, instead utilizing
> a driver that ships with Windows 10. Most older ActiveTwo systems can be
> field-upgraded by end-users according to instructions at
> https://www.biosemi.com/faq/install_USB.htm.
>
> Thie page at your site -
> http://www.fieldtriptoolbox.org/development/realtime/biosemi/ - does not
> mention which optical receiver / USB interface firmware versions are
> compatible, which leaves open the question of whether firmware 4.0 is
> supported. Firmware 3.0 shipped from sometime before Spring 2011 until
> Spring of 2015, but all systems shipped from about June 2015 forward have
> firmware 4.0, and many older systems have been field-upgraded.
>
> Thanks in advance for any insight!
>
> Best regards,
>
> Lloyd Smith
> President
> Cortech Solutions, Inc.
>
> E-mail: LSmith at cortechsolutions.com
> Tel: 910-362-1143 x202
> Cell: 910-431-2811
>
>
>
> ------------------------------
> Cortech Solutions, Inc.
> 1409 Audubon Blvd, Suite B1
> Wilmington, NC 28403 USA
>
> Tel: 910-362-1143
> Fax: 910-378-3443
>
> Sales: sales at cortechsolutions.com
> Support / repairs: support at cortechsolutions.com
> Billing / administration: admin at cortechsolutions.com
>
> Web: www.cortechsolutions.com
>
> _______________________________________________
> 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
>

-- 
Cortech Solutions, Inc.1409 Audubon Blvd, Suite B1
Wilmington, NC 28403 USA



Tel: 910-362-1143
Fax: 910-378-3443



Sales: sales at cortechsolutions.com 
<mailto:sales at cortechsolutions.com>
Support / repairs: 
support at cortechsolutions.com <mailto:support at cortechsolutions.com>
Billing 
/ administration: admin at cortechsolutions.com 
<mailto:admin at cortechsolutions.com>


Web: www.cortechsolutions.com 
<http://www.cortechsolutions.com>



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200609/f00cc29d/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PastedGraphic-1.png
Type: image/png
Size: 21038 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200609/f00cc29d/attachment.png>

From klee773 at gatech.edu  Wed Jun 10 13:47:30 2020
From: klee773 at gatech.edu (Lee, Kyoung Eun)
Date: Wed, 10 Jun 2020 11:47:30 +0000
Subject: [FieldTrip] Non-parametric permutation clustering with 2x2 within
 subject conditions.
Message-ID: <BL0PR07MB5059EDBF0C79CECF5A82E6D788830@BL0PR07MB5059.namprd07.prod.outlook.com>

Dear FieldTrip users,

Currently I'm working on a non-parametric permutation clustering with ft_freqstatistics function.
So far, I just compared two different within-subject conditions (Hit vs. Miss), Therefore, I set "cfg.statistic = 'depsamplesT'".
And my design is set as below :
subj = 42;
design(1,1:subj) = 1:subj; design(1,subj+1:2*subj)= 1:subj;
design(2,1:subj) = 1; design(2,subj+1:2*subj)= 2;

But now, I want to compare 2x2 within subject conditions (Target-Hit/ Target-Miss/ Lure-Hit/ Lure-Miss).
In this case, what kind of statistic I have to use? How can I change the design?
And lastly, how's the results look like? (would there be positive and negative clusters?)

Please let me know if you have any suggestion.
Thank you so much,

Best,
Cay




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200610/88e077c0/attachment.htm>

From tom.marshall at psy.ox.ac.uk  Wed Jun 10 15:28:43 2020
From: tom.marshall at psy.ox.ac.uk (Tom Marshall)
Date: Wed, 10 Jun 2020 13:28:43 +0000
Subject: [FieldTrip] Non-parametric permutation clustering with 2x2
 within subject conditions.
In-Reply-To: <BL0PR07MB5059EDBF0C79CECF5A82E6D788830@BL0PR07MB5059.namprd07.prod.outlook.com>
References: <BL0PR07MB5059EDBF0C79CECF5A82E6D788830@BL0PR07MB5059.namprd07.prod.outlook.com>
Message-ID: <CWLP265MB21934333B683EA5F13381E17F9830@CWLP265MB2193.GBRP265.PROD.OUTLOOK.COM>

Hi Cay,

It sounds like you want to test whether there is an interaction between your two independent variables ('target' and 'lure').

If so, you should start here: http://www.fieldtriptoolbox.org/faq/how_can_i_test_an_interaction_effect_using_cluster-based_permutation_tests/ , which will help you understand what you can and can't do to test interactions using cluster-based permutation.

If that doesn't help feel free to ask here again.

It is always helpful to provide as much information as possible in your question. For instance, right now I can't tell if you're asking about what kind of test to do, or how to write the code for doing the test, which makes it difficult to give advice.

I hope that's clear and helps you!

Best,
Tom
How to test an interaction effect using cluster-based permutation tests? - FieldTrip toolbox<http://www.fieldtriptoolbox.org/faq/how_can_i_test_an_interaction_effect_using_cluster-based_permutation_tests/>
How to test an interaction effect using cluster-based permutation tests? You can use cluster-based permutation tests for some but not for all interaction effects. Specifically, you can only use them for testing interaction effects in factorial designs with only a single between-subjects factor.
www.fieldtriptoolbox.org

________________________________
From: fieldtrip <fieldtrip-bounces at science.ru.nl> on behalf of Lee, Kyoung Eun <klee773 at gatech.edu>
Sent: 10 June 2020 12:47
To: fieldtrip at science.ru.nl <fieldtrip at science.ru.nl>
Subject: [FieldTrip] Non-parametric permutation clustering with 2x2 within subject conditions.


Dear FieldTrip users,



Currently I’m working on a non-parametric permutation clustering with ft_freqstatistics function.

So far, I just compared two different within-subject conditions (Hit vs. Miss), Therefore, I set “cfg.statistic = 'depsamplesT'”.

And my design is set as below :

subj = 42;

design(1,1:subj) = 1:subj; design(1,subj+1:2*subj)= 1:subj;

design(2,1:subj) = 1; design(2,subj+1:2*subj)= 2;



But now, I want to compare 2x2 within subject conditions (Target-Hit/ Target-Miss/ Lure-Hit/ Lure-Miss).

In this case, what kind of statistic I have to use? How can I change the design?

And lastly, how’s the results look like? (would there be positive and negative clusters?)



Please let me know if you have any suggestion.

Thank you so much,



Best,

Cay








-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200610/1f3e0d79/attachment.htm>

From rene.andrade at edu.uah.es  Thu Jun 11 14:30:59 2020
From: rene.andrade at edu.uah.es (=?iso-8859-1?Q?Andrade_Rey_Ren=E9?=)
Date: Thu, 11 Jun 2020 12:30:59 +0000
Subject: [FieldTrip] ft_timelockanalysis line 172
Message-ID: <VE1PR03MB5901E051A26EDC06BF65EB7BAF800@VE1PR03MB5901.eurprd03.prod.outlook.com>

Dear FTTbxs experts:
I am running the epilepsy tutorial (www.fieldtriptoolbox.org/tutorial/epilepsy) with my own data. I have an issue when running ft_timelockanalysis for covariance matrix. The error is as follows.

Index in position 1 exceeds array bounds.

Error in ft_timelockanalysis(line 172)
numsmp = sum(datasmp(1,:));

Best,
Andrade.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200611/6aef8dab/attachment.htm>

From wenxian_guanli at 163.com  Sat Jun 13 17:13:55 2020
From: wenxian_guanli at 163.com (John)
Date: Sat, 13 Jun 2020 23:13:55 +0800 (CST)
Subject: [FieldTrip] could not download demo data from ftp link
Message-ID: <b39a5b3.3af7.172ae3e8f8a.Coremail.wenxian_guanli@163.com>

Hi teams, 
I could not download fieldtrip and demo data from the ftp link (e.g. ftp://ftp.fieldtriptoolbox.org/pub/fieldtrip/tutorial/spikefield/p029_sort_final_01.nex. ). 
Is there any other way to download them? thanks


Best wishes
John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200613/0839a322/attachment.htm>

From ffein at stanford.edu  Mon Jun 15 19:12:37 2020
From: ffein at stanford.edu (Franklin Feingold)
Date: Mon, 15 Jun 2020 17:12:37 +0000
Subject: [FieldTrip] BIDS Common Derivatives released
Message-ID: <3773A80A-94ED-49F9-8DD3-D69267D6B92F@stanford.edu>

Hello!


The BIDS community is proud to announce the release of Common Derivatives! Derivatives are the outputs of preprocessing pipelines, capturing data and meta-data sufficient for a researcher to understand and (critically) reuse those outputs in subsequent pipelines. This specification can be found at: https://bids-specification.readthedocs.io/en/stable/05-derivatives/01-introduction.html


Common principles for derivative datasets:


  *   Derivative datasets describe the contents of the dataset, the methods by which it was generated, and the original dataset(s) that were used to generate it. This metadata is mandatory at the dataset level and optional at the file level.
  *   Derivative files must be distinguishable from raw files. A generic description (desc-) entity allows this if no other entity applies.
  *   The spatial interpretation of data, if applicable, can be specified with a space entity and SpatialReference metadata.


Releasing the common principles for derivative datasets will enable further progress into our modality specific derivative initiatives such as, electrophysiological<https://github.com/bids-standard/bep021>, PET, and diffusion MRI<https://github.com/bids-standard/bids-bep016>. Our immediate attention will shift to focus on specifying anatomical and functional derivatives (Look out for the pull requests soon!). BEP 028: (provenance)<https://github.com/bids-standard/bids-specification/pull/487> is a closely related effort that we hope to see progress quickly as well!


We would like to thank our incredible community of contributors and members that helped push this extension over the finish line!


Thank you,

Chris and Franklin - BIDS Maintainers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200615/98a984b6/attachment.htm>

From litvak.vladimir at gmail.com  Tue Jun 16 17:13:45 2020
From: litvak.vladimir at gmail.com (Vladimir Litvak)
Date: Tue, 16 Jun 2020 16:13:45 +0100
Subject: [FieldTrip] Topoplot layout
Message-ID: <CACq1BhLjSLdfrCo85e=Lvz99347CcHjNYTw-hVfrZWtGftjE3g@mail.gmail.com>

Dear all,

I'm trying to use topoplotER for CTF data and it looks like the sensors do
not reach the edges of the scalp and large parts of the map are
interpolated. This happens both with the sensors and with default layout.
Not sure if it was like that before but is it normal? Is there an option to
do a plot like in EEGLAB where some of it is outside the head outline or do
something else to fix this?

Thanks,

Vladimir

[image: image.png]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200616/02f16fd7/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 325883 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200616/02f16fd7/attachment.png>

From jan.schoffelen at donders.ru.nl  Tue Jun 16 17:26:09 2020
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Tue, 16 Jun 2020 15:26:09 +0000
Subject: [FieldTrip] Topoplot layout
In-Reply-To: <CACq1BhLjSLdfrCo85e=Lvz99347CcHjNYTw-hVfrZWtGftjE3g@mail.gmail.com>
References: <CACq1BhLjSLdfrCo85e=Lvz99347CcHjNYTw-hVfrZWtGftjE3g@mail.gmail.com>
Message-ID: <D4B8DFAE-94B4-42CD-AA68-177A525FC8B6@donders.ru.nl>

Dear Vladimir,

I am a bit surprised that the sensors are so far away from the rim. I suspect that your attached figures are created from an attempt to layout creation from the sensors’ 3D positions, rather than from a pre-cooked layout file.


If I use cfg.layout = ‘CTF275.lay’, load the layout lay=ft_prepare_layout(cfg), and plot it ft_plot_layout(lay,’box’,’off’,’label’,’off’), it doesn’t look too bad. It gives the panel on the left in the attached screenshot.

These days, however, we recommend using ‘CTF275_helmet.mat’ as cfg.layout. This gives the right panel in the attached screenshot.

If I were you, I’d go for the helmet layout.

Best wishes,
JM



[cid:F6920D98-B949-4706-91EF-9A49A6CA4435]

On 16 Jun 2020, at 17:13, Vladimir Litvak <litvak.vladimir at gmail.com<mailto:litvak.vladimir at gmail.com>> wrote:

Dear all,

I'm trying to use topoplotER for CTF data and it looks like the sensors do not reach the edges of the scalp and large parts of the map are interpolated. This happens both with the sensors and with default layout. Not sure if it was like that before but is it normal? Is there an option to do a plot like in EEGLAB where some of it is outside the head outline or do something else to fix this?

Thanks,

Vladimir

<image.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/20200616/d3fd4bf4/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot 2020-06-16 at 17.22.38.png
Type: image/png
Size: 337932 bytes
Desc: Screenshot 2020-06-16 at 17.22.38.png
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200616/d3fd4bf4/attachment.png>

From georgebuzzell at gmail.com  Tue Jun 16 18:41:58 2020
From: georgebuzzell at gmail.com (George Buzzell)
Date: Tue, 16 Jun 2020 12:41:58 -0400
Subject: [FieldTrip] Call for Papers: Special Issue On EEG Methods for
 Developmental Cognitive Neuroscientists
Message-ID: <CALM-MyZ1SVZnMAqajLsTFyQyx1JkuA+sfYf5Z55FX-HQndC6Ew@mail.gmail.com>

Apologies in advance for cross-posting.


Call for Papers: Special Issue On EEG Methods for Developmental Cognitive
Neuroscientists


We are now accepting letters of intent for submissions to a special issue
in Developmental Cognitive Neuroscience (IF = 4.92). The special issue is
entitled, “EEG Methods for Developmental Cognitive Neuroscientists: A
Tutorial Approach” and will assemble a series of papers, with accompanying
tutorials and code, focused on advanced EEG analysis approaches for
developmental research. We are placing particular emphasis on promising
methods that have not been widely adopted by developmental scientists. Our
goal is to provide both novice and experienced researchers with a set of
resources that will facilitate rapid application of these analytic methods
within the field of developmental science. Thus, we seek papers that not
only explain the theoretical and conceptual steps involved in novel
EEG-analytic approaches, but also contain step-by-step tutorials on how to
apply these methods to one’s own data. Additionally, all submitted papers
must include well-commented code and an example dataset that will be made
publicly available.



Complete details of the special issue can be found here
<https://www.journals.elsevier.com/developmental-cognitive-neuroscience/call-for-papers/special-issue-eeg-methods-for-developmental-cognitive-neuros>
(or
in the attached pdf). If you are interested in submitting a manuscript,
then a letter of intent is needed by August 1st, 2020. Please send letters
of intent or additional inquiries to gbuzzell at fiu.edu. I hope that many of
you will consider a submission proposal.



Best,

George

-- 
George A. Buzzell
University of Maryland, College Park
Incoming: Asst. Prof., Florida International University
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200616/678b2de2/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DCN_call_for_papers.pdf
Type: application/pdf
Size: 54690 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200616/678b2de2/attachment.pdf>

From litvak.vladimir at gmail.com  Wed Jun 17 13:23:35 2020
From: litvak.vladimir at gmail.com (Vladimir Litvak)
Date: Wed, 17 Jun 2020 12:23:35 +0100
Subject: [FieldTrip] Topoplot layout
In-Reply-To: <D4B8DFAE-94B4-42CD-AA68-177A525FC8B6@donders.ru.nl>
References: <CACq1BhLjSLdfrCo85e=Lvz99347CcHjNYTw-hVfrZWtGftjE3g@mail.gmail.com>
 <D4B8DFAE-94B4-42CD-AA68-177A525FC8B6@donders.ru.nl>
Message-ID: <CACq1BhKASONyLmzoEGbV_MKJpbnLbSL=GWGY8c+sNffWThR4uQ@mail.gmail.com>

Thanks, the helmet layout did the job.

Vladimir

On Tue, 16 Jun 2020 at 17:35, Schoffelen, J.M. (Jan Mathijs) <
jan.schoffelen at donders.ru.nl> wrote:

> Dear Vladimir,
>
> I am a bit surprised that the sensors are so far away from the rim. I
> suspect that your attached figures are created from an attempt to layout
> creation from the sensors’ 3D positions, rather than from a pre-cooked
> layout file.
>
>
> If I use cfg.layout = ‘CTF275.lay’, load the layout
> lay=ft_prepare_layout(cfg), and plot it
> ft_plot_layout(lay,’box’,’off’,’label’,’off’), it doesn’t look too bad. It
> gives the panel on the left in the attached screenshot.
>
> These days, however, we recommend using ‘CTF275_helmet.mat’ as cfg.layout.
> This gives the right panel in the attached screenshot.
>
> If I were you, I’d go for the helmet layout.
>
> Best wishes,
> JM
>
>
>
>
> On 16 Jun 2020, at 17:13, Vladimir Litvak <litvak.vladimir at gmail.com>
> wrote:
>
> Dear all,
>
> I'm trying to use topoplotER for CTF data and it looks like the sensors do
> not reach the edges of the scalp and large parts of the map are
> interpolated. This happens both with the sensors and with default layout.
> Not sure if it was like that before but is it normal? Is there an option to
> do a plot like in EEGLAB where some of it is outside the head outline or do
> something else to fix this?
>
> Thanks,
>
> Vladimir
>
> <image.png>
> _______________________________________________
> 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/20200617/9b4c5f44/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot 2020-06-16 at 17.22.38.png
Type: image/png
Size: 337932 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200617/9b4c5f44/attachment.png>

From tzvetan.popov at uni-konstanz.de  Thu Jun 18 12:53:11 2020
From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov)
Date: Thu, 18 Jun 2020 12:53:11 +0200
Subject: [FieldTrip] empty vertices in surface sourceplot
Message-ID: <386B0262-AAFC-48D9-928E-4574947EB167@uni-konstanz.de>

Dear all,

I am working with a source map (panel A in the attached figure) reconstructed in the Yeo17 atlas space. The result of ft_sourceparcelate (panel B) looks reasonable to me. I would like to plot this on the cortical surface. Yet I also get some empty patches (panel C). Has anyone run into the same problem and figured out a solution?

This is my configuration during the surface plot:
cfg = [];
cfg.method         = 'surface';
cfg.funparameter   = 'pow';
cfg.surffile       = 'surface_white_both.mat';
cfg.surfinflated       = 'surface_inflated_both.mat';
cfg.camlight       = 'no';
ft_sourceplot(cfg, parcel);
view ([0 0])
light('Position',[0 -1 0]);


Thanks a bunch!
tzvetan


  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200618/70e041f6/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot 2020-06-18 12.40.52.png
Type: image/png
Size: 465307 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200618/70e041f6/attachment.png>

From gmichael_ at hotmail.com  Thu Jun 18 14:14:35 2020
From: gmichael_ at hotmail.com (george michael)
Date: Thu, 18 Jun 2020 12:14:35 +0000
Subject: [FieldTrip] single-trial phase at stimulus onset using Hilbert
 transform
Message-ID: <DB3PR0502MB4058B7B0F7BDCA8F5DCA59EB909B0@DB3PR0502MB4058.eurprd05.prod.outlook.com>

Dear Fieldtrip Community,

I am trying to extract the alpha phase at stimulus onset from single trials.
My approach is to :
1) Band-pass filter the trial segments from -500ms to 0 (±1Hz around individual alpha frequency).
I use the filter 'firws' and filter direction 'onepass' to avoid smearing poststimulus activity into the prestimulus interval.
2) Compute Hilbert transform to extract the instantaneous phase of the bandpass signal.
3) Select the phase at the last sample (t=0) as the one representing phase at stimulus onset.

 cfg=[];
cfg.channel = 'O1';
cfg.bpfilter='yes';
cfg.bpfreq=[foi-1 foi+1];
cfg.bpfilttype= 'firws';
cfg.bpfiltdir= 'onepass';
cfg.hilbert='angle';
phase = ft_preprocessing(cfg , trials_prestim);

 for tr=1:length(phase .trial)
       phase_onset(tr,:)=phase .trial{tr}(:,end); % select phase at last sample
 end

The problem is that the band-bass signal looks quite weird at the right edge, towards t=0s (see attached figure).

Do you have any idea what would be the reason for this problem?
And which would be the optimal way to extract phase at stimulus onset?

Many thanks,
Georgios
-----------------------
Georgios Michail, MSc.
Department of Psychiatry and Psychotherapy
Charite-Universitätsmedizin Berlin



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200618/daf44f99/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bandpass_alpha_singlesubj.png
Type: image/png
Size: 460709 bytes
Desc: bandpass_alpha_singlesubj.png
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200618/daf44f99/attachment.png>

From tzvetan.popov at uni-konstanz.de  Thu Jun 18 14:27:41 2020
From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov)
Date: Thu, 18 Jun 2020 14:27:41 +0200
Subject: [FieldTrip] single-trial phase at stimulus onset using Hilbert
 transform
In-Reply-To: <DB3PR0502MB4058B7B0F7BDCA8F5DCA59EB909B0@DB3PR0502MB4058.eurprd05.prod.outlook.com>
References: <DB3PR0502MB4058B7B0F7BDCA8F5DCA59EB909B0@DB3PR0502MB4058.eurprd05.prod.outlook.com>
Message-ID: <C264BEF6-E0FF-4612-9910-6AE77D7AB2B1@uni-konstanz.de>

Dear Georgios,

the reason is your cfg.bpfiltdir = ‘onepass’. This should be zero phase or twopass filter. Yet, you will still get filter artefacts at the edges. I suggest you should re-segment your data, e.g. -1000 to 500ms, filter and then re-segment to -500 to 0 again.
Good luck,
tzvetan


> Am 18.06.2020 um 14:14 schrieb george michael <gmichael_ at hotmail.com>:
> 
> Dear Fieldtrip Community,
> 
> I am trying to extract the alpha phase at stimulus onset from single trials. 
> My approach is to :
> 1) Band-pass filter the trial segments from -500ms to 0 (±1Hz around individual alpha frequency).
> I use the filter 'firws' and filter direction 'onepass' to avoid smearing poststimulus activity into the prestimulus interval.
> 2) Compute Hilbert transform to extract the instantaneous phase of the bandpass signal. 
> 3) Select the phase at the last sample (t=0) as the one representing phase at stimulus onset.
> 
>  cfg=[];
> cfg.channel = 'O1';
> cfg.bpfilter='yes';
> cfg.bpfreq=[foi-1 foi+1];
> cfg.bpfilttype= 'firws';
> cfg.bpfiltdir= 'onepass';
> cfg.hilbert='angle';
> phase = ft_preprocessing(cfg , trials_prestim);
> 
>  for tr=1:length(phase .trial)
>        phase_onset(tr,:)=phase .trial{tr}(:,end); % select phase at last sample
>  end
> 
> The problem is that the band-bass signal looks quite weird at the right edge, towards t=0s (see attached figure). 
> 
> Do you have any idea what would be the reason for this problem? 
> And which would be the optimal way to extract phase at stimulus onset?
>  
> Many thanks,
> Georgios
> -----------------------
> Georgios Michail, MSc.
> Department of Psychiatry and Psychotherapy
> Charite-Universitätsmedizin Berlin
> 
> 
> 
> <bandpass_alpha_singlesubj.png>_______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip <https://mailman.science.ru.nl/mailman/listinfo/fieldtrip>
> https://doi.org/10.1371/journal.pcbi.1002202 <https://doi.org/10.1371/journal.pcbi.1002202>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200618/5d528cc6/attachment.htm>

From gmichael_ at hotmail.com  Thu Jun 18 14:44:53 2020
From: gmichael_ at hotmail.com (george michael)
Date: Thu, 18 Jun 2020 12:44:53 +0000
Subject: [FieldTrip] single-trial phase at stimulus onset using Hilbert
 transform
In-Reply-To: <C264BEF6-E0FF-4612-9910-6AE77D7AB2B1@uni-konstanz.de>
References: <DB3PR0502MB4058B7B0F7BDCA8F5DCA59EB909B0@DB3PR0502MB4058.eurprd05.prod.outlook.com>,
 <C264BEF6-E0FF-4612-9910-6AE77D7AB2B1@uni-konstanz.de>
Message-ID: <DB3PR0502MB405871884C7BC3BA3BC6F34B909B0@DB3PR0502MB4058.eurprd05.prod.outlook.com>

Dear Tzvetan,

thanks you for the quick reply.
Wouldn't be a problem to use "onepass-zerophase" or "twopass" given that I am interested in phase at stimulus onset?
Don't both filter-types smear poststimulus activity into the prestimulus interval?

Best,
Georgios
________________________________
From: fieldtrip <fieldtrip-bounces at science.ru.nl> on behalf of Tzvetan Popov <tzvetan.popov at uni-konstanz.de>
Sent: Thursday, June 18, 2020 14:27
To: FieldTrip discussion list <fieldtrip at science.ru.nl>
Subject: Re: [FieldTrip] single-trial phase at stimulus onset using Hilbert transform

Dear Georgios,

the reason is your cfg.bpfiltdir = ‘onepass’. This should be zero phase or twopass filter. Yet, you will still get filter artefacts at the edges. I suggest you should re-segment your data, e.g. -1000 to 500ms, filter and then re-segment to -500 to 0 again.
Good luck,
tzvetan


Am 18.06.2020 um 14:14 schrieb george michael <gmichael_ at hotmail.com<mailto:gmichael_ at hotmail.com>>:

Dear Fieldtrip Community,

I am trying to extract the alpha phase at stimulus onset from single trials.
My approach is to :
1) Band-pass filter the trial segments from -500ms to 0 (±1Hz around individual alpha frequency).
I use the filter 'firws' and filter direction 'onepass' to avoid smearing poststimulus activity into the prestimulus interval.
2) Compute Hilbert transform to extract the instantaneous phase of the bandpass signal.
3) Select the phase at the last sample (t=0) as the one representing phase at stimulus onset.

 cfg=[];
cfg.channel = 'O1';
cfg.bpfilter='yes';
cfg.bpfreq=[foi-1 foi+1];
cfg.bpfilttype= 'firws';
cfg.bpfiltdir= 'onepass';
cfg.hilbert='angle';
phase = ft_preprocessing(cfg , trials_prestim);

 for tr=1:length(phase .trial)
       phase_onset(tr,:)=phase .trial{tr}(:,end); % select phase at last sample
 end

The problem is that the band-bass signal looks quite weird at the right edge, towards t=0s (see attached figure).

Do you have any idea what would be the reason for this problem?
And which would be the optimal way to extract phase at stimulus onset?

Many thanks,
Georgios
-----------------------
Georgios Michail, MSc.
Department of Psychiatry and Psychotherapy
Charite-Universitätsmedizin Berlin



<bandpass_alpha_singlesubj.png>_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=02%7C01%7C%7C75cdf37ebb8c4629c90d08d813830d14%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637280801062055379&sdata=wX2%2FX5Q7YJ9T3jgil%2B0nWa9rdZ535Axf%2FZEqeMPHhq4%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202<https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=02%7C01%7C%7C75cdf37ebb8c4629c90d08d813830d14%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637280801062055379&sdata=YN7KvEKe8UwFVkTeeQV%2F0B2axKX8LtPgf50ehSehzSA%3D&reserved=0>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200618/71dbdd91/attachment.htm>

From tzvetan.popov at uni-konstanz.de  Thu Jun 18 15:00:43 2020
From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov)
Date: Thu, 18 Jun 2020 15:00:43 +0200
Subject: [FieldTrip] single-trial phase at stimulus onset using Hilbert
 transform
In-Reply-To: <DB3PR0502MB405871884C7BC3BA3BC6F34B909B0@DB3PR0502MB4058.eurprd05.prod.outlook.com>
References: <DB3PR0502MB4058B7B0F7BDCA8F5DCA59EB909B0@DB3PR0502MB4058.eurprd05.prod.outlook.com>
 <C264BEF6-E0FF-4612-9910-6AE77D7AB2B1@uni-konstanz.de>
 <DB3PR0502MB405871884C7BC3BA3BC6F34B909B0@DB3PR0502MB4058.eurprd05.prod.outlook.com>
Message-ID: <024E4A6C-BF3E-4267-82F2-818F5EA51845@uni-konstanz.de>

Using filters is always a “problem”. A symmetric filter will at least not misplace your signal of interest. My reply referred to the “weirdness at the right edge”. 

Best
tzvetan


> Am 18.06.2020 um 14:44 schrieb george michael <gmichael_ at hotmail.com>:
> 
> Dear Tzvetan,
> 
> thanks you for the quick reply.
> Wouldn't be a problem to use "onepass-zerophase" or "twopass" given that I am interested in phase at stimulus onset?
> Don't both filter-types smear poststimulus activity into the prestimulus interval?
> 
> Best,
> Georgios
> From: fieldtrip <fieldtrip-bounces at science.ru.nl> on behalf of Tzvetan Popov <tzvetan.popov at uni-konstanz.de>
> Sent: Thursday, June 18, 2020 14:27
> To: FieldTrip discussion list <fieldtrip at science.ru.nl>
> Subject: Re: [FieldTrip] single-trial phase at stimulus onset using Hilbert transform
>  
> Dear Georgios,
> 
> the reason is your cfg.bpfiltdir = ‘onepass’. This should be zero phase or twopass filter. Yet, you will still get filter artefacts at the edges. I suggest you should re-segment your data, e.g. -1000 to 500ms, filter and then re-segment to -500 to 0 again.
> Good luck,
> tzvetan
> 
> 
>> Am 18.06.2020 um 14:14 schrieb george michael <gmichael_ at hotmail.com <mailto:gmichael_ at hotmail.com>>:
>> 
>> Dear Fieldtrip Community,
>> 
>> I am trying to extract the alpha phase at stimulus onset from single trials. 
>> My approach is to :
>> 1) Band-pass filter the trial segments from -500ms to 0 (±1Hz around individual alpha frequency).
>> I use the filter 'firws' and filter direction 'onepass' to avoid smearing poststimulus activity into the prestimulus interval.
>> 2) Compute Hilbert transform to extract the instantaneous phase of the bandpass signal. 
>> 3) Select the phase at the last sample (t=0) as the one representing phase at stimulus onset.
>> 
>>  cfg=[];
>> cfg.channel = 'O1';
>> cfg.bpfilter='yes';
>> cfg.bpfreq=[foi-1 foi+1];
>> cfg.bpfilttype= 'firws';
>> cfg.bpfiltdir= 'onepass';
>> cfg.hilbert='angle';
>> phase = ft_preprocessing(cfg , trials_prestim);
>> 
>>  for tr=1:length(phase .trial)
>>        phase_onset(tr,:)=phase .trial{tr}(:,end); % select phase at last sample
>>  end
>> 
>> The problem is that the band-bass signal looks quite weird at the right edge, towards t=0s (see attached figure). 
>> 
>> Do you have any idea what would be the reason for this problem? 
>> And which would be the optimal way to extract phase at stimulus onset?
>>  
>> Many thanks,
>> Georgios
>> -----------------------
>> Georgios Michail, MSc.
>> Department of Psychiatry and Psychotherapy
>> Charite-Universitätsmedizin Berlin
>> 
>> 
>> 
>> <bandpass_alpha_singlesubj.png>_______________________________________________
>> fieldtrip mailing list
>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip <https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=02%7C01%7C%7C75cdf37ebb8c4629c90d08d813830d14%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637280801062055379&sdata=wX2%2FX5Q7YJ9T3jgil%2B0nWa9rdZ535Axf%2FZEqeMPHhq4%3D&reserved=0>
>> https://doi.org/10.1371/journal.pcbi.1002202 <https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=02%7C01%7C%7C75cdf37ebb8c4629c90d08d813830d14%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637280801062055379&sdata=YN7KvEKe8UwFVkTeeQV%2F0B2axKX8LtPgf50ehSehzSA%3D&reserved=0>
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip <https://mailman.science.ru.nl/mailman/listinfo/fieldtrip>
> https://doi.org/10.1371/journal.pcbi.1002202 <https://doi.org/10.1371/journal.pcbi.1002202>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200618/aa7afcf3/attachment.htm>

From sara.hussain at nih.gov  Thu Jun 18 15:25:49 2020
From: sara.hussain at nih.gov (Hussain, Sara (NIH/NINDS) [F])
Date: Thu, 18 Jun 2020 13:25:49 +0000
Subject: [FieldTrip] single-trial phase at stimulus onset using Hilbert
 transform
Message-ID: <566A683D-8E42-4392-B828-44B0034FB528@nih.gov>

Hey Georgios-

This can definitely be a tricky problem. I have run into this in the past when trying to sort responses to TMS based on when the stimulus occurs relative to the phase. My colleagues and I came up with a non-fieldtrip implementation of this which is published here: https://academic.oup.com/cercor/article/29/9/3766/5218042

What happens is because filters use a window of samples, anything after the stimulus can contaminate phase estimates at the stimulus timepoint. We ended up using a clamping approach in which all values beginning 1 sample before stimulus to the end of the epoch are clamped to the value of the sample preceding the stimulus. Then we use a one pass FIR filter and correct for the phase delay to get the filtered data.

I’ve attached a function I wrote to perform this process– you would have to modify some of the parameters in the function (sampling rate, filtering freqs, etc). If you end up using this please cite the above paper in which we’ve validated the phase estimates this filtering approach produces. After you get the filtered data, you can do the Hilbert and phase extraction as you mention.

Hope this helps-
Sara


From: george michael <gmichael_ at hotmail.com>
Reply-To: FieldTrip discussion list <fieldtrip at science.ru.nl>
Date: Thursday, June 18, 2020 at 9:11 AM
To: FieldTrip discussion list <fieldtrip at science.ru.nl>
Subject: [FieldTrip] single-trial phase at stimulus onset using Hilbert transform

Dear Fieldtrip Community,

I am trying to extract the alpha phase at stimulus onset from single trials.
My approach is to :
1) Band-pass filter the trial segments from -500ms to 0 (±1Hz around individual alpha frequency).
I use the filter 'firws' and filter direction 'onepass' to avoid smearing poststimulus activity into the prestimulus interval.
2) Compute Hilbert transform to extract the instantaneous phase of the bandpass signal.
3) Select the phase at the last sample (t=0) as the one representing phase at stimulus onset.

 cfg=[];
cfg.channel = 'O1';
cfg.bpfilter='yes';
cfg.bpfreq=[foi-1 foi+1];
cfg.bpfilttype= 'firws';
cfg.bpfiltdir= 'onepass';
cfg.hilbert='angle';
phase = ft_preprocessing(cfg , trials_prestim);

 for tr=1:length(phase .trial)
       phase_onset(tr,:)=phase .trial{tr}(:,end); % select phase at last sample
 end

The problem is that the band-bass signal looks quite weird at the right edge, towards t=0s (see attached figure).

Do you have any idea what would be the reason for this problem?
And which would be the optimal way to extract phase at stimulus onset?

Many thanks,
Georgios
-----------------------
Georgios Michail, MSc.
Department of Psychiatry and Psychotherapy
Charite-Universitätsmedizin Berlin



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200618/3aa1cc99/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mu_filt_rtms.m
Type: application/octet-stream
Size: 2843 bytes
Desc: mu_filt_rtms.m
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200618/3aa1cc99/attachment.obj>

From jan.schoffelen at donders.ru.nl  Thu Jun 18 15:50:14 2020
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Thu, 18 Jun 2020 13:50:14 +0000
Subject: [FieldTrip] empty vertices in surface sourceplot
In-Reply-To: <386B0262-AAFC-48D9-928E-4574947EB167@uni-konstanz.de>
References: <386B0262-AAFC-48D9-928E-4574947EB167@uni-konstanz.de>
Message-ID: <81537DB6-4F3C-4445-84CE-4D570919DE7A@donders.ru.nl>

Dear Tzvetan,

There are some options in ft_sourceplot (relating to the surface plotting) that can be tweaked in order to influence the interpolation onto the template surface. I don’t know them by heart, but they should be recoverable from the help section of the function.

Best wishes,
JM


On 18 Jun 2020, at 12:53, Tzvetan Popov <tzvetan.popov at uni-konstanz.de<mailto:tzvetan.popov at uni-konstanz.de>> wrote:

Dear all,

I am working with a source map (panel A in the attached figure) reconstructed in the Yeo17 atlas space. The result of ft_sourceparcelate (panel B) looks reasonable to me. I would like to plot this on the cortical surface. Yet I also get some empty patches (panel C). Has anyone run into the same problem and figured out a solution?

This is my configuration during the surface plot:
cfg = [];
cfg.method         = 'surface';
cfg.funparameter   = 'pow';
cfg.surffile       = 'surface_white_both.mat';
cfg.surfinflated       = 'surface_inflated_both.mat';
cfg.camlight       = 'no';
ft_sourceplot(cfg, parcel);
view ([0 0])
light('Position',[0 -1 0]);


Thanks a bunch!
tzvetan


  <Screenshot 2020-06-18 12.40.52.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/20200618/88594639/attachment.htm>

From jan.schoffelen at donders.ru.nl  Thu Jun 18 15:59:49 2020
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Thu, 18 Jun 2020 13:59:49 +0000
Subject: [FieldTrip] single-trial phase at stimulus onset using Hilbert
 transform
In-Reply-To: <DB3PR0502MB405871884C7BC3BA3BC6F34B909B0@DB3PR0502MB4058.eurprd05.prod.outlook.com>
References: <DB3PR0502MB4058B7B0F7BDCA8F5DCA59EB909B0@DB3PR0502MB4058.eurprd05.prod.outlook.com>
 <C264BEF6-E0FF-4612-9910-6AE77D7AB2B1@uni-konstanz.de>
 <DB3PR0502MB405871884C7BC3BA3BC6F34B909B0@DB3PR0502MB4058.eurprd05.prod.outlook.com>
Message-ID: <26E85421-00A5-4496-A10C-EAD0512362E8@donders.ru.nl>

Dear Georgios,

Note that the default filter direction implemented for the ‘firws’ filter is onepass-zerophase. I recommend to use this (thus not to specify ‘onepass’), but in addition to widen up (as per Tzvetan’s suggestion) the epoch to avoid filter edge effects in your time window of interest.
Note that you ask for a very narrow passband on very short data segments. This is in principle not really meaningful, since narrow filters require long filterorders (i.e. they need to integrate the original signal in a long window). As long as they are integrating from the left only, the phase estimates won’t be affected by the stimulus induced transient.


Best wishes,

Jan-Mathijs


On 18 Jun 2020, at 14:44, george michael <gmichael_ at hotmail.com<mailto:gmichael_ at hotmail.com>> wrote:

Dear Tzvetan,

thanks you for the quick reply.
Wouldn't be a problem to use "onepass-zerophase" or "twopass" given that I am interested in phase at stimulus onset?
Don't both filter-types smear poststimulus activity into the prestimulus interval?

Best,
Georgios
________________________________
From: fieldtrip <fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl>> on behalf of Tzvetan Popov <tzvetan.popov at uni-konstanz.de<mailto:tzvetan.popov at uni-konstanz.de>>
Sent: Thursday, June 18, 2020 14:27
To: FieldTrip discussion list <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>>
Subject: Re: [FieldTrip] single-trial phase at stimulus onset using Hilbert transform

Dear Georgios,

the reason is your cfg.bpfiltdir = ‘onepass’. This should be zero phase or twopass filter. Yet, you will still get filter artefacts at the edges. I suggest you should re-segment your data, e.g. -1000 to 500ms, filter and then re-segment to -500 to 0 again.
Good luck,
tzvetan


Am 18.06.2020 um 14:14 schrieb george michael <gmichael_ at hotmail.com<mailto:gmichael_ at hotmail.com>>:

Dear Fieldtrip Community,

I am trying to extract the alpha phase at stimulus onset from single trials.
My approach is to :
1) Band-pass filter the trial segments from -500ms to 0 (±1Hz around individual alpha frequency).
I use the filter 'firws' and filter direction 'onepass' to avoid smearing poststimulus activity into the prestimulus interval.
2) Compute Hilbert transform to extract the instantaneous phase of the bandpass signal.
3) Select the phase at the last sample (t=0) as the one representing phase at stimulus onset.

 cfg=[];
cfg.channel = 'O1';
cfg.bpfilter='yes';
cfg.bpfreq=[foi-1 foi+1];
cfg.bpfilttype= 'firws';
cfg.bpfiltdir= 'onepass';
cfg.hilbert='angle';
phase = ft_preprocessing(cfg , trials_prestim);

 for tr=1:length(phase .trial)
       phase_onset(tr,:)=phase .trial{tr}(:,end); % select phase at last sample
 end

The problem is that the band-bass signal looks quite weird at the right edge, towards t=0s (see attached figure).

Do you have any idea what would be the reason for this problem?
And which would be the optimal way to extract phase at stimulus onset?

Many thanks,
Georgios
-----------------------
Georgios Michail, MSc.
Department of Psychiatry and Psychotherapy
Charite-Universitätsmedizin Berlin



<bandpass_alpha_singlesubj.png>_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=02%7C01%7C%7C75cdf37ebb8c4629c90d08d813830d14%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637280801062055379&sdata=wX2%2FX5Q7YJ9T3jgil%2B0nWa9rdZ535Axf%2FZEqeMPHhq4%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202<https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=02%7C01%7C%7C75cdf37ebb8c4629c90d08d813830d14%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637280801062055379&sdata=YN7KvEKe8UwFVkTeeQV%2F0B2axKX8LtPgf50ehSehzSA%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/20200618/7cee4b42/attachment.htm>

From sara.hussain at nih.gov  Thu Jun 18 16:03:50 2020
From: sara.hussain at nih.gov (Hussain, Sara (NIH/NINDS) [F])
Date: Thu, 18 Jun 2020 14:03:50 +0000
Subject: [FieldTrip] single-trial phase at stimulus onset using Hilbert
 transform
In-Reply-To: <024E4A6C-BF3E-4267-82F2-818F5EA51845@uni-konstanz.de>
References: <DB3PR0502MB4058B7B0F7BDCA8F5DCA59EB909B0@DB3PR0502MB4058.eurprd05.prod.outlook.com>
 <C264BEF6-E0FF-4612-9910-6AE77D7AB2B1@uni-konstanz.de>
 <DB3PR0502MB405871884C7BC3BA3BC6F34B909B0@DB3PR0502MB4058.eurprd05.prod.outlook.com>
 <024E4A6C-BF3E-4267-82F2-818F5EA51845@uni-konstanz.de>
Message-ID: <7344F564-C870-4D11-85A0-FF2218257897@nih.gov>

I sent this reply to your question Georgios but it has yet to go through. Trying again –  see below.

Hey Georgios-

This can definitely be a tricky problem. I have run into this in the past when trying to sort responses to TMS based on when the stimulus occurs relative to the phase. My colleagues and I came up with a non-fieldtrip implementation of this which is published here: https://academic.oup.com/cercor/article/29/9/3766/5218042

What happens is because filters use a window of samples, anything after the stimulus can contaminate phase estimates at the stimulus timepoint. We ended up using a clamping approach in which all values beginning 1 sample before stimulus to the end of the epoch are clamped to the value of the sample preceding the stimulus. Then we use a one pass FIR filter and correct for the phase delay to get the filtered data.

I’ve attached a function I wrote to perform this process– you would have to modify some of the parameters in the function (sampling rate, filtering freqs, etc). If you end up using this please cite the above paper in which we’ve validated the phase estimates this filtering approach produces. After you get the filtered data, you can do the Hilbert and phase extraction as you mention.

Hope this helps-
Sara


From: Tzvetan Popov <tzvetan.popov at uni-konstanz.de>
Reply-To: FieldTrip discussion list <fieldtrip at science.ru.nl>
Date: Thursday, June 18, 2020 at 9:56 AM
To: FieldTrip discussion list <fieldtrip at science.ru.nl>
Subject: Re: [FieldTrip] single-trial phase at stimulus onset using Hilbert transform

Using filters is always a “problem”. A symmetric filter will at least not misplace your signal of interest. My reply referred to the “weirdness at the right edge”.

Best
tzvetan



Am 18.06.2020 um 14:44 schrieb george michael <gmichael_ at hotmail.com<mailto:gmichael_ at hotmail.com>>:

Dear Tzvetan,

thanks you for the quick reply.
Wouldn't be a problem to use "onepass-zerophase" or "twopass" given that I am interested in phase at stimulus onset?
Don't both filter-types smear poststimulus activity into the prestimulus interval?

Best,
Georgios
________________________________
From: fieldtrip <fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl>> on behalf of Tzvetan Popov <tzvetan.popov at uni-konstanz.de<mailto:tzvetan.popov at uni-konstanz.de>>
Sent: Thursday, June 18, 2020 14:27
To: FieldTrip discussion list <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>>
Subject: Re: [FieldTrip] single-trial phase at stimulus onset using Hilbert transform

Dear Georgios,

the reason is your cfg.bpfiltdir = ‘onepass’. This should be zero phase or twopass filter. Yet, you will still get filter artefacts at the edges. I suggest you should re-segment your data, e.g. -1000 to 500ms, filter and then re-segment to -500 to 0 again.
Good luck,
tzvetan



Am 18.06.2020 um 14:14 schrieb george michael <gmichael_ at hotmail.com<mailto:gmichael_ at hotmail.com>>:

Dear Fieldtrip Community,

I am trying to extract the alpha phase at stimulus onset from single trials.
My approach is to :
1) Band-pass filter the trial segments from -500ms to 0 (±1Hz around individual alpha frequency).
I use the filter 'firws' and filter direction 'onepass' to avoid smearing poststimulus activity into the prestimulus interval.
2) Compute Hilbert transform to extract the instantaneous phase of the bandpass signal.
3) Select the phase at the last sample (t=0) as the one representing phase at stimulus onset.

 cfg=[];
cfg.channel = 'O1';
cfg.bpfilter='yes';
cfg.bpfreq=[foi-1 foi+1];
cfg.bpfilttype= 'firws';
cfg.bpfiltdir= 'onepass';
cfg.hilbert='angle';
phase = ft_preprocessing(cfg , trials_prestim);

 for tr=1:length(phase .trial)
       phase_onset(tr,:)=phase .trial{tr}(:,end); % select phase at last sample
 end

The problem is that the band-bass signal looks quite weird at the right edge, towards t=0s (see attached figure).

Do you have any idea what would be the reason for this problem?
And which would be the optimal way to extract phase at stimulus onset?

Many thanks,
Georgios
-----------------------
Georgios Michail, MSc.
Department of Psychiatry and Psychotherapy
Charite-Universitätsmedizin Berlin



<bandpass_alpha_singlesubj.png>_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=02%7C01%7C%7C75cdf37ebb8c4629c90d08d813830d14%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637280801062055379&sdata=wX2%2FX5Q7YJ9T3jgil%2B0nWa9rdZ535Axf%2FZEqeMPHhq4%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202<https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=02%7C01%7C%7C75cdf37ebb8c4629c90d08d813830d14%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637280801062055379&sdata=YN7KvEKe8UwFVkTeeQV%2F0B2axKX8LtPgf50ehSehzSA%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/20200618/bc866dbd/attachment.htm>

From gmichael_ at hotmail.com  Thu Jun 18 16:45:02 2020
From: gmichael_ at hotmail.com (george michael)
Date: Thu, 18 Jun 2020 14:45:02 +0000
Subject: [FieldTrip] single-trial phase at stimulus onset using Hilbert
 transform
In-Reply-To: <26E85421-00A5-4496-A10C-EAD0512362E8@donders.ru.nl>
References: <DB3PR0502MB4058B7B0F7BDCA8F5DCA59EB909B0@DB3PR0502MB4058.eurprd05.prod.outlook.com>
 <C264BEF6-E0FF-4612-9910-6AE77D7AB2B1@uni-konstanz.de>
 <DB3PR0502MB405871884C7BC3BA3BC6F34B909B0@DB3PR0502MB4058.eurprd05.prod.outlook.com>,
 <26E85421-00A5-4496-A10C-EAD0512362E8@donders.ru.nl>
Message-ID: <DB3PR0502MB40583D1D35A6CEC7704E180E909B0@DB3PR0502MB4058.eurprd05.prod.outlook.com>

Dear Jan- Mathijs,

thank you very much for the suggestion and the explanation.
I'll try your (and Tzvetan's) suggestion in using onepass-zerophase filter on a longer epoch.

Best regards,
Georgios

________________________________
From: fieldtrip <fieldtrip-bounces at science.ru.nl> on behalf of Schoffelen, J.M. (Jan Mathijs) <jan.schoffelen at donders.ru.nl>
Sent: Thursday, June 18, 2020 15:59
To: FieldTrip discussion list <fieldtrip at science.ru.nl>
Subject: Re: [FieldTrip] single-trial phase at stimulus onset using Hilbert transform

Dear Georgios,

Note that the default filter direction implemented for the ‘firws’ filter is onepass-zerophase. I recommend to use this (thus not to specify ‘onepass’), but in addition to widen up (as per Tzvetan’s suggestion) the epoch to avoid filter edge effects in your time window of interest.
Note that you ask for a very narrow passband on very short data segments. This is in principle not really meaningful, since narrow filters require long filterorders (i.e. they need to integrate the original signal in a long window). As long as they are integrating from the left only, the phase estimates won’t be affected by the stimulus induced transient.


Best wishes,

Jan-Mathijs


On 18 Jun 2020, at 14:44, george michael <gmichael_ at hotmail.com<mailto:gmichael_ at hotmail.com>> wrote:

Dear Tzvetan,

thanks you for the quick reply.
Wouldn't be a problem to use "onepass-zerophase" or "twopass" given that I am interested in phase at stimulus onset?
Don't both filter-types smear poststimulus activity into the prestimulus interval?

Best,
Georgios
________________________________
From: fieldtrip <fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl>> on behalf of Tzvetan Popov <tzvetan.popov at uni-konstanz.de<mailto:tzvetan.popov at uni-konstanz.de>>
Sent: Thursday, June 18, 2020 14:27
To: FieldTrip discussion list <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>>
Subject: Re: [FieldTrip] single-trial phase at stimulus onset using Hilbert transform

Dear Georgios,

the reason is your cfg.bpfiltdir = ‘onepass’. This should be zero phase or twopass filter. Yet, you will still get filter artefacts at the edges. I suggest you should re-segment your data, e.g. -1000 to 500ms, filter and then re-segment to -500 to 0 again.
Good luck,
tzvetan


Am 18.06.2020 um 14:14 schrieb george michael <gmichael_ at hotmail.com<mailto:gmichael_ at hotmail.com>>:

Dear Fieldtrip Community,

I am trying to extract the alpha phase at stimulus onset from single trials.
My approach is to :
1) Band-pass filter the trial segments from -500ms to 0 (±1Hz around individual alpha frequency).
I use the filter 'firws' and filter direction 'onepass' to avoid smearing poststimulus activity into the prestimulus interval.
2) Compute Hilbert transform to extract the instantaneous phase of the bandpass signal.
3) Select the phase at the last sample (t=0) as the one representing phase at stimulus onset.

 cfg=[];
cfg.channel = 'O1';
cfg.bpfilter='yes';
cfg.bpfreq=[foi-1 foi+1];
cfg.bpfilttype= 'firws';
cfg.bpfiltdir= 'onepass';
cfg.hilbert='angle';
phase = ft_preprocessing(cfg , trials_prestim);

 for tr=1:length(phase .trial)
       phase_onset(tr,:)=phase .trial{tr}(:,end); % select phase at last sample
 end

The problem is that the band-bass signal looks quite weird at the right edge, towards t=0s (see attached figure).

Do you have any idea what would be the reason for this problem?
And which would be the optimal way to extract phase at stimulus onset?

Many thanks,
Georgios
-----------------------
Georgios Michail, MSc.
Department of Psychiatry and Psychotherapy
Charite-Universitätsmedizin Berlin



<bandpass_alpha_singlesubj.png>_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=02%7C01%7C%7C7bffdb25339e4312d47408d8138fe865%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637280856278937631&sdata=d778USKwchQqJZ3ePP7C7BZJbufyB81gkt6CkzBYoaE%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202<https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=02%7C01%7C%7C7bffdb25339e4312d47408d8138fe865%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637280856278937631&sdata=%2FLrJA%2Bj0MtvBYuXJjlwnt2wRMXX%2BEkX870dq5WKqkj4%3D&reserved=0>

_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=02%7C01%7C%7C7bffdb25339e4312d47408d8138fe865%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637280856278947626&sdata=I2X%2BeAogYvdggJUmMRg4DeCVFe5j2bV9eXe5XbwUQgY%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202<https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=02%7C01%7C%7C7bffdb25339e4312d47408d8138fe865%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637280856278947626&sdata=Bx%2B63FzoG4fFNW%2FhNI0os1Wy%2FxOIzXfDiqUUHb%2BTNWw%3D&reserved=0>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200618/873c01de/attachment.htm>

From gmichael_ at hotmail.com  Thu Jun 18 16:49:19 2020
From: gmichael_ at hotmail.com (george michael)
Date: Thu, 18 Jun 2020 14:49:19 +0000
Subject: [FieldTrip] single-trial phase at stimulus onset using Hilbert
 transform
In-Reply-To: <7344F564-C870-4D11-85A0-FF2218257897@nih.gov>
References: <DB3PR0502MB4058B7B0F7BDCA8F5DCA59EB909B0@DB3PR0502MB4058.eurprd05.prod.outlook.com>
 <C264BEF6-E0FF-4612-9910-6AE77D7AB2B1@uni-konstanz.de>
 <DB3PR0502MB405871884C7BC3BA3BC6F34B909B0@DB3PR0502MB4058.eurprd05.prod.outlook.com>
 <024E4A6C-BF3E-4267-82F2-818F5EA51845@uni-konstanz.de>,
 <7344F564-C870-4D11-85A0-FF2218257897@nih.gov>
Message-ID: <DB3PR0502MB40581C77F7A0CBDFF5CEA722909B0@DB3PR0502MB4058.eurprd05.prod.outlook.com>

Hi Sara,

thank you very much for the suggestion and for sharing the script.
I 'll definitely give it a try and compare it with the outcome from Fieldtrip (using firws and onepass-zerophase filter).

All the best,
Georgios

________________________________
From: fieldtrip <fieldtrip-bounces at science.ru.nl> on behalf of Hussain, Sara (NIH/NINDS) [F] <sara.hussain at nih.gov>
Sent: Thursday, June 18, 2020 16:03
To: FieldTrip discussion list <fieldtrip at science.ru.nl>
Subject: Re: [FieldTrip] single-trial phase at stimulus onset using Hilbert transform


I sent this reply to your question Georgios but it has yet to go through. Trying again –  see below.



Hey Georgios-



This can definitely be a tricky problem. I have run into this in the past when trying to sort responses to TMS based on when the stimulus occurs relative to the phase. My colleagues and I came up with a non-fieldtrip implementation of this which is published here: https://academic.oup.com/cercor/article/29/9/3766/5218042<https://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Facademic.oup.com%2Fcercor%2Farticle%2F29%2F9%2F3766%2F5218042&data=02%7C01%7C%7C56db724561a84059bb3f08d8139079b0%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637280858538599729&sdata=GkObc1Qr3AlUeQ9RY9zLWHX2DjXIpR9vaLsGlWzZZ%2F8%3D&reserved=0>



What happens is because filters use a window of samples, anything after the stimulus can contaminate phase estimates at the stimulus timepoint. We ended up using a clamping approach in which all values beginning 1 sample before stimulus to the end of the epoch are clamped to the value of the sample preceding the stimulus. Then we use a one pass FIR filter and correct for the phase delay to get the filtered data.



I’ve attached a function I wrote to perform this process– you would have to modify some of the parameters in the function (sampling rate, filtering freqs, etc). If you end up using this please cite the above paper in which we’ve validated the phase estimates this filtering approach produces. After you get the filtered data, you can do the Hilbert and phase extraction as you mention.



Hope this helps-

Sara





From: Tzvetan Popov <tzvetan.popov at uni-konstanz.de>
Reply-To: FieldTrip discussion list <fieldtrip at science.ru.nl>
Date: Thursday, June 18, 2020 at 9:56 AM
To: FieldTrip discussion list <fieldtrip at science.ru.nl>
Subject: Re: [FieldTrip] single-trial phase at stimulus onset using Hilbert transform



Using filters is always a “problem”. A symmetric filter will at least not misplace your signal of interest. My reply referred to the “weirdness at the right edge”.



Best

tzvetan





Am 18.06.2020 um 14:44 schrieb george michael <gmichael_ at hotmail.com<mailto:gmichael_ at hotmail.com>>:



Dear Tzvetan,



thanks you for the quick reply.

Wouldn't be a problem to use "onepass-zerophase" or "twopass" given that I am interested in phase at stimulus onset?

Don't both filter-types smear poststimulus activity into the prestimulus interval?



Best,

Georgios

________________________________

From: fieldtrip <fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl>> on behalf of Tzvetan Popov <tzvetan.popov at uni-konstanz.de<mailto:tzvetan.popov at uni-konstanz.de>>
Sent: Thursday, June 18, 2020 14:27
To: FieldTrip discussion list <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>>
Subject: Re: [FieldTrip] single-trial phase at stimulus onset using Hilbert transform



Dear Georgios,



the reason is your cfg.bpfiltdir = ‘onepass’. This should be zero phase or twopass filter. Yet, you will still get filter artefacts at the edges. I suggest you should re-segment your data, e.g. -1000 to 500ms, filter and then re-segment to -500 to 0 again.

Good luck,

tzvetan





Am 18.06.2020 um 14:14 schrieb george michael <gmichael_ at hotmail.com<mailto:gmichael_ at hotmail.com>>:



Dear Fieldtrip Community,



I am trying to extract the alpha phase at stimulus onset from single trials.

My approach is to :

1) Band-pass filter the trial segments from -500ms to 0 (±1Hz around individual alpha frequency).

I use the filter 'firws' and filter direction 'onepass' to avoid smearing poststimulus activity into the prestimulus interval.

2) Compute Hilbert transform to extract the instantaneous phase of the bandpass signal.

3) Select the phase at the last sample (t=0) as the one representing phase at stimulus onset.



 cfg=[];

cfg.channel = 'O1';

cfg.bpfilter='yes';

cfg.bpfreq=[foi-1 foi+1];

cfg.bpfilttype= 'firws';

cfg.bpfiltdir= 'onepass';

cfg.hilbert='angle';

phase = ft_preprocessing(cfg , trials_prestim);



 for tr=1:length(phase .trial)

       phase_onset(tr,:)=phase .trial{tr}(:,end); % select phase at last sample

 end



The problem is that the band-bass signal looks quite weird at the right edge, towards t=0s (see attached figure).



Do you have any idea what would be the reason for this problem?

And which would be the optimal way to extract phase at stimulus onset?



Many thanks,

Georgios

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

Georgios Michail, MSc.

Department of Psychiatry and Psychotherapy

Charite-Universitätsmedizin Berlin







<bandpass_alpha_singlesubj.png>_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=02%7C01%7C%7C56db724561a84059bb3f08d8139079b0%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637280858538609723&sdata=OIGuMA5s5QEkQMJ3Vl%2Fw%2FUH8jNL7ZSozd1ojtP4gnbU%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202<https://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=02%7C01%7C%7C56db724561a84059bb3f08d8139079b0%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637280858538629711&sdata=2xfm7gr%2BmKlkmWJCak2FNS8WFgfs2GYgjr5phJp22Ck%3D&reserved=0>



_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=02%7C01%7C%7C56db724561a84059bb3f08d8139079b0%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637280858538639705&sdata=Daxb1GMmcQazvBjEfrWy9vtTKELVexCDyZopBriKPg8%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202<https://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=02%7C01%7C%7C56db724561a84059bb3f08d8139079b0%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637280858538659694&sdata=jVLuHCF0ey%2FF3FL6OJA25vC7pyRkXMPcX9JkDa7pBus%3D&reserved=0>


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200618/b5eb9388/attachment.htm>

From jan.schoffelen at donders.ru.nl  Thu Jun 18 16:59:57 2020
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Thu, 18 Jun 2020 14:59:57 +0000
Subject: [FieldTrip] single-trial phase at stimulus onset using Hilbert
 transform
In-Reply-To: <DB3PR0502MB40583D1D35A6CEC7704E180E909B0@DB3PR0502MB4058.eurprd05.prod.outlook.com>
References: <DB3PR0502MB4058B7B0F7BDCA8F5DCA59EB909B0@DB3PR0502MB4058.eurprd05.prod.outlook.com>
 <C264BEF6-E0FF-4612-9910-6AE77D7AB2B1@uni-konstanz.de>
 <DB3PR0502MB405871884C7BC3BA3BC6F34B909B0@DB3PR0502MB4058.eurprd05.prod.outlook.com>
 <26E85421-00A5-4496-A10C-EAD0512362E8@donders.ru.nl>
 <DB3PR0502MB40583D1D35A6CEC7704E180E909B0@DB3PR0502MB4058.eurprd05.prod.outlook.com>
Message-ID: <38416DEA-61F2-4255-98B1-1C0F1862533F@donders.ru.nl>

Just as a final follow up, you could also consider to use the technique used in this publication in order to estimate the phase of band-limited activity:

https://www.jneurosci.org/content/30/12/4481

Best wishes,

Jan-Mathijs

On 18 Jun 2020, at 16:45, george michael <gmichael_ at hotmail.com<mailto:gmichael_ at hotmail.com>> wrote:

Dear Jan- Mathijs,

thank you very much for the suggestion and the explanation.
I'll try your (and Tzvetan's) suggestion in using onepass-zerophase filter on a longer epoch.

Best regards,
Georgios

________________________________
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: Thursday, June 18, 2020 15:59
To: FieldTrip discussion list <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>>
Subject: Re: [FieldTrip] single-trial phase at stimulus onset using Hilbert transform

Dear Georgios,

Note that the default filter direction implemented for the ‘firws’ filter is onepass-zerophase. I recommend to use this (thus not to specify ‘onepass’), but in addition to widen up (as per Tzvetan’s suggestion) the epoch to avoid filter edge effects in your time window of interest.
Note that you ask for a very narrow passband on very short data segments. This is in principle not really meaningful, since narrow filters require long filterorders (i.e. they need to integrate the original signal in a long window). As long as they are integrating from the left only, the phase estimates won’t be affected by the stimulus induced transient.


Best wishes,

Jan-Mathijs


On 18 Jun 2020, at 14:44, george michael <gmichael_ at hotmail.com<mailto:gmichael_ at hotmail.com>> wrote:

Dear Tzvetan,

thanks you for the quick reply.
Wouldn't be a problem to use "onepass-zerophase" or "twopass" given that I am interested in phase at stimulus onset?
Don't both filter-types smear poststimulus activity into the prestimulus interval?

Best,
Georgios
________________________________
From: fieldtrip <fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl>> on behalf of Tzvetan Popov <tzvetan.popov at uni-konstanz.de<mailto:tzvetan.popov at uni-konstanz.de>>
Sent: Thursday, June 18, 2020 14:27
To: FieldTrip discussion list <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>>
Subject: Re: [FieldTrip] single-trial phase at stimulus onset using Hilbert transform

Dear Georgios,

the reason is your cfg.bpfiltdir = ‘onepass’. This should be zero phase or twopass filter. Yet, you will still get filter artefacts at the edges. I suggest you should re-segment your data, e.g. -1000 to 500ms, filter and then re-segment to -500 to 0 again.
Good luck,
tzvetan


Am 18.06.2020 um 14:14 schrieb george michael <gmichael_ at hotmail.com<mailto:gmichael_ at hotmail.com>>:

Dear Fieldtrip Community,

I am trying to extract the alpha phase at stimulus onset from single trials.
My approach is to :
1) Band-pass filter the trial segments from -500ms to 0 (±1Hz around individual alpha frequency).
I use the filter 'firws' and filter direction 'onepass' to avoid smearing poststimulus activity into the prestimulus interval.
2) Compute Hilbert transform to extract the instantaneous phase of the bandpass signal.
3) Select the phase at the last sample (t=0) as the one representing phase at stimulus onset.

 cfg=[];
cfg.channel = 'O1';
cfg.bpfilter='yes';
cfg.bpfreq=[foi-1 foi+1];
cfg.bpfilttype= 'firws';
cfg.bpfiltdir= 'onepass';
cfg.hilbert='angle';
phase = ft_preprocessing(cfg , trials_prestim);

 for tr=1:length(phase .trial)
       phase_onset(tr,:)=phase .trial{tr}(:,end); % select phase at last sample
 end

The problem is that the band-bass signal looks quite weird at the right edge, towards t=0s (see attached figure).

Do you have any idea what would be the reason for this problem?
And which would be the optimal way to extract phase at stimulus onset?

Many thanks,
Georgios
-----------------------
Georgios Michail, MSc.
Department of Psychiatry and Psychotherapy
Charite-Universitätsmedizin Berlin



<bandpass_alpha_singlesubj.png>_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=02%7C01%7C%7C7bffdb25339e4312d47408d8138fe865%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637280856278937631&sdata=d778USKwchQqJZ3ePP7C7BZJbufyB81gkt6CkzBYoaE%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202<https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=02%7C01%7C%7C7bffdb25339e4312d47408d8138fe865%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637280856278937631&sdata=%2FLrJA%2Bj0MtvBYuXJjlwnt2wRMXX%2BEkX870dq5WKqkj4%3D&reserved=0>

_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=02%7C01%7C%7C7bffdb25339e4312d47408d8138fe865%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637280856278947626&sdata=I2X%2BeAogYvdggJUmMRg4DeCVFe5j2bV9eXe5XbwUQgY%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202<https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=02%7C01%7C%7C7bffdb25339e4312d47408d8138fe865%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637280856278947626&sdata=Bx%2B63FzoG4fFNW%2FhNI0os1Wy%2FxOIzXfDiqUUHb%2BTNWw%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/20200618/71b6f922/attachment.htm>

From handerson at usc.edu.au  Fri Jun 19 05:31:39 2020
From: handerson at usc.edu.au (Hannah Anderson)
Date: Fri, 19 Jun 2020 03:31:39 +0000
Subject: [FieldTrip] ft_definetrial
Message-ID: <SYAPR01MB28938F406736862E847B8ABD99980@SYAPR01MB2893.ausprd01.prod.outlook.com>

Dear FieldTrip community

I am attempting to define a trial based on a start and end marker, and then cut the trial into 2 second segments with 0.5% overlap.

    Marker Segmentation
    cfg                                      = [];
    cfg.dataset                       = d(data).name;
    cfg.continuous                 = 'yes';
    cfg.trialfun                        = 'trial_fun_startend'; %trial_function for marker segmentation
    cfg.trialdef.prestim          = 0.2; %in seconds
    cfg.trialdef.poststim        = 0; %in seconds
    cfg.trialdef.ntrials             = inf;

    cfg                                       = ft_definetrial(cfg);  % define trials

I created a trial fun which is successful in creating a trial from start marker to end marker but I get an error I get an error;
-Index in position 2 exceeds array bounds (must not exceed 2)
Error in ft_redefinetrial (line 267)
 offset    = newtrl(:,3);

when I try and then segment the trial into 2 second trials with overlap.

This is my trialfun:

function [trl, event] = trial_fun_startend(cfg);

hdr          = ft_read_header(cfg.dataset);
event        = ft_read_event(cfg.dataset);

detectflank  = 'up';

value        = [event(find(strcmp('STATUS', {event.type}))).value]';
sample       = [event(find(strcmp('STATUS', {event.type}))).sample]';

trl          = [];
sel          = find(strcmp({event.type}, 'STATUS'));
event        = event(sel)

begsample = event(1, 2);
endsample = event(1, 3);
offset    = newtrl(:,3);
trl      = [begsample endsample];

I am not sure what else I can try as the other define trial options segment the data into two trials (one for each trigger) and I need it to be one dataset starting at trigger 1 and ending at trigger 2. If anyone could offer some advice/assistance it would be greatly appreciated.

Kind regards,
Hannah


University of the Sunshine Coast  l  CRICOS 01595D
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200619/87ac718a/attachment.htm>

From yee.long at LIVE.COM  Fri Jun 19 05:51:56 2020
From: yee.long at LIVE.COM (Long Yee)
Date: Fri, 19 Jun 2020 03:51:56 +0000
Subject: [FieldTrip] cluster-based correction in 2D time-frequency data
Message-ID: <SL2PR04MB31459F98BF5C5F8620CFC3C9FE980@SL2PR04MB3145.apcprd04.prod.outlook.com>

Hi fieldtripers,

I am trying to use ft_freqstatistics to test a single electrode power difference in two conditions with cluster-based correction. Power data are organized as 2D matrix with dimord as 'freq_time'. The data and design work with 'fdr' correction but it didn't work with 'cluster' correction. I didn't figure out how to construct clusters in the 'freq_time' power matrix. Since I just have a single electrode in the test, I don't know how to specify "cfg.neighbours", which looks being required when "cfg.correctm='cluster' " was specified.

I would appreciate any help on how to do this. Thanks.

YL
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200619/84af0e83/attachment.htm>

From karafarrar at icloud.com  Thu Jun 18 19:28:42 2020
From: karafarrar at icloud.com (Kara Farrar)
Date: Thu, 18 Jun 2020 18:28:42 +0100
Subject: [FieldTrip] Problems with meshes
Message-ID: <A60B5532-9C10-4A4D-B009-C715C1322292@icloud.com>

﻿Hi Everyone, 

I have been having three different problems with the meshes produced following segmentation, which has been preventing me from creating head models. I have attached screenshots of the mesh plots to better explain these problems. 

1) For several subjects the brain and scalp meshes appear correct, but the CSF and skull meshes are misshaped or broken. I have tried improving the contrast of the image on FSL (fast -B <filename>), and running decouplesurf several times to check whether any of the layers are overlapping, but this hasn’t fixed the problem.

2) For other subjects the brain, CSF, and skull meshes look correct but the scalp mesh shows the skull inside. When I then try running the ft_prepare_headmodel function I get the following error: "Error using ft_prepare_headmodel (line 279)
the compartment nesting cannot be determined”. I again tried improving the contrast but this didn’t help to remove the skull from inside of the scalp mesh. 

3) Finally, for one subject who's MRI image was an EEG-MRI, the skull and scalp meshes appear to be raised in the centre. Changing the image contrast again didn’t help to resolve this.

I was just wondering whether anyone else experienced similar issues to these, and if so how you were able to fix them? I have been unable to find any solutions online. 

Thank you in advance.

Best Wishes,

Kara 





-------------- next part --------------
A non-text attachment was scrubbed...
Name: Brain.png
Type: image/png
Size: 722441 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200618/4eafc12d/attachment.png>
-------------- next part --------------

-------------- next part --------------
A non-text attachment was scrubbed...
Name: CSF.png
Type: image/png
Size: 176377 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200618/4eafc12d/attachment-0001.png>
-------------- next part --------------

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Skull.png
Type: image/png
Size: 162179 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200618/4eafc12d/attachment-0002.png>
-------------- next part --------------

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Scalp.png
Type: image/png
Size: 775722 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200618/4eafc12d/attachment-0003.png>
-------------- next part --------------

-------------- next part --------------
A non-text attachment was scrubbed...
Name: EEG-MRI.png
Type: image/png
Size: 548903 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200618/4eafc12d/attachment-0004.png>
-------------- next part --------------

 

From jan.schoffelen at donders.ru.nl  Fri Jun 19 08:52:26 2020
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Fri, 19 Jun 2020 06:52:26 +0000
Subject: [FieldTrip] ft_definetrial
In-Reply-To: <SYAPR01MB28938F406736862E847B8ABD99980@SYAPR01MB2893.ausprd01.prod.outlook.com>
References: <SYAPR01MB28938F406736862E847B8ABD99980@SYAPR01MB2893.ausprd01.prod.outlook.com>
Message-ID: <252730FB-F0C7-477E-833B-09D1CEFA522F@donders.ru.nl>

Dear Hannah,

From your error, it seems that you called ft_REdefinetrial, rather than ft_definetrial, I am not sure whether that was intended.
The way forward would be (in your case)

cfg = ft_definetrial(cfg);

% this yields a cfg.trl matrix that defines epochs  - from - marker1 - to - marker2

Then, you can use ft_preprocessing(cfg) to load in the epoched data, followed by a call to ft_redefinetrial to cut the epochs into 2 second snippets.

Alternatively, you can write a fancy ’trialfun’ that also incorporates the cutting into epochs of desired length (+desired overlap). Perhaps you can have a look at Appendix 2 of this tutorial: http://www.fieldtriptoolbox.org/tutorial/coherence/, which gives an example of such a trialfun.

Best wishes,
Jan-Mathijs




On 19 Jun 2020, at 05:31, Hannah Anderson <handerson at usc.edu.au<mailto:handerson at usc.edu.au>> wrote:

Dear FieldTrip community

I am attempting to define a trial based on a start and end marker, and then cut the trial into 2 second segments with 0.5% overlap.

    Marker Segmentation
    cfg                                      = [];
    cfg.dataset                       = d(data).name;
    cfg.continuous                 = 'yes';
    cfg.trialfun                        = 'trial_fun_startend'; %trial_function for marker segmentation
    cfg.trialdef.prestim          = 0.2; %in seconds
    cfg.trialdef.poststim        = 0; %in seconds
    cfg.trialdef.ntrials             = inf;

    cfg                                       = ft_definetrial(cfg);  % define trials

I created a trial fun which is successful in creating a trial from start marker to end marker but I get an error I get an error;
-Index in position 2 exceeds array bounds (must not exceed 2)
Error in ft_redefinetrial (line 267)
 offset    = newtrl(:,3);

when I try and then segment the trial into 2 second trials with overlap.

This is my trialfun:

function [trl, event] = trial_fun_startend(cfg);

hdr          = ft_read_header(cfg.dataset);
event        = ft_read_event(cfg.dataset);

detectflank  = 'up';

value        = [event(find(strcmp('STATUS', {event.type}))).value]';
sample       = [event(find(strcmp('STATUS', {event.type}))).sample]';

trl          = [];
sel          = find(strcmp({event.type}, 'STATUS'));
event        = event(sel)

begsample = event(1, 2);
endsample = event(1, 3);
offset    = newtrl(:,3);
trl      = [begsample endsample];

I am not sure what else I can try as the other define trial options segment the data into two trials (one for each trigger) and I need it to be one dataset starting at trigger 1 and ending at trigger 2. If anyone could offer some advice/assistance it would be greatly appreciated.

Kind regards,
Hannah

University of the Sunshine Coast  l  CRICOS 01595D
_______________________________________________
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/20200619/7136ae0f/attachment.htm>

From jan.schoffelen at donders.ru.nl  Fri Jun 19 08:56:45 2020
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Fri, 19 Jun 2020 06:56:45 +0000
Subject: [FieldTrip] cluster-based correction in 2D time-frequency data
In-Reply-To: <SL2PR04MB31459F98BF5C5F8620CFC3C9FE980@SL2PR04MB3145.apcprd04.prod.outlook.com>
References: <SL2PR04MB31459F98BF5C5F8620CFC3C9FE980@SL2PR04MB3145.apcprd04.prod.outlook.com>
Message-ID: <22E9ECDE-47D6-48CF-8ADE-D65CB596423E@donders.ru.nl>

Perhaps you could provide us with  a little bit more background, e.g. what is the exact error you got, and what have you tried yourself to fix this? Did you look in the e-mail archive to see whether other people have ran into similar issues? Have you tried defining cfg.neighbours = [];? etc.

Best wishes,
Jan-Mathijs


On 19 Jun 2020, at 05:51, Long Yee <yee.long at LIVE.COM<mailto:yee.long at LIVE.COM>> wrote:

Hi fieldtripers,

I am trying to use ft_freqstatistics to test a single electrode power difference in two conditions with cluster-based correction. Power data are organized as 2D matrix with dimord as 'freq_time'. The data and design work with 'fdr' correction but it didn't work with 'cluster' correction. I didn't figure out how to construct clusters in the 'freq_time' power matrix. Since I just have a single electrode in the test, I don't know how to specify "cfg.neighbours", which looks being required when "cfg.correctm='cluster' " was specified.

I would appreciate any help on how to do this. Thanks.

YL
_______________________________________________
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/20200619/32b3ed49/attachment.htm>

From gaelle.leys at kuleuven.be  Fri Jun 19 14:48:26 2020
From: gaelle.leys at kuleuven.be (=?iso-8859-1?Q?Ga=EBlle_Leys?=)
Date: Fri, 19 Jun 2020 12:48:26 +0000
Subject: [FieldTrip] Errors with downsampling and artifact rejection
Message-ID: <ccb89b4d31af42d3b4cd22485438f4ef@ICTS-S-EXMBX17.luna.kuleuven.be>

Dear Fieldtrip community,

I have recently started with Fieldtrip for my EEG data processing and I am encountering some problems which I can't seem to resolve.
I'm working with mff files from an EGI EEG system. I have no problem reading in and preprocessing the data. However, when trying to downsample and setup the automatic artifact removal, I'm getting some errors.


1)      When trying to downsample with the default options, these are the errors that I get:
Error using resample>getSamples (line 357)
The number of elements of Tx must match the number of rows of X when X is a matrix

Error in resample>nonUniformResample (line 123)
[x, tx] = getSamples(varargin{1:2});

Error in resample (line 116)
  [varargout{1:max(1,nargout)}] = nonUniformResample(method,varargin{:});

Error in ft_resampledata (line 228)
        newdat = transpose(resample(transpose(olddat),fsres,fsorig));

                I have tried downsampling before filtering, after filtering, on continuous data, or already segmented data. None of these things seem to resolve the error.


2)      When trying to set up the automatic artifact removal process and choosing yes for the interactive plot, I get a plotting error:

Error using plot

Vectors must be the same length.



Error in ft_artifact_zvalue>redraw_cb (line 973)

    plot(opt.h1, xval, yval, 'linestyle', '-', 'color', 'b', 'displayname', 'data');



Error in ft_artifact_zvalue (line 512)

  redraw_cb(h);

        I've noticed that the xval and yval are different numbers, which of course doesn't allow plotting. It seems like the xval changes according to the epoch length, however the yval remains the same and equals the amount of samples in my continuous data.


3)      When choosing no for the interactive plot, I also get an error:
Error using zeros
Size inputs must be integers.

Error in ft_artifact_zvalue (line 568)
dum = zeros(1,max(opt.trl(:,2)));

I've been looking into the functions and where it goes wrong, but I can't seem to pinpoint what exactly is causing these issues. Anyone here that can help or provide me some tips?

Thanks in advance!

Kind regards,

Gaëlle Leys

Research Associate
Brain & Cognition
Tiensestraat 102 box 3714
3000 Leuven
Room PSI 02.33
tel. +32 16 37 61 98

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200619/e7e1bde8/attachment.htm>

From stephen.whitmarsh at gmail.com  Fri Jun 19 15:08:21 2020
From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh)
Date: Fri, 19 Jun 2020 15:08:21 +0200
Subject: [FieldTrip] Errors with downsampling and artifact rejection
In-Reply-To: <ccb89b4d31af42d3b4cd22485438f4ef@ICTS-S-EXMBX17.luna.kuleuven.be>
References: <ccb89b4d31af42d3b4cd22485438f4ef@ICTS-S-EXMBX17.luna.kuleuven.be>
Message-ID: <CAFrxm=w44QZ0C7xB4cpsqdy0D0ou5UcpHNM-q3bjyaqwwJxRwg@mail.gmail.com>

Dear Gaëlle,

To understand the problem it would be helpful to have 1) description of the
data structures going in ft_resampledata (just type in command line and
copy-paste the output) and the artefact detection function you are using,
and 2) the configuration (cfg) you are using for those functions.

Cheers,
Stephen


Op vr 19 jun. 2020 om 14:56 schreef Gaëlle Leys <gaelle.leys at kuleuven.be>:

> Dear Fieldtrip community,
>
>
>
> I have recently started with Fieldtrip for my EEG data processing and I am
> encountering some problems which I can’t seem to resolve.
>
> I’m working with mff files from an EGI EEG system. I have no problem
> reading in and preprocessing the data. However, when trying to downsample
> and setup the automatic artifact removal, I’m getting some errors.
>
>
>
> 1)      When trying to downsample with the default options, these are the
> errors that I get:
>
> Error using resample>getSamples (line 357)
>
> The number of elements of Tx must match the number of rows of X when X is
> a matrix
>
>
>
> Error in resample>nonUniformResample (line 123)
>
> [x, tx] = getSamples(varargin{1:2});
>
>
>
> Error in resample (line 116)
>
>   [varargout{1:max(1,nargout)}] = nonUniformResample(method,varargin{:});
>
>
>
> Error in ft_resampledata (line 228)
>
>         newdat = transpose(resample(transpose(olddat),fsres,fsorig));
>
>
>
>                 I have tried downsampling before filtering, after
> filtering, on continuous data, or already segmented data. None of these
> things seem to resolve the error.
>
>
>
> 2)      When trying to set up the automatic artifact removal process and
> choosing yes for the interactive plot, I get a plotting error:
>
> Error using plot
>
> Vectors must be the same length.
>
>
>
> Error in ft_artifact_zvalue>redraw_cb (line 973)
>
>     plot(opt.h1, xval, yval, 'linestyle', '-', 'color', 'b',
> 'displayname', 'data');
>
>
>
> Error in ft_artifact_zvalue (line 512)
>
>   redraw_cb(h);
>
>
>
>         I’ve noticed that the xval and yval are different numbers, which
> of course doesn’t allow plotting. It seems like the xval changes according
> to the epoch length, however the yval remains the same and equals the
> amount of samples in my continuous data.
>
>
>
> 3)      When choosing no for the interactive plot, I also get an error:
>
> Error using zeros
>
> Size inputs must be integers.
>
>
>
> Error in ft_artifact_zvalue (line 568)
>
> dum = zeros(1,max(opt.trl(:,2)));
>
>
>
> I’ve been looking into the functions and where it goes wrong, but I can’t
> seem to pinpoint what exactly is causing these issues. Anyone here that can
> help or provide me some tips?
>
>
>
> Thanks in advance!
>
>
>
> Kind regards,
>
>
>
> Gaëlle Leys
>
>
>
> Research Associate
> Brain & Cognition
> Tiensestraat 102 box 3714
> 3000 Leuven
>
> Room PSI 02.33
> tel. +32 16 37 61 98
>
>
> _______________________________________________
> 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/20200619/137e31b1/attachment.htm>

From silvana.silva at upf.edu  Fri Jun 19 18:58:36 2020
From: silvana.silva at upf.edu (SILVA PEREIRA, SILVANA)
Date: Fri, 19 Jun 2020 18:58:36 +0200
Subject: [FieldTrip] MNI coordinates for the EEG easycap-M1 layout
Message-ID: <CA+_MWm1NufDWa-fjR71OzQ5ab88ioyUT8OJ-QFYX9ABr7gNQrA@mail.gmail.com>

Dear community,

I've been struggling to find the 3D positions (montages) for the
Acticap-64ch-standard2 on the web, which is a modified version of the
easycap-M1, but I have not succeeded. In the Fieldtrip page
http://www.fieldtriptoolbox.org/template/electrode/ you have the following:

You can find the template 3-D electrode sets included in FieldTrip here
<https://github.com/fieldtrip/fieldtrip/tree/master/template/electrode>.

But in that link you only find a txt file with theta-phi coordinates
(easycap-M1.txt). Is there any place where I could find these positions in
MNI space?

Thank you and best regards,
Silvana
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200619/c0adf7df/attachment.htm>

From rene.andrade at edu.uah.es  Sun Jun 21 22:34:49 2020
From: rene.andrade at edu.uah.es (=?utf-8?B?QW5kcmFkZSBSZXkgUmVuw6k=?=)
Date: Sun, 21 Jun 2020 20:34:49 +0000
Subject: [FieldTrip] Running out of memory (RAM)
Message-ID: <C30BBEE6-8A40-4668-8F48-E8244C205963@edu.uah.es>

Dear experts:
I am running this code


cfg = [];
cfg.headmodel = headmodel;
cfg.sourcemodel = leadfield;
cfg.method = 'lcmv';
cfg.lcmv.projectmom = 'yes'; % project dipole time series in direction of maximal power (see below)
cfg.lcmv.kurtosis = 'yes'; % compute kurtosis at each location
source = ft_sourceanalysis(cfg, cov_matrix);

Of http://www.fieldtriptoolbox.org/tutorial/epilepsy/. And I think  I run out of memory because with “top” I can see the computer stops responding when near 85% of RAM memory(16GB).

I cannot report any error because the only problem seems to be that either wrong code or wrong data or I don’t know.

Best,
Andrade.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200621/8b61eaac/attachment.htm>

From jan.schoffelen at donders.ru.nl  Mon Jun 22 08:51:30 2020
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Mon, 22 Jun 2020 06:51:30 +0000
Subject: [FieldTrip] Running out of memory (RAM)
In-Reply-To: <C30BBEE6-8A40-4668-8F48-E8244C205963@edu.uah.es>
References: <C30BBEE6-8A40-4668-8F48-E8244C205963@edu.uah.es>
Message-ID: <308CD012-C138-486C-9B4C-E7F7487D3426@donders.ru.nl>

Dear Andrade,

Without any more specific information, the only meaningful comment that can be given here, is ‘get yourself a more powerful computer’.

Memory usage depends highly on the operating system (in particular: matlab on windows machines used to be much less memory friendly, but it’s been a while that I have been running real computations on a window machine so perhaps this has changed), the total size of all variables that need to be kept in memory, etc.

Best wishes,
Jan-Mathijs



On 21 Jun 2020, at 22:34, Andrade Rey René <rene.andrade at edu.uah.es<mailto:rene.andrade at edu.uah.es>> wrote:

Dear experts:
I am running this code


cfg = [];
cfg.headmodel = headmodel;
cfg.sourcemodel = leadfield;
cfg.method = 'lcmv';
cfg.lcmv.projectmom = 'yes'; % project dipole time series in direction of maximal power (see below)
cfg.lcmv.kurtosis = 'yes'; % compute kurtosis at each location
source = ft_sourceanalysis(cfg, cov_matrix);

Of http://www.fieldtriptoolbox.org/tutorial/epilepsy/. And I think  I run out of memory because with “top” I can see the computer stops responding when near 85% of RAM memory(16GB).

I cannot report any error because the only problem seems to be that either wrong code or wrong data or I don’t know.

Best,
Andrade.
_______________________________________________
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/20200622/2a12ebf1/attachment.htm>

From jan.schoffelen at donders.ru.nl  Mon Jun 22 09:52:03 2020
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Mon, 22 Jun 2020 07:52:03 +0000
Subject: [FieldTrip] DICS question
In-Reply-To: <C2DE802A-23AC-4D55-A12F-644C31AC4871@gmail.com>
References: <C2DE802A-23AC-4D55-A12F-644C31AC4871@gmail.com>
Message-ID: <40F6A2CA-6DB9-453A-B33B-6E2413DA4EA8@donders.ru.nl>

Dear Craig,

Let me forward this e-mail to the discussion list, in order to widen the scope to all of Donostia and beyond.

Indeed, the estimation of spectrally resolved GC requires a full bandwidth signal. I have not extensively played with the different options here, but the scenario that you describe, i.e. compute a DICS spatial filter on a narrow bandwidth-of-interest signal, and subjecting the broadband sensor signals to this spatial filter, will, in my opinion, not be really optimal. The reason for this is that the beamformer then can only suppress interference from that particular bandwidth. Signal components that lie outside this range might still leak into the estimated time courses, which may lead to distortion and invalid GC estimates.

So, if you would be using an LCMV beamformer, I’d always recommend a broadband spatial filter, optionally on mildly highpass-filtered data. Then, the risk could be that the 1/f characteristic of the signals results in a covariance matrix whose signal components are dominated by low-frequency stuff. One could then worry about suboptimal spatial filtering of the higher frequency components. This is probably true, and I have worried about this myself, but in my experience this is the least of the worries one should have. (as a side note: I have played around with spectral whitening of the data prior to the beamforming. The reasoning behind this is that the individual variance components in the data are more evenly balanced across the frequency range, but the long story short is that this does not seem to influence the final GC estimate).

A larger worry would be the fact that source-estimated GC spectra very often have a canonical shape, unless you use extremely well-defined data such a visual attention experiment that induces strong gamma band oscillations. If you are into applying connectivity analysis in a more ethereal context, such as a cognitive or language experiment, you will see that source-level GC spectra will be always dominated by the low-frequency components (i.e. most of the time you’ll find a large peak at low frequencies). This of course can reflect genuine neuronal coupling, but my suspicion is that this is most of the time due to ‘weak signal asymmetries’, in other words due to asymmetries in SNR and location specific leakage of power. This can be further investigated using time-flipping and an appropriate statistical evaluation. For inspiration, you can of course always consult my 2017 PNAS paper :).

Another worry of course would be the fact that you’d be working with Elekta data :).

Practically, what I typically do, is to compute the broadband spatial filter with LCMV, and apply these filters (as is, or dimensionality reduced after a parcellation step) to the sensor level cross-spectral density data (from DC to Nyquist). The spectral factorization algorithm should be applied to the source-level data, which in my experience is most stable if you do this pairwise. I know that this is suboptimal in the context of an interpretation of direct versus indirect interactions, but I have always found this an argument that is part of a non-discussion at this stage of the analysis. One should first trust the estimates overall, before a discussion about direct versus indirect coupling becomes relevant.

Best wishes,
JM








On 19 Jun 2020, at 18:06, Craig Richter <craiggrichter at gmail.com<mailto:craiggrichter at gmail.com>> wrote:

Hey JM,

How’s it going? Covid treating you ok? Been a bit crazy here, but normalcy is resuming.

I have a question about DICS for you… :-/... Anyhow, so for coherence at a given frequency DICS is superior, since the spatial-filter is specific to that frequency, which is about the same as a building a noise-covariance matrix from a narrow-band filtered signal? But to do source-level GC, we need the broadband time-series, so we’re forced to use the unfiltered data and LCMV. But… what if we know the frequency we want to analyse, so we build the spatial filter on this frequency, or narrow-band filtered data, then compute virtual time series from the raw data, and compute GC. Then we simply look at our frequency of interest in the spectral results. Would this potentially generate a better GC estimate at the frequency of interest, or would it just mess everything up?

PS - I’ve cc’ed some other interested folks.

Thanks!

C.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200622/1a7e6793/attachment.htm>

From e.spaak at donders.ru.nl  Mon Jun 22 15:27:19 2020
From: e.spaak at donders.ru.nl (Eelke Spaak)
Date: Mon, 22 Jun 2020 15:27:19 +0200
Subject: [FieldTrip] Running out of memory (RAM)
In-Reply-To: <C30BBEE6-8A40-4668-8F48-E8244C205963@edu.uah.es>
References: <C30BBEE6-8A40-4668-8F48-E8244C205963@edu.uah.es>
Message-ID: <CABPNLUqmPjmyXR4gbRG3y-MLf97-SPGnRA+zp=SA4TBkCOugzw@mail.gmail.com>

Dear Andrade,

You could have a look here for some tips on memory efficiency:
http://www.fieldtriptoolbox.org/tutorial/memory/ Probably most relevant to
you: change the data precision to single, rather than double (saves ~50%).

Best,
Eelke

On Sun, 21 Jun 2020 at 22:34, Andrade Rey René <rene.andrade at edu.uah.es>
wrote:

> Dear experts:
> I am running this code
>
> cfg = [];cfg.headmodel = headmodel;cfg.sourcemodel = leadfield;cfg.method = 'lcmv';cfg.lcmv.projectmom = 'yes'; % project dipole time series in direction of maximal power (see below)cfg.lcmv.kurtosis = 'yes'; % compute kurtosis at each locationsource = ft_sourceanalysis(cfg, cov_matrix);
>
>
> Of http://www.fieldtriptoolbox.org/tutorial/epilepsy/. And I think  I run
> out of memory because with “top” I can see the computer stops responding
> when near 85% of RAM memory(16GB).
>
> I cannot report any error because the only problem seems to be that either
> wrong code or wrong data or I don’t know.
>
> Best,
> Andrade.
> _______________________________________________
> 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/20200622/58106b35/attachment.htm>

From MGlassen at kesslerfoundation.org  Mon Jun 22 15:47:14 2020
From: MGlassen at kesslerfoundation.org (Michael Glassen  -  Biomedical Engineer)
Date: Mon, 22 Jun 2020 13:47:14 +0000
Subject: [FieldTrip] Connectivity Dimensions
Message-ID: <aae7aaea206143f3a87df61e1478a883@kesslerfoundation.org>

Hi all,


I was looking to make some plots of directional connectivity data obtained from ft_connectivityanalysis, and I just wanted to double check the dimensions of pdcspctrm and dtfspctrm.


The dimord is 'chan_chan_freq_time', but there isn't any indication of which chan dimension is the from direction and which is the to direction. I tried piecing it together by using ft_connectivityplot and comparing these to my own plots, and I'm pretty sure that the dimensions are 'fromchan_tochan_freq_time' but I wanted to get confirmation before I moved forward.


Best,

Michael Glassen

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200622/5abef647/attachment.htm>

From jan.schoffelen at donders.ru.nl  Mon Jun 22 15:52:32 2020
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Mon, 22 Jun 2020 13:52:32 +0000
Subject: [FieldTrip] Connectivity Dimensions
In-Reply-To: <aae7aaea206143f3a87df61e1478a883@kesslerfoundation.org>
References: <aae7aaea206143f3a87df61e1478a883@kesslerfoundation.org>
Message-ID: <B6521FD0-2B75-4E0B-AF0C-68CDF3CB411B@donders.ru.nl>

Dear Michael,

Consider it confirmed!

Best wishes,
JM


On 22 Jun 2020, at 15:47, Michael Glassen - Biomedical Engineer <MGlassen at kesslerfoundation.org<mailto:MGlassen at kesslerfoundation.org>> wrote:

Hi all,

I was looking to make some plots of directional connectivity data obtained from ft_connectivityanalysis, and I just wanted to double check the dimensions of pdcspctrm and dtfspctrm.

The dimord is 'chan_chan_freq_time', but there isn't any indication of which chan dimension is the from direction and which is the to direction. I tried piecing it together by using ft_connectivityplot and comparing these to my own plots, and I'm pretty sure that the dimensions are 'fromchan_tochan_freq_time' but I wanted to get confirmation before I moved forward.

Best,
Michael Glassen

  ­­   _______________________________________________
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/20200622/f18ccfbb/attachment.htm>

From gaelle.leys at kuleuven.be  Mon Jun 22 16:47:00 2020
From: gaelle.leys at kuleuven.be (=?utf-8?B?R2HDq2xsZSBMZXlz?=)
Date: Mon, 22 Jun 2020 14:47:00 +0000
Subject: [FieldTrip] Errors with downsampling and artifact rejection
Message-ID: <a967d7106acf41d182449785c9466db7@ICTS-S-EXMBX17.luna.kuleuven.be>

Dear Stephen, 

I have included the data structures and cfg's involved in the functions.

1)	A. data structure for resampling data (raw data after reading it in):
data_eeg = 
  struct with fields:
hdr: [1×1 struct]
label: {129×1 cell}
time: {[1×245726 double]}
trial: {[129×245726 double]}
fsample: 1000
sampleinfo: [1 245726]
elec: [1×1 struct]
cfg: [1×1 struct]

1)	B. cfg for resampling data (I’m using all the default options for resampling):

Cfg=[];
[data_eeg] = ft_resampledata(cfg, data_eeg); % defaults are all OK

2)	A. data structure for artifact rejection (my data already epoched):
data_eeg = 
struct with fields:
hdr: [1×1 struct]
label: {129×1 cell}
 time: {1×108 cell}
 trial: {1×108 cell}
 fsample: 1000
 sampleinfo: [108×2 double]
 elec: [1×1 struct]
 cfg: [1×1 struct]


2)	B. cfg for artifact rejection (taken from the automatic artifact rejection example):
% jump
cfg = [];
cfg.trl = trl;
cfg.datafile = '100_1_20200305.mff';
cfg.headerfile = '100_1_20200305.mff';
cfg.continuous = 'yes';
 
% channel selection, cutoff and padding
cfg.artfctdef.zvalue.channel = 'EEG';
cfg.artfctdef.zvalue.cutoff = 20;
cfg.artfctdef.zvalue.trlpadding = 0;
cfg.artfctdef.zvalue.artpadding = 0;
cfg.artfctdef.zvalue.fltpadding = 0;
 
% algorithmic parameters
cfg.artfctdef.zvalue.cumulative = 'yes';
cfg.artfctdef.zvalue.medianfilter = 'yes';
cfg.artfctdef.zvalue.medianfiltord = 9;
cfg.artfctdef.zvalue.absdiff = 'yes';
 
% make the process interactive
cfg.artfctdef.zvalue.interactive = 'yes';
 
[cfg, artifact_jump] = ft_artifact_zvalue(cfg); %plot error and error using zeros
%[cfg, artifact_jump] = ft_artifact_zvalue(cfg, data_eeg); %no plot error, but each trial has the same graph, also error using zeros


Kind regards, 
Gaëlle Leys



-----Original Message-----
From: fieldtrip <fieldtrip-bounces at science.ru.nl> On Behalf Of fieldtrip-request at science.ru.nl
Sent: zaterdag 20 juni 2020 12:00
To: fieldtrip at science.ru.nl
Subject: fieldtrip Digest, Vol 115, Issue 22

Send fieldtrip mailing list submissions to
	fieldtrip at science.ru.nl

To subscribe or unsubscribe via the World Wide Web, visit
	https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
or, via email, send a message with subject or body 'help' to
	fieldtrip-request at science.ru.nl

You can reach the person managing the list at
	fieldtrip-owner at science.ru.nl

When replying, please edit your Subject line so it is more specific than "Re: Contents of fieldtrip digest..."


Today's Topics:

   1. Errors with downsampling and artifact rejection (Gaëlle Leys)
   2. Re: Errors with downsampling and artifact rejection
      (Stephen Whitmarsh)
   3. MNI coordinates for the EEG easycap-M1 layout
      (SILVA PEREIRA, SILVANA)


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

Message: 1
Date: Fri, 19 Jun 2020 12:48:26 +0000
From: Gaëlle Leys <gaelle.leys at kuleuven.be>
To: "fieldtrip at science.ru.nl" <fieldtrip at science.ru.nl>
Subject: [FieldTrip] Errors with downsampling and artifact rejection
Message-ID:
	<ccb89b4d31af42d3b4cd22485438f4ef at ICTS-S-EXMBX17.luna.kuleuven.be>
Content-Type: text/plain; charset="iso-8859-1"

Dear Fieldtrip community,

I have recently started with Fieldtrip for my EEG data processing and I am encountering some problems which I can't seem to resolve.
I'm working with mff files from an EGI EEG system. I have no problem reading in and preprocessing the data. However, when trying to downsample and setup the automatic artifact removal, I'm getting some errors.


1)      When trying to downsample with the default options, these are the errors that I get:
Error using resample>getSamples (line 357) The number of elements of Tx must match the number of rows of X when X is a matrix

Error in resample>nonUniformResample (line 123) [x, tx] = getSamples(varargin{1:2});

Error in resample (line 116)
  [varargout{1:max(1,nargout)}] = nonUniformResample(method,varargin{:});

Error in ft_resampledata (line 228)
        newdat = transpose(resample(transpose(olddat),fsres,fsorig));

                I have tried downsampling before filtering, after filtering, on continuous data, or already segmented data. None of these things seem to resolve the error.


2)      When trying to set up the automatic artifact removal process and choosing yes for the interactive plot, I get a plotting error:

Error using plot

Vectors must be the same length.



Error in ft_artifact_zvalue>redraw_cb (line 973)

    plot(opt.h1, xval, yval, 'linestyle', '-', 'color', 'b', 'displayname', 'data');



Error in ft_artifact_zvalue (line 512)

  redraw_cb(h);

        I've noticed that the xval and yval are different numbers, which of course doesn't allow plotting. It seems like the xval changes according to the epoch length, however the yval remains the same and equals the amount of samples in my continuous data.


3)      When choosing no for the interactive plot, I also get an error:
Error using zeros
Size inputs must be integers.

Error in ft_artifact_zvalue (line 568)
dum = zeros(1,max(opt.trl(:,2)));

I've been looking into the functions and where it goes wrong, but I can't seem to pinpoint what exactly is causing these issues. Anyone here that can help or provide me some tips?

Thanks in advance!

Kind regards,

Gaëlle Leys

Research Associate
Brain & Cognition
Tiensestraat 102 box 3714
3000 Leuven
Room PSI 02.33
tel. +32 16 37 61 98

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200619/e7e1bde8/attachment-0001.htm>

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

Message: 2
Date: Fri, 19 Jun 2020 15:08:21 +0200
From: Stephen Whitmarsh <stephen.whitmarsh at gmail.com>
To: FieldTrip discussion list <fieldtrip at science.ru.nl>
Subject: Re: [FieldTrip] Errors with downsampling and artifact
	rejection
Message-ID:
	<CAFrxm=w44QZ0C7xB4cpsqdy0D0ou5UcpHNM-q3bjyaqwwJxRwg at mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Dear Gaëlle,

To understand the problem it would be helpful to have 1) description of the data structures going in ft_resampledata (just type in command line and copy-paste the output) and the artefact detection function you are using, and 2) the configuration (cfg) you are using for those functions.

Cheers,
Stephen


Op vr 19 jun. 2020 om 14:56 schreef Gaëlle Leys <gaelle.leys at kuleuven.be>:

> Dear Fieldtrip community,
>
>
>
> I have recently started with Fieldtrip for my EEG data processing and 
> I am encountering some problems which I can’t seem to resolve.
>
> I’m working with mff files from an EGI EEG system. I have no problem 
> reading in and preprocessing the data. However, when trying to 
> downsample and setup the automatic artifact removal, I’m getting some errors.
>
>
>
> 1)      When trying to downsample with the default options, these are the
> errors that I get:
>
> Error using resample>getSamples (line 357)
>
> The number of elements of Tx must match the number of rows of X when X 
> is a matrix
>
>
>
> Error in resample>nonUniformResample (line 123)
>
> [x, tx] = getSamples(varargin{1:2});
>
>
>
> Error in resample (line 116)
>
>   [varargout{1:max(1,nargout)}] = 
> nonUniformResample(method,varargin{:});
>
>
>
> Error in ft_resampledata (line 228)
>
>         newdat = transpose(resample(transpose(olddat),fsres,fsorig));
>
>
>
>                 I have tried downsampling before filtering, after 
> filtering, on continuous data, or already segmented data. None of 
> these things seem to resolve the error.
>
>
>
> 2)      When trying to set up the automatic artifact removal process and
> choosing yes for the interactive plot, I get a plotting error:
>
> Error using plot
>
> Vectors must be the same length.
>
>
>
> Error in ft_artifact_zvalue>redraw_cb (line 973)
>
>     plot(opt.h1, xval, yval, 'linestyle', '-', 'color', 'b', 
> 'displayname', 'data');
>
>
>
> Error in ft_artifact_zvalue (line 512)
>
>   redraw_cb(h);
>
>
>
>         I’ve noticed that the xval and yval are different numbers, 
> which of course doesn’t allow plotting. It seems like the xval changes 
> according to the epoch length, however the yval remains the same and 
> equals the amount of samples in my continuous data.
>
>
>
> 3)      When choosing no for the interactive plot, I also get an error:
>
> Error using zeros
>
> Size inputs must be integers.
>
>
>
> Error in ft_artifact_zvalue (line 568)
>
> dum = zeros(1,max(opt.trl(:,2)));
>
>
>
> I’ve been looking into the functions and where it goes wrong, but I 
> can’t seem to pinpoint what exactly is causing these issues. Anyone 
> here that can help or provide me some tips?
>
>
>
> Thanks in advance!
>
>
>
> Kind regards,
>
>
>
> Gaëlle Leys
>
>
>
> Research Associate
> Brain & Cognition
> Tiensestraat 102 box 3714
> 3000 Leuven
>
> Room PSI 02.33
> tel. +32 16 37 61 98
>
>
> _______________________________________________
> 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/20200619/137e31b1/attachment-0001.htm>

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

Message: 3
Date: Fri, 19 Jun 2020 18:58:36 +0200
From: "SILVA PEREIRA, SILVANA" <silvana.silva at upf.edu>
To: fieldtrip at science.ru.nl
Subject: [FieldTrip] MNI coordinates for the EEG easycap-M1 layout
Message-ID:
	<CA+_MWm1NufDWa-fjR71OzQ5ab88ioyUT8OJ-QFYX9ABr7gNQrA at mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Dear community,

I've been struggling to find the 3D positions (montages) for the
Acticap-64ch-standard2 on the web, which is a modified version of the easycap-M1, but I have not succeeded. In the Fieldtrip page http://www.fieldtriptoolbox.org/template/electrode/ you have the following:

You can find the template 3-D electrode sets included in FieldTrip here <https://github.com/fieldtrip/fieldtrip/tree/master/template/electrode>.

But in that link you only find a txt file with theta-phi coordinates (easycap-M1.txt). Is there any place where I could find these positions in MNI space?

Thank you and best regards,
Silvana
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200619/c0adf7df/attachment-0001.htm>

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

Subject: Digest Footer

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


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

End of fieldtrip Digest, Vol 115, Issue 22
******************************************



From stephen.whitmarsh at gmail.com  Mon Jun 22 17:35:42 2020
From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh)
Date: Mon, 22 Jun 2020 17:35:42 +0200
Subject: [FieldTrip] Errors with downsampling and artifact rejection
In-Reply-To: <a967d7106acf41d182449785c9466db7@ICTS-S-EXMBX17.luna.kuleuven.be>
References: <a967d7106acf41d182449785c9466db7@ICTS-S-EXMBX17.luna.kuleuven.be>
Message-ID: <CAFrxm=wFXM-y1XBHbrVCTPwgjD2OWSG0c3Wx+v=Roiy7dprdPA@mail.gmail.com>

Dear Gaëlle,

You are using default settings for downsampling, which will then try to
downsample to 256Hz. Your original samplerate is 1000Hz, so that isn't a
neat integer division.
I tried the following, and could reproduce your problem:

Fs = 1000;
data_eeg = [];
data_eeg.label = {'a','b','c'};
data_eeg.time{1} = 0:1/Fs:10;
data_eeg.trial{1} = rand(length(data_eeg.label),length(data_eeg.time{1}));
data_eeg.Fs = Fs;
data_eeg.sampleinfo = [1, length(data_eeg.time{1})];

% Doesn't work:
cfg = [];
[data_eeg] = ft_resampledata(cfg, data_eeg);

% Does work:
cfg = [];
cfg.resamplefs = 250;
[data_eeg] = ft_resampledata(cfg, data_eeg);

So that deals with your first problem. Not sure why it has a problem with
the downsampling to non-integer values, but it's good practice and much
faster to stick to that anyway.

Not sure what to do with the artefact detection though, or what you
expect;  it seems you are running it with some contradictory settings/ways
perhaps:
- use cfg.dataset if reading from disk directly OR give datastructure to
function is you already have data in memory
- use cfg.continuous when data is not segmented
- the comment "jump" suggests you use settings for SQUID jumps, i.e.
optimized for MEG, but that should not give an error :-)

I suspect you probably want to run artefact detection on your
segmented data, so remove those references to the data on disk (datafile,
headerfile), and the trl from the cfg, and give your segmented data as an
argument as you did here:
%[cfg, artifact_jump] = ft_artifact_zvalue(cfg, data_eeg); %no plot error,
but each trial has the same graph, also error using zeros

Let us know how it goes,

All the best,
Stephen











Op ma 22 jun. 2020 om 17:02 schreef Gaëlle Leys <gaelle.leys at kuleuven.be>:

> Dear Stephen,
>
> I have included the data structures and cfg's involved in the functions.
>
> 1)      A. data structure for resampling data (raw data after reading it
> in):
> data_eeg =
>   struct with fields:
> hdr: [1×1 struct]
> label: {129×1 cell}
> time: {[1×245726 double]}
> trial: {[129×245726 double]}
> fsample: 1000
> sampleinfo: [1 245726]
> elec: [1×1 struct]
> cfg: [1×1 struct]
>
> 1)      B. cfg for resampling data (I’m using all the default options for
> resampling):
>
> Cfg=[];
> [data_eeg] = ft_resampledata(cfg, data_eeg); % defaults are all OK
>
> 2)      A. data structure for artifact rejection (my data already epoched):
> data_eeg =
> struct with fields:
> hdr: [1×1 struct]
> label: {129×1 cell}
>  time: {1×108 cell}
>  trial: {1×108 cell}
>  fsample: 1000
>  sampleinfo: [108×2 double]
>  elec: [1×1 struct]
>  cfg: [1×1 struct]
>
>
> 2)      B. cfg for artifact rejection (taken from the automatic artifact
> rejection example):
> % jump
> cfg = [];
> cfg.trl = trl;
> cfg.datafile = '100_1_20200305.mff';
> cfg.headerfile = '100_1_20200305.mff';
> cfg.continuous = 'yes';
>
> % channel selection, cutoff and padding
> cfg.artfctdef.zvalue.channel = 'EEG';
> cfg.artfctdef.zvalue.cutoff = 20;
> cfg.artfctdef.zvalue.trlpadding = 0;
> cfg.artfctdef.zvalue.artpadding = 0;
> cfg.artfctdef.zvalue.fltpadding = 0;
>
> % algorithmic parameters
> cfg.artfctdef.zvalue.cumulative = 'yes';
> cfg.artfctdef.zvalue.medianfilter = 'yes';
> cfg.artfctdef.zvalue.medianfiltord = 9;
> cfg.artfctdef.zvalue.absdiff = 'yes';
>
> % make the process interactive
> cfg.artfctdef.zvalue.interactive = 'yes';
>
> [cfg, artifact_jump] = ft_artifact_zvalue(cfg); %plot error and error
> using zeros
> %[cfg, artifact_jump] = ft_artifact_zvalue(cfg, data_eeg); %no plot error,
> but each trial has the same graph, also error using zeros
>
>
> Kind regards,
> Gaëlle Leys
>
>
>
> -----Original Message-----
> From: fieldtrip <fieldtrip-bounces at science.ru.nl> On Behalf Of
> fieldtrip-request at science.ru.nl
> Sent: zaterdag 20 juni 2020 12:00
> To: fieldtrip at science.ru.nl
> Subject: fieldtrip Digest, Vol 115, Issue 22
>
> Send fieldtrip mailing list submissions to
>         fieldtrip at science.ru.nl
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> or, via email, send a message with subject or body 'help' to
>         fieldtrip-request at science.ru.nl
>
> You can reach the person managing the list at
>         fieldtrip-owner at science.ru.nl
>
> When replying, please edit your Subject line so it is more specific than
> "Re: Contents of fieldtrip digest..."
>
>
> Today's Topics:
>
>    1. Errors with downsampling and artifact rejection (Gaëlle Leys)
>    2. Re: Errors with downsampling and artifact rejection
>       (Stephen Whitmarsh)
>    3. MNI coordinates for the EEG easycap-M1 layout
>       (SILVA PEREIRA, SILVANA)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 19 Jun 2020 12:48:26 +0000
> From: Gaëlle Leys <gaelle.leys at kuleuven.be>
> To: "fieldtrip at science.ru.nl" <fieldtrip at science.ru.nl>
> Subject: [FieldTrip] Errors with downsampling and artifact rejection
> Message-ID:
>         <ccb89b4d31af42d3b4cd22485438f4ef at ICTS-S-EXMBX17.luna.kuleuven.be>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Dear Fieldtrip community,
>
> I have recently started with Fieldtrip for my EEG data processing and I am
> encountering some problems which I can't seem to resolve.
> I'm working with mff files from an EGI EEG system. I have no problem
> reading in and preprocessing the data. However, when trying to downsample
> and setup the automatic artifact removal, I'm getting some errors.
>
>
> 1)      When trying to downsample with the default options, these are the
> errors that I get:
> Error using resample>getSamples (line 357) The number of elements of Tx
> must match the number of rows of X when X is a matrix
>
> Error in resample>nonUniformResample (line 123) [x, tx] =
> getSamples(varargin{1:2});
>
> Error in resample (line 116)
>   [varargout{1:max(1,nargout)}] = nonUniformResample(method,varargin{:});
>
> Error in ft_resampledata (line 228)
>         newdat = transpose(resample(transpose(olddat),fsres,fsorig));
>
>                 I have tried downsampling before filtering, after
> filtering, on continuous data, or already segmented data. None of these
> things seem to resolve the error.
>
>
> 2)      When trying to set up the automatic artifact removal process and
> choosing yes for the interactive plot, I get a plotting error:
>
> Error using plot
>
> Vectors must be the same length.
>
>
>
> Error in ft_artifact_zvalue>redraw_cb (line 973)
>
>     plot(opt.h1, xval, yval, 'linestyle', '-', 'color', 'b',
> 'displayname', 'data');
>
>
>
> Error in ft_artifact_zvalue (line 512)
>
>   redraw_cb(h);
>
>         I've noticed that the xval and yval are different numbers, which
> of course doesn't allow plotting. It seems like the xval changes according
> to the epoch length, however the yval remains the same and equals the
> amount of samples in my continuous data.
>
>
> 3)      When choosing no for the interactive plot, I also get an error:
> Error using zeros
> Size inputs must be integers.
>
> Error in ft_artifact_zvalue (line 568)
> dum = zeros(1,max(opt.trl(:,2)));
>
> I've been looking into the functions and where it goes wrong, but I can't
> seem to pinpoint what exactly is causing these issues. Anyone here that can
> help or provide me some tips?
>
> Thanks in advance!
>
> Kind regards,
>
> Gaëlle Leys
>
> Research Associate
> Brain & Cognition
> Tiensestraat 102 box 3714
> 3000 Leuven
> Room PSI 02.33
> tel. +32 16 37 61 98
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200619/e7e1bde8/attachment-0001.htm
> >
>
> ------------------------------
>
> Message: 2
> Date: Fri, 19 Jun 2020 15:08:21 +0200
> From: Stephen Whitmarsh <stephen.whitmarsh at gmail.com>
> To: FieldTrip discussion list <fieldtrip at science.ru.nl>
> Subject: Re: [FieldTrip] Errors with downsampling and artifact
>         rejection
> Message-ID:
>         <CAFrxm=
> w44QZ0C7xB4cpsqdy0D0ou5UcpHNM-q3bjyaqwwJxRwg at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Dear Gaëlle,
>
> To understand the problem it would be helpful to have 1) description of
> the data structures going in ft_resampledata (just type in command line and
> copy-paste the output) and the artefact detection function you are using,
> and 2) the configuration (cfg) you are using for those functions.
>
> Cheers,
> Stephen
>
>
> Op vr 19 jun. 2020 om 14:56 schreef Gaëlle Leys <gaelle.leys at kuleuven.be>:
>
> > Dear Fieldtrip community,
> >
> >
> >
> > I have recently started with Fieldtrip for my EEG data processing and
> > I am encountering some problems which I can’t seem to resolve.
> >
> > I’m working with mff files from an EGI EEG system. I have no problem
> > reading in and preprocessing the data. However, when trying to
> > downsample and setup the automatic artifact removal, I’m getting some
> errors.
> >
> >
> >
> > 1)      When trying to downsample with the default options, these are the
> > errors that I get:
> >
> > Error using resample>getSamples (line 357)
> >
> > The number of elements of Tx must match the number of rows of X when X
> > is a matrix
> >
> >
> >
> > Error in resample>nonUniformResample (line 123)
> >
> > [x, tx] = getSamples(varargin{1:2});
> >
> >
> >
> > Error in resample (line 116)
> >
> >   [varargout{1:max(1,nargout)}] =
> > nonUniformResample(method,varargin{:});
> >
> >
> >
> > Error in ft_resampledata (line 228)
> >
> >         newdat = transpose(resample(transpose(olddat),fsres,fsorig));
> >
> >
> >
> >                 I have tried downsampling before filtering, after
> > filtering, on continuous data, or already segmented data. None of
> > these things seem to resolve the error.
> >
> >
> >
> > 2)      When trying to set up the automatic artifact removal process and
> > choosing yes for the interactive plot, I get a plotting error:
> >
> > Error using plot
> >
> > Vectors must be the same length.
> >
> >
> >
> > Error in ft_artifact_zvalue>redraw_cb (line 973)
> >
> >     plot(opt.h1, xval, yval, 'linestyle', '-', 'color', 'b',
> > 'displayname', 'data');
> >
> >
> >
> > Error in ft_artifact_zvalue (line 512)
> >
> >   redraw_cb(h);
> >
> >
> >
> >         I’ve noticed that the xval and yval are different numbers,
> > which of course doesn’t allow plotting. It seems like the xval changes
> > according to the epoch length, however the yval remains the same and
> > equals the amount of samples in my continuous data.
> >
> >
> >
> > 3)      When choosing no for the interactive plot, I also get an error:
> >
> > Error using zeros
> >
> > Size inputs must be integers.
> >
> >
> >
> > Error in ft_artifact_zvalue (line 568)
> >
> > dum = zeros(1,max(opt.trl(:,2)));
> >
> >
> >
> > I’ve been looking into the functions and where it goes wrong, but I
> > can’t seem to pinpoint what exactly is causing these issues. Anyone
> > here that can help or provide me some tips?
> >
> >
> >
> > Thanks in advance!
> >
> >
> >
> > Kind regards,
> >
> >
> >
> > Gaëlle Leys
> >
> >
> >
> > Research Associate
> > Brain & Cognition
> > Tiensestraat 102 box 3714
> > 3000 Leuven
> >
> > Room PSI 02.33
> > tel. +32 16 37 61 98
> >
> >
> > _______________________________________________
> > 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/20200619/137e31b1/attachment-0001.htm
> >
>
> ------------------------------
>
> Message: 3
> Date: Fri, 19 Jun 2020 18:58:36 +0200
> From: "SILVA PEREIRA, SILVANA" <silvana.silva at upf.edu>
> To: fieldtrip at science.ru.nl
> Subject: [FieldTrip] MNI coordinates for the EEG easycap-M1 layout
> Message-ID:
>         <
> CA+_MWm1NufDWa-fjR71OzQ5ab88ioyUT8OJ-QFYX9ABr7gNQrA at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Dear community,
>
> I've been struggling to find the 3D positions (montages) for the
> Acticap-64ch-standard2 on the web, which is a modified version of the
> easycap-M1, but I have not succeeded. In the Fieldtrip page
> http://www.fieldtriptoolbox.org/template/electrode/ you have the
> following:
>
> You can find the template 3-D electrode sets included in FieldTrip here <
> https://github.com/fieldtrip/fieldtrip/tree/master/template/electrode>.
>
> But in that link you only find a txt file with theta-phi coordinates
> (easycap-M1.txt). Is there any place where I could find these positions in
> MNI space?
>
> Thank you and best regards,
> Silvana
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200619/c0adf7df/attachment-0001.htm
> >
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202
>
>
> ------------------------------
>
> End of fieldtrip Digest, Vol 115, Issue 22
> ******************************************
>
> _______________________________________________
> 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/20200622/3ef1e021/attachment.htm>

From rene.andrade at edu.uah.es  Mon Jun 22 23:38:39 2020
From: rene.andrade at edu.uah.es (=?utf-8?B?QW5kcmFkZSBSZXkgUmVuw6k=?=)
Date: Mon, 22 Jun 2020 21:38:39 +0000
Subject: [FieldTrip] fieldtrip Digest, Vol 115, Issue 23
In-Reply-To: <mailman.9.1592820002.25395.fieldtrip@science.ru.nl>
References: <mailman.9.1592820002.25395.fieldtrip@science.ru.nl>
Message-ID: <0CED8809-357C-49C1-B255-9CCE26A7EC75@edu.uah.es>

Is it normal that 16GB of RAM aren't sufficient for a normal EEG? May be I am doing something wrong and that is the reason my RAM isn't enough.

Sent from my iPhone

> On 22 Jun 2020, at 12:16, "fieldtrip-request at science.ru.nl" <fieldtrip-request at science.ru.nl> wrote:
> 
> ﻿Send fieldtrip mailing list submissions to
>    fieldtrip at science.ru.nl
> 
> To subscribe or unsubscribe via the World Wide Web, visit
>    https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> or, via email, send a message with subject or body 'help' to
>    fieldtrip-request at science.ru.nl
> 
> You can reach the person managing the list at
>    fieldtrip-owner at science.ru.nl
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of fieldtrip digest..."
> 
> 
> Today's Topics:
> 
>   1. Running out of memory (RAM) (Andrade Rey René)
>   2. Re: Running out of memory (RAM) (Schoffelen, J.M. (Jan Mathijs))
>   3. Re: DICS question (Schoffelen, J.M. (Jan Mathijs))
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Sun, 21 Jun 2020 20:34:49 +0000
> From: Andrade Rey René <rene.andrade at edu.uah.es>
> To: "fieldtrip at science.ru.nl" <fieldtrip at science.ru.nl>
> Subject: [FieldTrip] Running out of memory (RAM)
> Message-ID: <C30BBEE6-8A40-4668-8F48-E8244C205963 at edu.uah.es>
> Content-Type: text/plain; charset="utf-8"
> 
> Dear experts:
> I am running this code
> 
> 
> cfg = [];
> cfg.headmodel = headmodel;
> cfg.sourcemodel = leadfield;
> cfg.method = 'lcmv';
> cfg.lcmv.projectmom = 'yes'; % project dipole time series in direction of maximal power (see below)
> cfg.lcmv.kurtosis = 'yes'; % compute kurtosis at each location
> source = ft_sourceanalysis(cfg, cov_matrix);
> 
> Of http://www.fieldtriptoolbox.org/tutorial/epilepsy/. And I think  I run out of memory because with “top” I can see the computer stops responding when near 85% of RAM memory(16GB).
> 
> I cannot report any error because the only problem seems to be that either wrong code or wrong data or I don’t know.
> 
> Best,
> Andrade.
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200621/8b61eaac/attachment-0001.htm>
> 
> ------------------------------
> 
> Message: 2
> Date: Mon, 22 Jun 2020 06:51:30 +0000
> From: "Schoffelen, J.M. (Jan Mathijs)" <jan.schoffelen at donders.ru.nl>
> To: FieldTrip discussion list <fieldtrip at science.ru.nl>
> Subject: Re: [FieldTrip] Running out of memory (RAM)
> Message-ID: <308CD012-C138-486C-9B4C-E7F7487D3426 at donders.ru.nl>
> Content-Type: text/plain; charset="utf-8"
> 
> Dear Andrade,
> 
> Without any more specific information, the only meaningful comment that can be given here, is ‘get yourself a more powerful computer’.
> 
> Memory usage depends highly on the operating system (in particular: matlab on windows machines used to be much less memory friendly, but it’s been a while that I have been running real computations on a window machine so perhaps this has changed), the total size of all variables that need to be kept in memory, etc.
> 
> Best wishes,
> Jan-Mathijs
> 
> 
> 
> On 21 Jun 2020, at 22:34, Andrade Rey René <rene.andrade at edu.uah.es<mailto:rene.andrade at edu.uah.es>> wrote:
> 
> Dear experts:
> I am running this code
> 
> 
> cfg = [];
> cfg.headmodel = headmodel;
> cfg.sourcemodel = leadfield;
> cfg.method = 'lcmv';
> cfg.lcmv.projectmom = 'yes'; % project dipole time series in direction of maximal power (see below)
> cfg.lcmv.kurtosis = 'yes'; % compute kurtosis at each location
> source = ft_sourceanalysis(cfg, cov_matrix);
> 
> Of http://www.fieldtriptoolbox.org/tutorial/epilepsy/. And I think  I run out of memory because with “top” I can see the computer stops responding when near 85% of RAM memory(16GB).
> 
> I cannot report any error because the only problem seems to be that either wrong code or wrong data or I don’t know.
> 
> Best,
> Andrade.
> _______________________________________________
> 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/20200622/2a12ebf1/attachment-0001.htm>
> 
> ------------------------------
> 
> Message: 3
> Date: Mon, 22 Jun 2020 07:52:03 +0000
> From: "Schoffelen, J.M. (Jan Mathijs)" <jan.schoffelen at donders.ru.nl>
> To: FieldTrip discussion list <fieldtrip at science.ru.nl>
> Cc: Sanjeev Nara <s.nara at bcbl.eu>, "m.lizarazu at bcbl.eu"
>    <m.lizarazu at bcbl.eu>,  Nicola Molinaro <nicolaml at gmail.com>, Craig
>    Richter <craiggrichter at gmail.com>
> Subject: Re: [FieldTrip] DICS question
> Message-ID: <40F6A2CA-6DB9-453A-B33B-6E2413DA4EA8 at donders.ru.nl>
> Content-Type: text/plain; charset="utf-8"
> 
> Dear Craig,
> 
> Let me forward this e-mail to the discussion list, in order to widen the scope to all of Donostia and beyond.
> 
> Indeed, the estimation of spectrally resolved GC requires a full bandwidth signal. I have not extensively played with the different options here, but the scenario that you describe, i.e. compute a DICS spatial filter on a narrow bandwidth-of-interest signal, and subjecting the broadband sensor signals to this spatial filter, will, in my opinion, not be really optimal. The reason for this is that the beamformer then can only suppress interference from that particular bandwidth. Signal components that lie outside this range might still leak into the estimated time courses, which may lead to distortion and invalid GC estimates.
> 
> So, if you would be using an LCMV beamformer, I’d always recommend a broadband spatial filter, optionally on mildly highpass-filtered data. Then, the risk could be that the 1/f characteristic of the signals results in a covariance matrix whose signal components are dominated by low-frequency stuff. One could then worry about suboptimal spatial filtering of the higher frequency components. This is probably true, and I have worried about this myself, but in my experience this is the least of the worries one should have. (as a side note: I have played around with spectral whitening of the data prior to the beamforming. The reasoning behind this is that the individual variance components in the data are more evenly balanced across the frequency range, but the long story short is that this does not seem to influence the final GC estimate).
> 
> A larger worry would be the fact that source-estimated GC spectra very often have a canonical shape, unless you use extremely well-defined data such a visual attention experiment that induces strong gamma band oscillations. If you are into applying connectivity analysis in a more ethereal context, such as a cognitive or language experiment, you will see that source-level GC spectra will be always dominated by the low-frequency components (i.e. most of the time you’ll find a large peak at low frequencies). This of course can reflect genuine neuronal coupling, but my suspicion is that this is most of the time due to ‘weak signal asymmetries’, in other words due to asymmetries in SNR and location specific leakage of power. This can be further investigated using time-flipping and an appropriate statistical evaluation. For inspiration, you can of course always consult my 2017 PNAS paper :).
> 
> Another worry of course would be the fact that you’d be working with Elekta data :).
> 
> Practically, what I typically do, is to compute the broadband spatial filter with LCMV, and apply these filters (as is, or dimensionality reduced after a parcellation step) to the sensor level cross-spectral density data (from DC to Nyquist). The spectral factorization algorithm should be applied to the source-level data, which in my experience is most stable if you do this pairwise. I know that this is suboptimal in the context of an interpretation of direct versus indirect interactions, but I have always found this an argument that is part of a non-discussion at this stage of the analysis. One should first trust the estimates overall, before a discussion about direct versus indirect coupling becomes relevant.
> 
> Best wishes,
> JM
> 
> 
> 
> 
> 
> 
> 
> 
> On 19 Jun 2020, at 18:06, Craig Richter <craiggrichter at gmail.com<mailto:craiggrichter at gmail.com>> wrote:
> 
> Hey JM,
> 
> How’s it going? Covid treating you ok? Been a bit crazy here, but normalcy is resuming.
> 
> I have a question about DICS for you… :-/... Anyhow, so for coherence at a given frequency DICS is superior, since the spatial-filter is specific to that frequency, which is about the same as a building a noise-covariance matrix from a narrow-band filtered signal? But to do source-level GC, we need the broadband time-series, so we’re forced to use the unfiltered data and LCMV. But… what if we know the frequency we want to analyse, so we build the spatial filter on this frequency, or narrow-band filtered data, then compute virtual time series from the raw data, and compute GC. Then we simply look at our frequency of interest in the spectral results. Would this potentially generate a better GC estimate at the frequency of interest, or would it just mess everything up?
> 
> PS - I’ve cc’ed some other interested folks.
> 
> Thanks!
> 
> C.
> 
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200622/1a7e6793/attachment-0001.htm>
> 
> ------------------------------
> 
> Subject: Digest Footer
> 
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202
> 
> 
> ------------------------------
> 
> End of fieldtrip Digest, Vol 115, Issue 23
> ******************************************



From jan.schoffelen at donders.ru.nl  Tue Jun 23 08:42:03 2020
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Tue, 23 Jun 2020 06:42:03 +0000
Subject: [FieldTrip] Errors with downsampling and artifact rejection
In-Reply-To: <CAFrxm=wFXM-y1XBHbrVCTPwgjD2OWSG0c3Wx+v=Roiy7dprdPA@mail.gmail.com>
References: <a967d7106acf41d182449785c9466db7@ICTS-S-EXMBX17.luna.kuleuven.be>
 <CAFrxm=wFXM-y1XBHbrVCTPwgjD2OWSG0c3Wx+v=Roiy7dprdPA@mail.gmail.com>
Message-ID: <184602F0-A203-406F-B278-32CD899D4532@donders.ru.nl>

Hi Gaëlle,

Adding to Stephen’s comment: reading through the code and comments (highly recommended to occasionally do this, then you get a feel what’s going on under the hood) I saw that there’s a discrepancy between the comments in the help section of ft_resampledata, where it states that the default resamplefs=256, and the actually implemented default resamplefs, which is []. Apparently, MATLAB is lenient with respect to mathematical operations involving empty variables. Specifically, it doesn’t throw an error on lines 160/161 in ft_resampledata, where an empty variable is multiplied and divided by a scalar. Long story short, the silently accepted empty variable is the acual cause of the reported problem in ft_resampledata.

I look forward to a PR that fixes this. I suggest making the documentation consistent, i.e. stating that cfg.resamplefs is an argument that needs to be defined, and explicitly check this in the code, i.e. throw an error if it isn’t defined. This is typically done with a call to ft_checkconfig using the key-value pair ‘required’, and ‘resamplefs’ (in this case).

Thanks for your contribution,

Jan-Mathijs





On 22 Jun 2020, at 17:35, Stephen Whitmarsh <stephen.whitmarsh at gmail.com<mailto:stephen.whitmarsh at gmail.com>> wrote:

Dear Gaëlle,

You are using default settings for downsampling, which will then try to downsample to 256Hz. Your original samplerate is 1000Hz, so that isn't a neat integer division.
I tried the following, and could reproduce your problem:

Fs = 1000;
data_eeg = [];
data_eeg.label = {'a','b','c'};
data_eeg.time{1} = 0:1/Fs:10;
data_eeg.trial{1} = rand(length(data_eeg.label),length(data_eeg.time{1}));
data_eeg.Fs = Fs;
data_eeg.sampleinfo = [1, length(data_eeg.time{1})];

% Doesn't work:
cfg = [];
[data_eeg] = ft_resampledata(cfg, data_eeg);

% Does work:
cfg = [];
cfg.resamplefs = 250;
[data_eeg] = ft_resampledata(cfg, data_eeg);

So that deals with your first problem. Not sure why it has a problem with the downsampling to non-integer values, but it's good practice and much faster to stick to that anyway.

Not sure what to do with the artefact detection though, or what you expect;  it seems you are running it with some contradictory settings/ways perhaps:
- use cfg.dataset if reading from disk directly OR give datastructure to function is you already have data in memory
- use cfg.continuous when data is not segmented
- the comment "jump" suggests you use settings for SQUID jumps, i.e. optimized for MEG, but that should not give an error :-)

I suspect you probably want to run artefact detection on your segmented data, so remove those references to the data on disk (datafile, headerfile), and the trl from the cfg, and give your segmented data as an argument as you did here:
%[cfg, artifact_jump] = ft_artifact_zvalue(cfg, data_eeg); %no plot error, but each trial has the same graph, also error using zeros

Let us know how it goes,

All the best,
Stephen











Op ma 22 jun. 2020 om 17:02 schreef Gaëlle Leys <gaelle.leys at kuleuven.be<mailto:gaelle.leys at kuleuven.be>>:
Dear Stephen,

I have included the data structures and cfg's involved in the functions.

1)      A. data structure for resampling data (raw data after reading it in):
data_eeg =
  struct with fields:
hdr: [1×1 struct]
label: {129×1 cell}
time: {[1×245726 double]}
trial: {[129×245726 double]}
fsample: 1000
sampleinfo: [1 245726]
elec: [1×1 struct]
cfg: [1×1 struct]

1)      B. cfg for resampling data (I’m using all the default options for resampling):

Cfg=[];
[data_eeg] = ft_resampledata(cfg, data_eeg); % defaults are all OK

2)      A. data structure for artifact rejection (my data already epoched):
data_eeg =
struct with fields:
hdr: [1×1 struct]
label: {129×1 cell}
 time: {1×108 cell}
 trial: {1×108 cell}
 fsample: 1000
 sampleinfo: [108×2 double]
 elec: [1×1 struct]
 cfg: [1×1 struct]


2)      B. cfg for artifact rejection (taken from the automatic artifact rejection example):
% jump
cfg = [];
cfg.trl = trl;
cfg.datafile = '100_1_20200305.mff';
cfg.headerfile = '100_1_20200305.mff';
cfg.continuous = 'yes';

% channel selection, cutoff and padding
cfg.artfctdef.zvalue.channel = 'EEG';
cfg.artfctdef.zvalue.cutoff = 20;
cfg.artfctdef.zvalue.trlpadding = 0;
cfg.artfctdef.zvalue.artpadding = 0;
cfg.artfctdef.zvalue.fltpadding = 0;

% algorithmic parameters
cfg.artfctdef.zvalue.cumulative = 'yes';
cfg.artfctdef.zvalue.medianfilter = 'yes';
cfg.artfctdef.zvalue.medianfiltord = 9;
cfg.artfctdef.zvalue.absdiff = 'yes';

% make the process interactive
cfg.artfctdef.zvalue.interactive = 'yes';

[cfg, artifact_jump] = ft_artifact_zvalue(cfg); %plot error and error using zeros
%[cfg, artifact_jump] = ft_artifact_zvalue(cfg, data_eeg); %no plot error, but each trial has the same graph, also error using zeros


Kind regards,
Gaëlle Leys



-----Original Message-----
From: fieldtrip <fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl>> On Behalf Of fieldtrip-request at science.ru.nl<mailto:fieldtrip-request at science.ru.nl>
Sent: zaterdag 20 juni 2020 12:00
To: fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>
Subject: fieldtrip Digest, Vol 115, Issue 22

Send fieldtrip mailing list submissions to
        fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>

To subscribe or unsubscribe via the World Wide Web, visit
        https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
or, via email, send a message with subject or body 'help' to
        fieldtrip-request at science.ru.nl<mailto:fieldtrip-request at science.ru.nl>

You can reach the person managing the list at
        fieldtrip-owner at science.ru.nl<mailto:fieldtrip-owner at science.ru.nl>

When replying, please edit your Subject line so it is more specific than "Re: Contents of fieldtrip digest..."


Today's Topics:

   1. Errors with downsampling and artifact rejection (Gaëlle Leys)
   2. Re: Errors with downsampling and artifact rejection
      (Stephen Whitmarsh)
   3. MNI coordinates for the EEG easycap-M1 layout
      (SILVA PEREIRA, SILVANA)


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

Message: 1
Date: Fri, 19 Jun 2020 12:48:26 +0000
From: Gaëlle Leys <gaelle.leys at kuleuven.be<mailto:gaelle.leys at kuleuven.be>>
To: "fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>" <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>>
Subject: [FieldTrip] Errors with downsampling and artifact rejection
Message-ID:
        <ccb89b4d31af42d3b4cd22485438f4ef at ICTS-S-EXMBX17.luna.kuleuven.be<mailto:ccb89b4d31af42d3b4cd22485438f4ef at ICTS-S-EXMBX17.luna.kuleuven.be>>
Content-Type: text/plain; charset="iso-8859-1"

Dear Fieldtrip community,

I have recently started with Fieldtrip for my EEG data processing and I am encountering some problems which I can't seem to resolve.
I'm working with mff files from an EGI EEG system. I have no problem reading in and preprocessing the data. However, when trying to downsample and setup the automatic artifact removal, I'm getting some errors.


1)      When trying to downsample with the default options, these are the errors that I get:
Error using resample>getSamples (line 357) The number of elements of Tx must match the number of rows of X when X is a matrix

Error in resample>nonUniformResample (line 123) [x, tx] = getSamples(varargin{1:2});

Error in resample (line 116)
  [varargout{1:max(1,nargout)}] = nonUniformResample(method,varargin{:});

Error in ft_resampledata (line 228)
        newdat = transpose(resample(transpose(olddat),fsres,fsorig));

                I have tried downsampling before filtering, after filtering, on continuous data, or already segmented data. None of these things seem to resolve the error.


2)      When trying to set up the automatic artifact removal process and choosing yes for the interactive plot, I get a plotting error:

Error using plot

Vectors must be the same length.



Error in ft_artifact_zvalue>redraw_cb (line 973)

    plot(opt.h1, xval, yval, 'linestyle', '-', 'color', 'b', 'displayname', 'data');



Error in ft_artifact_zvalue (line 512)

  redraw_cb(h);

        I've noticed that the xval and yval are different numbers, which of course doesn't allow plotting. It seems like the xval changes according to the epoch length, however the yval remains the same and equals the amount of samples in my continuous data.


3)      When choosing no for the interactive plot, I also get an error:
Error using zeros
Size inputs must be integers.

Error in ft_artifact_zvalue (line 568)
dum = zeros(1,max(opt.trl(:,2)));

I've been looking into the functions and where it goes wrong, but I can't seem to pinpoint what exactly is causing these issues. Anyone here that can help or provide me some tips?

Thanks in advance!

Kind regards,

Gaëlle Leys

Research Associate
Brain & Cognition
Tiensestraat 102 box 3714
3000 Leuven
Room PSI 02.33
tel. +32 16 37 61 98

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200619/e7e1bde8/attachment-0001.htm>

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

Message: 2
Date: Fri, 19 Jun 2020 15:08:21 +0200
From: Stephen Whitmarsh <stephen.whitmarsh at gmail.com<mailto:stephen.whitmarsh at gmail.com>>
To: FieldTrip discussion list <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>>
Subject: Re: [FieldTrip] Errors with downsampling and artifact
        rejection
Message-ID:
        <CAFrxm=w44QZ0C7xB4cpsqdy0D0ou5UcpHNM-q3bjyaqwwJxRwg at mail.gmail.com<mailto:w44QZ0C7xB4cpsqdy0D0ou5UcpHNM-q3bjyaqwwJxRwg at mail.gmail.com>>
Content-Type: text/plain; charset="utf-8"

Dear Gaëlle,

To understand the problem it would be helpful to have 1) description of the data structures going in ft_resampledata (just type in command line and copy-paste the output) and the artefact detection function you are using, and 2) the configuration (cfg) you are using for those functions.

Cheers,
Stephen


Op vr 19 jun. 2020 om 14:56 schreef Gaëlle Leys <gaelle.leys at kuleuven.be<mailto:gaelle.leys at kuleuven.be>>:

> Dear Fieldtrip community,
>
>
>
> I have recently started with Fieldtrip for my EEG data processing and
> I am encountering some problems which I can’t seem to resolve.
>
> I’m working with mff files from an EGI EEG system. I have no problem
> reading in and preprocessing the data. However, when trying to
> downsample and setup the automatic artifact removal, I’m getting some errors.
>
>
>
> 1)      When trying to downsample with the default options, these are the
> errors that I get:
>
> Error using resample>getSamples (line 357)
>
> The number of elements of Tx must match the number of rows of X when X
> is a matrix
>
>
>
> Error in resample>nonUniformResample (line 123)
>
> [x, tx] = getSamples(varargin{1:2});
>
>
>
> Error in resample (line 116)
>
>   [varargout{1:max(1,nargout)}] =
> nonUniformResample(method,varargin{:});
>
>
>
> Error in ft_resampledata (line 228)
>
>         newdat = transpose(resample(transpose(olddat),fsres,fsorig));
>
>
>
>                 I have tried downsampling before filtering, after
> filtering, on continuous data, or already segmented data. None of
> these things seem to resolve the error.
>
>
>
> 2)      When trying to set up the automatic artifact removal process and
> choosing yes for the interactive plot, I get a plotting error:
>
> Error using plot
>
> Vectors must be the same length.
>
>
>
> Error in ft_artifact_zvalue>redraw_cb (line 973)
>
>     plot(opt.h1, xval, yval, 'linestyle', '-', 'color', 'b',
> 'displayname', 'data');
>
>
>
> Error in ft_artifact_zvalue (line 512)
>
>   redraw_cb(h);
>
>
>
>         I’ve noticed that the xval and yval are different numbers,
> which of course doesn’t allow plotting. It seems like the xval changes
> according to the epoch length, however the yval remains the same and
> equals the amount of samples in my continuous data.
>
>
>
> 3)      When choosing no for the interactive plot, I also get an error:
>
> Error using zeros
>
> Size inputs must be integers.
>
>
>
> Error in ft_artifact_zvalue (line 568)
>
> dum = zeros(1,max(opt.trl(:,2)));
>
>
>
> I’ve been looking into the functions and where it goes wrong, but I
> can’t seem to pinpoint what exactly is causing these issues. Anyone
> here that can help or provide me some tips?
>
>
>
> Thanks in advance!
>
>
>
> Kind regards,
>
>
>
> Gaëlle Leys
>
>
>
> Research Associate
> Brain & Cognition
> Tiensestraat 102 box 3714
> 3000 Leuven
>
> Room PSI 02.33
> tel. +32 16 37 61 98
>
>
> _______________________________________________
> 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/20200619/137e31b1/attachment-0001.htm>

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

Message: 3
Date: Fri, 19 Jun 2020 18:58:36 +0200
From: "SILVA PEREIRA, SILVANA" <silvana.silva at upf.edu<mailto:silvana.silva at upf.edu>>
To: fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>
Subject: [FieldTrip] MNI coordinates for the EEG easycap-M1 layout
Message-ID:
        <CA+_MWm1NufDWa-fjR71OzQ5ab88ioyUT8OJ-QFYX9ABr7gNQrA at mail.gmail.com<mailto:CA%2B_MWm1NufDWa-fjR71OzQ5ab88ioyUT8OJ-QFYX9ABr7gNQrA at mail.gmail.com>>
Content-Type: text/plain; charset="utf-8"

Dear community,

I've been struggling to find the 3D positions (montages) for the
Acticap-64ch-standard2 on the web, which is a modified version of the easycap-M1, but I have not succeeded. In the Fieldtrip page http://www.fieldtriptoolbox.org/template/electrode/ you have the following:

You can find the template 3-D electrode sets included in FieldTrip here <https://github.com/fieldtrip/fieldtrip/tree/master/template/electrode>.

But in that link you only find a txt file with theta-phi coordinates (easycap-M1.txt). Is there any place where I could find these positions in MNI space?

Thank you and best regards,
Silvana
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200619/c0adf7df/attachment-0001.htm>

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

Subject: Digest Footer

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


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

End of fieldtrip Digest, Vol 115, Issue 22
******************************************

_______________________________________________
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/20200623/62aa978f/attachment.htm>

From alina.bondarenko19 at imperial.ac.uk  Tue Jun 23 13:23:04 2020
From: alina.bondarenko19 at imperial.ac.uk (Bondarenko, Alina I)
Date: Tue, 23 Jun 2020 11:23:04 +0000
Subject: [FieldTrip] Error using ft_read_header
Message-ID: <AM0PR06MB6036B5BB926828E6F18C1A97B7940@AM0PR06MB6036.eurprd06.prod.outlook.com>

Hello all,


I'll try to describe the problem I've been having as clearly as I can here:

  *   I'm trying to use a Field Trip function ft_read_header to load some .mat files.

  *   When I try to load up a file using ft_read_header, I get an error message saying that within the ft_read_header script, the function feval is being used incorrectly. Namely, that feval is trying to execute a script called matlab as if it were a function.

Error using feval
Attempt to execute SCRIPT matlab as a function:
/Applications/MATLAB_R2019b.app/toolbox/matlab/general/matlab.m

  *   When I look inside the ft_read_header script, the line (2594) that gives the error looks like this:

feval(headerformat, filename)

Where headerformat is assigned a string 'matlab', which is supposed to represent the file type of the file I'm trying to load. Filename is a string variable I assign, e.g. filename = 'session1.mat'.

Headerformat is assigned the string 'matlab' in line 203 of ft_read_header (found in debugging mode):

headerformat = ft_filetype(filename);


  *   Feval is supposed to "evaluate a function" (I'm not quite sure exactly what this means based on the documentation), but it's first argument is supposed to be a function name, so I guess that a string saying 'matlab' should have always thrown an error, but the thing is that this function used to work just fine for me before. I also haven't edited any of the built in Field Trip scripts, so I'm not sure why this has stopped working.


Here are some things I've tried to fix the problem:


  *
I looked up the 'executing script as function error' and thought that since Matlab would like to execute a function, but is instead executing a script of the same name, then changing the name of the script could stop the problem.

However, when I change the name of the matlab.m script (e.g. to matlab_change.m) I get this error message instead:

Error using feval
Previously accessible file
"/Applications/MATLAB_R2019b.app/toolbox/matlab/general/matlab.m" is now inaccessible.

The only file called matlab.m is a short text file containing some info about what Matlab is and what it can be used for (I used "which matlab -all" to check this). There are no functions called matlab.

  *   In between the time when this function was working fine for me, and when it started showing me this error, I installed several versions of OSL and SPM on my computer. So, I uninstalled all these things.
  *   Uninstalled and reinstalled Field Trip
  *   Uninstalled and reinstalled Matlab
  *   Copy pasted all the functions involved and saved these under different names in different folders. Tried running them - got the same error.

I would greatly appreciate anyone's help on this! This error has been driving me crazy.

All the best,
Alina.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200623/f7877928/attachment.htm>

From stephen.whitmarsh at gmail.com  Tue Jun 23 14:04:08 2020
From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh)
Date: Tue, 23 Jun 2020 14:04:08 +0200
Subject: [FieldTrip] Error using ft_read_header
In-Reply-To: <AM0PR06MB6036B5BB926828E6F18C1A97B7940@AM0PR06MB6036.eurprd06.prod.outlook.com>
References: <AM0PR06MB6036B5BB926828E6F18C1A97B7940@AM0PR06MB6036.eurprd06.prod.outlook.com>
Message-ID: <CAFrxm=xoQkFS04eGcXa+=TdN8D1sakA23O8LqfQFucct+77yow@mail.gmail.com>

Dear Alina,

Not sure there is not something more sinister at play in the code somewhere
(I mean a bug or installation error), but I would start by asking why you
are using  *ft_read_header *to load a .mat file?

Are you sure you don't just want to load the matfile with MATLAB's load
functions? I.e. header = load('myfilename.mat')? Or, otherwise, read the
header of an original EEG/MEG datafile (some EEG/MEG dataformat)?

If not, and for a more informed response, please specify a bit more of the
code you use to process/write and then (try to) load the header.

Cheers,
Stephen



Op di 23 jun. 2020 om 13:30 schreef Bondarenko, Alina I <
alina.bondarenko19 at imperial.ac.uk>:

> Hello all,
>
>
> I'll try to describe the problem I've been having as clearly as I can here:
>
>    - I'm trying to use a Field Trip function *ft_read_header *to load
>    some .mat files.
>
>    - When I try to load up a file using *ft_read_header,* I get an error
>    message saying that within the *ft_read_header *script, the function
>    *feval* is being used incorrectly. Namely, that *feval* is trying to
>    execute a script called *matlab* as if it were a function.
>
>    Error using feval
>    Attempt to execute SCRIPT matlab as a function:
>    /Applications/MATLAB_R2019b.app/toolbox/matlab/general/matlab.m
>
>    - When I look inside the *ft_read_header* script, the line (2594) that
>    gives the error looks like this:
>
>    feval(headerformat, filename)
>
>    Where *headerformat* is assigned a string 'matlab', which is supposed
>    to represent the file type of the file I'm trying to load. Filename is a
>    string variable I assign, e.g. filename = 'session1.mat'.
>
>    Headerformat is assigned the string 'matlab' in line 203 of
>    *ft_read_header *(found in debugging mode):
>
>    headerformat = ft_filetype(filename);
>
>
>    - Feval is supposed to "evaluate a function" (I'm not quite sure
>    exactly what this means based on the documentation), but it's first
>    argument is supposed to be a function name, so I guess that a string saying
>    'matlab' should have always thrown an error, but the thing is that this
>    function used to work just fine for me before. I also haven't edited any of
>    the built in Field Trip scripts, so I'm not sure why this has stopped
>    working.
>
>
>
> Here are some things I've tried to fix the problem:
>
>
>    - I looked up the 'executing script as function error' and thought
>    that since Matlab would like to execute a function, but is instead
>    executing a script of the same name, then changing the name of the script
>    could stop the problem.
>
>    However, when I change the name of the matlab.m script (e.g. to
>    matlab_change.m) I get this error message instead:
>
>    Error using feval
>    Previously accessible file
>    "/Applications/MATLAB_R2019b.app/toolbox/matlab/general/matlab.m" is
>    now inaccessible.
>
>    The only file called matlab.m is a short text file containing some
>    info about what Matlab is and what it can be used for (I used "*which
>    matlab -all"* to check this). There are no functions called matlab.
>
>    - In between the time when this function was working fine for me, and
>    when it started showing me this error, I installed several versions of OSL
>    and SPM on my computer. So, I uninstalled all these things.
>    - Uninstalled and reinstalled Field Trip
>    - Uninstalled and reinstalled Matlab
>    - Copy pasted all the functions involved and saved these under
>    different names in different folders. Tried running them - got the same
>    error.
>
>
> I would greatly appreciate anyone's help on this! This error has been
> driving me crazy.
>
> All the best,
> Alina.
>
>
> _______________________________________________
> 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/20200623/aaed43b9/attachment.htm>

From alina.bondarenko19 at imperial.ac.uk  Tue Jun 23 15:18:28 2020
From: alina.bondarenko19 at imperial.ac.uk (Bondarenko, Alina I)
Date: Tue, 23 Jun 2020 13:18:28 +0000
Subject: [FieldTrip] Error using ft_read_header
In-Reply-To: <CAFrxm=xoQkFS04eGcXa+=TdN8D1sakA23O8LqfQFucct+77yow@mail.gmail.com>
References: <AM0PR06MB6036B5BB926828E6F18C1A97B7940@AM0PR06MB6036.eurprd06.prod.outlook.com>,
 <CAFrxm=xoQkFS04eGcXa+=TdN8D1sakA23O8LqfQFucct+77yow@mail.gmail.com>
Message-ID: <AM0PR06MB6036E290F84A09B1F3041CF9B7940@AM0PR06MB6036.eurprd06.prod.outlook.com>

Dear Stephen,

Thanks for the quick response!

I have been initially using another function, ft_read_data (which calls on ft_read_header) as part of some code to load and convert .mat files to .csv files - and it was in this code that the bug/error first showed up.



filename = 'my_data.mat';

dat = ft_read_data(filename);

writematrix(dat, 'my_data.csv')


Error using feval

Attempt to execute SCRIPT matlab as a function:
/Applications/MATLAB_R2019b.app/toolbox/matlab/general/matlab.m

Error in ft_read_header (line 2594)
      hdr = feval(headerformat, filename);

Error in ft_read_data (line 214)
  hdr = ft_read_header(filename, 'headerformat', headerformat, 'chanindx',
  chanindx, 'checkmaxfilter', checkmaxfilter);


There are other ways of converting .mat to .csv files, so that's not a huge problem, however, it seems that whenever I use any function that requires/calls on  ft_read_header the same error comes up.  So, I haven't been able to use quite a few Field Trip functions as a result.

I am working with data that has been preprocessed by another lab, so unfortunately I don't have more code than this to show you. However, I get the same error with a different dataset, which I was also previously able to run through these functions without a problem.

Thank you in advance for your time!

Best,
Alina.
________________________________
From: fieldtrip <fieldtrip-bounces at science.ru.nl> on behalf of Stephen Whitmarsh <stephen.whitmarsh at gmail.com>
Sent: 23 June 2020 13:04
To: FieldTrip discussion list <fieldtrip at science.ru.nl>
Subject: Re: [FieldTrip] Error using ft_read_header


This email from stephen.whitmarsh at gmail.com originates from outside Imperial. Do not click on links and attachments unless you recognise the sender. If you trust the sender, add them to your safe senders list<https://spam.ic.ac.uk/SpamConsole/Senders.aspx> to disable email stamping for this address.



Dear Alina,

Not sure there is not something more sinister at play in the code somewhere (I mean a bug or installation error), but I would start by asking why you are using  ft_read_header to load a .mat file?

Are you sure you don't just want to load the matfile with MATLAB's load functions? I.e. header = load('myfilename.mat')? Or, otherwise, read the header of an original EEG/MEG datafile (some EEG/MEG dataformat)?

If not, and for a more informed response, please specify a bit more of the code you use to process/write and then (try to) load the header.

Cheers,
Stephen



Op di 23 jun. 2020 om 13:30 schreef Bondarenko, Alina I <alina.bondarenko19 at imperial.ac.uk<mailto:alina.bondarenko19 at imperial.ac.uk>>:
Hello all,


I'll try to describe the problem I've been having as clearly as I can here:

  *   I'm trying to use a Field Trip function ft_read_header to load some .mat files.

  *   When I try to load up a file using ft_read_header, I get an error message saying that within the ft_read_header script, the function feval is being used incorrectly. Namely, that feval is trying to execute a script called matlab as if it were a function.

Error using feval
Attempt to execute SCRIPT matlab as a function:
/Applications/MATLAB_R2019b.app/toolbox/matlab/general/matlab.m

  *   When I look inside the ft_read_header script, the line (2594) that gives the error looks like this:

feval(headerformat, filename)

Where headerformat is assigned a string 'matlab', which is supposed to represent the file type of the file I'm trying to load. Filename is a string variable I assign, e.g. filename = 'session1.mat'.

Headerformat is assigned the string 'matlab' in line 203 of ft_read_header (found in debugging mode):

headerformat = ft_filetype(filename);


  *   Feval is supposed to "evaluate a function" (I'm not quite sure exactly what this means based on the documentation), but it's first argument is supposed to be a function name, so I guess that a string saying 'matlab' should have always thrown an error, but the thing is that this function used to work just fine for me before. I also haven't edited any of the built in Field Trip scripts, so I'm not sure why this has stopped working.


Here are some things I've tried to fix the problem:


  *
I looked up the 'executing script as function error' and thought that since Matlab would like to execute a function, but is instead executing a script of the same name, then changing the name of the script could stop the problem.

However, when I change the name of the matlab.m script (e.g. to matlab_change.m) I get this error message instead:

Error using feval
Previously accessible file
"/Applications/MATLAB_R2019b.app/toolbox/matlab/general/matlab.m" is now inaccessible.

The only file called matlab.m is a short text file containing some info about what Matlab is and what it can be used for (I used "which matlab -all" to check this). There are no functions called matlab.

  *   In between the time when this function was working fine for me, and when it started showing me this error, I installed several versions of OSL and SPM on my computer. So, I uninstalled all these things.
  *   Uninstalled and reinstalled Field Trip
  *   Uninstalled and reinstalled Matlab
  *   Copy pasted all the functions involved and saved these under different names in different folders. Tried running them - got the same error.

I would greatly appreciate anyone's help on this! This error has been driving me crazy.

All the best,
Alina.


_______________________________________________
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/20200623/7dca17e8/attachment.htm>

From stephen.whitmarsh at gmail.com  Tue Jun 23 15:50:48 2020
From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh)
Date: Tue, 23 Jun 2020 15:50:48 +0200
Subject: [FieldTrip] Error using ft_read_header
In-Reply-To: <AM0PR06MB6036E290F84A09B1F3041CF9B7940@AM0PR06MB6036.eurprd06.prod.outlook.com>
References: <AM0PR06MB6036B5BB926828E6F18C1A97B7940@AM0PR06MB6036.eurprd06.prod.outlook.com>
 <CAFrxm=xoQkFS04eGcXa+=TdN8D1sakA23O8LqfQFucct+77yow@mail.gmail.com>
 <AM0PR06MB6036E290F84A09B1F3041CF9B7940@AM0PR06MB6036.eurprd06.prod.outlook.com>
Message-ID: <CAFrxm=y8fFiKDoE1iAywcs0zADRg6QXOj9k7dDrCgjMzG6QBLA@mail.gmail.com>

Hi Alina,

Have you asked a colleague to try it out to rule-out something to do with
the matlab installation?

Cheers,
Stephen



Op di 23 jun. 2020 om 15:30 schreef Bondarenko, Alina I <
alina.bondarenko19 at imperial.ac.uk>:

> Dear Stephen,
>
> Thanks for the quick response!
>
> I have been initially using another function, ft_read_data (which calls on
> ft_read_header) as part of some code to load and convert .mat files to .csv
> files - and it was in this code that the bug/error first showed up.
>
>
> filename = 'my_data.mat';
>
> dat = ft_read_data(filename);
>
> writematrix(dat, 'my_data.csv')
>
>
> Error using feval
> Attempt to execute SCRIPT matlab as a function:
> /Applications/MATLAB_R2019b.app/toolbox/matlab/general/matlab.m
>
> Error in ft_read_header (line 2594)
>       hdr = feval(headerformat, filename);
>
> Error in ft_read_data (line 214)
>   hdr = ft_read_header(filename, 'headerformat', headerformat, 'chanindx',
>   chanindx, 'checkmaxfilter', checkmaxfilter);
>
>
>
> There are other ways of converting .mat to .csv files, so that's not a
> huge problem, however, it seems that whenever I use any function that
> requires/calls on  ft_read_header the same error comes up.  So, I haven't
> been able to use quite a few Field Trip functions as a result.
>
> I am working with data that has been preprocessed by another lab, so
> unfortunately I don't have more code than this to show you. However, I get
> the same error with a different dataset, which I was also previously able
> to run through these functions without a problem.
>
> Thank you in advance for your time!
>
> Best,
> Alina.
> ------------------------------
> *From:* fieldtrip <fieldtrip-bounces at science.ru.nl> on behalf of Stephen
> Whitmarsh <stephen.whitmarsh at gmail.com>
> *Sent:* 23 June 2020 13:04
> *To:* FieldTrip discussion list <fieldtrip at science.ru.nl>
> *Subject:* Re: [FieldTrip] Error using ft_read_header
>
>
> This email from stephen.whitmarsh at gmail.com originates from outside
> Imperial. Do not click on links and attachments unless you recognise the
> sender. If you trust the sender, add them to your safe senders list
> <https://spam.ic.ac.uk/SpamConsole/Senders.aspx> to disable email
> stamping for this address.
>
>
> Dear Alina,
>
> Not sure there is not something more sinister at play in the code
> somewhere (I mean a bug or installation error), but I would start by asking
> why you are using  * ft_read_header *to load a .mat file?
>
> Are you sure you don't just want to load the matfile with MATLAB's load
> functions? I.e. header = load('myfilename.mat')? Or, otherwise, read the
> header of an original EEG/MEG datafile (some EEG/MEG dataformat)?
>
> If not, and for a more informed response, please specify a bit more of the
> code you use to process/write and then (try to) load the header.
>
> Cheers,
> Stephen
>
>
>
> Op di 23 jun. 2020 om 13:30 schreef Bondarenko, Alina I <
> alina.bondarenko19 at imperial.ac.uk>:
>
> Hello all,
>
>
> I'll try to describe the problem I've been having as clearly as I can here:
>
>    - I'm trying to use a Field Trip function *ft_read_header *to load
>    some .mat files.
>
>    - When I try to load up a file using *ft_read_header,* I get an error
>    message saying that within the *ft_read_header *script, the function
>    *feval* is being used incorrectly. Namely, that *feval* is trying to
>    execute a script called *matlab* as if it were a function.
>
>    Error using feval
>    Attempt to execute SCRIPT matlab as a function:
>    /Applications/MATLAB_R2019b.app/toolbox/matlab/general/matlab.m
>
>    - When I look inside the *ft_read_header* script, the line (2594) that
>    gives the error looks like this:
>
>    feval(headerformat, filename)
>
>    Where *headerformat* is assigned a string 'matlab', which is supposed
>    to represent the file type of the file I'm trying to load. Filename is a
>    string variable I assign, e.g. filename = 'session1.mat'.
>
>    Headerformat is assigned the string 'matlab' in line 203 of
>    *ft_read_header *(found in debugging mode):
>
>    headerformat = ft_filetype(filename);
>
>
>    - Feval is supposed to "evaluate a function" (I'm not quite sure
>    exactly what this means based on the documentation), but it's first
>    argument is supposed to be a function name, so I guess that a string saying
>    'matlab' should have always thrown an error, but the thing is that this
>    function used to work just fine for me before. I also haven't edited any of
>    the built in Field Trip scripts, so I'm not sure why this has stopped
>    working.
>
>
>
> Here are some things I've tried to fix the problem:
>
>
>    - I looked up the 'executing script as function error' and thought
>    that since Matlab would like to execute a function, but is instead
>    executing a script of the same name, then changing the name of the script
>    could stop the problem.
>
>    However, when I change the name of the matlab.m script (e.g. to
>    matlab_change.m) I get this error message instead:
>
>    Error using feval
>    Previously accessible file
>    "/Applications/MATLAB_R2019b.app/toolbox/matlab/general/matlab.m" is
>    now inaccessible.
>
>    The only file called matlab.m is a short text file containing some
>    info about what Matlab is and what it can be used for (I used "*which
>    matlab -all"* to check this). There are no functions called matlab.
>
>    - In between the time when this function was working fine for me, and
>    when it started showing me this error, I installed several versions of OSL
>    and SPM on my computer. So, I uninstalled all these things.
>    - Uninstalled and reinstalled Field Trip
>    - Uninstalled and reinstalled Matlab
>    - Copy pasted all the functions involved and saved these under
>    different names in different folders. Tried running them - got the same
>    error.
>
>
> I would greatly appreciate anyone's help on this! This error has been
> driving me crazy.
>
> All the best,
> Alina.
>
>
> _______________________________________________
> 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/20200623/af2b5f44/attachment.htm>

From liang134 at mail.chapman.edu  Tue Jun 23 21:13:33 2020
From: liang134 at mail.chapman.edu (Andy Liang)
Date: Tue, 23 Jun 2020 12:13:33 -0700
Subject: [FieldTrip] Atlas position and the Source Connectivity position
Message-ID: <CAMmeW0ES2ddhbnv2Dvag3K6-Ac3=YCLnMA-F=O2QT3L0RKW1nQ@mail.gmail.com>

Dear experts:

I was following the tutorial on the whole brain analysis
http://www.fieldtriptoolbox.org/tutorial/networkanalysis/.

While I got to this block of code that performs parcellation using an atlas
for source connectivity:

load atlas_MMP1.0_4k.mat;atlas.pos = source_conn.pos; % otherwise the
parcellation won't work
cfg = [];cfg.parcellation = 'parcellation';cfg.parameter    =
'cohspctrm';parc_conn = ft_sourceparcellate(cfg, source_conn, atlas);
figure;imagesc(parc_conn.cohspctrm);


The code loads an atlas and replaces the atlas position with the source
connectivity position. I am wondering what's the logic behind replacing the
atlas.pos with source_conn.pos? This kind of hard-coding replacement seems
skeptical and random for me and also the original atlas.pos is very
different from source.pos. Is this substitution messing up the parcellation
while the labels in the atlas refer to a different position in the source?

Best regards,
Andy Liang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200623/f97981b0/attachment.htm>

From r.oostenveld at donders.ru.nl  Wed Jun 24 09:47:14 2020
From: r.oostenveld at donders.ru.nl (Robert Oostenveld)
Date: Wed, 24 Jun 2020 09:47:14 +0200
Subject: [FieldTrip] bug in recent versions of ft_prepare_leadfield
Message-ID: <20A42FDB-D40A-4CE7-AE76-DCEC44F92678@donders.ru.nl>

Dear all

We are sorry to report that with merging the recent pull request #1377 <https://github.com/fieldtrip/fieldtrip/pull/1377> about a month ago, we introduced a bug in the FieldTrip release that might have affected your computations.

Specifically, the handling of the defaults for cfg.reducerank and the cfg.backproject changed a bit, which had an unforeseen sideeffect in ft_prepare_leadfield, if (and only if) you used this function for the computation of MEG-based leadfields, using the singleshell method. Specifically, ft_prepare_leadfield would by default compute MEG singleshell leadfields with reducerank=2 (this is how it always has been), but it would wrongly backproject (i.e. the intended projection of the rank-reduced 2-column leadfield back into 3D space with a column for the x, y, and z dipole moment in Cartesian space) the rank-reduced leadfield. Rather, ft_prepare_leadfield would on line 292 <https://github.com/fieldtrip/fieldtrip/blob/af5f9822413d11e66f3821943e945e98ab766da6/ft_prepare_leadfield.m#L292> discard the last column. The error was due to MATLAB interpreting if [] as false, causing on line 295 only the first two columns to be copied to the output. Consequently, the leadfield for the z-direction was discarded.

Are you affected? If you used the master branch from GitHub (which is the development version), or a release version between 20200529 and 20200607, and if you have used ft_prepare_leadfield for MEG with singleshell models, then you are likely affected. You can check yourself: your precomputed leadfields should have three columns; if they only have two columns and you did not explicityly specify reducerank and backproject in your configuration, your leadfields are wrong. Other models than MEG singleshell are not affected.

To resolve the problem, please update to the latest 20200623 release version from the FTP server <ftp://ftp.fieldtriptoolbox.org/pub/fieldtrip/> or from the GitHub release page <https://github.com/fieldtrip/fieldtrip/releases> and recompute your leadfields, source estimates, etcetera.

best regards,
Robert

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200624/4de33da1/attachment.htm>

From r.oostenveld at donders.ru.nl  Wed Jun 24 13:48:30 2020
From: r.oostenveld at donders.ru.nl (Robert Oostenveld)
Date: Wed, 24 Jun 2020 13:48:30 +0200
Subject: [FieldTrip] new "reproducescript" functionality just presented at
 OHBM
Message-ID: <643B1C4C-92A8-469B-8143-29BC3E507DAD@donders.ru.nl>

Dear FieldTrip users

My colleague Mats has just present some new FieldTrip core functionality in the Open Science Room at the (online) OHBM conference. You can watch his presentation at https://www.youtube.com/watch?v=lBKNT9VbYOU <https://www.youtube.com/watch?v=lBKNT9VbYOU>. The stream is still live, hence I cannot point to a specific time in the stream, but it is around 2 hours and 57 minutes from the start of the stream.

Let us know if you have any questions.

best regards
Robert and Mats


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200624/19b3ed9d/attachment.htm>

From rene.andrade at edu.uah.es  Wed Jun 24 21:22:56 2020
From: rene.andrade at edu.uah.es (=?utf-8?B?QW5kcmFkZSBSZXkgUmVuw6k=?=)
Date: Wed, 24 Jun 2020 19:22:56 +0000
Subject: [FieldTrip] fieldtrip Digest, Vol 115, Issue 24
In-Reply-To: <mailman.9.1592906401.28953.fieldtrip@science.ru.nl>
References: <mailman.9.1592906401.28953.fieldtrip@science.ru.nl>
Message-ID: <1F22D7DC-7930-4BA5-AB8D-E88860B5912A@edu.uah.es>

Dear Eelke Spaak:
Thank you for the advise on memory efficiency coding. Although in my case I have tried single precision and it still doesn’t seem to change much. I was wondering if I could analyse different channels one by one although I don’t think is possible for inverse solution. I am referring to http://www.fieldtriptoolbox.org/faq/how_can_i_preprocess_a_dataset_that_is_too_large_to_fit_into_memory/.
My problem is only when computing ft_sourceanalysis only. I don’t know if trying another method rather than lcmv may be less computationally heavy.

Best,
Andrade.

On 23 Jun 2020, at 12:00, fieldtrip-request at science.ru.nl<mailto:fieldtrip-request at science.ru.nl> wrote:

Send fieldtrip mailing list submissions to
fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>

To subscribe or unsubscribe via the World Wide Web, visit
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
or, via email, send a message with subject or body 'help' to
fieldtrip-request at science.ru.nl

You can reach the person managing the list at
fieldtrip-owner at science.ru.nl

When replying, please edit your Subject line so it is more specific
than "Re: Contents of fieldtrip digest..."


Today's Topics:

  1. Re: Running out of memory (RAM) (Eelke Spaak)
  2. Connectivity Dimensions (Michael Glassen  -  Biomedical Engineer)
  3. Re: Connectivity Dimensions (Schoffelen, J.M. (Jan Mathijs))
  4. Re: Errors with downsampling and artifact rejection (Gaëlle Leys)
  5. Re: Errors with downsampling and artifact rejection
     (Stephen Whitmarsh)
  6. Re: fieldtrip Digest, Vol 115, Issue 23 (Andrade Rey René)
  7. Re: Errors with downsampling and artifact rejection
     (Schoffelen, J.M. (Jan Mathijs))


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

Message: 1
Date: Mon, 22 Jun 2020 15:27:19 +0200
From: Eelke Spaak <e.spaak at donders.ru.nl>
To: FieldTrip discussion list <fieldtrip at science.ru.nl>
Subject: Re: [FieldTrip] Running out of memory (RAM)
Message-ID:
<CABPNLUqmPjmyXR4gbRG3y-MLf97-SPGnRA+zp=SA4TBkCOugzw at mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Dear Andrade,

You could have a look here for some tips on memory efficiency:
http://www.fieldtriptoolbox.org/tutorial/memory/ Probably most relevant to
you: change the data precision to single, rather than double (saves ~50%).

Best,
Eelke

On Sun, 21 Jun 2020 at 22:34, Andrade Rey René <rene.andrade at edu.uah.es>
wrote:

Dear experts:
I am running this code

cfg = [];cfg.headmodel = headmodel;cfg.sourcemodel = leadfield;cfg.method = 'lcmv';cfg.lcmv.projectmom = 'yes'; % project dipole time series in direction of maximal power (see below)cfg.lcmv.kurtosis = 'yes'; % compute kurtosis at each locationsource = ft_sourceanalysis(cfg, cov_matrix);


Of http://www.fieldtriptoolbox.org/tutorial/epilepsy/. And I think  I run
out of memory because with “top” I can see the computer stops responding
when near 85% of RAM memory(16GB).

I cannot report any error because the only problem seems to be that either
wrong code or wrong data or I don’t know.

Best,
Andrade.
_______________________________________________
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/20200622/58106b35/attachment-0001.htm>

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

Message: 2
Date: Mon, 22 Jun 2020 13:47:14 +0000
From: "Michael Glassen  -  Biomedical Engineer"
<MGlassen at kesslerfoundation.org>
To: "fieldtrip at science.ru.nl" <fieldtrip at science.ru.nl>
Subject: [FieldTrip] Connectivity Dimensions
Message-ID: <aae7aaea206143f3a87df61e1478a883 at kesslerfoundation.org>
Content-Type: text/plain; charset="iso-8859-1"

Hi all,


I was looking to make some plots of directional connectivity data obtained from ft_connectivityanalysis, and I just wanted to double check the dimensions of pdcspctrm and dtfspctrm.


The dimord is 'chan_chan_freq_time', but there isn't any indication of which chan dimension is the from direction and which is the to direction. I tried piecing it together by using ft_connectivityplot and comparing these to my own plots, and I'm pretty sure that the dimensions are 'fromchan_tochan_freq_time' but I wanted to get confirmation before I moved forward.


Best,

Michael Glassen

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200622/5abef647/attachment-0001.htm>

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

Message: 3
Date: Mon, 22 Jun 2020 13:52:32 +0000
From: "Schoffelen, J.M. (Jan Mathijs)" <jan.schoffelen at donders.ru.nl>
To: FieldTrip discussion list <fieldtrip at science.ru.nl>
Subject: Re: [FieldTrip] Connectivity Dimensions
Message-ID: <B6521FD0-2B75-4E0B-AF0C-68CDF3CB411B at donders.ru.nl>
Content-Type: text/plain; charset="utf-8"

Dear Michael,

Consider it confirmed!

Best wishes,
JM


On 22 Jun 2020, at 15:47, Michael Glassen - Biomedical Engineer <MGlassen at kesslerfoundation.org<mailto:MGlassen at kesslerfoundation.org>> wrote:

Hi all,

I was looking to make some plots of directional connectivity data obtained from ft_connectivityanalysis, and I just wanted to double check the dimensions of pdcspctrm and dtfspctrm.

The dimord is 'chan_chan_freq_time', but there isn't any indication of which chan dimension is the from direction and which is the to direction. I tried piecing it together by using ft_connectivityplot and comparing these to my own plots, and I'm pretty sure that the dimensions are 'fromchan_tochan_freq_time' but I wanted to get confirmation before I moved forward.

Best,
Michael Glassen

 ­­   _______________________________________________
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/20200622/f18ccfbb/attachment-0001.htm>

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

Message: 4
Date: Mon, 22 Jun 2020 14:47:00 +0000
From: Gaëlle Leys <gaelle.leys at kuleuven.be>
To: "fieldtrip at science.ru.nl" <fieldtrip at science.ru.nl>
Subject: Re: [FieldTrip] Errors with downsampling and artifact
rejection
Message-ID:
<a967d7106acf41d182449785c9466db7 at ICTS-S-EXMBX17.luna.kuleuven.be>
Content-Type: text/plain; charset="utf-8"

Dear Stephen,

I have included the data structures and cfg's involved in the functions.

1) A. data structure for resampling data (raw data after reading it in):
data_eeg =
 struct with fields:
hdr: [1×1 struct]
label: {129×1 cell}
time: {[1×245726 double]}
trial: {[129×245726 double]}
fsample: 1000
sampleinfo: [1 245726]
elec: [1×1 struct]
cfg: [1×1 struct]

1) B. cfg for resampling data (I’m using all the default options for resampling):

Cfg=[];
[data_eeg] = ft_resampledata(cfg, data_eeg); % defaults are all OK

2) A. data structure for artifact rejection (my data already epoched):
data_eeg =
struct with fields:
hdr: [1×1 struct]
label: {129×1 cell}
time: {1×108 cell}
trial: {1×108 cell}
fsample: 1000
sampleinfo: [108×2 double]
elec: [1×1 struct]
cfg: [1×1 struct]


2) B. cfg for artifact rejection (taken from the automatic artifact rejection example):
% jump
cfg = [];
cfg.trl = trl;
cfg.datafile = '100_1_20200305.mff';
cfg.headerfile = '100_1_20200305.mff';
cfg.continuous = 'yes';

% channel selection, cutoff and padding
cfg.artfctdef.zvalue.channel = 'EEG';
cfg.artfctdef.zvalue.cutoff = 20;
cfg.artfctdef.zvalue.trlpadding = 0;
cfg.artfctdef.zvalue.artpadding = 0;
cfg.artfctdef.zvalue.fltpadding = 0;

% algorithmic parameters
cfg.artfctdef.zvalue.cumulative = 'yes';
cfg.artfctdef.zvalue.medianfilter = 'yes';
cfg.artfctdef.zvalue.medianfiltord = 9;
cfg.artfctdef.zvalue.absdiff = 'yes';

% make the process interactive
cfg.artfctdef.zvalue.interactive = 'yes';

[cfg, artifact_jump] = ft_artifact_zvalue(cfg); %plot error and error using zeros
%[cfg, artifact_jump] = ft_artifact_zvalue(cfg, data_eeg); %no plot error, but each trial has the same graph, also error using zeros


Kind regards,
Gaëlle Leys



-----Original Message-----
From: fieldtrip <fieldtrip-bounces at science.ru.nl> On Behalf Of fieldtrip-request at science.ru.nl
Sent: zaterdag 20 juni 2020 12:00
To: fieldtrip at science.ru.nl
Subject: fieldtrip Digest, Vol 115, Issue 22

Send fieldtrip mailing list submissions to
fieldtrip at science.ru.nl

To subscribe or unsubscribe via the World Wide Web, visit
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
or, via email, send a message with subject or body 'help' to
fieldtrip-request at science.ru.nl

You can reach the person managing the list at
fieldtrip-owner at science.ru.nl

When replying, please edit your Subject line so it is more specific than "Re: Contents of fieldtrip digest..."


Today's Topics:

  1. Errors with downsampling and artifact rejection (Gaëlle Leys)
  2. Re: Errors with downsampling and artifact rejection
     (Stephen Whitmarsh)
  3. MNI coordinates for the EEG easycap-M1 layout
     (SILVA PEREIRA, SILVANA)


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

Message: 1
Date: Fri, 19 Jun 2020 12:48:26 +0000
From: Gaëlle Leys <gaelle.leys at kuleuven.be>
To: "fieldtrip at science.ru.nl" <fieldtrip at science.ru.nl>
Subject: [FieldTrip] Errors with downsampling and artifact rejection
Message-ID:
<ccb89b4d31af42d3b4cd22485438f4ef at ICTS-S-EXMBX17.luna.kuleuven.be>
Content-Type: text/plain; charset="iso-8859-1"

Dear Fieldtrip community,

I have recently started with Fieldtrip for my EEG data processing and I am encountering some problems which I can't seem to resolve.
I'm working with mff files from an EGI EEG system. I have no problem reading in and preprocessing the data. However, when trying to downsample and setup the automatic artifact removal, I'm getting some errors.


1)      When trying to downsample with the default options, these are the errors that I get:
Error using resample>getSamples (line 357) The number of elements of Tx must match the number of rows of X when X is a matrix

Error in resample>nonUniformResample (line 123) [x, tx] = getSamples(varargin{1:2});

Error in resample (line 116)
 [varargout{1:max(1,nargout)}] = nonUniformResample(method,varargin{:});

Error in ft_resampledata (line 228)
       newdat = transpose(resample(transpose(olddat),fsres,fsorig));

               I have tried downsampling before filtering, after filtering, on continuous data, or already segmented data. None of these things seem to resolve the error.


2)      When trying to set up the automatic artifact removal process and choosing yes for the interactive plot, I get a plotting error:

Error using plot

Vectors must be the same length.



Error in ft_artifact_zvalue>redraw_cb (line 973)

   plot(opt.h1, xval, yval, 'linestyle', '-', 'color', 'b', 'displayname', 'data');



Error in ft_artifact_zvalue (line 512)

 redraw_cb(h);

       I've noticed that the xval and yval are different numbers, which of course doesn't allow plotting. It seems like the xval changes according to the epoch length, however the yval remains the same and equals the amount of samples in my continuous data.


3)      When choosing no for the interactive plot, I also get an error:
Error using zeros
Size inputs must be integers.

Error in ft_artifact_zvalue (line 568)
dum = zeros(1,max(opt.trl(:,2)));

I've been looking into the functions and where it goes wrong, but I can't seem to pinpoint what exactly is causing these issues. Anyone here that can help or provide me some tips?

Thanks in advance!

Kind regards,

Gaëlle Leys

Research Associate
Brain & Cognition
Tiensestraat 102 box 3714
3000 Leuven
Room PSI 02.33
tel. +32 16 37 61 98

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200619/e7e1bde8/attachment-0001.htm>

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

Message: 2
Date: Fri, 19 Jun 2020 15:08:21 +0200
From: Stephen Whitmarsh <stephen.whitmarsh at gmail.com>
To: FieldTrip discussion list <fieldtrip at science.ru.nl>
Subject: Re: [FieldTrip] Errors with downsampling and artifact
rejection
Message-ID:
<CAFrxm=w44QZ0C7xB4cpsqdy0D0ou5UcpHNM-q3bjyaqwwJxRwg at mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Dear Gaëlle,

To understand the problem it would be helpful to have 1) description of the data structures going in ft_resampledata (just type in command line and copy-paste the output) and the artefact detection function you are using, and 2) the configuration (cfg) you are using for those functions.

Cheers,
Stephen


Op vr 19 jun. 2020 om 14:56 schreef Gaëlle Leys <gaelle.leys at kuleuven.be>:

Dear Fieldtrip community,



I have recently started with Fieldtrip for my EEG data processing and
I am encountering some problems which I can’t seem to resolve.

I’m working with mff files from an EGI EEG system. I have no problem
reading in and preprocessing the data. However, when trying to
downsample and setup the automatic artifact removal, I’m getting some errors.



1)      When trying to downsample with the default options, these are the
errors that I get:

Error using resample>getSamples (line 357)

The number of elements of Tx must match the number of rows of X when X
is a matrix



Error in resample>nonUniformResample (line 123)

[x, tx] = getSamples(varargin{1:2});



Error in resample (line 116)

 [varargout{1:max(1,nargout)}] =
nonUniformResample(method,varargin{:});



Error in ft_resampledata (line 228)

       newdat = transpose(resample(transpose(olddat),fsres,fsorig));



               I have tried downsampling before filtering, after
filtering, on continuous data, or already segmented data. None of
these things seem to resolve the error.



2)      When trying to set up the automatic artifact removal process and
choosing yes for the interactive plot, I get a plotting error:

Error using plot

Vectors must be the same length.



Error in ft_artifact_zvalue>redraw_cb (line 973)

   plot(opt.h1, xval, yval, 'linestyle', '-', 'color', 'b',
'displayname', 'data');



Error in ft_artifact_zvalue (line 512)

 redraw_cb(h);



       I’ve noticed that the xval and yval are different numbers,
which of course doesn’t allow plotting. It seems like the xval changes
according to the epoch length, however the yval remains the same and
equals the amount of samples in my continuous data.



3)      When choosing no for the interactive plot, I also get an error:

Error using zeros

Size inputs must be integers.



Error in ft_artifact_zvalue (line 568)

dum = zeros(1,max(opt.trl(:,2)));



I’ve been looking into the functions and where it goes wrong, but I
can’t seem to pinpoint what exactly is causing these issues. Anyone
here that can help or provide me some tips?



Thanks in advance!



Kind regards,



Gaëlle Leys



Research Associate
Brain & Cognition
Tiensestraat 102 box 3714
3000 Leuven

Room PSI 02.33
tel. +32 16 37 61 98


_______________________________________________
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/20200619/137e31b1/attachment-0001.htm>

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

Message: 3
Date: Fri, 19 Jun 2020 18:58:36 +0200
From: "SILVA PEREIRA, SILVANA" <silvana.silva at upf.edu>
To: fieldtrip at science.ru.nl
Subject: [FieldTrip] MNI coordinates for the EEG easycap-M1 layout
Message-ID:
<CA+_MWm1NufDWa-fjR71OzQ5ab88ioyUT8OJ-QFYX9ABr7gNQrA at mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Dear community,

I've been struggling to find the 3D positions (montages) for the
Acticap-64ch-standard2 on the web, which is a modified version of the easycap-M1, but I have not succeeded. In the Fieldtrip page http://www.fieldtriptoolbox.org/template/electrode/ you have the following:

You can find the template 3-D electrode sets included in FieldTrip here <https://github.com/fieldtrip/fieldtrip/tree/master/template/electrode>.

But in that link you only find a txt file with theta-phi coordinates (easycap-M1.txt). Is there any place where I could find these positions in MNI space?

Thank you and best regards,
Silvana
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200619/c0adf7df/attachment-0001.htm>

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

Subject: Digest Footer

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


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

End of fieldtrip Digest, Vol 115, Issue 22
******************************************



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

Message: 5
Date: Mon, 22 Jun 2020 17:35:42 +0200
From: Stephen Whitmarsh <stephen.whitmarsh at gmail.com>
To: FieldTrip discussion list <fieldtrip at science.ru.nl>
Subject: Re: [FieldTrip] Errors with downsampling and artifact
rejection
Message-ID:
<CAFrxm=wFXM-y1XBHbrVCTPwgjD2OWSG0c3Wx+v=Roiy7dprdPA at mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Dear Gaëlle,

You are using default settings for downsampling, which will then try to
downsample to 256Hz. Your original samplerate is 1000Hz, so that isn't a
neat integer division.
I tried the following, and could reproduce your problem:

Fs = 1000;
data_eeg = [];
data_eeg.label = {'a','b','c'};
data_eeg.time{1} = 0:1/Fs:10;
data_eeg.trial{1} = rand(length(data_eeg.label),length(data_eeg.time{1}));
data_eeg.Fs = Fs;
data_eeg.sampleinfo = [1, length(data_eeg.time{1})];

% Doesn't work:
cfg = [];
[data_eeg] = ft_resampledata(cfg, data_eeg);

% Does work:
cfg = [];
cfg.resamplefs = 250;
[data_eeg] = ft_resampledata(cfg, data_eeg);

So that deals with your first problem. Not sure why it has a problem with
the downsampling to non-integer values, but it's good practice and much
faster to stick to that anyway.

Not sure what to do with the artefact detection though, or what you
expect;  it seems you are running it with some contradictory settings/ways
perhaps:
- use cfg.dataset if reading from disk directly OR give datastructure to
function is you already have data in memory
- use cfg.continuous when data is not segmented
- the comment "jump" suggests you use settings for SQUID jumps, i.e.
optimized for MEG, but that should not give an error :-)

I suspect you probably want to run artefact detection on your
segmented data, so remove those references to the data on disk (datafile,
headerfile), and the trl from the cfg, and give your segmented data as an
argument as you did here:
%[cfg, artifact_jump] = ft_artifact_zvalue(cfg, data_eeg); %no plot error,
but each trial has the same graph, also error using zeros

Let us know how it goes,

All the best,
Stephen











Op ma 22 jun. 2020 om 17:02 schreef Gaëlle Leys <gaelle.leys at kuleuven.be>:

Dear Stephen,

I have included the data structures and cfg's involved in the functions.

1)      A. data structure for resampling data (raw data after reading it
in):
data_eeg =
 struct with fields:
hdr: [1×1 struct]
label: {129×1 cell}
time: {[1×245726 double]}
trial: {[129×245726 double]}
fsample: 1000
sampleinfo: [1 245726]
elec: [1×1 struct]
cfg: [1×1 struct]

1)      B. cfg for resampling data (I’m using all the default options for
resampling):

Cfg=[];
[data_eeg] = ft_resampledata(cfg, data_eeg); % defaults are all OK

2)      A. data structure for artifact rejection (my data already epoched):
data_eeg =
struct with fields:
hdr: [1×1 struct]
label: {129×1 cell}
time: {1×108 cell}
trial: {1×108 cell}
fsample: 1000
sampleinfo: [108×2 double]
elec: [1×1 struct]
cfg: [1×1 struct]


2)      B. cfg for artifact rejection (taken from the automatic artifact
rejection example):
% jump
cfg = [];
cfg.trl = trl;
cfg.datafile = '100_1_20200305.mff';
cfg.headerfile = '100_1_20200305.mff';
cfg.continuous = 'yes';

% channel selection, cutoff and padding
cfg.artfctdef.zvalue.channel = 'EEG';
cfg.artfctdef.zvalue.cutoff = 20;
cfg.artfctdef.zvalue.trlpadding = 0;
cfg.artfctdef.zvalue.artpadding = 0;
cfg.artfctdef.zvalue.fltpadding = 0;

% algorithmic parameters
cfg.artfctdef.zvalue.cumulative = 'yes';
cfg.artfctdef.zvalue.medianfilter = 'yes';
cfg.artfctdef.zvalue.medianfiltord = 9;
cfg.artfctdef.zvalue.absdiff = 'yes';

% make the process interactive
cfg.artfctdef.zvalue.interactive = 'yes';

[cfg, artifact_jump] = ft_artifact_zvalue(cfg); %plot error and error
using zeros
%[cfg, artifact_jump] = ft_artifact_zvalue(cfg, data_eeg); %no plot error,
but each trial has the same graph, also error using zeros


Kind regards,
Gaëlle Leys



-----Original Message-----
From: fieldtrip <fieldtrip-bounces at science.ru.nl> On Behalf Of
fieldtrip-request at science.ru.nl
Sent: zaterdag 20 juni 2020 12:00
To: fieldtrip at science.ru.nl
Subject: fieldtrip Digest, Vol 115, Issue 22

Send fieldtrip mailing list submissions to
       fieldtrip at science.ru.nl

To subscribe or unsubscribe via the World Wide Web, visit
       https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
or, via email, send a message with subject or body 'help' to
       fieldtrip-request at science.ru.nl

You can reach the person managing the list at
       fieldtrip-owner at science.ru.nl

When replying, please edit your Subject line so it is more specific than
"Re: Contents of fieldtrip digest..."


Today's Topics:

  1. Errors with downsampling and artifact rejection (Gaëlle Leys)
  2. Re: Errors with downsampling and artifact rejection
     (Stephen Whitmarsh)
  3. MNI coordinates for the EEG easycap-M1 layout
     (SILVA PEREIRA, SILVANA)


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

Message: 1
Date: Fri, 19 Jun 2020 12:48:26 +0000
From: Gaëlle Leys <gaelle.leys at kuleuven.be>
To: "fieldtrip at science.ru.nl" <fieldtrip at science.ru.nl>
Subject: [FieldTrip] Errors with downsampling and artifact rejection
Message-ID:
       <ccb89b4d31af42d3b4cd22485438f4ef at ICTS-S-EXMBX17.luna.kuleuven.be>
Content-Type: text/plain; charset="iso-8859-1"

Dear Fieldtrip community,

I have recently started with Fieldtrip for my EEG data processing and I am
encountering some problems which I can't seem to resolve.
I'm working with mff files from an EGI EEG system. I have no problem
reading in and preprocessing the data. However, when trying to downsample
and setup the automatic artifact removal, I'm getting some errors.


1)      When trying to downsample with the default options, these are the
errors that I get:
Error using resample>getSamples (line 357) The number of elements of Tx
must match the number of rows of X when X is a matrix

Error in resample>nonUniformResample (line 123) [x, tx] =
getSamples(varargin{1:2});

Error in resample (line 116)
 [varargout{1:max(1,nargout)}] = nonUniformResample(method,varargin{:});

Error in ft_resampledata (line 228)
       newdat = transpose(resample(transpose(olddat),fsres,fsorig));

               I have tried downsampling before filtering, after
filtering, on continuous data, or already segmented data. None of these
things seem to resolve the error.


2)      When trying to set up the automatic artifact removal process and
choosing yes for the interactive plot, I get a plotting error:

Error using plot

Vectors must be the same length.



Error in ft_artifact_zvalue>redraw_cb (line 973)

   plot(opt.h1, xval, yval, 'linestyle', '-', 'color', 'b',
'displayname', 'data');



Error in ft_artifact_zvalue (line 512)

 redraw_cb(h);

       I've noticed that the xval and yval are different numbers, which
of course doesn't allow plotting. It seems like the xval changes according
to the epoch length, however the yval remains the same and equals the
amount of samples in my continuous data.


3)      When choosing no for the interactive plot, I also get an error:
Error using zeros
Size inputs must be integers.

Error in ft_artifact_zvalue (line 568)
dum = zeros(1,max(opt.trl(:,2)));

I've been looking into the functions and where it goes wrong, but I can't
seem to pinpoint what exactly is causing these issues. Anyone here that can
help or provide me some tips?

Thanks in advance!

Kind regards,

Gaëlle Leys

Research Associate
Brain & Cognition
Tiensestraat 102 box 3714
3000 Leuven
Room PSI 02.33
tel. +32 16 37 61 98

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <
http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200619/e7e1bde8/attachment-0001.htm


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

Message: 2
Date: Fri, 19 Jun 2020 15:08:21 +0200
From: Stephen Whitmarsh <stephen.whitmarsh at gmail.com>
To: FieldTrip discussion list <fieldtrip at science.ru.nl>
Subject: Re: [FieldTrip] Errors with downsampling and artifact
       rejection
Message-ID:
       <CAFrxm=
w44QZ0C7xB4cpsqdy0D0ou5UcpHNM-q3bjyaqwwJxRwg at mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Dear Gaëlle,

To understand the problem it would be helpful to have 1) description of
the data structures going in ft_resampledata (just type in command line and
copy-paste the output) and the artefact detection function you are using,
and 2) the configuration (cfg) you are using for those functions.

Cheers,
Stephen


Op vr 19 jun. 2020 om 14:56 schreef Gaëlle Leys <gaelle.leys at kuleuven.be>:

Dear Fieldtrip community,



I have recently started with Fieldtrip for my EEG data processing and
I am encountering some problems which I can’t seem to resolve.

I’m working with mff files from an EGI EEG system. I have no problem
reading in and preprocessing the data. However, when trying to
downsample and setup the automatic artifact removal, I’m getting some
errors.



1)      When trying to downsample with the default options, these are the
errors that I get:

Error using resample>getSamples (line 357)

The number of elements of Tx must match the number of rows of X when X
is a matrix



Error in resample>nonUniformResample (line 123)

[x, tx] = getSamples(varargin{1:2});



Error in resample (line 116)

 [varargout{1:max(1,nargout)}] =
nonUniformResample(method,varargin{:});



Error in ft_resampledata (line 228)

       newdat = transpose(resample(transpose(olddat),fsres,fsorig));



               I have tried downsampling before filtering, after
filtering, on continuous data, or already segmented data. None of
these things seem to resolve the error.



2)      When trying to set up the automatic artifact removal process and
choosing yes for the interactive plot, I get a plotting error:

Error using plot

Vectors must be the same length.



Error in ft_artifact_zvalue>redraw_cb (line 973)

   plot(opt.h1, xval, yval, 'linestyle', '-', 'color', 'b',
'displayname', 'data');



Error in ft_artifact_zvalue (line 512)

 redraw_cb(h);



       I’ve noticed that the xval and yval are different numbers,
which of course doesn’t allow plotting. It seems like the xval changes
according to the epoch length, however the yval remains the same and
equals the amount of samples in my continuous data.



3)      When choosing no for the interactive plot, I also get an error:

Error using zeros

Size inputs must be integers.



Error in ft_artifact_zvalue (line 568)

dum = zeros(1,max(opt.trl(:,2)));



I’ve been looking into the functions and where it goes wrong, but I
can’t seem to pinpoint what exactly is causing these issues. Anyone
here that can help or provide me some tips?



Thanks in advance!



Kind regards,



Gaëlle Leys



Research Associate
Brain & Cognition
Tiensestraat 102 box 3714
3000 Leuven

Room PSI 02.33
tel. +32 16 37 61 98


_______________________________________________
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/20200619/137e31b1/attachment-0001.htm


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

Message: 3
Date: Fri, 19 Jun 2020 18:58:36 +0200
From: "SILVA PEREIRA, SILVANA" <silvana.silva at upf.edu>
To: fieldtrip at science.ru.nl
Subject: [FieldTrip] MNI coordinates for the EEG easycap-M1 layout
Message-ID:
       <
CA+_MWm1NufDWa-fjR71OzQ5ab88ioyUT8OJ-QFYX9ABr7gNQrA at mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Dear community,

I've been struggling to find the 3D positions (montages) for the
Acticap-64ch-standard2 on the web, which is a modified version of the
easycap-M1, but I have not succeeded. In the Fieldtrip page
http://www.fieldtriptoolbox.org/template/electrode/ you have the
following:

You can find the template 3-D electrode sets included in FieldTrip here <
https://github.com/fieldtrip/fieldtrip/tree/master/template/electrode>.

But in that link you only find a txt file with theta-phi coordinates
(easycap-M1.txt). Is there any place where I could find these positions in
MNI space?

Thank you and best regards,
Silvana
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <
http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200619/c0adf7df/attachment-0001.htm


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

Subject: Digest Footer

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


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

End of fieldtrip Digest, Vol 115, Issue 22
******************************************

_______________________________________________
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/20200622/3ef1e021/attachment-0001.htm>

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

Message: 6
Date: Mon, 22 Jun 2020 21:38:39 +0000
From: Andrade Rey René <rene.andrade at edu.uah.es>
To: "fieldtrip at science.ru.nl" <fieldtrip at science.ru.nl>
Subject: Re: [FieldTrip] fieldtrip Digest, Vol 115, Issue 23
Message-ID: <0CED8809-357C-49C1-B255-9CCE26A7EC75 at edu.uah.es>
Content-Type: text/plain; charset="utf-8"

Is it normal that 16GB of RAM aren't sufficient for a normal EEG? May be I am doing something wrong and that is the reason my RAM isn't enough.

Sent from my iPhone

On 22 Jun 2020, at 12:16, "fieldtrip-request at science.ru.nl" <fieldtrip-request at science.ru.nl> wrote:

﻿Send fieldtrip mailing list submissions to
  fieldtrip at science.ru.nl

To subscribe or unsubscribe via the World Wide Web, visit
  https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
or, via email, send a message with subject or body 'help' to
  fieldtrip-request at science.ru.nl

You can reach the person managing the list at
  fieldtrip-owner at science.ru.nl

When replying, please edit your Subject line so it is more specific
than "Re: Contents of fieldtrip digest..."


Today's Topics:

 1. Running out of memory (RAM) (Andrade Rey René)
 2. Re: Running out of memory (RAM) (Schoffelen, J.M. (Jan Mathijs))
 3. Re: DICS question (Schoffelen, J.M. (Jan Mathijs))


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

Message: 1
Date: Sun, 21 Jun 2020 20:34:49 +0000
From: Andrade Rey René <rene.andrade at edu.uah.es>
To: "fieldtrip at science.ru.nl" <fieldtrip at science.ru.nl>
Subject: [FieldTrip] Running out of memory (RAM)
Message-ID: <C30BBEE6-8A40-4668-8F48-E8244C205963 at edu.uah.es>
Content-Type: text/plain; charset="utf-8"

Dear experts:
I am running this code


cfg = [];
cfg.headmodel = headmodel;
cfg.sourcemodel = leadfield;
cfg.method = 'lcmv';
cfg.lcmv.projectmom = 'yes'; % project dipole time series in direction of maximal power (see below)
cfg.lcmv.kurtosis = 'yes'; % compute kurtosis at each location
source = ft_sourceanalysis(cfg, cov_matrix);

Of http://www.fieldtriptoolbox.org/tutorial/epilepsy/. And I think  I run out of memory because with “top” I can see the computer stops responding when near 85% of RAM memory(16GB).

I cannot report any error because the only problem seems to be that either wrong code or wrong data or I don’t know.

Best,
Andrade.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200621/8b61eaac/attachment-0001.htm>

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

Message: 2
Date: Mon, 22 Jun 2020 06:51:30 +0000
From: "Schoffelen, J.M. (Jan Mathijs)" <jan.schoffelen at donders.ru.nl>
To: FieldTrip discussion list <fieldtrip at science.ru.nl>
Subject: Re: [FieldTrip] Running out of memory (RAM)
Message-ID: <308CD012-C138-486C-9B4C-E7F7487D3426 at donders.ru.nl>
Content-Type: text/plain; charset="utf-8"

Dear Andrade,

Without any more specific information, the only meaningful comment that can be given here, is ‘get yourself a more powerful computer’.

Memory usage depends highly on the operating system (in particular: matlab on windows machines used to be much less memory friendly, but it’s been a while that I have been running real computations on a window machine so perhaps this has changed), the total size of all variables that need to be kept in memory, etc.

Best wishes,
Jan-Mathijs



On 21 Jun 2020, at 22:34, Andrade Rey René <rene.andrade at edu.uah.es<mailto:rene.andrade at edu.uah.es>> wrote:

Dear experts:
I am running this code


cfg = [];
cfg.headmodel = headmodel;
cfg.sourcemodel = leadfield;
cfg.method = 'lcmv';
cfg.lcmv.projectmom = 'yes'; % project dipole time series in direction of maximal power (see below)
cfg.lcmv.kurtosis = 'yes'; % compute kurtosis at each location
source = ft_sourceanalysis(cfg, cov_matrix);

Of http://www.fieldtriptoolbox.org/tutorial/epilepsy/. And I think  I run out of memory because with “top” I can see the computer stops responding when near 85% of RAM memory(16GB).

I cannot report any error because the only problem seems to be that either wrong code or wrong data or I don’t know.

Best,
Andrade.
_______________________________________________
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/20200622/2a12ebf1/attachment-0001.htm>

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

Message: 3
Date: Mon, 22 Jun 2020 07:52:03 +0000
From: "Schoffelen, J.M. (Jan Mathijs)" <jan.schoffelen at donders.ru.nl>
To: FieldTrip discussion list <fieldtrip at science.ru.nl>
Cc: Sanjeev Nara <s.nara at bcbl.eu>, "m.lizarazu at bcbl.eu"
  <m.lizarazu at bcbl.eu>,  Nicola Molinaro <nicolaml at gmail.com>, Craig
  Richter <craiggrichter at gmail.com>
Subject: Re: [FieldTrip] DICS question
Message-ID: <40F6A2CA-6DB9-453A-B33B-6E2413DA4EA8 at donders.ru.nl>
Content-Type: text/plain; charset="utf-8"

Dear Craig,

Let me forward this e-mail to the discussion list, in order to widen the scope to all of Donostia and beyond.

Indeed, the estimation of spectrally resolved GC requires a full bandwidth signal. I have not extensively played with the different options here, but the scenario that you describe, i.e. compute a DICS spatial filter on a narrow bandwidth-of-interest signal, and subjecting the broadband sensor signals to this spatial filter, will, in my opinion, not be really optimal. The reason for this is that the beamformer then can only suppress interference from that particular bandwidth. Signal components that lie outside this range might still leak into the estimated time courses, which may lead to distortion and invalid GC estimates.

So, if you would be using an LCMV beamformer, I’d always recommend a broadband spatial filter, optionally on mildly highpass-filtered data. Then, the risk could be that the 1/f characteristic of the signals results in a covariance matrix whose signal components are dominated by low-frequency stuff. One could then worry about suboptimal spatial filtering of the higher frequency components. This is probably true, and I have worried about this myself, but in my experience this is the least of the worries one should have. (as a side note: I have played around with spectral whitening of the data prior to the beamforming. The reasoning behind this is that the individual variance components in the data are more evenly balanced across the frequency range, but the long story short is that this does not seem to influence the final GC estimate).

A larger worry would be the fact that source-estimated GC spectra very often have a canonical shape, unless you use extremely well-defined data such a visual attention experiment that induces strong gamma band oscillations. If you are into applying connectivity analysis in a more ethereal context, such as a cognitive or language experiment, you will see that source-level GC spectra will be always dominated by the low-frequency components (i.e. most of the time you’ll find a large peak at low frequencies). This of course can reflect genuine neuronal coupling, but my suspicion is that this is most of the time due to ‘weak signal asymmetries’, in other words due to asymmetries in SNR and location specific leakage of power. This can be further investigated using time-flipping and an appropriate statistical evaluation. For inspiration, you can of course always consult my 2017 PNAS paper :).

Another worry of course would be the fact that you’d be working with Elekta data :).

Practically, what I typically do, is to compute the broadband spatial filter with LCMV, and apply these filters (as is, or dimensionality reduced after a parcellation step) to the sensor level cross-spectral density data (from DC to Nyquist). The spectral factorization algorithm should be applied to the source-level data, which in my experience is most stable if you do this pairwise. I know that this is suboptimal in the context of an interpretation of direct versus indirect interactions, but I have always found this an argument that is part of a non-discussion at this stage of the analysis. One should first trust the estimates overall, before a discussion about direct versus indirect coupling becomes relevant.

Best wishes,
JM








On 19 Jun 2020, at 18:06, Craig Richter <craiggrichter at gmail.com<mailto:craiggrichter at gmail.com>> wrote:

Hey JM,

How’s it going? Covid treating you ok? Been a bit crazy here, but normalcy is resuming.

I have a question about DICS for you… :-/... Anyhow, so for coherence at a given frequency DICS is superior, since the spatial-filter is specific to that frequency, which is about the same as a building a noise-covariance matrix from a narrow-band filtered signal? But to do source-level GC, we need the broadband time-series, so we’re forced to use the unfiltered data and LCMV. But… what if we know the frequency we want to analyse, so we build the spatial filter on this frequency, or narrow-band filtered data, then compute virtual time series from the raw data, and compute GC. Then we simply look at our frequency of interest in the spectral results. Would this potentially generate a better GC estimate at the frequency of interest, or would it just mess everything up?

PS - I’ve cc’ed some other interested folks.

Thanks!

C.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200622/1a7e6793/attachment-0001.htm>

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

Subject: Digest Footer

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


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

End of fieldtrip Digest, Vol 115, Issue 23
******************************************



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

Message: 7
Date: Tue, 23 Jun 2020 06:42:03 +0000
From: "Schoffelen, J.M. (Jan Mathijs)" <jan.schoffelen at donders.ru.nl>
To: FieldTrip discussion list <fieldtrip at science.ru.nl>
Subject: Re: [FieldTrip] Errors with downsampling and artifact
rejection
Message-ID: <184602F0-A203-406F-B278-32CD899D4532 at donders.ru.nl>
Content-Type: text/plain; charset="utf-8"

Hi Gaëlle,

Adding to Stephen’s comment: reading through the code and comments (highly recommended to occasionally do this, then you get a feel what’s going on under the hood) I saw that there’s a discrepancy between the comments in the help section of ft_resampledata, where it states that the default resamplefs=256, and the actually implemented default resamplefs, which is []. Apparently, MATLAB is lenient with respect to mathematical operations involving empty variables. Specifically, it doesn’t throw an error on lines 160/161 in ft_resampledata, where an empty variable is multiplied and divided by a scalar. Long story short, the silently accepted empty variable is the acual cause of the reported problem in ft_resampledata.

I look forward to a PR that fixes this. I suggest making the documentation consistent, i.e. stating that cfg.resamplefs is an argument that needs to be defined, and explicitly check this in the code, i.e. throw an error if it isn’t defined. This is typically done with a call to ft_checkconfig using the key-value pair ‘required’, and ‘resamplefs’ (in this case).

Thanks for your contribution,

Jan-Mathijs





On 22 Jun 2020, at 17:35, Stephen Whitmarsh <stephen.whitmarsh at gmail.com<mailto:stephen.whitmarsh at gmail.com>> wrote:

Dear Gaëlle,

You are using default settings for downsampling, which will then try to downsample to 256Hz. Your original samplerate is 1000Hz, so that isn't a neat integer division.
I tried the following, and could reproduce your problem:

Fs = 1000;
data_eeg = [];
data_eeg.label = {'a','b','c'};
data_eeg.time{1} = 0:1/Fs:10;
data_eeg.trial{1} = rand(length(data_eeg.label),length(data_eeg.time{1}));
data_eeg.Fs = Fs;
data_eeg.sampleinfo = [1, length(data_eeg.time{1})];

% Doesn't work:
cfg = [];
[data_eeg] = ft_resampledata(cfg, data_eeg);

% Does work:
cfg = [];
cfg.resamplefs = 250;
[data_eeg] = ft_resampledata(cfg, data_eeg);

So that deals with your first problem. Not sure why it has a problem with the downsampling to non-integer values, but it's good practice and much faster to stick to that anyway.

Not sure what to do with the artefact detection though, or what you expect;  it seems you are running it with some contradictory settings/ways perhaps:
- use cfg.dataset if reading from disk directly OR give datastructure to function is you already have data in memory
- use cfg.continuous when data is not segmented
- the comment "jump" suggests you use settings for SQUID jumps, i.e. optimized for MEG, but that should not give an error :-)

I suspect you probably want to run artefact detection on your segmented data, so remove those references to the data on disk (datafile, headerfile), and the trl from the cfg, and give your segmented data as an argument as you did here:
%[cfg, artifact_jump] = ft_artifact_zvalue(cfg, data_eeg); %no plot error, but each trial has the same graph, also error using zeros

Let us know how it goes,

All the best,
Stephen











Op ma 22 jun. 2020 om 17:02 schreef Gaëlle Leys <gaelle.leys at kuleuven.be<mailto:gaelle.leys at kuleuven.be>>:
Dear Stephen,

I have included the data structures and cfg's involved in the functions.

1)      A. data structure for resampling data (raw data after reading it in):
data_eeg =
 struct with fields:
hdr: [1×1 struct]
label: {129×1 cell}
time: {[1×245726 double]}
trial: {[129×245726 double]}
fsample: 1000
sampleinfo: [1 245726]
elec: [1×1 struct]
cfg: [1×1 struct]

1)      B. cfg for resampling data (I’m using all the default options for resampling):

Cfg=[];
[data_eeg] = ft_resampledata(cfg, data_eeg); % defaults are all OK

2)      A. data structure for artifact rejection (my data already epoched):
data_eeg =
struct with fields:
hdr: [1×1 struct]
label: {129×1 cell}
time: {1×108 cell}
trial: {1×108 cell}
fsample: 1000
sampleinfo: [108×2 double]
elec: [1×1 struct]
cfg: [1×1 struct]


2)      B. cfg for artifact rejection (taken from the automatic artifact rejection example):
% jump
cfg = [];
cfg.trl = trl;
cfg.datafile = '100_1_20200305.mff';
cfg.headerfile = '100_1_20200305.mff';
cfg.continuous = 'yes';

% channel selection, cutoff and padding
cfg.artfctdef.zvalue.channel = 'EEG';
cfg.artfctdef.zvalue.cutoff = 20;
cfg.artfctdef.zvalue.trlpadding = 0;
cfg.artfctdef.zvalue.artpadding = 0;
cfg.artfctdef.zvalue.fltpadding = 0;

% algorithmic parameters
cfg.artfctdef.zvalue.cumulative = 'yes';
cfg.artfctdef.zvalue.medianfilter = 'yes';
cfg.artfctdef.zvalue.medianfiltord = 9;
cfg.artfctdef.zvalue.absdiff = 'yes';

% make the process interactive
cfg.artfctdef.zvalue.interactive = 'yes';

[cfg, artifact_jump] = ft_artifact_zvalue(cfg); %plot error and error using zeros
%[cfg, artifact_jump] = ft_artifact_zvalue(cfg, data_eeg); %no plot error, but each trial has the same graph, also error using zeros


Kind regards,
Gaëlle Leys



-----Original Message-----
From: fieldtrip <fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl>> On Behalf Of fieldtrip-request at science.ru.nl<mailto:fieldtrip-request at science.ru.nl>
Sent: zaterdag 20 juni 2020 12:00
To: fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>
Subject: fieldtrip Digest, Vol 115, Issue 22

Send fieldtrip mailing list submissions to
       fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>

To subscribe or unsubscribe via the World Wide Web, visit
       https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
or, via email, send a message with subject or body 'help' to
       fieldtrip-request at science.ru.nl<mailto:fieldtrip-request at science.ru.nl>

You can reach the person managing the list at
       fieldtrip-owner at science.ru.nl<mailto:fieldtrip-owner at science.ru.nl>

When replying, please edit your Subject line so it is more specific than "Re: Contents of fieldtrip digest..."


Today's Topics:

  1. Errors with downsampling and artifact rejection (Gaëlle Leys)
  2. Re: Errors with downsampling and artifact rejection
     (Stephen Whitmarsh)
  3. MNI coordinates for the EEG easycap-M1 layout
     (SILVA PEREIRA, SILVANA)


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

Message: 1
Date: Fri, 19 Jun 2020 12:48:26 +0000
From: Gaëlle Leys <gaelle.leys at kuleuven.be<mailto:gaelle.leys at kuleuven.be>>
To: "fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>" <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>>
Subject: [FieldTrip] Errors with downsampling and artifact rejection
Message-ID:
       <ccb89b4d31af42d3b4cd22485438f4ef at ICTS-S-EXMBX17.luna.kuleuven.be<mailto:ccb89b4d31af42d3b4cd22485438f4ef at ICTS-S-EXMBX17.luna.kuleuven.be>>
Content-Type: text/plain; charset="iso-8859-1"

Dear Fieldtrip community,

I have recently started with Fieldtrip for my EEG data processing and I am encountering some problems which I can't seem to resolve.
I'm working with mff files from an EGI EEG system. I have no problem reading in and preprocessing the data. However, when trying to downsample and setup the automatic artifact removal, I'm getting some errors.


1)      When trying to downsample with the default options, these are the errors that I get:
Error using resample>getSamples (line 357) The number of elements of Tx must match the number of rows of X when X is a matrix

Error in resample>nonUniformResample (line 123) [x, tx] = getSamples(varargin{1:2});

Error in resample (line 116)
 [varargout{1:max(1,nargout)}] = nonUniformResample(method,varargin{:});

Error in ft_resampledata (line 228)
       newdat = transpose(resample(transpose(olddat),fsres,fsorig));

               I have tried downsampling before filtering, after filtering, on continuous data, or already segmented data. None of these things seem to resolve the error.


2)      When trying to set up the automatic artifact removal process and choosing yes for the interactive plot, I get a plotting error:

Error using plot

Vectors must be the same length.



Error in ft_artifact_zvalue>redraw_cb (line 973)

   plot(opt.h1, xval, yval, 'linestyle', '-', 'color', 'b', 'displayname', 'data');



Error in ft_artifact_zvalue (line 512)

 redraw_cb(h);

       I've noticed that the xval and yval are different numbers, which of course doesn't allow plotting. It seems like the xval changes according to the epoch length, however the yval remains the same and equals the amount of samples in my continuous data.


3)      When choosing no for the interactive plot, I also get an error:
Error using zeros
Size inputs must be integers.

Error in ft_artifact_zvalue (line 568)
dum = zeros(1,max(opt.trl(:,2)));

I've been looking into the functions and where it goes wrong, but I can't seem to pinpoint what exactly is causing these issues. Anyone here that can help or provide me some tips?

Thanks in advance!

Kind regards,

Gaëlle Leys

Research Associate
Brain & Cognition
Tiensestraat 102 box 3714
3000 Leuven
Room PSI 02.33
tel. +32 16 37 61 98

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200619/e7e1bde8/attachment-0001.htm>

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

Message: 2
Date: Fri, 19 Jun 2020 15:08:21 +0200
From: Stephen Whitmarsh <stephen.whitmarsh at gmail.com<mailto:stephen.whitmarsh at gmail.com>>
To: FieldTrip discussion list <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>>
Subject: Re: [FieldTrip] Errors with downsampling and artifact
       rejection
Message-ID:
       <CAFrxm=w44QZ0C7xB4cpsqdy0D0ou5UcpHNM-q3bjyaqwwJxRwg at mail.gmail.com<mailto:w44QZ0C7xB4cpsqdy0D0ou5UcpHNM-q3bjyaqwwJxRwg at mail.gmail.com>>
Content-Type: text/plain; charset="utf-8"

Dear Gaëlle,

To understand the problem it would be helpful to have 1) description of the data structures going in ft_resampledata (just type in command line and copy-paste the output) and the artefact detection function you are using, and 2) the configuration (cfg) you are using for those functions.

Cheers,
Stephen


Op vr 19 jun. 2020 om 14:56 schreef Gaëlle Leys <gaelle.leys at kuleuven.be<mailto:gaelle.leys at kuleuven.be>>:

Dear Fieldtrip community,



I have recently started with Fieldtrip for my EEG data processing and
I am encountering some problems which I can’t seem to resolve.

I’m working with mff files from an EGI EEG system. I have no problem
reading in and preprocessing the data. However, when trying to
downsample and setup the automatic artifact removal, I’m getting some errors.



1)      When trying to downsample with the default options, these are the
errors that I get:

Error using resample>getSamples (line 357)

The number of elements of Tx must match the number of rows of X when X
is a matrix



Error in resample>nonUniformResample (line 123)

[x, tx] = getSamples(varargin{1:2});



Error in resample (line 116)

 [varargout{1:max(1,nargout)}] =
nonUniformResample(method,varargin{:});



Error in ft_resampledata (line 228)

       newdat = transpose(resample(transpose(olddat),fsres,fsorig));



               I have tried downsampling before filtering, after
filtering, on continuous data, or already segmented data. None of
these things seem to resolve the error.



2)      When trying to set up the automatic artifact removal process and
choosing yes for the interactive plot, I get a plotting error:

Error using plot

Vectors must be the same length.



Error in ft_artifact_zvalue>redraw_cb (line 973)

   plot(opt.h1, xval, yval, 'linestyle', '-', 'color', 'b',
'displayname', 'data');



Error in ft_artifact_zvalue (line 512)

 redraw_cb(h);



       I’ve noticed that the xval and yval are different numbers,
which of course doesn’t allow plotting. It seems like the xval changes
according to the epoch length, however the yval remains the same and
equals the amount of samples in my continuous data.



3)      When choosing no for the interactive plot, I also get an error:

Error using zeros

Size inputs must be integers.



Error in ft_artifact_zvalue (line 568)

dum = zeros(1,max(opt.trl(:,2)));



I’ve been looking into the functions and where it goes wrong, but I
can’t seem to pinpoint what exactly is causing these issues. Anyone
here that can help or provide me some tips?



Thanks in advance!



Kind regards,



Gaëlle Leys



Research Associate
Brain & Cognition
Tiensestraat 102 box 3714
3000 Leuven

Room PSI 02.33
tel. +32 16 37 61 98


_______________________________________________
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/20200619/137e31b1/attachment-0001.htm>

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

Message: 3
Date: Fri, 19 Jun 2020 18:58:36 +0200
From: "SILVA PEREIRA, SILVANA" <silvana.silva at upf.edu<mailto:silvana.silva at upf.edu>>
To: fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>
Subject: [FieldTrip] MNI coordinates for the EEG easycap-M1 layout
Message-ID:
       <CA+_MWm1NufDWa-fjR71OzQ5ab88ioyUT8OJ-QFYX9ABr7gNQrA at mail.gmail.com<mailto:CA%2B_MWm1NufDWa-fjR71OzQ5ab88ioyUT8OJ-QFYX9ABr7gNQrA at mail.gmail.com>>
Content-Type: text/plain; charset="utf-8"

Dear community,

I've been struggling to find the 3D positions (montages) for the
Acticap-64ch-standard2 on the web, which is a modified version of the easycap-M1, but I have not succeeded. In the Fieldtrip page http://www.fieldtriptoolbox.org/template/electrode/ you have the following:

You can find the template 3-D electrode sets included in FieldTrip here <https://github.com/fieldtrip/fieldtrip/tree/master/template/electrode>.

But in that link you only find a txt file with theta-phi coordinates (easycap-M1.txt). Is there any place where I could find these positions in MNI space?

Thank you and best regards,
Silvana
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200619/c0adf7df/attachment-0001.htm>

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

Subject: Digest Footer

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


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

End of fieldtrip Digest, Vol 115, Issue 22
******************************************

_______________________________________________
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/20200623/62aa978f/attachment-0001.htm>

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

Subject: Digest Footer

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


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

End of fieldtrip Digest, Vol 115, Issue 24
******************************************

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200624/3af4d8c9/attachment.htm>

From christophe.grova at mcgill.ca  Wed Jun 24 21:33:11 2020
From: christophe.grova at mcgill.ca (Christophe Grova)
Date: Wed, 24 Jun 2020 19:33:11 +0000
Subject: [FieldTrip] Two postdoctoral positions available in the Multimodal
 Functional Imaging Lab in Montreal
In-Reply-To: <QB1PR01MB251310C4C9B0F6489B6D663490950@QB1PR01MB2513.CANPRD01.PROD.OUTLOOK.COM>
References: <QB1PR01MB2513533AF0AD9C92105143A490950@QB1PR01MB2513.CANPRD01.PROD.OUTLOOK.COM>,
 <QB1PR01MB251310C4C9B0F6489B6D663490950@QB1PR01MB2513.CANPRD01.PROD.OUTLOOK.COM>
Message-ID: <QB1PR01MB2513A19E95021E4662A7B58490950@QB1PR01MB2513.CANPRD01.PROD.OUTLOOK.COM>



Multimodal neuroimaging in epilepsy and sleep

Two postdoctoral positions available in the MultiFunkIm Lab - Montreal Canada

McGill University  / Concordia University



I am happy to announce that there are two postdoc positions available in my lab, the Multimodal Functional Imaging Lab located both at Concordia University (PERFORM Centre) and in Biomedical Engineering Dpt at McGill University, Montreal Canada. The fellow will join a multidisciplinary team and have the opportunity to get involved in projects involving multimodal data application (EEG/MEG, high density EEG, simultaneous EEG/fMRI, prolonged EEG/fNIRS recordings, intracranial EEG) for applications in epilepsy presurgical mapping and sleep studies, advanced methodological and statistical analysis developments, and contributions in neuroimaging software implementations.

Position 1: MEG and high density EEG analysis in epilepsy and sleep studies: we are looking for a postdoctoral fellow with solid engineering background and expertise in EEG/MEG source modeling, to join our team to get involved in advanced development of source localization techniques, contribution to our Maximum Entropy on the Mean package https://neuroimage.usc.edu/brainstorm/Tutorials/TutBEst, evaluation of source localization methods for resting state connectivity and advanced computational modeling. In close collaboration with the epilepsy team of the Neuro (Montreal Neurological Institute), the fellow will have access to MEG, high density EEG and intracranial EEG recordings of epilepsy patients, aiming at developing and validating methods localizing epileptic discharges (spikes, seizures) but also studying ongoing resting state patterns, providing new biomarkers to predict surgical outcome (https://pubmed.ncbi.nlm.nih.gov/32191632/). Applicants must have a PhD (or close to completion) in a related field (e.g., neurosciences, computer science, biomedical engineering, physics). Applicants should have strong knowledge of Matlab and or Python and/or experience in analysis of neuroimaging, excellent organizational skills, an aptitude for teamwork, good writing skills and a productive publication record. Experience in one or more aspects of the research themes will constitute an asset.

Position 2: Multimodal investigation of epileptic activity using simultaneous EEG/MEG and whole night EEG/NIRS monitoring: we are looking for an MD candidate (neurologist) with previous training in epileptology and neurophysiology (EEG). Expertise in analyzing MEG or NIRS signals and/or computational skills including neuroimaging softwares are appreciated additional qualification. The candidate should be fluent in English (and if possible French) due to the patient population studied. Combined with EEG measuring brain electric activity on the scalp, NIRS allows studying hemodynamic processes at the time of spontaneous epileptic activity. The candidate will join a team of engineers and methodologists who will provide access in 3D reconstruction of the generators of EEG, MEG and NIRS signals and methods to assess multimodal concordances between bioelectrical neuronal signals and hemodynamic processes. The purpose of this Postdoctoral project will be to assess the integrity of neurovascular coupling processes at the time of epileptic discharges and interaction using a unique multimodal environment involving EEG/MEG, EEG/NIRS and EEG/fMRI recordings, while benefitting from whole night personalized  EEG-NIRS  monitoring  (Pellegrino et al Frontiers in Neurosc. 2016<https://www.ncbi.nlm.nih.gov/pubmed/27047325>) to  study interaction  between  sleep and epilepsy.  The candidate will directly benefit from our new software package dedicated to NIRS data analysis NIRSTOR: https://github.com/Nirstorm/nirstorm.



Data acquisitions will take place either at PERFORM centre at Concordia University (http://www.concordia.ca/research/perform.html) or at the McConnell Brain Imaging Centre of the Montreal Neurological Institute at McGill University (https://www.mcgill.ca/bic/). Collaborators include expert  epileptologist from the Montreal Neurological Institute (Dr. F. Dubeau, Dr. B. Frauscher, Dr. J. Gotman and Dr. E. Kobayashi), expertise in sleep and  neuroimaging (Dr. T.T. Dang-Vu, PERFORM / Concordia, Dr Frauscher) and expert methodologists in neuroimaging and signal processing (Dr. J.M. Lina, Ecole de Technologie Supérieure, Dr. H. Benali , PERFORM / Concordia)



Both positions are available now. Review of applications will begin as they are received and will continue until the position has been filled. If interested please send your CV, a brief research statement and two references letters to myself: christophe.grova at concordia.ca

Please note that I am attending OHBM conference, so will be happy to meet you at your poster and to schedule interviews.



Cordially

Christophe Grova

Dr. Christophe Grova, Ph.D,

Associate Professor, PERFORM Centre

Department of Physics, Concordia U.

Adjunct Professor in Biomedical Engineering,

Neurology & Neurosurgery, McGill U.

christophe.grova at concordia.ca



For more information about our current research programs, please visit the lab website:

https://www.concordia.ca/artsci/physics/research/grova-research-group.html


***************************
Christophe Grova, PhD
Associate Professor, Physics Dpt, Concordia University
PERFORM centre, Concordia University,
Chair of PERFORM Applied Bio-Imaging Committee (ABC)

Adjunct Prof in Biomedical Engineering, and Neurology and Neurosurgery Dpt, McGill University
Multimodal Functional Imaging Lab (Multi FunkIm)
Montreal Neurological Institute - epilepsy group
Centre de Recherches en Mathématiques

Physics Dpt Concordia University - Loyola Campus - Office SP 265.02
7141 Sherbrooke Street West, Montreal, QC  H4B 1R6
Phone: (514) 848-2424 ext.4221

Biomedical Engineering Department McGill University - Room 304
3775 University Street, Montreal, Quebec, Canada, H3A 2B4
Phone : (514) 398 2516
Fax : (514) 398 7461

email : christophe.grova at concordia.ca , christophe.grova at mcgill.ca

web:
Explore Concordia: http://explore.concordia.ca/christophe-grova
Physics, Concordia University: http://www.concordia.ca/artsci/physics/faculty.html?fpid=christophe-grova
McGill University: http://www.bic.mni.mcgill.ca/ResearchLabsMFIL/PeopleChristophe
MultiFunkIm Lab: http://www.bic.mni.mcgill.ca/ResearchLabsMFIL/HomePage

***************************
[X]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200624/972edfc2/attachment.htm>

From bnuzhanglei2008 at gmail.com  Thu Jun 25 14:45:39 2020
From: bnuzhanglei2008 at gmail.com (Lei Zhang)
Date: Thu, 25 Jun 2020 14:45:39 +0200
Subject: [FieldTrip] Tenure-Track Assistant Professor in Professorship in
 Cognitive Neuroscience of brain-microbiome interaction (University of
 Vienna)
Message-ID: <CANUgFMdpKvJa8Z_UpOcNr69a7=hNP467fFwaMYwcrW31V+egKA@mail.gmail.com>

(my apologies for cross-posting)

Dear colleagues,

The Vienna Cognitive Science Hub is looking for a Tenure-Track
Professorship in Cognitive Neuroscience of brain-microbiome interaction.

The application deadline is 23.09.2020.

The candidate for the tenure track position should have a strong focus on
the translational and integrative potential of human cognitive
neuroscience, at the interface of (social) brain, cognition, their
disorders, and the microbiome. Research should be building upon a strong
conceptual framework and interdisciplinarity. The methodological approach
should focus on the interplay between neuro-cognitive processes and neural
codes, and their relation to biological regulation systems driven by the
microbiome, in humans.

Thematically, the focus should be on basic mechanistic research in the
domains of (social) emotion and cognition, as well as their disorders,
preferentially but not necessarily on topics such as social interaction,
affiliation, or learning and memory.

While basic in nature, the research should hold potential to advance the
translational understanding of mental and cognitive disorders, such as
depression and autism, or of agingrelated diseases, such as Alzheimer’s
disease, or Frontotemporal Dementia, respectively.
The position provides excellent opportunities to strengthen
cross-institutional collaborative initiatives within the domain of
neuroscience and microbiome research.

[Job Flyer] https://bit.ly/3i2OTU8
[Full Description] https://bit.ly/2Yxwwza

Contact for questions regarding the advertisement:
peter.rantasa at univie.ac.at

Best wishes,
Lei

*Dr. Lei Zhang*
Postdoc

Social, Cognitive & Affective Neuroscience Unit
<http://scan-psy.univie.ac.at/>
Department of Cognition, Emotion, and Methods in Psychology

Faculty of Psychology
University of Vienna
Liebiggasse 5, 1010 Vienna, Austria
e: lei.zhang at univie.ac.at
w: lei-zhang.net
t: @lei_zhang_lz <https://twitter.com/lei_zhang_lz>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200625/62f236e8/attachment.htm>

From koman888 at mail.ru  Thu Jun 25 17:49:08 2020
From: koman888 at mail.ru (=?UTF-8?B?0JrQuNGA0LjQu9C7INCa0L7QvNCw0YDQvtCy?=)
Date: Thu, 25 Jun 2020 18:49:08 +0300
Subject: [FieldTrip] =?utf-8?q?very_low_sLORETA__values?=
Message-ID: <1593100148.339240054@f385.i.mail.ru>


Dear Fieldtrippers,
        I am doing a research of auditory ERP.
        I've performed source reconstruction using sLORETA method.
        'The dSPM and sLORETA values are statistical scores akin to z-scores and F-scores; therefore they are unit-less and can be interpreted at deviation from “standard fluctuations” as defined from noise or baseline variance stats for instance. 
        I want to understand why sLORETA applied to data produces so small values for time-courses:
        1e-10, 1e-9?
Meanwhile dSPM yields time-courses in the range 1e+1 - 1e-1.
        Could You explain or post a reference link?
        Best wishes,
        Kirill
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200625/178225ab/attachment.htm>

From jan.schoffelen at donders.ru.nl  Thu Jun 25 19:17:11 2020
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Thu, 25 Jun 2020 17:17:11 +0000
Subject: [FieldTrip] very low sLORETA  values
In-Reply-To: <1593100148.339240054@f385.i.mail.ru>
References: <1593100148.339240054@f385.i.mail.ru>
Message-ID: <AA4C2F6D-2E5F-43CE-A881-286431EF7A77@donders.ru.nl>

Hi Kirill,

I don’t know where you got the quote from, so I cannot comment on what I would expect as output units, but I suggest that you check the documentation of the ft_sloreta function, and/or read in the code what is actually done to generate the function’s output.

My suspicion is that what is called ’sloreta’ in fieldtrip does not correspond to the ‘classical’ definition of sloreta that you refer to. From the top of my head already a big difference would be that the original sloreta is a distributed sourcemodel, which is typically obtained using a single inversion step,  while the implementation in fieldtrip seems to run a ’scan’ dipole per dipole, and seems to follow the formulation in the Sekihara and Nagarajan book. Whether or not these in the end of the day are equivalent: I don’t know. (And at the moment I find it way too hot to think about this)

Best wishes,
Jan-Mathijs







On 25 Jun 2020, at 17:49, Кирилл Комаров <koman888 at mail.ru<mailto:koman888 at mail.ru>> wrote:

Dear Fieldtrippers,
        I am doing a research of auditory ERP.
        I've performed source reconstruction using sLORETA method.
        'The dSPM and sLORETA values are statistical scores akin to z-scores and F-scores; therefore they are unit-less and can be interpreted at deviation from “standard fluctuations” as defined from noise or baseline variance stats for instance.
        I want to understand why sLORETA applied to data produces so small values for time-courses:
        1e-10, 1e-9?
Meanwhile dSPM yields time-courses in the range 1e+1 - 1e-1.
        Could You explain or post a reference link?
        Best wishes,
        Kirill


_______________________________________________
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/20200625/2855f92e/attachment.htm>

From jonas at obleser.de  Fri Jun 26 17:23:07 2020
From: jonas at obleser.de (Jonas Obleser)
Date: Fri, 26 Jun 2020 17:23:07 +0200
Subject: [FieldTrip] =?utf-8?q?Job_alert=3A_PhD_position_University_of_L?=
 =?utf-8?q?=C3=BCbeck_w/Jonas_Obleser_=28GER=29_and_Bj=C3=B6rn_Herrmann_?=
 =?utf-8?b?KENBTik=?=
Message-ID: <233A8E57-D408-4915-AE64-33EDD2DC40B1@obleser.de>

Dear all,

please alert any potentially interested MSc student or RA to this new PhD opportunity, ideally starting towards the end of the year. Application deadline (PDF) is July 12.
Ample opportunity to learn or deepen knowledge on EEG/MEG signals!
Job ad here: https://www.dropbox.com/s/d3obe7igjjp0pdd/Final_1035_Ausschreibung-IPSY-Obleser_Wiss-MitarbeiterIn_DFG-EN.pdf?dl=1 <https://www.dropbox.com/s/d3obe7igjjp0pdd/Final_1035_Ausschreibung-IPSY-Obleser_Wiss-MitarbeiterIn_DFG-EN.pdf?dl=1>. 

Best wishes, Jonas



Jonas Obleser
Chair in Physiological Psychology and Research Methods
 
University of Lübeck
Department of Psychology
MFC 8, Maria-Goeppert-Straße 9a
23562 Lübeck, Germany

Phone +49 (0)451 3101 3620
Mobile +49 (0)171 6993337
jonas.obleser at uni-luebeck.de <mailto:jonas.obleser at uni-luebeck.de>
http://jonasobleser.com <http://jonasobleser.com/>
http://auditorycognition.com <http://auditorycognition.com/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200626/fd2a9a8a/attachment.htm>

From Moataz.Assem at mrc-cbu.cam.ac.uk  Fri Jun 26 19:26:03 2020
From: Moataz.Assem at mrc-cbu.cam.ac.uk (Moataz Assem)
Date: Fri, 26 Jun 2020 17:26:03 +0000
Subject: [FieldTrip] fieldtrip Digest, Vol 115, Issue 17
In-Reply-To: <mailman.144.1592477599.2003.fieldtrip@science.ru.nl>
References: <mailman.144.1592477599.2003.fieldtrip@science.ru.nl>
Message-ID: <33ad9f175a7b47b69c91e377c2748f42@mrc-cbu.cam.ac.uk>


Hi Tzvetan,

I have a similar problem and I think it might have something to do with matlab rendering (or perhaps the OS).
I explored plotting with matlab 2014a instead of 2018a and the vertices were patched up.

Moataz

________________________________
From: fieldtrip <fieldtrip-bounces at science.ru.nl> on behalf of fieldtrip-request at science.ru.nl <fieldtrip-request at science.ru.nl>
Sent: 18 June 2020 11:53
To: fieldtrip at science.ru.nl
Subject: fieldtrip Digest, Vol 115, Issue 17

Send fieldtrip mailing list submissions to
        fieldtrip at science.ru.nl

To subscribe or unsubscribe via the World Wide Web, visit
        https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
or, via email, send a message with subject or body 'help' to
        fieldtrip-request at science.ru.nl

You can reach the person managing the list at
        fieldtrip-owner at science.ru.nl

When replying, please edit your Subject line so it is more specific
than "Re: Contents of fieldtrip digest..."


Today's Topics:

   1. empty vertices in surface sourceplot (Tzvetan Popov)


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

Message: 1
Date: Thu, 18 Jun 2020 12:53:11 +0200
From: Tzvetan Popov <tzvetan.popov at uni-konstanz.de>
To: FieldTrip discussion list <fieldtrip at science.ru.nl>
Subject: [FieldTrip] empty vertices in surface sourceplot
Message-ID: <386B0262-AAFC-48D9-928E-4574947EB167 at uni-konstanz.de>
Content-Type: text/plain; charset="utf-8"

Dear all,

I am working with a source map (panel A in the attached figure) reconstructed in the Yeo17 atlas space. The result of ft_sourceparcelate (panel B) looks reasonable to me. I would like to plot this on the cortical surface. Yet I also get some empty patches (panel C). Has anyone run into the same problem and figured out a solution?

This is my configuration during the surface plot:
cfg = [];
cfg.method         = 'surface';
cfg.funparameter   = 'pow';
cfg.surffile       = 'surface_white_both.mat';
cfg.surfinflated       = 'surface_inflated_both.mat';
cfg.camlight       = 'no';
ft_sourceplot(cfg, parcel);
view ([0 0])
light('Position',[0 -1 0]);


Thanks a bunch!
tzvetan



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200618/70e041f6/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot 2020-06-18 12.40.52.png
Type: image/png
Size: 465307 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200618/70e041f6/attachment.png

[http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200618/70e041f6/attachment.png]

>

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

Subject: Digest Footer

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


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

End of fieldtrip Digest, Vol 115, Issue 17
******************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200626/d94c74ad/attachment.htm>

From lmelloni at gmail.com  Sun Jun 28 18:05:30 2020
From: lmelloni at gmail.com (Lucia Melloni)
Date: Sun, 28 Jun 2020 18:05:30 +0200
Subject: [FieldTrip] Scientific Project Coordinator for an open science,
 large-scale collaboration
Message-ID: <4C1EF073-765C-479D-83FA-734B27B0F66F@gmail.com>

Dear all,

If you are seeking a challenge, if you are dynamic and enthusiastic about managing a large consortium of scientists, then do not hesitate to apply for the Scientific Project Coordinator  position in my group at the Max Planck Institute for Empirical Aesthetics. You will be coordinating this <https://science.sciencemag.org/content/366/6463/293> project which was recently features in science, and involves 11 institutions across Europe, the US and China running an adversarial collaboration project aimed at understanding the neural foundations of consciousness. 

This is a unique opportunity to contribute to the development of an open science model for large-scale collaborations. We are looking for an internationally experienced scientist with knowledge of science management, networking, and international collaboration, and a keen interest in developing practices and procedures for open science.  This is a full-time position for 2 years. 

More information on the job requirements and the position can be found here <https://www.aesthetics.mpg.de/karriere/jobs/scientific-project-coordinator-mfd.html>.

For enquiries concerning this job opportunity please contact Dr. Lucia Melloni: lucia.melloni at ae.mpg.de <mailto:lucia.melloni at ae.mpg.de>.

Please submit your application - preferably online in a single pdf - including a CV and a cover letter describing your background, experience and motivation as well as the names of two references, who have previously agreed to be contacted, no later than July 31, 2020 to: job at ae.mpg.de <mailto:job at ae.mpg.de>
Looking forward to the applications!

Best wishes,

Lucia Melloni
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200628/c38f374c/attachment.htm>

From gaelle.leys at kuleuven.be  Mon Jun 29 10:58:48 2020
From: gaelle.leys at kuleuven.be (=?utf-8?B?R2HDq2xsZSBMZXlz?=)
Date: Mon, 29 Jun 2020 08:58:48 +0000
Subject: [FieldTrip] Errors with downsampling and artifact rejection
Message-ID: <1784f60e69e04a5fb5b27d20bdb365a7@ICTS-S-EXMBX17.luna.kuleuven.be>

Dear Stephen, 

The downsampling works with 200 or 250Hz!
As for the artifact rejection, changing the settings to what you suggested and working with the downsampled data solved all the errors that I was getting. 

Thanks for the help!

Kind regards, 
Gaëlle Leys


-----Original Message-----
From: fieldtrip <fieldtrip-bounces at science.ru.nl> On Behalf Of fieldtrip-request at science.ru.nl
Sent: dinsdag 23 juni 2020 12:00
To: fieldtrip at science.ru.nl
Subject: fieldtrip Digest, Vol 115, Issue 24

Send fieldtrip mailing list submissions to
	fieldtrip at science.ru.nl

To subscribe or unsubscribe via the World Wide Web, visit
	https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
or, via email, send a message with subject or body 'help' to
	fieldtrip-request at science.ru.nl

You can reach the person managing the list at
	fieldtrip-owner at science.ru.nl

When replying, please edit your Subject line so it is more specific
than "Re: Contents of fieldtrip digest..."


Today's Topics:

   1. Re: Running out of memory (RAM) (Eelke Spaak)
   2. Connectivity Dimensions (Michael Glassen  -  Biomedical Engineer)
   3. Re: Connectivity Dimensions (Schoffelen, J.M. (Jan Mathijs))
   4. Re: Errors with downsampling and artifact rejection (Gaëlle Leys)
   5. Re: Errors with downsampling and artifact rejection
      (Stephen Whitmarsh)
   6. Re: fieldtrip Digest, Vol 115, Issue 23 (Andrade Rey René)
   7. Re: Errors with downsampling and artifact rejection
      (Schoffelen, J.M. (Jan Mathijs))


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

Message: 1
Date: Mon, 22 Jun 2020 15:27:19 +0200
From: Eelke Spaak <e.spaak at donders.ru.nl>
To: FieldTrip discussion list <fieldtrip at science.ru.nl>
Subject: Re: [FieldTrip] Running out of memory (RAM)
Message-ID:
	<CABPNLUqmPjmyXR4gbRG3y-MLf97-SPGnRA+zp=SA4TBkCOugzw at mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Dear Andrade,

You could have a look here for some tips on memory efficiency:
http://www.fieldtriptoolbox.org/tutorial/memory/ Probably most relevant to
you: change the data precision to single, rather than double (saves ~50%).

Best,
Eelke

On Sun, 21 Jun 2020 at 22:34, Andrade Rey René <rene.andrade at edu.uah.es>
wrote:

> Dear experts:
> I am running this code
>
> cfg = [];cfg.headmodel = headmodel;cfg.sourcemodel = leadfield;cfg.method = 'lcmv';cfg.lcmv.projectmom = 'yes'; % project dipole time series in direction of maximal power (see below)cfg.lcmv.kurtosis = 'yes'; % compute kurtosis at each locationsource = ft_sourceanalysis(cfg, cov_matrix);
>
>
> Of http://www.fieldtriptoolbox.org/tutorial/epilepsy/. And I think  I run
> out of memory because with “top” I can see the computer stops responding
> when near 85% of RAM memory(16GB).
>
> I cannot report any error because the only problem seems to be that either
> wrong code or wrong data or I don’t know.
>
> Best,
> Andrade.
> _______________________________________________
> 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/20200622/58106b35/attachment-0001.htm>

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

Message: 2
Date: Mon, 22 Jun 2020 13:47:14 +0000
From: "Michael Glassen  -  Biomedical Engineer"
	<MGlassen at kesslerfoundation.org>
To: "fieldtrip at science.ru.nl" <fieldtrip at science.ru.nl>
Subject: [FieldTrip] Connectivity Dimensions
Message-ID: <aae7aaea206143f3a87df61e1478a883 at kesslerfoundation.org>
Content-Type: text/plain; charset="iso-8859-1"

Hi all,


I was looking to make some plots of directional connectivity data obtained from ft_connectivityanalysis, and I just wanted to double check the dimensions of pdcspctrm and dtfspctrm.


The dimord is 'chan_chan_freq_time', but there isn't any indication of which chan dimension is the from direction and which is the to direction. I tried piecing it together by using ft_connectivityplot and comparing these to my own plots, and I'm pretty sure that the dimensions are 'fromchan_tochan_freq_time' but I wanted to get confirmation before I moved forward.


Best,

Michael Glassen

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200622/5abef647/attachment-0001.htm>

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

Message: 3
Date: Mon, 22 Jun 2020 13:52:32 +0000
From: "Schoffelen, J.M. (Jan Mathijs)" <jan.schoffelen at donders.ru.nl>
To: FieldTrip discussion list <fieldtrip at science.ru.nl>
Subject: Re: [FieldTrip] Connectivity Dimensions
Message-ID: <B6521FD0-2B75-4E0B-AF0C-68CDF3CB411B at donders.ru.nl>
Content-Type: text/plain; charset="utf-8"

Dear Michael,

Consider it confirmed!

Best wishes,
JM


On 22 Jun 2020, at 15:47, Michael Glassen - Biomedical Engineer <MGlassen at kesslerfoundation.org<mailto:MGlassen at kesslerfoundation.org>> wrote:

Hi all,

I was looking to make some plots of directional connectivity data obtained from ft_connectivityanalysis, and I just wanted to double check the dimensions of pdcspctrm and dtfspctrm.

The dimord is 'chan_chan_freq_time', but there isn't any indication of which chan dimension is the from direction and which is the to direction. I tried piecing it together by using ft_connectivityplot and comparing these to my own plots, and I'm pretty sure that the dimensions are 'fromchan_tochan_freq_time' but I wanted to get confirmation before I moved forward.

Best,
Michael Glassen

  ­­   _______________________________________________
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/20200622/f18ccfbb/attachment-0001.htm>

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

Message: 4
Date: Mon, 22 Jun 2020 14:47:00 +0000
From: Gaëlle Leys <gaelle.leys at kuleuven.be>
To: "fieldtrip at science.ru.nl" <fieldtrip at science.ru.nl>
Subject: Re: [FieldTrip] Errors with downsampling and artifact
	rejection
Message-ID:
	<a967d7106acf41d182449785c9466db7 at ICTS-S-EXMBX17.luna.kuleuven.be>
Content-Type: text/plain; charset="utf-8"

Dear Stephen, 

I have included the data structures and cfg's involved in the functions.

1)	A. data structure for resampling data (raw data after reading it in):
data_eeg = 
  struct with fields:
hdr: [1×1 struct]
label: {129×1 cell}
time: {[1×245726 double]}
trial: {[129×245726 double]}
fsample: 1000
sampleinfo: [1 245726]
elec: [1×1 struct]
cfg: [1×1 struct]

1)	B. cfg for resampling data (I’m using all the default options for resampling):

Cfg=[];
[data_eeg] = ft_resampledata(cfg, data_eeg); % defaults are all OK

2)	A. data structure for artifact rejection (my data already epoched):
data_eeg = 
struct with fields:
hdr: [1×1 struct]
label: {129×1 cell}
 time: {1×108 cell}
 trial: {1×108 cell}
 fsample: 1000
 sampleinfo: [108×2 double]
 elec: [1×1 struct]
 cfg: [1×1 struct]


2)	B. cfg for artifact rejection (taken from the automatic artifact rejection example):
% jump
cfg = [];
cfg.trl = trl;
cfg.datafile = '100_1_20200305.mff';
cfg.headerfile = '100_1_20200305.mff';
cfg.continuous = 'yes';
 
% channel selection, cutoff and padding
cfg.artfctdef.zvalue.channel = 'EEG';
cfg.artfctdef.zvalue.cutoff = 20;
cfg.artfctdef.zvalue.trlpadding = 0;
cfg.artfctdef.zvalue.artpadding = 0;
cfg.artfctdef.zvalue.fltpadding = 0;
 
% algorithmic parameters
cfg.artfctdef.zvalue.cumulative = 'yes';
cfg.artfctdef.zvalue.medianfilter = 'yes';
cfg.artfctdef.zvalue.medianfiltord = 9;
cfg.artfctdef.zvalue.absdiff = 'yes';
 
% make the process interactive
cfg.artfctdef.zvalue.interactive = 'yes';
 
[cfg, artifact_jump] = ft_artifact_zvalue(cfg); %plot error and error using zeros
%[cfg, artifact_jump] = ft_artifact_zvalue(cfg, data_eeg); %no plot error, but each trial has the same graph, also error using zeros


Kind regards, 
Gaëlle Leys



-----Original Message-----
From: fieldtrip <fieldtrip-bounces at science.ru.nl> On Behalf Of fieldtrip-request at science.ru.nl
Sent: zaterdag 20 juni 2020 12:00
To: fieldtrip at science.ru.nl
Subject: fieldtrip Digest, Vol 115, Issue 22

Send fieldtrip mailing list submissions to
	fieldtrip at science.ru.nl

To subscribe or unsubscribe via the World Wide Web, visit
	https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
or, via email, send a message with subject or body 'help' to
	fieldtrip-request at science.ru.nl

You can reach the person managing the list at
	fieldtrip-owner at science.ru.nl

When replying, please edit your Subject line so it is more specific than "Re: Contents of fieldtrip digest..."


Today's Topics:

   1. Errors with downsampling and artifact rejection (Gaëlle Leys)
   2. Re: Errors with downsampling and artifact rejection
      (Stephen Whitmarsh)
   3. MNI coordinates for the EEG easycap-M1 layout
      (SILVA PEREIRA, SILVANA)


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

Message: 1
Date: Fri, 19 Jun 2020 12:48:26 +0000
From: Gaëlle Leys <gaelle.leys at kuleuven.be>
To: "fieldtrip at science.ru.nl" <fieldtrip at science.ru.nl>
Subject: [FieldTrip] Errors with downsampling and artifact rejection
Message-ID:
	<ccb89b4d31af42d3b4cd22485438f4ef at ICTS-S-EXMBX17.luna.kuleuven.be>
Content-Type: text/plain; charset="iso-8859-1"

Dear Fieldtrip community,

I have recently started with Fieldtrip for my EEG data processing and I am encountering some problems which I can't seem to resolve.
I'm working with mff files from an EGI EEG system. I have no problem reading in and preprocessing the data. However, when trying to downsample and setup the automatic artifact removal, I'm getting some errors.


1)      When trying to downsample with the default options, these are the errors that I get:
Error using resample>getSamples (line 357) The number of elements of Tx must match the number of rows of X when X is a matrix

Error in resample>nonUniformResample (line 123) [x, tx] = getSamples(varargin{1:2});

Error in resample (line 116)
  [varargout{1:max(1,nargout)}] = nonUniformResample(method,varargin{:});

Error in ft_resampledata (line 228)
        newdat = transpose(resample(transpose(olddat),fsres,fsorig));

                I have tried downsampling before filtering, after filtering, on continuous data, or already segmented data. None of these things seem to resolve the error.


2)      When trying to set up the automatic artifact removal process and choosing yes for the interactive plot, I get a plotting error:

Error using plot

Vectors must be the same length.



Error in ft_artifact_zvalue>redraw_cb (line 973)

    plot(opt.h1, xval, yval, 'linestyle', '-', 'color', 'b', 'displayname', 'data');



Error in ft_artifact_zvalue (line 512)

  redraw_cb(h);

        I've noticed that the xval and yval are different numbers, which of course doesn't allow plotting. It seems like the xval changes according to the epoch length, however the yval remains the same and equals the amount of samples in my continuous data.


3)      When choosing no for the interactive plot, I also get an error:
Error using zeros
Size inputs must be integers.

Error in ft_artifact_zvalue (line 568)
dum = zeros(1,max(opt.trl(:,2)));

I've been looking into the functions and where it goes wrong, but I can't seem to pinpoint what exactly is causing these issues. Anyone here that can help or provide me some tips?

Thanks in advance!

Kind regards,

Gaëlle Leys

Research Associate
Brain & Cognition
Tiensestraat 102 box 3714
3000 Leuven
Room PSI 02.33
tel. +32 16 37 61 98

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200619/e7e1bde8/attachment-0001.htm>

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

Message: 2
Date: Fri, 19 Jun 2020 15:08:21 +0200
From: Stephen Whitmarsh <stephen.whitmarsh at gmail.com>
To: FieldTrip discussion list <fieldtrip at science.ru.nl>
Subject: Re: [FieldTrip] Errors with downsampling and artifact
	rejection
Message-ID:
	<CAFrxm=w44QZ0C7xB4cpsqdy0D0ou5UcpHNM-q3bjyaqwwJxRwg at mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Dear Gaëlle,

To understand the problem it would be helpful to have 1) description of the data structures going in ft_resampledata (just type in command line and copy-paste the output) and the artefact detection function you are using, and 2) the configuration (cfg) you are using for those functions.

Cheers,
Stephen


Op vr 19 jun. 2020 om 14:56 schreef Gaëlle Leys <gaelle.leys at kuleuven.be>:

> Dear Fieldtrip community,
>
>
>
> I have recently started with Fieldtrip for my EEG data processing and 
> I am encountering some problems which I can’t seem to resolve.
>
> I’m working with mff files from an EGI EEG system. I have no problem 
> reading in and preprocessing the data. However, when trying to 
> downsample and setup the automatic artifact removal, I’m getting some errors.
>
>
>
> 1)      When trying to downsample with the default options, these are the
> errors that I get:
>
> Error using resample>getSamples (line 357)
>
> The number of elements of Tx must match the number of rows of X when X 
> is a matrix
>
>
>
> Error in resample>nonUniformResample (line 123)
>
> [x, tx] = getSamples(varargin{1:2});
>
>
>
> Error in resample (line 116)
>
>   [varargout{1:max(1,nargout)}] = 
> nonUniformResample(method,varargin{:});
>
>
>
> Error in ft_resampledata (line 228)
>
>         newdat = transpose(resample(transpose(olddat),fsres,fsorig));
>
>
>
>                 I have tried downsampling before filtering, after 
> filtering, on continuous data, or already segmented data. None of 
> these things seem to resolve the error.
>
>
>
> 2)      When trying to set up the automatic artifact removal process and
> choosing yes for the interactive plot, I get a plotting error:
>
> Error using plot
>
> Vectors must be the same length.
>
>
>
> Error in ft_artifact_zvalue>redraw_cb (line 973)
>
>     plot(opt.h1, xval, yval, 'linestyle', '-', 'color', 'b', 
> 'displayname', 'data');
>
>
>
> Error in ft_artifact_zvalue (line 512)
>
>   redraw_cb(h);
>
>
>
>         I’ve noticed that the xval and yval are different numbers, 
> which of course doesn’t allow plotting. It seems like the xval changes 
> according to the epoch length, however the yval remains the same and 
> equals the amount of samples in my continuous data.
>
>
>
> 3)      When choosing no for the interactive plot, I also get an error:
>
> Error using zeros
>
> Size inputs must be integers.
>
>
>
> Error in ft_artifact_zvalue (line 568)
>
> dum = zeros(1,max(opt.trl(:,2)));
>
>
>
> I’ve been looking into the functions and where it goes wrong, but I 
> can’t seem to pinpoint what exactly is causing these issues. Anyone 
> here that can help or provide me some tips?
>
>
>
> Thanks in advance!
>
>
>
> Kind regards,
>
>
>
> Gaëlle Leys
>
>
>
> Research Associate
> Brain & Cognition
> Tiensestraat 102 box 3714
> 3000 Leuven
>
> Room PSI 02.33
> tel. +32 16 37 61 98
>
>
> _______________________________________________
> 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/20200619/137e31b1/attachment-0001.htm>

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

Message: 3
Date: Fri, 19 Jun 2020 18:58:36 +0200
From: "SILVA PEREIRA, SILVANA" <silvana.silva at upf.edu>
To: fieldtrip at science.ru.nl
Subject: [FieldTrip] MNI coordinates for the EEG easycap-M1 layout
Message-ID:
	<CA+_MWm1NufDWa-fjR71OzQ5ab88ioyUT8OJ-QFYX9ABr7gNQrA at mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Dear community,

I've been struggling to find the 3D positions (montages) for the
Acticap-64ch-standard2 on the web, which is a modified version of the easycap-M1, but I have not succeeded. In the Fieldtrip page http://www.fieldtriptoolbox.org/template/electrode/ you have the following:

You can find the template 3-D electrode sets included in FieldTrip here <https://github.com/fieldtrip/fieldtrip/tree/master/template/electrode>.

But in that link you only find a txt file with theta-phi coordinates (easycap-M1.txt). Is there any place where I could find these positions in MNI space?

Thank you and best regards,
Silvana
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200619/c0adf7df/attachment-0001.htm>

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

Subject: Digest Footer

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


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

End of fieldtrip Digest, Vol 115, Issue 22
******************************************



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

Message: 5
Date: Mon, 22 Jun 2020 17:35:42 +0200
From: Stephen Whitmarsh <stephen.whitmarsh at gmail.com>
To: FieldTrip discussion list <fieldtrip at science.ru.nl>
Subject: Re: [FieldTrip] Errors with downsampling and artifact
	rejection
Message-ID:
	<CAFrxm=wFXM-y1XBHbrVCTPwgjD2OWSG0c3Wx+v=Roiy7dprdPA at mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Dear Gaëlle,

You are using default settings for downsampling, which will then try to
downsample to 256Hz. Your original samplerate is 1000Hz, so that isn't a
neat integer division.
I tried the following, and could reproduce your problem:

Fs = 1000;
data_eeg = [];
data_eeg.label = {'a','b','c'};
data_eeg.time{1} = 0:1/Fs:10;
data_eeg.trial{1} = rand(length(data_eeg.label),length(data_eeg.time{1}));
data_eeg.Fs = Fs;
data_eeg.sampleinfo = [1, length(data_eeg.time{1})];

% Doesn't work:
cfg = [];
[data_eeg] = ft_resampledata(cfg, data_eeg);

% Does work:
cfg = [];
cfg.resamplefs = 250;
[data_eeg] = ft_resampledata(cfg, data_eeg);

So that deals with your first problem. Not sure why it has a problem with
the downsampling to non-integer values, but it's good practice and much
faster to stick to that anyway.

Not sure what to do with the artefact detection though, or what you
expect;  it seems you are running it with some contradictory settings/ways
perhaps:
- use cfg.dataset if reading from disk directly OR give datastructure to
function is you already have data in memory
- use cfg.continuous when data is not segmented
- the comment "jump" suggests you use settings for SQUID jumps, i.e.
optimized for MEG, but that should not give an error :-)

I suspect you probably want to run artefact detection on your
segmented data, so remove those references to the data on disk (datafile,
headerfile), and the trl from the cfg, and give your segmented data as an
argument as you did here:
%[cfg, artifact_jump] = ft_artifact_zvalue(cfg, data_eeg); %no plot error,
but each trial has the same graph, also error using zeros

Let us know how it goes,

All the best,
Stephen











Op ma 22 jun. 2020 om 17:02 schreef Gaëlle Leys <gaelle.leys at kuleuven.be>:

> Dear Stephen,
>
> I have included the data structures and cfg's involved in the functions.
>
> 1)      A. data structure for resampling data (raw data after reading it
> in):
> data_eeg =
>   struct with fields:
> hdr: [1×1 struct]
> label: {129×1 cell}
> time: {[1×245726 double]}
> trial: {[129×245726 double]}
> fsample: 1000
> sampleinfo: [1 245726]
> elec: [1×1 struct]
> cfg: [1×1 struct]
>
> 1)      B. cfg for resampling data (I’m using all the default options for
> resampling):
>
> Cfg=[];
> [data_eeg] = ft_resampledata(cfg, data_eeg); % defaults are all OK
>
> 2)      A. data structure for artifact rejection (my data already epoched):
> data_eeg =
> struct with fields:
> hdr: [1×1 struct]
> label: {129×1 cell}
>  time: {1×108 cell}
>  trial: {1×108 cell}
>  fsample: 1000
>  sampleinfo: [108×2 double]
>  elec: [1×1 struct]
>  cfg: [1×1 struct]
>
>
> 2)      B. cfg for artifact rejection (taken from the automatic artifact
> rejection example):
> % jump
> cfg = [];
> cfg.trl = trl;
> cfg.datafile = '100_1_20200305.mff';
> cfg.headerfile = '100_1_20200305.mff';
> cfg.continuous = 'yes';
>
> % channel selection, cutoff and padding
> cfg.artfctdef.zvalue.channel = 'EEG';
> cfg.artfctdef.zvalue.cutoff = 20;
> cfg.artfctdef.zvalue.trlpadding = 0;
> cfg.artfctdef.zvalue.artpadding = 0;
> cfg.artfctdef.zvalue.fltpadding = 0;
>
> % algorithmic parameters
> cfg.artfctdef.zvalue.cumulative = 'yes';
> cfg.artfctdef.zvalue.medianfilter = 'yes';
> cfg.artfctdef.zvalue.medianfiltord = 9;
> cfg.artfctdef.zvalue.absdiff = 'yes';
>
> % make the process interactive
> cfg.artfctdef.zvalue.interactive = 'yes';
>
> [cfg, artifact_jump] = ft_artifact_zvalue(cfg); %plot error and error
> using zeros
> %[cfg, artifact_jump] = ft_artifact_zvalue(cfg, data_eeg); %no plot error,
> but each trial has the same graph, also error using zeros
>
>
> Kind regards,
> Gaëlle Leys
>
>
>
> -----Original Message-----
> From: fieldtrip <fieldtrip-bounces at science.ru.nl> On Behalf Of
> fieldtrip-request at science.ru.nl
> Sent: zaterdag 20 juni 2020 12:00
> To: fieldtrip at science.ru.nl
> Subject: fieldtrip Digest, Vol 115, Issue 22
>
> Send fieldtrip mailing list submissions to
>         fieldtrip at science.ru.nl
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> or, via email, send a message with subject or body 'help' to
>         fieldtrip-request at science.ru.nl
>
> You can reach the person managing the list at
>         fieldtrip-owner at science.ru.nl
>
> When replying, please edit your Subject line so it is more specific than
> "Re: Contents of fieldtrip digest..."
>
>
> Today's Topics:
>
>    1. Errors with downsampling and artifact rejection (Gaëlle Leys)
>    2. Re: Errors with downsampling and artifact rejection
>       (Stephen Whitmarsh)
>    3. MNI coordinates for the EEG easycap-M1 layout
>       (SILVA PEREIRA, SILVANA)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 19 Jun 2020 12:48:26 +0000
> From: Gaëlle Leys <gaelle.leys at kuleuven.be>
> To: "fieldtrip at science.ru.nl" <fieldtrip at science.ru.nl>
> Subject: [FieldTrip] Errors with downsampling and artifact rejection
> Message-ID:
>         <ccb89b4d31af42d3b4cd22485438f4ef at ICTS-S-EXMBX17.luna.kuleuven.be>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Dear Fieldtrip community,
>
> I have recently started with Fieldtrip for my EEG data processing and I am
> encountering some problems which I can't seem to resolve.
> I'm working with mff files from an EGI EEG system. I have no problem
> reading in and preprocessing the data. However, when trying to downsample
> and setup the automatic artifact removal, I'm getting some errors.
>
>
> 1)      When trying to downsample with the default options, these are the
> errors that I get:
> Error using resample>getSamples (line 357) The number of elements of Tx
> must match the number of rows of X when X is a matrix
>
> Error in resample>nonUniformResample (line 123) [x, tx] =
> getSamples(varargin{1:2});
>
> Error in resample (line 116)
>   [varargout{1:max(1,nargout)}] = nonUniformResample(method,varargin{:});
>
> Error in ft_resampledata (line 228)
>         newdat = transpose(resample(transpose(olddat),fsres,fsorig));
>
>                 I have tried downsampling before filtering, after
> filtering, on continuous data, or already segmented data. None of these
> things seem to resolve the error.
>
>
> 2)      When trying to set up the automatic artifact removal process and
> choosing yes for the interactive plot, I get a plotting error:
>
> Error using plot
>
> Vectors must be the same length.
>
>
>
> Error in ft_artifact_zvalue>redraw_cb (line 973)
>
>     plot(opt.h1, xval, yval, 'linestyle', '-', 'color', 'b',
> 'displayname', 'data');
>
>
>
> Error in ft_artifact_zvalue (line 512)
>
>   redraw_cb(h);
>
>         I've noticed that the xval and yval are different numbers, which
> of course doesn't allow plotting. It seems like the xval changes according
> to the epoch length, however the yval remains the same and equals the
> amount of samples in my continuous data.
>
>
> 3)      When choosing no for the interactive plot, I also get an error:
> Error using zeros
> Size inputs must be integers.
>
> Error in ft_artifact_zvalue (line 568)
> dum = zeros(1,max(opt.trl(:,2)));
>
> I've been looking into the functions and where it goes wrong, but I can't
> seem to pinpoint what exactly is causing these issues. Anyone here that can
> help or provide me some tips?
>
> Thanks in advance!
>
> Kind regards,
>
> Gaëlle Leys
>
> Research Associate
> Brain & Cognition
> Tiensestraat 102 box 3714
> 3000 Leuven
> Room PSI 02.33
> tel. +32 16 37 61 98
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200619/e7e1bde8/attachment-0001.htm
> >
>
> ------------------------------
>
> Message: 2
> Date: Fri, 19 Jun 2020 15:08:21 +0200
> From: Stephen Whitmarsh <stephen.whitmarsh at gmail.com>
> To: FieldTrip discussion list <fieldtrip at science.ru.nl>
> Subject: Re: [FieldTrip] Errors with downsampling and artifact
>         rejection
> Message-ID:
>         <CAFrxm=
> w44QZ0C7xB4cpsqdy0D0ou5UcpHNM-q3bjyaqwwJxRwg at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Dear Gaëlle,
>
> To understand the problem it would be helpful to have 1) description of
> the data structures going in ft_resampledata (just type in command line and
> copy-paste the output) and the artefact detection function you are using,
> and 2) the configuration (cfg) you are using for those functions.
>
> Cheers,
> Stephen
>
>
> Op vr 19 jun. 2020 om 14:56 schreef Gaëlle Leys <gaelle.leys at kuleuven.be>:
>
> > Dear Fieldtrip community,
> >
> >
> >
> > I have recently started with Fieldtrip for my EEG data processing and
> > I am encountering some problems which I can’t seem to resolve.
> >
> > I’m working with mff files from an EGI EEG system. I have no problem
> > reading in and preprocessing the data. However, when trying to
> > downsample and setup the automatic artifact removal, I’m getting some
> errors.
> >
> >
> >
> > 1)      When trying to downsample with the default options, these are the
> > errors that I get:
> >
> > Error using resample>getSamples (line 357)
> >
> > The number of elements of Tx must match the number of rows of X when X
> > is a matrix
> >
> >
> >
> > Error in resample>nonUniformResample (line 123)
> >
> > [x, tx] = getSamples(varargin{1:2});
> >
> >
> >
> > Error in resample (line 116)
> >
> >   [varargout{1:max(1,nargout)}] =
> > nonUniformResample(method,varargin{:});
> >
> >
> >
> > Error in ft_resampledata (line 228)
> >
> >         newdat = transpose(resample(transpose(olddat),fsres,fsorig));
> >
> >
> >
> >                 I have tried downsampling before filtering, after
> > filtering, on continuous data, or already segmented data. None of
> > these things seem to resolve the error.
> >
> >
> >
> > 2)      When trying to set up the automatic artifact removal process and
> > choosing yes for the interactive plot, I get a plotting error:
> >
> > Error using plot
> >
> > Vectors must be the same length.
> >
> >
> >
> > Error in ft_artifact_zvalue>redraw_cb (line 973)
> >
> >     plot(opt.h1, xval, yval, 'linestyle', '-', 'color', 'b',
> > 'displayname', 'data');
> >
> >
> >
> > Error in ft_artifact_zvalue (line 512)
> >
> >   redraw_cb(h);
> >
> >
> >
> >         I’ve noticed that the xval and yval are different numbers,
> > which of course doesn’t allow plotting. It seems like the xval changes
> > according to the epoch length, however the yval remains the same and
> > equals the amount of samples in my continuous data.
> >
> >
> >
> > 3)      When choosing no for the interactive plot, I also get an error:
> >
> > Error using zeros
> >
> > Size inputs must be integers.
> >
> >
> >
> > Error in ft_artifact_zvalue (line 568)
> >
> > dum = zeros(1,max(opt.trl(:,2)));
> >
> >
> >
> > I’ve been looking into the functions and where it goes wrong, but I
> > can’t seem to pinpoint what exactly is causing these issues. Anyone
> > here that can help or provide me some tips?
> >
> >
> >
> > Thanks in advance!
> >
> >
> >
> > Kind regards,
> >
> >
> >
> > Gaëlle Leys
> >
> >
> >
> > Research Associate
> > Brain & Cognition
> > Tiensestraat 102 box 3714
> > 3000 Leuven
> >
> > Room PSI 02.33
> > tel. +32 16 37 61 98
> >
> >
> > _______________________________________________
> > 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/20200619/137e31b1/attachment-0001.htm
> >
>
> ------------------------------
>
> Message: 3
> Date: Fri, 19 Jun 2020 18:58:36 +0200
> From: "SILVA PEREIRA, SILVANA" <silvana.silva at upf.edu>
> To: fieldtrip at science.ru.nl
> Subject: [FieldTrip] MNI coordinates for the EEG easycap-M1 layout
> Message-ID:
>         <
> CA+_MWm1NufDWa-fjR71OzQ5ab88ioyUT8OJ-QFYX9ABr7gNQrA at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Dear community,
>
> I've been struggling to find the 3D positions (montages) for the
> Acticap-64ch-standard2 on the web, which is a modified version of the
> easycap-M1, but I have not succeeded. In the Fieldtrip page
> http://www.fieldtriptoolbox.org/template/electrode/ you have the
> following:
>
> You can find the template 3-D electrode sets included in FieldTrip here <
> https://github.com/fieldtrip/fieldtrip/tree/master/template/electrode>.
>
> But in that link you only find a txt file with theta-phi coordinates
> (easycap-M1.txt). Is there any place where I could find these positions in
> MNI space?
>
> Thank you and best regards,
> Silvana
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200619/c0adf7df/attachment-0001.htm
> >
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202
>
>
> ------------------------------
>
> End of fieldtrip Digest, Vol 115, Issue 22
> ******************************************
>
> _______________________________________________
> 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/20200622/3ef1e021/attachment-0001.htm>

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

Message: 6
Date: Mon, 22 Jun 2020 21:38:39 +0000
From: Andrade Rey René <rene.andrade at edu.uah.es>
To: "fieldtrip at science.ru.nl" <fieldtrip at science.ru.nl>
Subject: Re: [FieldTrip] fieldtrip Digest, Vol 115, Issue 23
Message-ID: <0CED8809-357C-49C1-B255-9CCE26A7EC75 at edu.uah.es>
Content-Type: text/plain; charset="utf-8"

Is it normal that 16GB of RAM aren't sufficient for a normal EEG? May be I am doing something wrong and that is the reason my RAM isn't enough.

Sent from my iPhone

> On 22 Jun 2020, at 12:16, "fieldtrip-request at science.ru.nl" <fieldtrip-request at science.ru.nl> wrote:
> 
> ﻿Send fieldtrip mailing list submissions to
>    fieldtrip at science.ru.nl
> 
> To subscribe or unsubscribe via the World Wide Web, visit
>    https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> or, via email, send a message with subject or body 'help' to
>    fieldtrip-request at science.ru.nl
> 
> You can reach the person managing the list at
>    fieldtrip-owner at science.ru.nl
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of fieldtrip digest..."
> 
> 
> Today's Topics:
> 
>   1. Running out of memory (RAM) (Andrade Rey René)
>   2. Re: Running out of memory (RAM) (Schoffelen, J.M. (Jan Mathijs))
>   3. Re: DICS question (Schoffelen, J.M. (Jan Mathijs))
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Sun, 21 Jun 2020 20:34:49 +0000
> From: Andrade Rey René <rene.andrade at edu.uah.es>
> To: "fieldtrip at science.ru.nl" <fieldtrip at science.ru.nl>
> Subject: [FieldTrip] Running out of memory (RAM)
> Message-ID: <C30BBEE6-8A40-4668-8F48-E8244C205963 at edu.uah.es>
> Content-Type: text/plain; charset="utf-8"
> 
> Dear experts:
> I am running this code
> 
> 
> cfg = [];
> cfg.headmodel = headmodel;
> cfg.sourcemodel = leadfield;
> cfg.method = 'lcmv';
> cfg.lcmv.projectmom = 'yes'; % project dipole time series in direction of maximal power (see below)
> cfg.lcmv.kurtosis = 'yes'; % compute kurtosis at each location
> source = ft_sourceanalysis(cfg, cov_matrix);
> 
> Of http://www.fieldtriptoolbox.org/tutorial/epilepsy/. And I think  I run out of memory because with “top” I can see the computer stops responding when near 85% of RAM memory(16GB).
> 
> I cannot report any error because the only problem seems to be that either wrong code or wrong data or I don’t know.
> 
> Best,
> Andrade.
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200621/8b61eaac/attachment-0001.htm>
> 
> ------------------------------
> 
> Message: 2
> Date: Mon, 22 Jun 2020 06:51:30 +0000
> From: "Schoffelen, J.M. (Jan Mathijs)" <jan.schoffelen at donders.ru.nl>
> To: FieldTrip discussion list <fieldtrip at science.ru.nl>
> Subject: Re: [FieldTrip] Running out of memory (RAM)
> Message-ID: <308CD012-C138-486C-9B4C-E7F7487D3426 at donders.ru.nl>
> Content-Type: text/plain; charset="utf-8"
> 
> Dear Andrade,
> 
> Without any more specific information, the only meaningful comment that can be given here, is ‘get yourself a more powerful computer’.
> 
> Memory usage depends highly on the operating system (in particular: matlab on windows machines used to be much less memory friendly, but it’s been a while that I have been running real computations on a window machine so perhaps this has changed), the total size of all variables that need to be kept in memory, etc.
> 
> Best wishes,
> Jan-Mathijs
> 
> 
> 
> On 21 Jun 2020, at 22:34, Andrade Rey René <rene.andrade at edu.uah.es<mailto:rene.andrade at edu.uah.es>> wrote:
> 
> Dear experts:
> I am running this code
> 
> 
> cfg = [];
> cfg.headmodel = headmodel;
> cfg.sourcemodel = leadfield;
> cfg.method = 'lcmv';
> cfg.lcmv.projectmom = 'yes'; % project dipole time series in direction of maximal power (see below)
> cfg.lcmv.kurtosis = 'yes'; % compute kurtosis at each location
> source = ft_sourceanalysis(cfg, cov_matrix);
> 
> Of http://www.fieldtriptoolbox.org/tutorial/epilepsy/. And I think  I run out of memory because with “top” I can see the computer stops responding when near 85% of RAM memory(16GB).
> 
> I cannot report any error because the only problem seems to be that either wrong code or wrong data or I don’t know.
> 
> Best,
> Andrade.
> _______________________________________________
> 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/20200622/2a12ebf1/attachment-0001.htm>
> 
> ------------------------------
> 
> Message: 3
> Date: Mon, 22 Jun 2020 07:52:03 +0000
> From: "Schoffelen, J.M. (Jan Mathijs)" <jan.schoffelen at donders.ru.nl>
> To: FieldTrip discussion list <fieldtrip at science.ru.nl>
> Cc: Sanjeev Nara <s.nara at bcbl.eu>, "m.lizarazu at bcbl.eu"
>    <m.lizarazu at bcbl.eu>,  Nicola Molinaro <nicolaml at gmail.com>, Craig
>    Richter <craiggrichter at gmail.com>
> Subject: Re: [FieldTrip] DICS question
> Message-ID: <40F6A2CA-6DB9-453A-B33B-6E2413DA4EA8 at donders.ru.nl>
> Content-Type: text/plain; charset="utf-8"
> 
> Dear Craig,
> 
> Let me forward this e-mail to the discussion list, in order to widen the scope to all of Donostia and beyond.
> 
> Indeed, the estimation of spectrally resolved GC requires a full bandwidth signal. I have not extensively played with the different options here, but the scenario that you describe, i.e. compute a DICS spatial filter on a narrow bandwidth-of-interest signal, and subjecting the broadband sensor signals to this spatial filter, will, in my opinion, not be really optimal. The reason for this is that the beamformer then can only suppress interference from that particular bandwidth. Signal components that lie outside this range might still leak into the estimated time courses, which may lead to distortion and invalid GC estimates.
> 
> So, if you would be using an LCMV beamformer, I’d always recommend a broadband spatial filter, optionally on mildly highpass-filtered data. Then, the risk could be that the 1/f characteristic of the signals results in a covariance matrix whose signal components are dominated by low-frequency stuff. One could then worry about suboptimal spatial filtering of the higher frequency components. This is probably true, and I have worried about this myself, but in my experience this is the least of the worries one should have. (as a side note: I have played around with spectral whitening of the data prior to the beamforming. The reasoning behind this is that the individual variance components in the data are more evenly balanced across the frequency range, but the long story short is that this does not seem to influence the final GC estimate).
> 
> A larger worry would be the fact that source-estimated GC spectra very often have a canonical shape, unless you use extremely well-defined data such a visual attention experiment that induces strong gamma band oscillations. If you are into applying connectivity analysis in a more ethereal context, such as a cognitive or language experiment, you will see that source-level GC spectra will be always dominated by the low-frequency components (i.e. most of the time you’ll find a large peak at low frequencies). This of course can reflect genuine neuronal coupling, but my suspicion is that this is most of the time due to ‘weak signal asymmetries’, in other words due to asymmetries in SNR and location specific leakage of power. This can be further investigated using time-flipping and an appropriate statistical evaluation. For inspiration, you can of course always consult my 2017 PNAS paper :).
> 
> Another worry of course would be the fact that you’d be working with Elekta data :).
> 
> Practically, what I typically do, is to compute the broadband spatial filter with LCMV, and apply these filters (as is, or dimensionality reduced after a parcellation step) to the sensor level cross-spectral density data (from DC to Nyquist). The spectral factorization algorithm should be applied to the source-level data, which in my experience is most stable if you do this pairwise. I know that this is suboptimal in the context of an interpretation of direct versus indirect interactions, but I have always found this an argument that is part of a non-discussion at this stage of the analysis. One should first trust the estimates overall, before a discussion about direct versus indirect coupling becomes relevant.
> 
> Best wishes,
> JM
> 
> 
> 
> 
> 
> 
> 
> 
> On 19 Jun 2020, at 18:06, Craig Richter <craiggrichter at gmail.com<mailto:craiggrichter at gmail.com>> wrote:
> 
> Hey JM,
> 
> How’s it going? Covid treating you ok? Been a bit crazy here, but normalcy is resuming.
> 
> I have a question about DICS for you… :-/... Anyhow, so for coherence at a given frequency DICS is superior, since the spatial-filter is specific to that frequency, which is about the same as a building a noise-covariance matrix from a narrow-band filtered signal? But to do source-level GC, we need the broadband time-series, so we’re forced to use the unfiltered data and LCMV. But… what if we know the frequency we want to analyse, so we build the spatial filter on this frequency, or narrow-band filtered data, then compute virtual time series from the raw data, and compute GC. Then we simply look at our frequency of interest in the spectral results. Would this potentially generate a better GC estimate at the frequency of interest, or would it just mess everything up?
> 
> PS - I’ve cc’ed some other interested folks.
> 
> Thanks!
> 
> C.
> 
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200622/1a7e6793/attachment-0001.htm>
> 
> ------------------------------
> 
> Subject: Digest Footer
> 
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202
> 
> 
> ------------------------------
> 
> End of fieldtrip Digest, Vol 115, Issue 23
> ******************************************



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

Message: 7
Date: Tue, 23 Jun 2020 06:42:03 +0000
From: "Schoffelen, J.M. (Jan Mathijs)" <jan.schoffelen at donders.ru.nl>
To: FieldTrip discussion list <fieldtrip at science.ru.nl>
Subject: Re: [FieldTrip] Errors with downsampling and artifact
	rejection
Message-ID: <184602F0-A203-406F-B278-32CD899D4532 at donders.ru.nl>
Content-Type: text/plain; charset="utf-8"

Hi Gaëlle,

Adding to Stephen’s comment: reading through the code and comments (highly recommended to occasionally do this, then you get a feel what’s going on under the hood) I saw that there’s a discrepancy between the comments in the help section of ft_resampledata, where it states that the default resamplefs=256, and the actually implemented default resamplefs, which is []. Apparently, MATLAB is lenient with respect to mathematical operations involving empty variables. Specifically, it doesn’t throw an error on lines 160/161 in ft_resampledata, where an empty variable is multiplied and divided by a scalar. Long story short, the silently accepted empty variable is the acual cause of the reported problem in ft_resampledata.

I look forward to a PR that fixes this. I suggest making the documentation consistent, i.e. stating that cfg.resamplefs is an argument that needs to be defined, and explicitly check this in the code, i.e. throw an error if it isn’t defined. This is typically done with a call to ft_checkconfig using the key-value pair ‘required’, and ‘resamplefs’ (in this case).

Thanks for your contribution,

Jan-Mathijs





On 22 Jun 2020, at 17:35, Stephen Whitmarsh <stephen.whitmarsh at gmail.com<mailto:stephen.whitmarsh at gmail.com>> wrote:

Dear Gaëlle,

You are using default settings for downsampling, which will then try to downsample to 256Hz. Your original samplerate is 1000Hz, so that isn't a neat integer division.
I tried the following, and could reproduce your problem:

Fs = 1000;
data_eeg = [];
data_eeg.label = {'a','b','c'};
data_eeg.time{1} = 0:1/Fs:10;
data_eeg.trial{1} = rand(length(data_eeg.label),length(data_eeg.time{1}));
data_eeg.Fs = Fs;
data_eeg.sampleinfo = [1, length(data_eeg.time{1})];

% Doesn't work:
cfg = [];
[data_eeg] = ft_resampledata(cfg, data_eeg);

% Does work:
cfg = [];
cfg.resamplefs = 250;
[data_eeg] = ft_resampledata(cfg, data_eeg);

So that deals with your first problem. Not sure why it has a problem with the downsampling to non-integer values, but it's good practice and much faster to stick to that anyway.

Not sure what to do with the artefact detection though, or what you expect;  it seems you are running it with some contradictory settings/ways perhaps:
- use cfg.dataset if reading from disk directly OR give datastructure to function is you already have data in memory
- use cfg.continuous when data is not segmented
- the comment "jump" suggests you use settings for SQUID jumps, i.e. optimized for MEG, but that should not give an error :-)

I suspect you probably want to run artefact detection on your segmented data, so remove those references to the data on disk (datafile, headerfile), and the trl from the cfg, and give your segmented data as an argument as you did here:
%[cfg, artifact_jump] = ft_artifact_zvalue(cfg, data_eeg); %no plot error, but each trial has the same graph, also error using zeros

Let us know how it goes,

All the best,
Stephen











Op ma 22 jun. 2020 om 17:02 schreef Gaëlle Leys <gaelle.leys at kuleuven.be<mailto:gaelle.leys at kuleuven.be>>:
Dear Stephen,

I have included the data structures and cfg's involved in the functions.

1)      A. data structure for resampling data (raw data after reading it in):
data_eeg =
  struct with fields:
hdr: [1×1 struct]
label: {129×1 cell}
time: {[1×245726 double]}
trial: {[129×245726 double]}
fsample: 1000
sampleinfo: [1 245726]
elec: [1×1 struct]
cfg: [1×1 struct]

1)      B. cfg for resampling data (I’m using all the default options for resampling):

Cfg=[];
[data_eeg] = ft_resampledata(cfg, data_eeg); % defaults are all OK

2)      A. data structure for artifact rejection (my data already epoched):
data_eeg =
struct with fields:
hdr: [1×1 struct]
label: {129×1 cell}
 time: {1×108 cell}
 trial: {1×108 cell}
 fsample: 1000
 sampleinfo: [108×2 double]
 elec: [1×1 struct]
 cfg: [1×1 struct]


2)      B. cfg for artifact rejection (taken from the automatic artifact rejection example):
% jump
cfg = [];
cfg.trl = trl;
cfg.datafile = '100_1_20200305.mff';
cfg.headerfile = '100_1_20200305.mff';
cfg.continuous = 'yes';

% channel selection, cutoff and padding
cfg.artfctdef.zvalue.channel = 'EEG';
cfg.artfctdef.zvalue.cutoff = 20;
cfg.artfctdef.zvalue.trlpadding = 0;
cfg.artfctdef.zvalue.artpadding = 0;
cfg.artfctdef.zvalue.fltpadding = 0;

% algorithmic parameters
cfg.artfctdef.zvalue.cumulative = 'yes';
cfg.artfctdef.zvalue.medianfilter = 'yes';
cfg.artfctdef.zvalue.medianfiltord = 9;
cfg.artfctdef.zvalue.absdiff = 'yes';

% make the process interactive
cfg.artfctdef.zvalue.interactive = 'yes';

[cfg, artifact_jump] = ft_artifact_zvalue(cfg); %plot error and error using zeros
%[cfg, artifact_jump] = ft_artifact_zvalue(cfg, data_eeg); %no plot error, but each trial has the same graph, also error using zeros


Kind regards,
Gaëlle Leys



-----Original Message-----
From: fieldtrip <fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl>> On Behalf Of fieldtrip-request at science.ru.nl<mailto:fieldtrip-request at science.ru.nl>
Sent: zaterdag 20 juni 2020 12:00
To: fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>
Subject: fieldtrip Digest, Vol 115, Issue 22

Send fieldtrip mailing list submissions to
        fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>

To subscribe or unsubscribe via the World Wide Web, visit
        https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
or, via email, send a message with subject or body 'help' to
        fieldtrip-request at science.ru.nl<mailto:fieldtrip-request at science.ru.nl>

You can reach the person managing the list at
        fieldtrip-owner at science.ru.nl<mailto:fieldtrip-owner at science.ru.nl>

When replying, please edit your Subject line so it is more specific than "Re: Contents of fieldtrip digest..."


Today's Topics:

   1. Errors with downsampling and artifact rejection (Gaëlle Leys)
   2. Re: Errors with downsampling and artifact rejection
      (Stephen Whitmarsh)
   3. MNI coordinates for the EEG easycap-M1 layout
      (SILVA PEREIRA, SILVANA)


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

Message: 1
Date: Fri, 19 Jun 2020 12:48:26 +0000
From: Gaëlle Leys <gaelle.leys at kuleuven.be<mailto:gaelle.leys at kuleuven.be>>
To: "fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>" <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>>
Subject: [FieldTrip] Errors with downsampling and artifact rejection
Message-ID:
        <ccb89b4d31af42d3b4cd22485438f4ef at ICTS-S-EXMBX17.luna.kuleuven.be<mailto:ccb89b4d31af42d3b4cd22485438f4ef at ICTS-S-EXMBX17.luna.kuleuven.be>>
Content-Type: text/plain; charset="iso-8859-1"

Dear Fieldtrip community,

I have recently started with Fieldtrip for my EEG data processing and I am encountering some problems which I can't seem to resolve.
I'm working with mff files from an EGI EEG system. I have no problem reading in and preprocessing the data. However, when trying to downsample and setup the automatic artifact removal, I'm getting some errors.


1)      When trying to downsample with the default options, these are the errors that I get:
Error using resample>getSamples (line 357) The number of elements of Tx must match the number of rows of X when X is a matrix

Error in resample>nonUniformResample (line 123) [x, tx] = getSamples(varargin{1:2});

Error in resample (line 116)
  [varargout{1:max(1,nargout)}] = nonUniformResample(method,varargin{:});

Error in ft_resampledata (line 228)
        newdat = transpose(resample(transpose(olddat),fsres,fsorig));

                I have tried downsampling before filtering, after filtering, on continuous data, or already segmented data. None of these things seem to resolve the error.


2)      When trying to set up the automatic artifact removal process and choosing yes for the interactive plot, I get a plotting error:

Error using plot

Vectors must be the same length.



Error in ft_artifact_zvalue>redraw_cb (line 973)

    plot(opt.h1, xval, yval, 'linestyle', '-', 'color', 'b', 'displayname', 'data');



Error in ft_artifact_zvalue (line 512)

  redraw_cb(h);

        I've noticed that the xval and yval are different numbers, which of course doesn't allow plotting. It seems like the xval changes according to the epoch length, however the yval remains the same and equals the amount of samples in my continuous data.


3)      When choosing no for the interactive plot, I also get an error:
Error using zeros
Size inputs must be integers.

Error in ft_artifact_zvalue (line 568)
dum = zeros(1,max(opt.trl(:,2)));

I've been looking into the functions and where it goes wrong, but I can't seem to pinpoint what exactly is causing these issues. Anyone here that can help or provide me some tips?

Thanks in advance!

Kind regards,

Gaëlle Leys

Research Associate
Brain & Cognition
Tiensestraat 102 box 3714
3000 Leuven
Room PSI 02.33
tel. +32 16 37 61 98

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200619/e7e1bde8/attachment-0001.htm>

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

Message: 2
Date: Fri, 19 Jun 2020 15:08:21 +0200
From: Stephen Whitmarsh <stephen.whitmarsh at gmail.com<mailto:stephen.whitmarsh at gmail.com>>
To: FieldTrip discussion list <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>>
Subject: Re: [FieldTrip] Errors with downsampling and artifact
        rejection
Message-ID:
        <CAFrxm=w44QZ0C7xB4cpsqdy0D0ou5UcpHNM-q3bjyaqwwJxRwg at mail.gmail.com<mailto:w44QZ0C7xB4cpsqdy0D0ou5UcpHNM-q3bjyaqwwJxRwg at mail.gmail.com>>
Content-Type: text/plain; charset="utf-8"

Dear Gaëlle,

To understand the problem it would be helpful to have 1) description of the data structures going in ft_resampledata (just type in command line and copy-paste the output) and the artefact detection function you are using, and 2) the configuration (cfg) you are using for those functions.

Cheers,
Stephen


Op vr 19 jun. 2020 om 14:56 schreef Gaëlle Leys <gaelle.leys at kuleuven.be<mailto:gaelle.leys at kuleuven.be>>:

> Dear Fieldtrip community,
>
>
>
> I have recently started with Fieldtrip for my EEG data processing and
> I am encountering some problems which I can’t seem to resolve.
>
> I’m working with mff files from an EGI EEG system. I have no problem
> reading in and preprocessing the data. However, when trying to
> downsample and setup the automatic artifact removal, I’m getting some errors.
>
>
>
> 1)      When trying to downsample with the default options, these are the
> errors that I get:
>
> Error using resample>getSamples (line 357)
>
> The number of elements of Tx must match the number of rows of X when X
> is a matrix
>
>
>
> Error in resample>nonUniformResample (line 123)
>
> [x, tx] = getSamples(varargin{1:2});
>
>
>
> Error in resample (line 116)
>
>   [varargout{1:max(1,nargout)}] =
> nonUniformResample(method,varargin{:});
>
>
>
> Error in ft_resampledata (line 228)
>
>         newdat = transpose(resample(transpose(olddat),fsres,fsorig));
>
>
>
>                 I have tried downsampling before filtering, after
> filtering, on continuous data, or already segmented data. None of
> these things seem to resolve the error.
>
>
>
> 2)      When trying to set up the automatic artifact removal process and
> choosing yes for the interactive plot, I get a plotting error:
>
> Error using plot
>
> Vectors must be the same length.
>
>
>
> Error in ft_artifact_zvalue>redraw_cb (line 973)
>
>     plot(opt.h1, xval, yval, 'linestyle', '-', 'color', 'b',
> 'displayname', 'data');
>
>
>
> Error in ft_artifact_zvalue (line 512)
>
>   redraw_cb(h);
>
>
>
>         I’ve noticed that the xval and yval are different numbers,
> which of course doesn’t allow plotting. It seems like the xval changes
> according to the epoch length, however the yval remains the same and
> equals the amount of samples in my continuous data.
>
>
>
> 3)      When choosing no for the interactive plot, I also get an error:
>
> Error using zeros
>
> Size inputs must be integers.
>
>
>
> Error in ft_artifact_zvalue (line 568)
>
> dum = zeros(1,max(opt.trl(:,2)));
>
>
>
> I’ve been looking into the functions and where it goes wrong, but I
> can’t seem to pinpoint what exactly is causing these issues. Anyone
> here that can help or provide me some tips?
>
>
>
> Thanks in advance!
>
>
>
> Kind regards,
>
>
>
> Gaëlle Leys
>
>
>
> Research Associate
> Brain & Cognition
> Tiensestraat 102 box 3714
> 3000 Leuven
>
> Room PSI 02.33
> tel. +32 16 37 61 98
>
>
> _______________________________________________
> 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/20200619/137e31b1/attachment-0001.htm>

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

Message: 3
Date: Fri, 19 Jun 2020 18:58:36 +0200
From: "SILVA PEREIRA, SILVANA" <silvana.silva at upf.edu<mailto:silvana.silva at upf.edu>>
To: fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>
Subject: [FieldTrip] MNI coordinates for the EEG easycap-M1 layout
Message-ID:
        <CA+_MWm1NufDWa-fjR71OzQ5ab88ioyUT8OJ-QFYX9ABr7gNQrA at mail.gmail.com<mailto:CA%2B_MWm1NufDWa-fjR71OzQ5ab88ioyUT8OJ-QFYX9ABr7gNQrA at mail.gmail.com>>
Content-Type: text/plain; charset="utf-8"

Dear community,

I've been struggling to find the 3D positions (montages) for the
Acticap-64ch-standard2 on the web, which is a modified version of the easycap-M1, but I have not succeeded. In the Fieldtrip page http://www.fieldtriptoolbox.org/template/electrode/ you have the following:

You can find the template 3-D electrode sets included in FieldTrip here <https://github.com/fieldtrip/fieldtrip/tree/master/template/electrode>.

But in that link you only find a txt file with theta-phi coordinates (easycap-M1.txt). Is there any place where I could find these positions in MNI space?

Thank you and best regards,
Silvana
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200619/c0adf7df/attachment-0001.htm>

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

Subject: Digest Footer

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


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

End of fieldtrip Digest, Vol 115, Issue 22
******************************************

_______________________________________________
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/20200623/62aa978f/attachment-0001.htm>

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

Subject: Digest Footer

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


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

End of fieldtrip Digest, Vol 115, Issue 24
******************************************



From Pradeep.Dheerendra at newcastle.ac.uk  Tue Jun 30 12:09:43 2020
From: Pradeep.Dheerendra at newcastle.ac.uk (Pradeep Dheerendra)
Date: Tue, 30 Jun 2020 10:09:43 +0000
Subject: [FieldTrip] PhD position in Auditory Cognition
Message-ID: <LOYP265MB2173A92D5DCE8264DAB66ACCCD6F0@LOYP265MB2173.GBRP265.PROD.OUTLOOK.COM>

New fully funded PhD position available in Auditory Cognition Group at Newcastle, UK with Prof Tim Griffiths. 

Great opportunity to learn/develop EEG skills and auditory psychophysics!

Closing date for applications: 29/07/2020 

Details: https://www.ncl.ac.uk/postgraduate/funding/sources/allstudents/bi030.html

Best regards,
Pradeep
----------------------------------------------------------------
Auditory Cognition Group, 
Medical School, Newcastle University, 
Newcastle Upon Tyne, NE2 4HH, U.K.
 
Tel: +44 (0) 191 208 3445
Fax: +44 (0) 191 208 5227
Website: https://www.auditorycognition.org/
---------------------------------------------------------------




From werkle at mpib-berlin.mpg.de  Tue Jun 30 13:27:11 2020
From: werkle at mpib-berlin.mpg.de (Markus Werkle-Bergner)
Date: Tue, 30 Jun 2020 13:27:11 +0200
Subject: [FieldTrip] PhD position in the RHYME-lab at Max Planck Institute
 for Human Development, Berlin
In-Reply-To: <LOYP265MB2173A92D5DCE8264DAB66ACCCD6F0@LOYP265MB2173.GBRP265.PROD.OUTLOOK.COM>
References: <LOYP265MB2173A92D5DCE8264DAB66ACCCD6F0@LOYP265MB2173.GBRP265.PROD.OUTLOOK.COM>
Message-ID: <b6601d56-8402-4bee-ca75-b48e8a4ad5c4@mpib-berlin.mpg.de>

Dear all,

the RHYME-lab at the Max Planck Institute for Human Development in 
Berlin (https://www.mpib-berlin.mpg.de/rhyme) has an open PhD position 
available.

More information can be found here:
https://www.mpib-berlin.mpg.de/1076828/2020-06-25-lip-pre-doctoral-position?c=219557 


The focus of the PhD-position will be on developing analysis techniques 
for the decoding of unique spatial memories from mobile EEG recordings 
of freely moving humans.

Best regards,
Markus Werkle-Bergner

-- 
-------------------------------------------------
Dr. rer. nat. Markus Werkle-Bergner
Senior Research Scientist (W2)

Lifespan Rhythms of Memory and Cognition (RHYME)

Center for Lifespan Psychology
Max Planck Institute for Human Development
Lentzeallee 94, 14195 Berlin, Germany
Phone: +49(0)30-82406-447 Skype: markus.wb
-------------------------------------------------



